:root {
  --paper: #F6F1EA;
  --ink:   #1A1A1A;
  --fog:   #68635E;
  --hair:  rgba(26, 26, 26, 0.14);
  --hair-strong: rgba(26, 26, 26, 0.22);

  --f-display: 'Fraunces', Georgia, serif;
  --f-body:    'Inter Tight', -apple-system, system-ui, sans-serif;
  --f-mono:    'JetBrains Mono', ui-monospace, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }

html {
  scrollbar-width: thin;
  scrollbar-color: var(--hair-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--hair-strong);
  border: 3px solid var(--paper);
  border-radius: 10px;
  transition: background 180ms ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fog);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-12);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  gap: clamp(24px, 4vh, 64px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fog);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  color: var(--ink);
  text-transform: none;
}

.home-link:hover { text-decoration: underline; }

.hint {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--fog);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--hair-strong);
  border-radius: 3px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink);
  background: var(--paper);
  margin: 0 1px;
}

.site-footer {
  display: grid;
  gap: var(--space-6);
}

.footer-nav {
  display: grid;
  max-width: 460px;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
}

.footer-nav h2, .site-footer .coord {
  font-family: var(--f-mono);
  color: var(--fog);
  font-weight: 400;
  text-transform: uppercase;
}

.footer-nav h2 {
  border-top: 1px solid var(--hair);
  padding-block: var(--space-3) var(--space-1);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.footer-nav ul { list-style: none; }

.footer-nav li > a, .footer-planned {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: var(--space-4);
  align-items: center;
  min-height: 44px;
  padding-block: 6px;
  border-bottom: 1px solid var(--hair);
  color: var(--ink);
  font-size: 17px;
  transition: padding-left 220ms ease, border-color 220ms ease;
}

.footer-planned { color: var(--fog); }

.footer-nav li > a:is(:hover, :focus-visible) {
  padding-left: 6px;
  border-color: var(--ink);
}

.footer-arrow, .footer-meta {
  font-family: var(--f-mono);
  color: var(--fog);
}
.footer-arrow { font-size: 14px; }
.footer-meta { font-size: 13px; text-align: right; }

.site-footer .coord {
  font-size: 12px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(20px, 3vh, 48px);
  padding: var(--space-4) 0;
}

.name {
  font-family: var(--f-display);
  font-size: clamp(56px, 12vw, 128px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 0, "wght" 400;
  transition: font-variation-settings 600ms cubic-bezier(0.2, 0, 0, 1);
  display: inline-block;
  cursor: default;
}

.name:hover {
  font-variation-settings: "opsz" 132, "SOFT" 50, "wght" 400;
}

.lead {
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
  max-width: 46ch;
  font-weight: 400;
}

.body {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  max-width: 48ch;
}

.rule-animated {
  display: block;
  height: 1px;
  background: var(--ink);
  border: 0;
  width: 0;
  max-width: 100%;
  opacity: 0.9;
}

.home .rule-animated {
  animation: draw 900ms cubic-bezier(0.2, 0, 0, 1) 400ms forwards;
}

@keyframes draw {
  from { width: 0; }
  to { width: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .home .rule-animated { animation: none; width: 240px; }
}

.home-links {
  display: grid;
  justify-items: start;
  max-width: 560px;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.home-links a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.17em;
}

.home-links a:hover { text-decoration-thickness: 2px; }

.story-link {
  font-family: var(--f-display);
  font-size: clamp(27px, 3.4vw, 38px);
  line-height: 1.2;
}

.publication { font-size: 17px; }
.publication span { color: var(--fog); }

.about-lead {
  grid-area: lead;
  max-width: 64ch;
}

.about-lead h1 {
  font-family: var(--f-display);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.intro {
  font-size: 22px;
  line-height: 1.5;
}

.prose {
  grid-area: story;
  display: grid;
  gap: var(--space-6);
  max-width: 64ch;
  font-size: 18px;
  line-height: 1.65;
}

.prose p.origin::first-letter {
  font-family: var(--f-display);
  font-size: 72px;
  line-height: 0.9;
  font-weight: 400;
  float: left;
  padding: 4px 10px 0 0;
  color: var(--ink);
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  grid-template-areas: "lead portrait" "story portrait";
  gap: var(--space-6) var(--space-12);
  align-content: start;
  align-items: start;
}

.portrait-col {
  grid-area: portrait;
  padding-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.portrait {
  width: 100%;
  height: auto;
  display: block;

  border-radius: 0;
}

.portrait-caption {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fog);
  text-transform: uppercase;
}

.inspector {
  position: fixed;
  pointer-events: none;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: var(--ink);
  padding: 6px 9px;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 9000;
  opacity: 0;
  transform: translate(14px, 14px);
  transition: opacity 140ms ease;
  text-transform: uppercase;
}

.inspector.visible { opacity: 0.92; }

@media (hover: none) {
  .inspector { display: none !important; }
}

.home .topbar { justify-content: flex-end; }

@media (min-width: 721px) {
  .home .shell { padding-block: clamp(20px, 3vh, 48px); gap: clamp(14px, 2vh, 32px); }
  .home .hero { gap: clamp(16px, 2.2vh, 32px); }
}

@media (min-width: 721px) and (max-height: 800px) {
  .home .name { font-size: clamp(72px, 10vw, 100px); }
  .home .hero { gap: 12px; }
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--hair-strong);
  text-underline-offset: 0.2em;
}
.prose a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.menu-button {
  min-height: 44px;
  padding: 4px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}
.menu-button:hover { text-decoration: underline; }

#site-menu {
  position: fixed;
  inset: 18vh 0 auto;
  margin-inline: auto;
  width: min(560px, calc(100vw - 32px));
  max-height: 75dvh;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-mono);
}
#site-menu::backdrop {
  background: rgb(26 26 26 / 38%);
  backdrop-filter: blur(3px);
}
html:has(#site-menu[open]) { overflow: hidden; }

.menu-tools {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 8px;
  border-bottom: 1px solid var(--hair);
}
.menu-tools input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 8px 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.menu-tools button {
  border: 1px solid var(--hair-strong);
  padding: 7px 9px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.menu-links { list-style: none; }
.menu-links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--hair);
}
.menu-links a small { color: var(--fog); }
.menu-links a:is(:focus, :hover) { color: var(--paper); background: var(--ink); }
.menu-links a:is(:focus, :hover) small { color: inherit; }
.empty-menu { padding: 16px 20px; font-size: 14px; }

@media (max-width: 720px) {
  .shell { padding: var(--space-6); gap: var(--space-6); }
  .name { font-size: clamp(44px, 14.4vw, 56px); }
  .footer-nav li > a, .footer-planned { column-gap: var(--space-2); }
  .footer-meta { font-size: 12px; }
  .about-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "lead" "portrait" "story";
  }
  .portrait-col { width: min(160px, 100%); padding-top: 0; }
  .inspector, .kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { transition: none !important; animation: none !important; }
}
