:root {
  color-scheme: light;
  --bg: #f2f0e9;
  --surface: #faf9f5;
  --surface-strong: #ffffff;
  --ink: #171916;
  --muted: #62665e;
  --line: rgba(23, 25, 22, 0.16);
  --line-strong: rgba(23, 25, 22, 0.32);
  --accent: #2f6857;
  --accent-soft: #dce9b0;
  --signal: #d7f260;
  --shadow: 0 28px 80px rgba(37, 42, 35, 0.11);
  --shell: min(1180px, calc(100vw - 48px));
  --radius: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111411;
  --surface: #171b17;
  --surface-strong: #1d221d;
  --ink: #f0f1e9;
  --muted: #aeb4a8;
  --line: rgba(240, 241, 233, 0.14);
  --line-strong: rgba(240, 241, 233, 0.3);
  --accent: #93cbb8;
  --accent-soft: #344634;
  --signal: #d7f260;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  transition:
    background-color 240ms ease,
    color 240ms ease;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  content: "";
  opacity: 0.16;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, black, transparent 58%);
}

::selection {
  background: var(--signal);
  color: #171916;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease;
}

.site-header.is-scrolled {
  border-color: var(--line);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 10px;
  font-size: 0.86rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-style: italic;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 42px);
}

.main-nav a {
  position: relative;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.main-nav a::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 1px;
  background: var(--ink);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 260ms var(--ease);
}

.main-nav a:hover {
  color: var(--ink);
}

.main-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.theme-toggle {
  display: grid;
  justify-self: end;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: rotate(12deg);
}

.theme-toggle-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: clamp(48px, 8vw, 118px);
  padding-block: 132px 96px;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.eyebrow,
.section-kicker {
  margin: 0 0 28px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent);
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(4.6rem, 10.5vw, 9.4rem);
  font-weight: 720;
  letter-spacing: -0.075em;
  line-height: 0.83;
}

.hero h1 span {
  display: block;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.08em;
}

.hero-intro {
  max-width: 620px;
  margin: 38px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.7vw, 1.32rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 750;
  transition:
    transform 200ms var(--ease),
    box-shadow 200ms ease,
    background-color 200ms ease,
    color 200ms ease;
}

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

.button-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.button-primary:hover {
  box-shadow: 0 12px 24px color-mix(in srgb, var(--ink) 18%, transparent);
}

.button-secondary {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.button-secondary:hover {
  background: var(--surface-strong);
}

.hero-visual {
  position: relative;
  isolation: isolate;
  width: min(100%, 480px);
  aspect-ratio: 0.88;
  justify-self: end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 1.35);
  background:
    radial-gradient(circle at 68% 23%, var(--signal), transparent 18%),
    linear-gradient(145deg, var(--accent-soft), var(--surface) 65%);
  box-shadow: var(--shadow);
}

.visual-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.55;
}

.hero-visual::before,
.hero-visual::after {
  position: absolute;
  z-index: -1;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  content: "";
}

.hero-visual::before {
  width: 82%;
  aspect-ratio: 1;
  top: 10%;
  left: 9%;
}

.hero-visual::after {
  width: 42%;
  aspect-ratio: 1;
  right: -4%;
  bottom: 5%;
  background: color-mix(in srgb, var(--surface) 52%, transparent);
}

.monogram {
  position: absolute;
  top: 50%;
  left: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(6rem, 12vw, 10rem);
  font-style: italic;
  letter-spacing: -0.1em;
  line-height: 1;
  transform: translate(-53%, -50%) rotate(-7deg);
}

.visual-note {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 80%, transparent);
  box-shadow: 0 8px 30px rgba(23, 25, 22, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.visual-note span {
  color: var(--accent);
}

.note-top {
  top: 8%;
  left: 7%;
}

.note-right {
  top: 34%;
  right: 4%;
}

.note-bottom {
  bottom: 9%;
  left: 7%;
}

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-cue span:last-child {
  animation: nudge 1.8s ease-in-out infinite;
}

.section {
  padding-block: clamp(96px, 13vw, 180px);
  border-top: 1px solid var(--line);
}

.section-about {
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 64px;
  align-items: end;
  margin-bottom: clamp(54px, 8vw, 92px);
}

.section-heading .section-kicker {
  grid-column: 1 / -1;
  margin-bottom: -28px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 6.2rem);
  font-weight: 680;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.section-heading > p:last-child {
  max-width: 460px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 1.08rem;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-strong);
}

.focus-card {
  min-height: 320px;
  padding: 28px clamp(24px, 3vw, 42px) 36px 0;
  border-right: 1px solid var(--line);
}

.focus-card + .focus-card {
  padding-left: clamp(24px, 3vw, 42px);
}

.focus-card:last-child {
  padding-right: 0;
  border-right: 0;
}

.card-index {
  margin: 0 0 98px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.focus-card h3 {
  margin: 0 0 14px;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  letter-spacing: -0.045em;
}

.focus-card > p:last-child {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
}

.section-work {
  overflow: hidden;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.section-heading-row .section-kicker {
  margin-bottom: 28px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.84rem;
  font-weight: 750;
}

.text-link span {
  transition: transform 180ms var(--ease);
}

.text-link:hover span {
  transform: translate(3px, -3px);
}

.project-list {
  border-top: 1px solid var(--line-strong);
}

.project-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding-block: clamp(34px, 5vw, 58px);
  border-bottom: 1px solid var(--line);
  transition:
    padding 260ms var(--ease),
    background-color 260ms ease;
}

.project-card:hover {
  padding-inline: 24px;
  background: var(--surface);
}

.project-number {
  padding-top: 7px;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
}

.project-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.project-title-row h3 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 4.3rem);
  font-weight: 650;
  letter-spacing: -0.06em;
  line-height: 1;
}

.project-title-row > span {
  font-size: 1.5rem;
  transition: transform 220ms var(--ease);
}

.project-card:hover .project-title-row > span {
  transform: translate(5px, -5px);
}

.project-content > p {
  max-width: 650px;
  margin: 24px 0;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.64rem;
  font-weight: 650;
}

.section-contact {
  padding-bottom: clamp(72px, 9vw, 120px);
  border-top: 0;
}

.contact-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(42px, 8vw, 94px);
  border-radius: calc(var(--radius) * 1.5);
  background: var(--ink);
  color: var(--bg);
}

.contact-panel::before {
  position: absolute;
  z-index: -1;
  width: 440px;
  height: 440px;
  top: -160px;
  right: -100px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
  opacity: 0.22;
}

.contact-panel::after {
  position: absolute;
  z-index: -1;
  width: 170px;
  height: 170px;
  right: 11%;
  bottom: -65px;
  border-radius: 50%;
  background: var(--signal);
  content: "";
}

.contact-panel .section-kicker {
  color: color-mix(in srgb, var(--bg) 62%, transparent);
}

.contact-panel h2 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(3.4rem, 7.5vw, 7.6rem);
  font-weight: 670;
  letter-spacing: -0.07em;
  line-height: 0.86;
}

.contact-panel > p:not(.section-kicker) {
  max-width: 580px;
  margin: 38px 0 32px;
  color: color-mix(in srgb, var(--bg) 70%, transparent);
  font-size: 1.05rem;
}

.button-contact {
  border-color: var(--signal);
  background: var(--signal);
  color: #171916;
}

.button-contact:hover {
  box-shadow: 0 12px 34px rgba(215, 242, 96, 0.2);
}

.site-footer {
  padding-block: 26px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.footer-inner p {
  margin: 0;
}

.footer-inner p:nth-child(2) {
  text-align: center;
}

.footer-inner a {
  justify-self: end;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms var(--ease),
    transform 700ms var(--ease);
}

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

@keyframes nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}

@media (max-width: 900px) {
  :root {
    --shell: min(100% - 36px, 720px);
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 68px;
    padding-top: 152px;
    padding-bottom: 124px;
  }

  .hero-copy {
    max-width: 720px;
  }

  .hero-visual {
    width: min(100%, 560px);
    justify-self: start;
    aspect-ratio: 1.15;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .section-heading .section-kicker {
    grid-column: auto;
    margin-bottom: 0;
  }

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

  .focus-card,
  .focus-card + .focus-card {
    min-height: auto;
    padding: 28px 0 36px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .focus-card:last-child {
    border-bottom: 0;
  }

  .card-index {
    margin-bottom: 52px;
  }
}

@media (max-width: 640px) {
  :root {
    --shell: calc(100% - 28px);
    --radius: 18px;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    min-height: 68px;
  }

  .main-nav {
    display: none;
  }

  .hero {
    padding-top: 122px;
  }

  .hero h1 {
    font-size: clamp(4rem, 22vw, 6rem);
  }

  .hero-intro {
    font-size: 1rem;
  }

  .hero-actions .button {
    flex: 1;
  }

  .hero-visual {
    aspect-ratio: 0.92;
  }

  .visual-note {
    font-size: 0.56rem;
  }

  .scroll-cue {
    bottom: 30px;
  }

  .section-heading-row {
    display: grid;
    align-items: start;
  }

  .section-heading-row .text-link {
    width: fit-content;
    margin-top: 8px;
  }

  .project-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-card:hover {
    padding-inline: 12px;
  }

  .project-title-row {
    align-items: start;
  }

  .project-title-row h3 {
    font-size: clamp(1.8rem, 10vw, 2.8rem);
  }

  .contact-panel::after {
    width: 100px;
    height: 100px;
    right: 8%;
    bottom: -52px;
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
  }

  .footer-inner p:nth-child(2) {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
