:root {
  --bg: #f7f4ee;
  --surface: #fffdf8;
  --surface-strong: #f0e7da;
  --ink: #161511;
  --muted: #6e675b;
  --line: #ded2c2;
  --accent: #145c54;
  --accent-strong: #0e443f;
  --coral: #d95d39;
  --gold: #d4a72c;
  --sky: #5f8eb8;
  --shadow: 0 24px 70px rgba(47, 39, 25, 0.16);
}

body[data-theme='dark'] {
  --bg: #111312;
  --surface: #191c1a;
  --surface-strong: #242925;
  --ink: #f4f0e8;
  --muted: #b6afa3;
  --line: #343a36;
  --accent: #79c9bd;
  --accent-strong: #9fe3d9;
  --coral: #f0825f;
  --gold: #e6bf56;
  --sky: #8ebbe0;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', Arial, sans-serif;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: '';
  background:
    linear-gradient(rgba(22, 21, 17, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 21, 17, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px rgba(26, 23, 18, 0.08);
}

.brand,
.nav-links,
.hero-actions,
.project-tags {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.65rem;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  color: #fffdf8;
  background: var(--accent-strong);
  border-radius: 8px;
}

.nav-links {
  gap: clamp(0.8rem, 3vw, 2.2rem);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.nav-links a {
  transition: color 160ms ease;
}

.nav-links a:hover {
  color: var(--accent-strong);
}

.theme-toggle {
  position: relative;
  width: 2.45rem;
  height: 2.45rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.theme-icon,
.theme-icon::after {
  position: absolute;
  border-radius: 999px;
  content: '';
}

.theme-icon {
  inset: 0.72rem;
  background: var(--gold);
}

body[data-theme='dark'] .theme-icon::after {
  top: -0.18rem;
  right: -0.18rem;
  width: 0.86rem;
  height: 0.86rem;
  background: var(--surface);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(20rem, 1.1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  min-height: calc(88vh - 4.6rem);
  padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 4vw, 3rem) 2rem;
  align-items: center;
  overflow: hidden;
}

.hero-media {
  position: relative;
  min-height: clamp(21rem, 42vw, 36rem);
}

.screen-frame {
  position: absolute;
  inset: 0;
  max-width: 42rem;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
  overflow: hidden;
}

.mock-toolbar {
  display: flex;
  gap: 0.45rem;
  padding: 1rem;
  background: var(--surface-strong);
  border-bottom: 1px solid var(--line);
}

.mock-toolbar span {
  width: 0.72rem;
  height: 0.72rem;
  background: var(--coral);
  border-radius: 999px;
}

.mock-toolbar span:nth-child(2) {
  background: var(--gold);
}

.mock-toolbar span:nth-child(3) {
  background: var(--accent);
}

.mock-canvas {
  display: grid;
  grid-template-columns: 7rem 1fr;
  min-height: 30rem;
}

.mock-sidebar {
  background:
    linear-gradient(var(--accent), var(--accent)) 1.3rem 2rem / 3.6rem 0.6rem no-repeat,
    linear-gradient(var(--line), var(--line)) 1.3rem 4.2rem / 4.4rem 0.5rem no-repeat,
    linear-gradient(var(--line), var(--line)) 1.3rem 5.8rem / 3.2rem 0.5rem no-repeat,
    var(--accent-strong);
}

.mock-main {
  padding: clamp(1.2rem, 3vw, 2.3rem);
}

.mock-line {
  width: 52%;
  height: 0.85rem;
  margin-bottom: 1rem;
  background: var(--line);
  border-radius: 999px;
}

.mock-line.long {
  width: 82%;
  height: 2.8rem;
  background: var(--ink);
}

.mock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.mock-grid span {
  min-height: 7.5rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mock-grid span:nth-child(2) {
  background: color-mix(in srgb, var(--sky) 40%, var(--surface));
}

.mock-grid span:nth-child(3) {
  background: color-mix(in srgb, var(--coral) 36%, var(--surface));
}

.mock-grid span:nth-child(4) {
  background: color-mix(in srgb, var(--gold) 42%, var(--surface));
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 45rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 16ch;
  font-size: clamp(2.7rem, 5.6vw, 5.7rem);
  font-weight: 800;
}

.hero-text {
  max-width: 39rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.1rem;
  border-radius: 8px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: #fffdf8;
  background: var(--accent-strong);
}

.button.secondary {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.hero-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.hero-panel div,
.snapshot,
.project,
.process-grid article {
  background: var(--surface);
}

.hero-panel div {
  padding: 1.15rem;
}

.panel-label,
.project-type {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-panel strong {
  display: block;
  margin-top: 0.35rem;
  line-height: 1.35;
}

.section {
  padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem);
}

.intro-section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 2rem;
}

.snapshot {
  min-height: 10rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.snapshot span {
  display: block;
  color: var(--accent-strong);
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1;
}

.snapshot p {
  max-width: 14rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-weight: 700;
}

.section-heading {
  display: grid;
  grid-template-columns: 13rem minmax(0, 48rem);
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.section-heading.narrow {
  grid-template-columns: 1fr;
  max-width: 44rem;
}

h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
}

.project-list {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

.project {
  display: grid;
  grid-template-columns: minmax(12rem, 0.9fr) minmax(0, 1fr);
  min-height: 24rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.feature-project {
  grid-row: span 2;
  grid-template-columns: 1fr;
}

.project-visual {
  position: relative;
  display: grid;
  min-height: 15rem;
  place-items: center;
  overflow: hidden;
}

.event-visual {
  min-height: 22rem;
  background: #173f3a;
}

.study-visual {
  background: #315f86;
}

.science-visual {
  background: #8e442e;
}

.visual-chip {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1;
  padding: 0.4rem 0.65rem;
  color: #fffdf8;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.poster-lines {
  width: min(70%, 20rem);
}

.poster-lines span,
.note-stack span {
  display: block;
  background: #fffdf8;
  border-radius: 8px;
}

.poster-lines span:first-child {
  height: 5.3rem;
  margin-bottom: 1.1rem;
}

.poster-lines span:nth-child(2) {
  width: 76%;
  height: 1rem;
  margin-bottom: 0.7rem;
  background: var(--gold);
}

.poster-lines span:nth-child(3) {
  width: 54%;
  height: 1rem;
  background: var(--coral);
}

.note-stack {
  position: relative;
  width: 11rem;
  height: 11rem;
}

.note-stack span {
  position: absolute;
  inset: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.55);
}

.note-stack span:nth-child(1) {
  transform: rotate(-10deg);
}

.note-stack span:nth-child(2) {
  background: var(--gold);
  transform: rotate(5deg) translate(0.4rem, 0.35rem);
}

.note-stack span:nth-child(3) {
  background: #fffdf8;
  transform: rotate(14deg) translate(1rem, 0.8rem);
}

.orbit-model {
  position: relative;
  width: 11rem;
  height: 11rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
}

.orbit-model::before,
.orbit-model::after {
  position: absolute;
  inset: 50% auto auto 50%;
  content: '';
  transform: translate(-50%, -50%);
  border-radius: 999px;
}

.orbit-model::before {
  width: 3.2rem;
  height: 3.2rem;
  background: var(--gold);
}

.orbit-model::after {
  width: 15rem;
  height: 5rem;
  border: 2px solid rgba(255, 255, 255, 0.45);
  transform: translate(-50%, -50%) rotate(-28deg);
}

.orbit-model span {
  position: absolute;
  width: 1.2rem;
  height: 1.2rem;
  background: #fffdf8;
  border-radius: 999px;
}

.orbit-model span:first-child {
  top: 1rem;
  right: 1.8rem;
}

.orbit-model span:last-child {
  bottom: 1.8rem;
  left: 1rem;
}

.project-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.2rem, 3vw, 2rem);
}

.project h3 {
  margin-top: 0.45rem;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.project p:not(.project-type) {
  margin: 0.85rem 0 1.2rem;
  color: var(--muted);
}

.project-tags {
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0;
  margin: auto 0 0;
  list-style: none;
}

.project-tags li,
.skill-board span {
  padding: 0.45rem 0.65rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.process-section {
  background: var(--accent-strong);
  color: #fffdf8;
}

.process-section .eyebrow,
.process-section p {
  color: color-mix(in srgb, #fffdf8 74%, transparent);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  overflow: hidden;
}

.process-grid article {
  min-height: 18rem;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--accent-strong) 88%, #fffdf8);
}

.process-grid span {
  color: var(--gold);
  font-weight: 800;
}

.process-grid h3 {
  margin-top: 4.5rem;
  font-size: 1.5rem;
}

.skills-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(19rem, 1.15fr);
  gap: clamp(1rem, 5vw, 4rem);
  align-items: start;
}

.skills-copy p:not(.eyebrow) {
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.06rem;
}

.skill-board {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.skill-board span {
  border-radius: 8px;
  font-size: 0.94rem;
}

.contact-section {
  padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem);
}

.contact-inner {
  max-width: 72rem;
  padding: clamp(1.5rem, 5vw, 4rem);
  color: #fffdf8;
  background:
    linear-gradient(115deg, rgba(14, 68, 63, 0.96), rgba(20, 92, 84, 0.88)),
    linear-gradient(90deg, var(--coral), var(--gold));
  border-radius: 8px;
}

.contact-inner h2 {
  max-width: 13ch;
}

.contact-inner p:not(.eyebrow) {
  max-width: 38rem;
  margin: 1rem 0 1.7rem;
  color: rgba(255, 253, 248, 0.78);
}

.contact-inner .button.primary {
  color: var(--accent-strong);
  background: #fffdf8;
}

.footer {
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer p {
  margin: 0;
}

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

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

@media (max-width: 980px) {
  .hero,
  .skills-section,
  .project-list {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .hero-copy {
    order: -1;
  }

  h1 {
    max-width: 14ch;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .project,
  .feature-project {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
  }

  .nav-links {
    display: none;
  }

  .hero-panel,
  .intro-section,
  .process-grid {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-height: 20rem;
  }

  .mock-canvas {
    grid-template-columns: 5rem 1fr;
    min-height: 18rem;
  }

  .mock-grid {
    gap: 0.65rem;
  }

  .mock-grid span {
    min-height: 4.8rem;
  }

  .project {
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 2rem;
  }

  .button {
    width: 100%;
  }

  .hero-actions {
    align-items: stretch;
  }

  .mock-canvas {
    grid-template-columns: 3.8rem 1fr;
  }

  .mock-line.long {
    height: 2rem;
  }

  .contact-inner h2 {
    max-width: 100%;
  }
}
