:root {
  --ink: #2a1b1f;
  --paper: #f2e7da;
  --paper-deep: #dfcbb9;
  --stone: #8d7665;
  --clay: #b45a32;
  --sage: #258ea3;
  --pine: #c14f99;
  --night: #09070c;
  --neon-cyan: #2aaed1;
  --neon-magenta: #c14f99;
  --mist: rgba(255, 247, 238, 0.74);
  --line: rgba(42, 27, 31, 0.14);
  --line-strong: rgba(42, 27, 31, 0.24);
  --card: rgba(255, 248, 240, 0.88);
  --card-strong: rgba(250, 240, 230, 0.96);
  --shadow-soft: 0 24px 44px rgba(36, 22, 25, 0.16);
  --shadow-hard: 0 10px 0 rgba(54, 33, 26, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
}

body[data-theme="night"] {
  --ink: #f4edf8;
  --paper: #09070c;
  --paper-deep: #13101a;
  --stone: #bca28a;
  --clay: #d06d3f;
  --sage: #7ad9cc;
  --pine: #ff8cd7;
  --night: #040308;
  --neon-cyan: #78ddff;
  --neon-magenta: #ff8cd7;
  --mist: rgba(18, 14, 24, 0.74);
  --line: rgba(244, 237, 248, 0.14);
  --line-strong: rgba(244, 237, 248, 0.24);
  --card: rgba(18, 14, 24, 0.9);
  --card-strong: rgba(24, 18, 31, 0.96);
  --shadow-soft: 0 24px 54px rgba(0, 0, 0, 0.54);
  --shadow-hard: 0 10px 0 rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "IBM Plex Sans", sans-serif;
  line-height: 1.68;
  overflow-x: hidden;
  transition: background-color 220ms ease, color 220ms ease;
}

.background-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 12% 10%, rgba(240, 108, 194, 0.26), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(88, 201, 255, 0.24), transparent 32%),
    radial-gradient(circle at 72% 86%, rgba(180, 90, 50, 0.2), transparent 34%),
    linear-gradient(145deg, var(--paper) 0%, var(--paper-deep) 100%);
}

.background-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.32;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(88, 201, 255, 0.07) 0 1px, transparent 1px 6px),
    radial-gradient(circle at 20% 20%, rgba(240, 108, 194, 0.12) 0 1px, transparent 1px 100%);
  background-size: auto, auto, auto, 22px 22px;
}

.page-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 4px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.08);
}

.page-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta), var(--clay));
}

.site-header {
  width: min(1120px, 92vw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.55rem 0 1rem;
}

.brand-block {
  max-width: 26rem;
}

.brand {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pine);
}

.brand-caption {
  margin: 0.45rem 0 0;
  color: rgba(37, 24, 15, 0.74);
}

body[data-theme="night"] .brand-caption {
  color: rgba(243, 232, 217, 0.74);
}

.header-actions,
.nav-links,
.hero-cta,
.contact-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.header-actions {
  justify-content: flex-end;
  align-items: center;
}

.nav-links {
  justify-content: flex-end;
}

.primary-link {
  text-decoration: none;
  color: var(--sage);
  font: 600 0.88rem/1 "IBM Plex Mono", monospace;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}

.primary-link:hover {
  color: var(--neon-cyan);
  border-color: rgba(88, 201, 255, 0.56);
}

.mode-toggle {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: rgba(88, 201, 255, 0.08);
  color: var(--ink);
  padding: 0.68rem 0.95rem;
  border-radius: 999px;
  font: 600 0.8rem/1 "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.mode-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--neon-magenta);
}

main {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 1rem 0 5rem;
}

.hero,
.about,
.contact,
.social,
.field-notes,
.statement,
.project-card,
.card {
  box-shadow: var(--shadow-soft), var(--shadow-hard);
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 1.2rem;
  padding: clamp(1.8rem, 5vw, 4rem);
  border: 1px solid var(--line-strong);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 248, 240, 0.9), rgba(240, 225, 208, 0.94)),
    linear-gradient(90deg, rgba(42, 174, 209, 0.08), rgba(193, 79, 153, 0.06));
}

body[data-theme="night"] .hero {
  background:
    linear-gradient(145deg, rgba(20, 15, 26, 0.94), rgba(10, 8, 15, 0.98)),
    linear-gradient(90deg, rgba(240, 108, 194, 0.09), transparent);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -10% -46% auto;
  width: 420px;
  height: 420px;
  border-radius: 48% 52% 60% 40% / 40% 51% 49% 60%;
  background: radial-gradient(circle, rgba(240, 108, 194, 0.28), rgba(240, 108, 194, 0));
  z-index: -1;
}

.hero::after,
.project-card::after,
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04), transparent),
    repeating-linear-gradient(135deg, rgba(88, 201, 255, 0.08) 0 1px, transparent 1px 18px);
  opacity: 0.36;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  gap: 1.5rem;
  align-items: end;
}

.hero-copy,
.hero-notes {
  position: relative;
  z-index: 1;
}

.hero-notes {
  padding: 1.1rem 1.15rem;
  border-radius: 22px;
  background: var(--mist);
  border: 1px solid var(--line);
}

.eyebrow,
.section-label,
.timeline-tag,
.meta-list span,
.project-meta span,
.btn,
.primary-link {
  font-family: "IBM Plex Mono", monospace;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--clay);
}

.section-label,
.timeline-tag,
.meta-list span,
.project-meta span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.section-label {
  margin: 0 0 0.55rem;
  color: var(--clay);
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.01em;
}

h1 {
  max-width: 12ch;
  margin: 0.7rem 0 1rem;
  font-size: clamp(3.2rem, 8vw, 5.9rem);
  line-height: 0.9;
  font-weight: 600;
}

h1 span {
  color: var(--clay);
}

h2 {
  margin-bottom: 0.55rem;
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 0.95;
}

h3 {
  margin-bottom: 0.4rem;
  font-size: 1.7rem;
  line-height: 1;
}

.lead {
  max-width: 60ch;
  font-size: clamp(1.02rem, 2.1vw, 1.24rem);
}

.meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.meta-list li {
  display: grid;
  gap: 0.18rem;
  padding-bottom: 0.72rem;
  border-bottom: 1px solid rgba(37, 24, 15, 0.08);
}

body[data-theme="night"] .meta-list li {
  border-bottom-color: rgba(243, 232, 217, 0.08);
}

.meta-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.hero-cta,
.contact-actions {
  margin-top: 1.6rem;
}

.btn {
  text-decoration: none;
  border-radius: 999px;
  padding: 0.82rem 1.22rem;
  border: 1px solid transparent;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 16px rgba(40, 27, 16, 0.2);
}

.btn-solid {
  background: linear-gradient(120deg, var(--neon-magenta), var(--clay));
  color: #fff7ff;
  border-color: rgba(255, 140, 215, 0.34);
}

.btn-ghost {
  background: rgba(88, 201, 255, 0.07);
  border-color: rgba(88, 201, 255, 0.32);
  color: var(--neon-cyan);
}

.btn-ghost:hover {
  color: var(--neon-magenta);
  border-color: rgba(240, 108, 194, 0.48);
}

.section-intro {
  max-width: 48rem;
  margin-top: 2rem;
}

.section-intro p:last-child {
  margin-top: 0;
}

.grid-section,
.projects-grid,
.timeline,
.social-grid {
  display: grid;
  gap: 1rem;
}

.grid-section,
.projects-grid {
  margin-top: 2rem;
  grid-template-columns: repeat(12, 1fr);
}

.project-card,
.card {
  position: relative;
  overflow: hidden;
  grid-column: span 4;
  padding: 1.45rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, var(--card-strong), var(--card) 72%);
}

.featured {
  grid-column: span 8;
}

.grid-section .card:nth-child(1),
.projects-grid .project-card:nth-child(2) {
  transform: translateY(1.2rem);
}

.grid-section .card:nth-child(2) {
  grid-column: span 5;
}

.grid-section .card:nth-child(3) {
  grid-column: span 3;
}

.project-card h2,
.card h2,
.about h2,
.social h2,
.contact h2 {
  margin-bottom: 0.45rem;
}

.project-card p,
.card p,
.about p,
.contact p,
.social p,
.timeline-entry p {
  margin-top: 0;
}

.project-card ul,
.card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.project-meta {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(37, 24, 15, 0.12);
}

body[data-theme="night"] .project-meta {
  border-top-color: rgba(243, 232, 217, 0.12);
}

.project-meta p {
  margin: 0;
}

.about,
.contact,
.social,
.field-notes {
  margin-top: 1.3rem;
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, var(--card-strong), var(--card) 82%);
}

.about {
  border-left: 5px solid rgba(88, 201, 255, 0.7);
}

.contact {
  border-left: 5px solid rgba(180, 90, 50, 0.8);
}

.social {
  border-left: 5px solid rgba(240, 108, 194, 0.72);
}

.statement {
  margin-top: 1.3rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(37, 24, 15, 0.18);
  background: linear-gradient(145deg, rgba(88, 201, 255, 0.26), rgba(180, 90, 50, 0.32), rgba(240, 108, 194, 0.22));
  color: #f8f5ef;
}

body[data-theme="night"] .statement {
  background: linear-gradient(145deg, rgba(88, 201, 255, 0.2), rgba(180, 90, 50, 0.22), rgba(240, 108, 194, 0.24));
}

.statement p {
  margin: 0;
  font-size: clamp(1.08rem, 2.7vw, 1.5rem);
  font-weight: 600;
}

.field-notes {
  background: linear-gradient(160deg, rgba(251, 244, 234, 0.94), rgba(237, 222, 206, 0.96));
}

body[data-theme="night"] .field-notes {
  background: linear-gradient(160deg, rgba(20, 15, 27, 0.95), rgba(11, 8, 16, 0.98));
}

.field-notes .section-intro {
  margin-top: 0;
}

.timeline {
  margin-top: 1.2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.timeline.compact {
  margin-top: 0.8rem;
}

.timeline-entry {
  position: relative;
  padding: 1.1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 252, 247, 0.54);
}

body[data-theme="night"] .timeline-entry {
  background: rgba(255, 255, 255, 0.03);
}

.timeline-entry::before {
  content: "";
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 1px;
  background: rgba(88, 201, 255, 0.72);
}

.timeline-tag {
  margin: 0 0 0.65rem;
  color: var(--clay);
}

.social-grid {
  grid-template-columns: repeat(3, 1fr);
}

.social-link {
  text-decoration: none;
  color: var(--ink);
  padding: 0.95rem;
  border: 1px solid rgba(88, 201, 255, 0.26);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 252, 247, 0.94), rgba(243, 231, 218, 0.9));
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body[data-theme="night"] .social-link {
  background: linear-gradient(145deg, rgba(29, 22, 35, 0.94), rgba(16, 12, 21, 0.9));
  border-color: rgba(240, 108, 194, 0.26);
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.28);
  border-color: rgba(240, 108, 194, 0.52);
}

.social-link span {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.92rem;
  font-weight: 500;
  opacity: 0.84;
}

a {
  color: var(--neon-cyan);
}

a:hover {
  color: var(--neon-magenta);
}

a:focus-visible,
.btn:focus-visible,
.mode-toggle:focus-visible,
.primary-link:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 3px;
}

footer {
  padding: 0 1rem 2rem;
  text-align: center;
  font-size: 0.95rem;
  color: rgba(42, 27, 31, 0.74);
}

body[data-theme="night"] footer {
  color: rgba(244, 237, 248, 0.76);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 680ms ease, transform 680ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-delay="1"] {
  transition-delay: 90ms;
}

.reveal[data-delay="2"] {
  transition-delay: 180ms;
}

.reveal[data-delay="3"] {
  transition-delay: 270ms;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 960px) {
  .hero-layout,
  .timeline {
    grid-template-columns: 1fr;
  }

  .card,
  .project-card,
  .featured,
  .grid-section .card:nth-child(2),
  .grid-section .card:nth-child(3) {
    grid-column: span 6;
    transform: none;
  }

  .social-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }

  .header-actions,
  .nav-links {
    justify-content: flex-start;
  }

  .grid-section,
  .projects-grid,
  .social-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .card,
  .project-card,
  .featured,
  .grid-section .card:nth-child(2),
  .grid-section .card:nth-child(3) {
    grid-column: span 12;
  }

  .hero {
    border-radius: 26px;
    padding: 1.5rem;
  }

  h1 {
    max-width: 100%;
  }

  .field-notes,
  .about,
  .social,
  .contact {
    padding: 1.25rem;
  }
}
