/* Website kit — layout & section styling. Composes brand tokens from styles.css.
   Kit-local only (not shipped to consumers). */

.site { min-height: 100vh; background: var(--bg); color: var(--text); }
.wrap { width: 100%; max-width: var(--container-xl); margin: 0 auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: var(--container-md); }

/* ---------- Header ---------- */
.hdr { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.hdr__in { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.hdr__nav { display: flex; align-items: center; gap: 4px; }
.navlink { font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary);
  background: none; border: none; cursor: pointer; padding: 8px 14px; border-radius: var(--radius-md);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.navlink:hover { color: var(--text); background: var(--surface-2); }
.navlink--on { color: var(--text); }
.navlink--on::after { content: ""; display: block; height: 2px; background: var(--accent); margin: 5px 12px -1px; border-radius: 2px; }
.hdr__right { display: flex; align-items: center; gap: 10px; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius-md);
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out); }
.iconbtn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(1.875rem, 4.5vw, 3.75rem) 0 clamp(2.5rem, 5vw, 4.5rem); overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.75rem); line-height: 1.02; letter-spacing: -0.035em; margin: 18px 0 0; }
.hero h1 .accent { color: var(--primary); }
.hero__lead { font-size: clamp(1.05rem, 2vw, 1.375rem); line-height: 1.55; color: var(--text-secondary); max-width: 40ch; margin: 22px 0 0; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; font-family: var(--font-mono);
  font-size: var(--text-xs); color: var(--text-muted); letter-spacing: .02em; }
.hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero__portrait { position: relative; justify-self: center; }
.hero__portrait img { width: min(340px, 80vw); aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.hero__tickets { position: absolute; left: -18px; bottom: 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md); padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.hero__tickets .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success-500); box-shadow: 0 0 0 3px color-mix(in oklch, var(--success-500) 25%, transparent); }
.hero__tickets .t { font-family: var(--font-mono); font-size: 12px; color: var(--text); }

/* ---------- Section scaffolding ---------- */
.section { padding: clamp(1.875rem, 4.5vw, 3.75rem) 0 clamp(2.5rem, 6vw, 5rem); }
.section--sunken { background: var(--surface-sunken); border-block: 1px solid var(--border); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.section__head h1, .section__head h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); letter-spacing: -0.02em; margin: 12px 0 0; }
.section__head p { color: var(--text-secondary); margin: 8px 0 0; max-width: 108ch; }

.statrow { display: flex; flex-direction: column; gap: 1rem; }
.statrow__stats { display: flex; flex-wrap: wrap; gap: clamp(1.5rem, 5vw, 4rem); }

/* ---------- Work list ---------- */
.worklist { display: flex; flex-direction: column; gap: 16px; }
.work { display: grid; grid-template-columns: 168px 1fr; gap: 28px; padding: 24px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.work:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.work__period { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); letter-spacing: .02em; }
.work__org { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--accent); margin-top: 6px; }
.work__role { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.01em; margin: 0 0 4px; }
.work__sum { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.6; margin: 0 0 14px; }
.work__out { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.work__out li { position: relative; padding-left: 20px; font-size: var(--text-sm); color: var(--text); }
.work__out li::before { content: ""; position: absolute; left: 0; top: 8px; width: 9px; height: 9px;
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg); }
.work__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.inlinelink { background: none; border: none; cursor: pointer; font: inherit; color: var(--accent); padding: 0; }
.inlinelink:hover { text-decoration: underline; }

/* ---------- Service link (Work page) & Service record page ---------- */
.servicelink { width: 100%; display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 18px 22px;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); cursor: pointer;
  text-align: left; color: var(--text-secondary); font-family: var(--font-sans); font-size: var(--text-sm); line-height: 1.5;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.servicelink:hover { border-color: var(--gold-700); color: var(--text); background: var(--surface-2); }
.servicelink .svl__icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--gold-700) 12%, transparent); color: var(--gold-700); flex: none; }
.servicelink .svl__txt { flex: 1; }
.servicelink .svl__txt b { color: var(--text); font-weight: 600; font-family: var(--font-display); }
.servicelink .svl__cta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--gold-700); white-space: nowrap; letter-spacing: .02em; }

.svstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 26px;
  background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.svstat__v { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.02em; color: var(--gold-700); }
.svstat__l { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); margin-top: 7px; letter-spacing: .02em; line-height: 1.4; }
.svrole { display: flex; align-items: center; gap: 10px; }
.svrole__icon { display: inline-flex; color: var(--gold-700); }
.svnote { margin-top: 30px; color: var(--text-muted); font-size: var(--text-sm); }
.about__photo img { width: 100%; border-radius: var(--radius-xl); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.about__lede { font-size: clamp(1.2rem, 2.4vw, 1.6rem); line-height: 1.4; letter-spacing: -0.01em;
  font-family: var(--font-display); font-weight: 500; color: var(--text); margin: 14px 0 18px; }
.about p { color: var(--text-secondary); line-height: 1.7; }
.about p b { color: var(--text); font-weight: 600; }
.skillgrid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ---------- Writing ---------- */
.postlist { display: flex; flex-direction: column; gap: 2px; }
.post { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 22px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer; border-radius: var(--radius-md);
  transition: background var(--dur-fast) var(--ease-out); }
.post:hover { background: var(--surface-2); }
.post__meta { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); margin-bottom: 9px; }
.post__title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.015em; margin: 0 0 8px; }
.post:hover .post__title { color: var(--primary); }
.post__excerpt { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.6; max-width: 62ch; margin: 0; }
.post__arrow { color: var(--text-muted); transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.post:hover .post__arrow { color: var(--accent); transform: translate(3px, -3px); }

.feature { display: grid; grid-template-columns: 1fr; gap: 0; padding: 30px; border-radius: var(--radius-xl);
  background: var(--navy-900); color: #eaf1f8; position: relative; overflow: hidden; margin-bottom: 28px; cursor: pointer; }
.feature::before { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(to right, rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 30px 30px; }
.feature > * { position: relative; }
.feature__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.4rem); letter-spacing: -0.02em; margin: 14px 0 12px; color: #fff; max-width: 20ch; }
.feature__excerpt { color: #a9c0db; max-width: 54ch; line-height: 1.6; margin: 0 0 22px; }

/* ---------- Article ---------- */
.article { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.article__head { max-width: var(--container-md); margin: 0 auto 36px; }
.article__head h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -0.03em; margin: 16px 0 18px; }
.article__meta { display: flex; align-items: center; gap: 16px; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.article__body { max-width: var(--container-md); margin: 0 auto; font-size: var(--text-md); line-height: 1.75; color: var(--text); }
.article__body p { margin: 0 0 1.3em; color: var(--text-secondary); }
.article__body h3 { font-size: var(--text-xl); margin: 1.8em 0 .6em; letter-spacing: -0.01em; }
.article__body blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent);
  font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); color: var(--text); line-height: 1.4; }
.article__body code { background: var(--surface-sunken); padding: 2px 6px; border-radius: var(--radius-xs); color: var(--primary); font-size: .9em; }
.backlink { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--text-secondary); background: none; border: none; cursor: pointer; padding: 0; letter-spacing: .04em; text-transform: uppercase; }
.backlink:hover { color: var(--primary); }

/* ---------- Building / projects ---------- */
.projgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.proj { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.proj:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.proj__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.proj__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--radius-md);
  background: var(--accent-soft); color: var(--accent-hover); }
.proj__stack { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); text-align: right; letter-spacing: .01em; }
.proj__name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -0.01em; margin: 4px 0 0; }
.proj__blurb { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.6; margin: 0; flex: 1; }
.proj__blurb ul { margin: 10px 0 0; padding-left: 20px; }
.proj__blurb li { margin-top: 6px; }
.proj__link { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--accent-hover); letter-spacing: .01em; }
.proj__link a { color: inherit; text-decoration: none; }
.proj__link a:hover { text-decoration: underline; }

/* ---------- CTA band ---------- */
.cta { text-align: center; padding: clamp(3rem, 7vw, 5.5rem) 0; }
.cta h2 { font-size: clamp(1.9rem, 4.5vw, 3rem); letter-spacing: -0.025em; margin: 14px 0 14px; }
.cta p { color: var(--text-secondary); max-width: 42ch; margin: 0 auto 28px; }
.cta__row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
/* CTA eyebrow — larger, bolder, and a deeper gold in light theme so "Let's talk" reads
   clearly over the dotted ground instead of getting lost. Dark theme keeps the bright gold. */
.cta .cw-kicker-c { font-size: var(--text-sm); font-weight: var(--fw-bold); }
.cta .cw-kicker-c--gold { color: var(--gold-700); }
[data-theme="dark"] .cta .cw-kicker-c--gold,
.theme-dark .cta .cw-kicker-c--gold { color: var(--gold); }

/* ---------- Homepage vertical rhythm ----------
   The home page stacks four full-padding sections (hero, sunken stats,
   work, CTA). Their symmetric padding would otherwise compound to ~10rem
   of whitespace between each block, leaving the page strung-out. Tighten
   the rhythm here so it reads as one flowing splash; the single-section
   inner pages keep the roomier default. */
.page--home .hero { padding-bottom: clamp(1.75rem, 3.5vw, 3rem); }
.page--home .section { padding: clamp(2rem, 4vw, 3.5rem) 0; }
.page--home .section--sunken { padding: clamp(1.75rem, 3.5vw, 2.75rem) 0; }
.page--home .cta { padding: 0 0 clamp(2.75rem, 5.5vw, 4.5rem); }

/* ---------- Footer ---------- */
.ftr { border-top: 1px solid var(--border); padding: 34px 0; }
.ftr__in { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.ftr__social { display: flex; gap: 8px; }
.ftr__copy { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { order: -1; justify-self: start; }
  .about { grid-template-columns: 1fr; }
  .work { grid-template-columns: 1fr; gap: 12px; }
  .projgrid { grid-template-columns: 1fr; }
  .svstats { grid-template-columns: repeat(2, 1fr); }
  .hdr__nav { display: none; }
}

/* ---------- Accessibility baseline ---------- */

/* Skip-to-content link: visually hidden until keyboard-focused. */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus {
  top: 8px;
}

/* Visible keyboard-focus ring across interactive elements. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

/* Respect the user's reduced-motion preference: suppress transitions,
   animations, and smooth scrolling. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ========================================================================
   404 page — promoted from _design_reference/NotFound.jsx + 404.html.
   Composes brand tokens only; no new variables introduced.
   ======================================================================== */
.nf {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 68px);
}
.nf__grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  width: 100%;
}

.nf__digits {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.5vw, 14px);
  margin: 14px 0 6px;
  line-height: 1;
}
.nf__digits > span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(5rem, 16vw, 11rem);
  letter-spacing: -0.04em;
  color: var(--text);
}
.nf__o {
  display: inline-grid;
  place-items: center;
  color: var(--gold-700);
  transform: translateY(2px);
}
.nf__o svg {
  width: clamp(4rem, 13vw, 9rem);
  height: clamp(4rem, 13vw, 9rem);
  stroke-width: 1.75;
}

.nf__h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 6px 0 0;
}

/* Diagnostic readout card */
.nf__diag {
  margin-top: 26px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  max-width: 52ch;
}
.nf__diag-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nf__diag-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.nf__diag-text {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text);
  margin: 12px 0 2px;
  min-height: 2.5em;
}

.nf__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Terminal gag */
.nf__right {
  justify-self: center;
  width: 100%;
  max-width: 460px;
}
.term404 {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--navy-950);
}
.term404__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--navy-900);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.term404__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.term404__dot:nth-child(1) {
  background: #e5654b;
}
.term404__dot:nth-child(2) {
  background: var(--gold-500);
}
.term404__dot:nth-child(3) {
  background: var(--success-500);
}
.term404__title {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #8aa3c2;
  letter-spacing: 0.02em;
}
.term404__body {
  padding: 22px 20px 26px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.9;
  color: #cfe0f2;
}
.term404__body p {
  margin: 0;
}
.term404__prompt {
  color: var(--teal-500, #16a5b0);
}
.term404__indent {
  padding-left: 2.6em;
}
.term404__str {
  color: var(--gold-500);
}
.term404__out {
  color: #f0b9ac;
  margin-top: 6px !important;
}
.term404__cursor {
  margin-top: 10px !important;
}
.term404__blink {
  display: inline-block;
  color: #cfe0f2;
  animation: nf-blink 1.05s steps(1) infinite;
}
@keyframes nf-blink {
  50% {
    opacity: 0;
  }
}

.nf__caption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  margin: 16px 0 0;
  letter-spacing: 0.01em;
}

@media (max-width: 860px) {
  .nf {
    min-height: 0;
    padding: clamp(2.5rem, 8vw, 5rem) 0;
  }
  .nf__grid {
    grid-template-columns: 1fr;
  }
  .nf__right {
    order: -1;
    max-width: 100%;
  }
}
