@font-face {
  font-family: 'Midnight Sans Bold';
  src: url('assets/MidnightSansRDPro-12Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'Midnight Sans Regular';
  src: url('assets/MidnightSansRDPro-36Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* Base Styles */
:root {
  --brand-black: #fff3de;
  --brand-red: #2660a4;
}

/* Page transition — calm fade & lift */
body {
  background-color: var(--brand-black);
  color: var(--brand-red);
  position: relative;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

body.page-ready {
  opacity: 1;
}

/* Custom Text Effects */
h1 {
  font-variant-ligatures: discretionary-ligatures;
  text-shadow: 0 0 20px color-mix(in srgb, currentColor 10%, transparent);
}

/* Animation for the main content appearance */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

main {
  animation: fadeIn 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) 0.1s both;
}

/* Project card hover overlay */
.project-overlay {
  background: color-mix(in srgb, var(--brand-black) 80%, transparent);
}

/* Highlight link - underline with wavy hover */
.highlight-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-style: solid;
  transition:
    text-decoration-style 0.3s ease,
    text-underline-offset 0.3s ease;
}

.highlight-link:hover {
  text-decoration-style: wavy;
  text-underline-offset: 4px;
  animation: wave-nudge 0.4s ease forwards;
}

@keyframes wave-nudge {
  0% {
    text-underline-offset: 3px;
  }
  50% {
    text-underline-offset: 5px;
  }
  100% {
    text-underline-offset: 4px;
  }
}

/* Hero text letter animation */
.hero-line {
  display: inline-block;
}

.hero-char {
  display: inline-block;
  opacity: 0;
  transform: scale(1);
  transition:
    opacity 0.5s ease-out,
    transform 0.2s ease-out;
  will-change: transform, opacity;
}

.hero-char.revealed {
  opacity: 1;
}

/* Password overlay shake animation */
.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}

/* ================================
   Article Content Styles
   (Substack HTML rendered inline)
   ================================ */

.article-content {
  line-height: 1.75;
  font-size: 1rem;
}

.article-content p {
  margin-bottom: 1.25em;
}

.article-content h2 {
  font-family: 'Midnight Sans Bold', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.75em;
  letter-spacing: -0.01em;
}

.article-content h3 {
  font-family: 'Midnight Sans Bold', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
}

.article-content h4 {
  font-family: 'Midnight Sans Bold', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.article-content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.article-content a:hover {
  opacity: 0.7;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5em 0;
}

.article-content figure {
  margin: 1.5em 0;
}

.article-content figure img {
  margin: 0 0 0.5em 0;
}

.article-content figcaption {
  font-size: 0.8rem;
  opacity: 0.6;
  font-family: 'Space Mono', monospace;
  text-align: center;
}

.article-content blockquote {
  border-left: 3px solid currentColor;
  padding-left: 1em;
  margin: 1.5em 0;
  opacity: 0.85;
  font-style: italic;
}

.article-content ul {
  list-style: disc;
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

.article-content ol {
  list-style: decimal;
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

.article-content li {
  margin-bottom: 0.5em;
}

.article-content hr {
  border: none;
  border-top: 1px dotted currentColor;
  margin: 2em 0;
  opacity: 0.4;
}

.article-content strong,
.article-content b {
  font-weight: 700;
}

.article-content em,
.article-content i {
  font-style: italic;
}

.article-content pre,
.article-content code {
  font-family: 'Space Mono', monospace;
  font-size: 0.875rem;
  background: color-mix(in srgb, currentColor 8%, transparent);
  border-radius: 4px;
}

.article-content code {
  padding: 0.15em 0.4em;
}

.article-content pre {
  padding: 1em;
  overflow-x: auto;
  margin: 1.5em 0;
}

.article-content pre code {
  padding: 0;
  background: none;
}

.article-content .article-video-embed {
  margin: 1.5em 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

.article-content th,
.article-content td {
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  padding: 0.5em 0.75em;
  text-align: left;
}

.article-content th {
  font-weight: 700;
  background: color-mix(in srgb, currentColor 5%, transparent);
}

/* ================================
   Project Content Styles
   (Notion blocks rendered inline)
   ================================ */

.project-content {
  line-height: 1.75;
  font-size: 1rem;
}

.project-content p {
  margin-bottom: 1.25em;
}

.project-content h2 {
  font-family: 'Midnight Sans Bold', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.75em;
  letter-spacing: -0.01em;
}

.project-content h3 {
  font-family: 'Midnight Sans Bold', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  margin-top: 1.75em;
  margin-bottom: 0.5em;
}

.project-content h4 {
  font-family: 'Midnight Sans Bold', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.project-content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.project-content a:hover {
  opacity: 0.7;
}

.project-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5em 0;
}

.project-content figure {
  margin: 1.5em 0;
}

.project-content figure img {
  margin: 0 0 0.5em 0;
}

.project-content figcaption {
  font-size: 0.8rem;
  opacity: 0.6;
  font-family: 'Space Mono', monospace;
  text-align: center;
}

.project-content blockquote {
  border-left: 3px solid currentColor;
  padding-left: 1em;
  margin: 1.5em 0;
  opacity: 0.85;
  font-style: italic;
}

.project-content ul {
  list-style: disc;
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

.project-content ol {
  list-style: decimal;
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

.project-content li {
  margin-bottom: 0.5em;
}

.project-content hr {
  border: none;
  border-top: 1px dotted currentColor;
  margin: 2em 0;
  opacity: 0.4;
}

.project-content strong,
.project-content b {
  font-weight: 700;
}

.project-content em,
.project-content i {
  font-style: italic;
}

.project-content pre,
.project-content code {
  font-family: 'Space Mono', monospace;
  font-size: 0.875rem;
  background: color-mix(in srgb, currentColor 8%, transparent);
  border-radius: 4px;
}

.project-content code {
  padding: 0.15em 0.4em;
}

.project-content pre {
  padding: 1em;
  overflow-x: auto;
  margin: 1.5em 0;
}

.project-content pre code {
  padding: 0;
  background: none;
}

.project-content .project-video-embed {
  margin: 1.5em 0;
}

.project-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

.project-content th,
.project-content td {
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  padding: 0.5em 0.75em;
  text-align: left;
}

.project-content th {
  font-weight: 700;
  background: color-mix(in srgb, currentColor 5%, transparent);
}

/* ================================
   Lightbox Styles
   ================================ */

.lightbox-image {
  transition: opacity 0.2s ease;
}

#lightbox button {
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

#lightbox-prev,
#lightbox-next {
  width: 48px;
  height: 48px;
  border: 2px solid currentColor;
  border-radius: 0;
}

#lightbox-prev:hover,
#lightbox-next:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}
