/* ── deep-night cartography ─────────────────────────────────────────
   near-black indigo sky · one warm sodium-amber accent
   Fraunces (display) · IBM Plex Mono (chrome)                        */

:root {
  --ink-0: #07070f;
  --ink-1: #0e0e1a;
  --ink-2: #161628;
  --paper: #e9e4d6;
  --paper-dim: #9a96a8;
  --amber: #ffaa33;
  --amber-deep: #c97e1e;
  --amber-soft: rgba(255, 170, 51, 0.14);
  --line: rgba(233, 228, 214, 0.1);
  --font-display: "Fraunces", georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --city-0-t: #1d1d33;
  --city-0-l: #131322;
  --city-0-r: #0c0c18;
  --city-1-t: #5a3d16;
  --city-1-l: #3a280f;
  --city-1-r: #281b0a;
  --city-2-t: #92611c;
  --city-2-l: #5e3f13;
  --city-2-r: #402b0d;
  --city-3-t: #cf8a24;
  --city-3-l: #8a5c18;
  --city-3-r: #5e3f11;
  --city-4-t: var(--amber);
  --city-4-l: #b1761f;
  --city-4-r: #7c5316;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink-0);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 340;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
}

::selection {
  background: var(--amber);
  color: var(--ink-0);
}

a {
  color: var(--amber);
  text-decoration-color: var(--amber-deep);
  text-underline-offset: 3px;
}

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

.mono {
  font-family: var(--font-mono);
}

/* ── atmosphere ───────────────────────────────────────────────── */

.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 90% at 80% -10%, #131336 0%, transparent 55%),
    radial-gradient(100% 70% at 10% 110%, #1a1230 0%, transparent 50%),
    radial-gradient(60% 40% at 70% 80%, rgba(255, 170, 51, 0.05) 0%, transparent 70%),
    var(--ink-0);
}

.sky::after {
  /* faint surveyor's dot grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(233, 228, 214, 0.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.25));
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── topbar ───────────────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
  background: linear-gradient(to bottom, rgba(7, 7, 15, 0.85), transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar__mark {
  font-weight: 600;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--amber);
}

.topbar__status {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--paper-dim);
}

/* ── layout ───────────────────────────────────────────────────── */

main,
.contact {
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

section,
footer {
  padding-block: clamp(4rem, 10vh, 7rem);
  scroll-margin-top: 3.5rem;
}

.section-title {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  font-weight: 420;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
}

.section-title__no {
  font-size: 0.6em;
  color: var(--amber);
  vertical-align: 0.5em;
  margin-right: 0.6em;
  letter-spacing: 0.1em;
}

.section-sub {
  color: var(--paper-dim);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  margin: 0 0 2.5rem;
}

/* ── hero ─────────────────────────────────────────────────────── */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: 40%;
  left: 50%;
  width: 60vw;
  height: 60vw;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--amber-soft) 0%, transparent 60%);
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
  animation: pulse-glow 8s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.6; }
}

.hero__kicker {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 1.2rem;
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.hero__name {
  font-size: clamp(3.4rem, 13vw, 9.5rem);
  font-weight: 560;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 1.8rem;
  font-variation-settings: "opsz" 144;
}

.hero__line {
  display: block;
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) 0.12s both;
}

.hero__line--accent {
  color: var(--amber);
  animation-delay: 0.26s;
}

.hero__line--accent em {
  font-weight: 640;
}

.hero__bio {
  max-width: 34em;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--paper-dim);
  margin: 0;
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) 0.4s both;
}

.hero__scrollcue {
  position: absolute;
  bottom: 2.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: var(--paper-dim);
  animation: bob 2.6s ease-in-out 1.5s infinite;
}

.hero__scrollcue:hover {
  color: var(--amber);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* ── the commit city ──────────────────────────────────────────── */

.city {
  margin: 0;
}

.city svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 18px 50px rgba(255, 170, 51, 0.1));
}

/* faces — lit from the upper left, amber windows by level */
.f-t { fill: var(--city-0-t); stroke: rgba(233, 228, 214, 0.05); stroke-width: 0.5; }
.f-l { fill: var(--city-0-l); }
.f-r { fill: var(--city-0-r); }

.bldg[data-level="1"] .f-t { fill: var(--city-1-t); }
.bldg[data-level="1"] .f-l { fill: var(--city-1-l); }
.bldg[data-level="1"] .f-r { fill: var(--city-1-r); }

.bldg[data-level="2"] .f-t { fill: var(--city-2-t); }
.bldg[data-level="2"] .f-l { fill: var(--city-2-l); }
.bldg[data-level="2"] .f-r { fill: var(--city-2-r); }

.bldg[data-level="3"] .f-t { fill: var(--city-3-t); }
.bldg[data-level="3"] .f-l { fill: var(--city-3-l); }
.bldg[data-level="3"] .f-r { fill: var(--city-3-r); }

.bldg[data-level="4"] .f-t { fill: var(--city-4-t); }
.bldg[data-level="4"] .f-l { fill: var(--city-4-l); }
.bldg[data-level="4"] .f-r { fill: var(--city-4-r); }

.bldg:hover .f-t {
  fill: #ffd28a;
}

/* diagonal build-up wave (var(--wave) set per building by JS) */
.bldg {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.5s ease var(--wave, 0ms),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) var(--wave, 0ms);
}

.city--unbuilt .bldg {
  opacity: 0;
  transform: translateY(18px);
  transition: none;
}

.city__fallback {
  font-size: 0.85rem;
  color: var(--paper-dim);
  border: 1px dashed var(--line);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.city__legend {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--paper-dim);
  text-align: right;
  margin-top: 1rem;
}

/* ── projects ─────────────────────────────────────────────────── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.1rem;
  margin-top: 2.5rem;
}

.card {
  display: block;
  background: linear-gradient(160deg, rgba(22, 22, 40, 0.6), rgba(14, 14, 26, 0.6) 65%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.6rem 1.5rem 1.3rem;
  color: inherit;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 170, 51, 0.3);
  box-shadow: 0 12px 32px rgba(255, 170, 51, 0.1), 0 4px 12px rgba(0, 0, 0, 0.4);
  background: linear-gradient(160deg, rgba(26, 26, 48, 0.7), rgba(16, 16, 30, 0.7) 65%);
}

.card__title {
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 0.6rem;
}

.card__desc {
  color: var(--paper-dim);
  font-size: 0.95rem;
  margin: 0 0 1.2rem;
}

.card__tags {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin: 0;
}

/* ── contact ──────────────────────────────────────────────────── */

.contact {
  padding-block: clamp(4rem, 12vh, 8rem) 3rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.contact__title {
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.02em;
  margin: 0 0 2rem;
}

.contact__links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.8rem;
}

.contact__links a {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.contact__links a:hover {
  color: var(--amber);
  border-color: var(--amber);
}

.contact__colophon {
  margin-top: 4rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: rgba(154, 150, 168, 0.55);
}

/* ── scroll reveals ───────────────────────────────────────────── */

/* hidden state only when JS is running (it adds .js to <html>) */
.js .reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── reduced motion ───────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal,
  .city--unbuilt .bldg {
    opacity: 1;
    transform: none;
  }
}
