/* Self-hosted fonts (SIL Open Font License, see assets/fonts) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-500.woff2") format("woff2"); }

:root {
  --bg: #0b0d0f;
  --line: #24282c;
  --accent: #e0a050;
  --fg: #f1efea;
  --text: #c6cacd;
  --muted: #8a9096;
  --surface: #15181b;

  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);

  --bar-h: 56px;
  --side: 20px;
  --rail: 0px;
}
@media (min-width: 720px) { :root { --side: 40px; --rail: 72px; } }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }

body {
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  font: 400 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
h1, h2, h3 { font-weight: 400; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { display: block; }
img { max-width: 100%; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 50;
  padding: 8px 14px; background: var(--fg); color: var(--bg);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.load-error {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
  padding: 12px 16px; background: var(--surface); color: var(--fg); font-size: .9rem;
}
.todo-tag { font: 400 .75rem var(--mono); color: var(--accent); white-space: nowrap; }

/* Space background, drawn once by js/space.js */
.space {
  position: fixed; top: 0; left: 0; z-index: -1;
  width: 100%; height: 100vh; height: 100lvh;
  pointer-events: none;
}

/* Top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  height: var(--bar-h); padding: 0 var(--side);
  background: var(--bg);
  font-size: .875rem;
}
.brand { font: 500 1rem var(--mono); letter-spacing: -.03em; color: var(--fg); }
.bar-section { color: var(--muted); white-space: nowrap; }
@media (max-width: 379px) { .bar-section { display: none; } }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
@media (min-width: 720px) { .topbar__right { gap: 28px; } }

.lang { display: flex; gap: 8px; }
.lang__btn { min-width: 24px; min-height: 40px; color: var(--muted); transition: color .25s ease-out; }
.lang__btn:hover { color: var(--fg); }
.lang__btn[aria-pressed="true"] { color: var(--fg); }

.clock { font: 400 .8125rem var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }

.menu-btn { display: grid; place-content: center; gap: 7px; width: 40px; height: 40px; margin-right: -8px; }
.menu-btn span { display: block; width: 20px; height: 1.5px; background: var(--fg); transition: transform .35s var(--ease); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }
@media (min-width: 720px) { .menu-btn { display: none; } }

/* Icon sidebar: collapsible below 720px, always visible above it */
.sidenav {
  position: fixed; z-index: 25;
  inset: var(--bar-h) auto 0 0;
  width: 220px;
  padding-top: 12px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform .4s var(--ease), visibility 0s linear .4s;
}
.sidenav.is-open {
  transform: none; visibility: visible;
  transition: transform .4s var(--ease), visibility 0s;
}
.sidenav ol { display: grid; gap: 4px; }
.sidenav a {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  min-height: 52px; padding: 0 24px;
  color: var(--muted);
  transition: color .25s ease-out;
}
.sidenav a::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform .4s var(--ease);
}
.sidenav svg {
  flex: none; width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round;
}
.sidenav a:hover, .sidenav a[aria-current="location"] { color: var(--fg); }
.sidenav a[aria-current="location"]::before { transform: none; }
.sidenav__label { font-size: 1rem; white-space: nowrap; }

@media (min-width: 720px) {
  .sidenav {
    width: var(--rail);
    background: none;
    transform: none; visibility: visible; transition: none;
  }
  .sidenav a { justify-content: center; padding: 0; min-height: 56px; }
  /* Labels become tooltips on hover and keyboard focus */
  .sidenav__label {
    position: absolute; left: calc(100% + 8px); top: 50%;
    padding: 4px 10px;
    font-size: .8125rem; color: var(--fg);
    background: var(--surface);
    opacity: 0;
    transform: translate(-6px, -50%);
    pointer-events: none;
    transition: opacity .2s ease-out, transform .3s var(--ease);
  }
  .sidenav a:hover .sidenav__label,
  .sidenav a:focus-visible .sidenav__label { opacity: 1; transform: translate(0, -50%); }
}

/* Sections */
.section {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--bar-h) + 48px) var(--side) 72px calc(var(--side) + var(--rail));
}
.section__inner {
  flex: 1;
  display: flex; flex-direction: column;
  width: 100%; max-width: 1240px;
  margin: 0 auto;
}
.title {
  margin-bottom: auto;
  padding-bottom: 48px;
  font: 400 clamp(2.5rem, 6.5vw, 5.5rem)/1 var(--mono);
  letter-spacing: -.06em;
  color: var(--fg);
}

/* Reveal */
.js .reveal { opacity: 0; transition: opacity .3s ease-out; }
.motion .reveal { transform: translateY(14px); transition: opacity .3s ease-out, transform .3s ease-out; }
.js .is-in .reveal {
  opacity: 1;
  transition: opacity .8s var(--ease) calc(var(--i, 0) * 70ms);
}
.motion .is-in .reveal {
  transform: none;
  transition: opacity .8s var(--ease) calc(var(--i, 0) * 70ms), transform .8s var(--ease) calc(var(--i, 0) * 70ms);
}

/* Home */
.section--home { padding-top: calc(var(--bar-h) + 24px); }
.home-title {
  margin-left: -.04em;
  font: 400 clamp(5rem, 21vw, 17rem)/.9 var(--mono);
  letter-spacing: -.08em;
  color: var(--fg);
}
.home-copy { display: grid; gap: 20px; margin-top: clamp(28px, 5vh, 56px); }
.home-bio { max-width: 34em; font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.4; letter-spacing: -.01em; color: var(--fg); white-space: pre-line; }
.socials { display: flex; flex-wrap: wrap; gap: 4px; margin-left: -11px; }
.socials a, .socials button {
  display: grid; place-items: center; width: 44px; height: 44px;
  color: var(--fg);
  transition: color .25s ease-out;
}
.socials svg { width: 20px; height: 20px; fill: currentColor; }
.socials .is-todo { color: #565b60; cursor: not-allowed; }
@media (hover: hover) {
  .socials a:not(.is-todo):hover, .socials button:not(.is-todo):hover { color: var(--accent); }
}

/* Projects */
#projects .title { margin-bottom: 0; padding-bottom: clamp(28px, 5vh, 48px); }
.project-grid { display: grid; gap: 20px; }
@media (min-width: 620px) { .project-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .project-grid { grid-template-columns: repeat(3, 1fr); } }
.project-card {
  display: flex; flex-direction: column;
  height: 100%;
  background: rgba(241, 239, 234, .03);
  border: 1px solid rgba(241, 239, 234, .1);
  border-radius: 14px;
  overflow: hidden;
}
a.project-card { transition: transform .5s var(--ease), border-color .25s ease-out; }
.project-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.project-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.project-card__media img[hidden] { display: none; }
.project-card--soon {
  align-items: center; justify-content: center; gap: 10px;
  min-height: 220px;
  padding: 24px;
  text-align: center;
  background: none;
  border: 1px dashed rgba(241, 239, 234, .2);
}
.project-card__soon {
  display: inline-flex; align-items: center; gap: 12px;
  font: 400 clamp(1.75rem, 3vw, 2.25rem)/1 var(--mono);
  letter-spacing: -.05em;
  color: var(--fg);
}
.project-card__soon::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.motion .project-card__soon::before { animation: soon-pulse 2.4s ease-in-out infinite; }
@keyframes soon-pulse { 50% { opacity: .25; } }
.project-card--soon .project-card__desc { color: var(--muted); }
.project-card__body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: 16px; }
.project-card__name {
  font: 500 1.125rem/1.25 var(--mono); letter-spacing: -.03em;
  color: var(--fg); overflow-wrap: anywhere;
  transition: color .25s ease-out;
}
.project-card__desc { color: var(--text); font-size: .9375rem; }
.project-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.project-card__tags span {
  padding: 2px 10px;
  font: 400 .75rem/1.5 var(--mono); color: var(--text);
  background: rgba(241, 239, 234, .06);
  border-radius: 999px;
}
.project-card__stats { display: flex; gap: 14px; font: 400 .8125rem var(--mono); color: var(--muted); }
.project-card__stats span { display: inline-flex; align-items: center; gap: 5px; }
.project-card__stats svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.project-empty { padding-top: 20px; border-top: 1px solid var(--line); color: var(--text); }
.project-all { margin-top: 24px; font-size: .9375rem; }
@media (hover: hover) {
  a.project-card:hover { transform: translateY(-3px); border-color: var(--accent); }
  a.project-card:hover .project-card__name { color: var(--accent); }
}

/* Links */
.link-list { border-bottom: 1px solid var(--line); }
.link-card {
  display: grid; align-items: baseline; column-gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: clamp(16px, 2.6vh, 28px) 0;
  border-top: 1px solid var(--line);
  transition: transform .5s var(--ease);
}
.link-card__name {
  font-size: clamp(1.75rem, 4.4vw, 3.5rem); line-height: 1.1; letter-spacing: -.035em;
  color: var(--fg);
  transition: color .25s ease-out;
}
.link-card__meta { grid-column: 1; grid-row: 2; margin-top: 4px; font-size: .9375rem; color: var(--muted); }
.link-card__handle { display: block; color: var(--text); }
.link-card__end { grid-column: 2; grid-row: 1; align-self: center; }
.link-card__arrow { width: 24px; height: 24px; color: var(--muted); transition: color .25s ease-out, transform .5s var(--ease); }
.link-card.is-todo { cursor: not-allowed; }
.link-card.is-todo .link-card__name { color: var(--muted); }
@media (min-width: 860px) {
  .link-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; }
  .link-card__meta { grid-column: 2; grid-row: 1; margin: 0; }
  .link-card__end { grid-column: 3; }
}
@media (hover: hover) {
  .link-card:not(.is-todo):hover { transform: translateY(-3px); }
  .link-card:not(.is-todo):hover .link-card__name,
  .link-card:not(.is-todo):hover .link-card__arrow { color: var(--accent); }
  .link-card:not(.is-todo):hover .link-card__arrow { transform: translate(3px, -3px); }
}

/* Contact */
.contact-email { display: block; width: 100%; text-align: left; color: var(--fg); }
.contact-email:disabled { cursor: not-allowed; }
.contact-email strong {
  display: block;
  font-size: clamp(1.625rem, 5.4vw, 4.75rem); font-weight: 400; line-height: 1.1; letter-spacing: -.04em;
  overflow-wrap: anywhere;
  transition: color .25s ease-out;
}
@media (hover: hover) { .contact-email:not(:disabled):hover strong { color: var(--accent); } }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 16px; }
.contact-email__state, .contact-link { font-size: .9375rem; }
.contact-email__state { color: var(--muted); }

/* Confirmation message */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  background: var(--fg); color: var(--bg);
  font-size: .9375rem; font-weight: 500;
  transform: translateX(-50%);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease-out, visibility 0s linear .25s;
}
.toast.is-visible { opacity: 1; visibility: visible; transition: opacity .25s ease-out, visibility 0s; }
.contact-link { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: color .25s ease-out, text-decoration-color .25s ease-out; }
.contact-link:not([href]) { color: var(--muted); text-decoration: none; cursor: not-allowed; }
@media (hover: hover) { .contact-link[href]:hover { color: var(--accent); text-decoration-color: currentColor; } }
.contact-row {
  display: grid; gap: 28px;
  margin-top: clamp(32px, 6vh, 64px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
@media (min-width: 720px) { .contact-row { grid-template-columns: 1fr 2fr; gap: 48px; } }
.contact-col h3 { margin-bottom: 8px; font-size: .875rem; color: var(--muted); }
.contact-col p { max-width: 46ch; margin-bottom: 10px; }

/* Sponsors */
.sponsor-grid { display: grid; gap: 32px 20px; align-items: start; }
@media (min-width: 620px) { .sponsor-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .sponsor-grid { grid-template-columns: repeat(3, 1fr); } }
.sponsor { border-top: 1px solid var(--line); transition: border-color .3s ease-out; }
.sponsor.is-open { border-color: var(--fg); }
.sponsor h3 { font: inherit; }
.sponsor__toggle {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px;
  width: 100%; padding: 20px 0;
  text-align: left;
}
.sponsor__logo { width: 120px; height: 48px; margin-bottom: 20px; object-fit: contain; object-position: left; }
.sponsor__name { display: block; font-size: 1.25rem; line-height: 1.25; letter-spacing: -.02em; color: var(--fg); transition: color .25s ease-out; }
.sponsor__tagline { display: block; margin-top: 2px; font-size: .9375rem; color: var(--muted); }
.sponsor__sign { position: relative; width: 14px; height: 14px; margin-top: 4px; }
.sponsor__sign::before, .sponsor__sign::after {
  content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 1.5px;
  background: var(--fg); transition: transform .4s var(--ease);
}
.sponsor__sign::after { transform: rotate(90deg); }
.sponsor.is-open .sponsor__sign::after { transform: rotate(0); }
@media (hover: hover) { .sponsor__toggle:hover .sponsor__name { color: var(--accent); } }
.sponsor__panel { overflow: hidden; }
.sponsor__panel[hidden] { display: none; }
.sponsor__body { padding-bottom: 8px; }
.sponsor__body > p:first-child { margin-bottom: 8px; font-size: .875rem; color: var(--muted); }
.product { padding: 12px 0; border-top: 1px solid var(--line); }
.product__name { color: var(--fg); }
.product__note { font-size: .9375rem; color: var(--muted); }
.product .contact-link { display: inline-block; margin-top: 6px; font-size: .875rem; }
.sponsor__site { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.sponsor__site .contact-link { font-size: .875rem; }
.empty { color: var(--muted); }

.section--last { padding-bottom: 28px; }
.footer {
  display: flex; justify-content: space-between; gap: 16px;
  width: 100%; max-width: 1240px; margin: 64px auto 0;
  font-size: .8125rem; color: var(--muted);
}
.footer .contact-link { font-size: inherit; color: inherit; }

/* Standalone pages: privacy and 404 */
.page {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100svh;
  max-width: 760px;
  padding: calc(var(--bar-h) + 48px) var(--side) 64px;
}
.page .title { margin: 0; padding: 0; }
.page--center { justify-content: center; padding-top: var(--bar-h); }
.page__lead { margin-top: 20px; font-size: clamp(1.25rem, 2.2vw, 1.75rem); line-height: 1.25; letter-spacing: -.02em; color: var(--fg); }
.page__back { margin-top: 40px; }
.prose { margin-top: 24px; max-width: 62ch; }

@media (prefers-reduced-motion: reduce) {
  .link-card, .project-card, .link-card__arrow, .sidenav, .sidenav a::before, .sidenav__label, .menu-btn span { transition: none !important; }
  .link-card:hover, .project-card:hover, .link-card:hover .link-card__arrow { transform: none !important; }
}
