:root {
  --bg: #f4f3ef;
  --ink: #121212;
  --muted: #3c3c3c;
  --faint: #5e5e5e;
  --line: rgba(18, 18, 18, 0.12);
  --line-strong: rgba(18, 18, 18, 0.28);
  --card: rgba(255, 255, 255, 0.84);
  --nav: rgba(244, 243, 239, 0.86);
  --chip: rgba(18, 18, 18, 0.05);
  --wash: rgba(244, 243, 239, 0.84);
  --scene: 22, 22, 22;
  --scene-line: 0.5;
  --scene-face: 0.045;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
  --radius: 14px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #070708;
  --ink: #f4f4f1;
  --muted: #c9c9c2;
  --faint: #a4a49c;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.3);
  --card: rgba(14, 14, 16, 0.82);
  --nav: rgba(7, 7, 8, 0.84);
  --chip: rgba(255, 255, 255, 0.06);
  --wash: rgba(7, 7, 8, 0.72);
  --scene: 236, 236, 232;
  --scene-line: 0.62;
  --scene-face: 0.05;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
}

body, .card, .nav, .btn, .field input, .field textarea {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

::selection { background: var(--ink); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

a { color: inherit; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

html.is-calm #scene { opacity: 0.28; }

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--ink);
  z-index: 40;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  z-index: 50;
}

.skip:focus { top: 8px; }

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--nav);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.nav-left, .nav-right, .nav-socials {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-right { justify-self: end; }

.nav a {
  text-decoration: none;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav a:hover, .nav a.active { color: var(--ink); }

.nav-socials a {
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  display: inline-flex;
}

.nav-socials a:hover { transform: translateY(-2px); }

.icon-btn, .menu-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.icon-sun { display: none; }

html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }

.menu-btn, .mobile-socials { display: none; }

.wrap {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
}

main {
  position: relative;
  z-index: 1;
  padding-top: 66px;
}

main::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 48px;
  width: min(860px, 100%);
  height: 280px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--wash), transparent 72%);
  pointer-events: none;
}

section { scroll-margin-top: 68px; padding: 18px 0 8px; }

section + section { border-top: 1px solid var(--line); }

.hero { padding-top: 22px; padding-bottom: 12px; border-top: 0; }

.kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.04em; }

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  line-height: 0.92;
  text-wrap: balance;
}

.role {
  margin: 8px 0 0;
  min-height: 1.15em;
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.role.is-out { opacity: 0; transform: translateY(6px); }

.lede {
  max-width: 62ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  text-wrap: balance;
}

.hero-actions, .pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  border: 1px solid var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn.ghost { background: transparent; color: var(--ink); }

.btn.email-link {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  font-weight: 500;
}

.btn:hover { transform: translateY(-1px); }

.pills a {
  text-decoration: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  background: var(--chip);
}

.pills a:hover { border-color: var(--ink); }

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  line-height: 1;
}

h2 .idx {
  margin-right: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--faint);
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  scroll-margin-top: 74px;
}

.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
form.card:hover { transform: none; }

.card:target { border-color: var(--ink); }

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.card h3 { margin: 0; font-size: 1.02rem; letter-spacing: -0.03em; }

.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.mark, .glyph {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  background: var(--bg);
}

.mark { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }

.shot {
  height: 112px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: var(--chip);
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  transform: scale(1.01);
  transition: transform 0.35s ease, filter 0.35s ease;
}

.card:hover .shot img {
  filter: grayscale(0.2) contrast(1.05);
  transform: scale(1.05);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
}

.degree { margin-top: 2px; }

.spec {
  margin-top: 4px;
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 1.12rem;
  color: var(--ink);
}

.score {
  margin-top: 6px;
  font-weight: 600;
  color: var(--ink);
}

.score span { font-weight: 400; color: var(--faint); }

.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 14px;
  align-items: start;
}

.contact-copy { padding-top: 4px; }

.form {
  display: grid;
  gap: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field { display: grid; gap: 4px; }

.field span, .counter {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
}

.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--ink);
}

.field textarea { min-height: 84px; resize: vertical; }

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status { min-height: 1.2em; margin: 2px 0 0; font-size: 0.92rem; }
.status.ok { color: var(--ink); }
.status.bad { color: var(--ink); font-weight: 600; }

.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

footer {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  padding: 12px 0 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--faint);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

footer .hint {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.hint { display: inline-flex; align-items: center; gap: 5px; }

kbd {
  font-family: inherit;
  font-size: 10px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--ink);
}

.palette[hidden] { display: none !important; }

.palette {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.palette-panel {
  width: min(520px, calc(100vw - 28px));
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.palette-panel input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  padding: 14px 16px;
  font: inherit;
  font-size: 16px;
}

.palette-panel ul { list-style: none; margin: 0; padding: 6px; max-height: 280px; overflow: auto; }

.palette-panel li button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
}

.palette-panel li button[aria-selected="true"],
.palette-panel li button:hover { background: var(--chip); }

@media (max-width: 860px) {
  .grid, .grid.two, .contact-grid, .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-inner { display: flex; justify-content: space-between; }
  .nav-socials { display: none; }
  .menu-btn { display: inline-flex; }
  .nav-left {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    z-index: 5;
    box-shadow: var(--shadow);
  }
  .nav-left.open { display: flex; }
  .nav-left.open .mobile-socials { display: flex; gap: 14px; padding-top: 4px; }
  h1 { font-size: 2.6rem; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
