/* ============================================================
   cv.kirichoff.xyz — warm dark editorial, ask-first
   Markup generated by landing/build.js · behaviour in landing/app.js
   ============================================================ */

:root {
  --bg: #141210;
  --bg-2: #1b1815;
  --card: #1f1b17;
  --ink: #efe9df;
  --ink-2: #b8b0a3;
  --muted: #7c7468;
  --line: #2b2621;
  --accent: #e0b35a;
  --accent-2: #f0c973;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --max: 1280px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* the hero portrait bleeds past the layout column by design — clip the bleed
     at the page edge so it never turns into horizontal scroll */
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

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

.mono {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 2;
}

/* ---------- scroll-scrubbed video background ---------- */
.bgv {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bgv video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: saturate(0.9) contrast(1.05);
}

.bgv::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 18, 16, 0.15) 0%, rgba(20, 18, 16, 0.55) 50%, rgba(20, 18, 16, 0.92) 100%),
    radial-gradient(70% 60% at 30% 20%, transparent, rgba(20, 18, 16, 0.6));
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 60;
  transition: width 0.1s linear;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  /* sticky bar must not let content show through underneath */
  background: linear-gradient(180deg, rgba(20, 18, 16, 0.92), rgba(20, 18, 16, 0.75));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-in {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 40px;
  max-width: var(--max);
  margin: 0 auto;
}

.nav .brand {
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
  font-weight: 300;
  white-space: nowrap;
}

.nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  font-size: 14px;
  color: var(--ink-2);
}

.nav ul a {
  position: relative;
  white-space: nowrap;
}

.nav ul a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 1px;
  background: var(--accent);
  transition: right 0.3s;
}

.nav ul a:hover::after { right: 0; }

.nav .cta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  white-space: nowrap;
  background: rgba(20, 18, 16, 0.5);
  backdrop-filter: blur(8px);
  transition: 0.25s;
}

.nav .cta:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pulse {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #7ed37e;
  box-shadow: 0 0 0 0 rgba(126, 211, 126, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(126, 211, 126, 0); }
  100% { box-shadow: 0 0 0 0 rgba(126, 211, 126, 0); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  /* text column is capped so the headline can never run under the portrait */
  grid-template-columns: minmax(0, 620px) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 30px 0 40px;
}
.hero-text { min-width: 0; position: relative; z-index: 2; }

/* grid items default to min-width:auto, which lets a wide child widen the
   track past the container and create horizontal scroll — opt out */
.hero > * {
  min-width: 0;
}

.hero h1 {
  margin-top: 18px;
  font-family: var(--serif);
  font-weight: 300;
  /* Sized so the longest authored headline line (identity.headline in
     profile.yaml) still fits its column on one line — the array decides the
     line breaks, the browser must not add its own. */
  font-size: clamp(44px, 6.4vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variation-settings: 'opsz' 144;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

/* the cycling verb: mono-ish shimmer while "thinking", snaps back to serif when settled */
.hero h1 .verb { display: inline-block; }
.hero h1 .verb.out { animation: verbout 0.35s ease-in both; }
.hero h1 .verb.in { animation: verbin 0.5s ease-out both; }
@keyframes verbout { to { opacity: 0; transform: translateY(-8px); } }
@keyframes verbin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* variable weight breathes on hover, word by word */
.hero h1 .w {
  display: inline-block;
  transition: font-weight 0.35s, letter-spacing 0.35s, color 0.35s;
  font-variation-settings: 'opsz' 144;
}

.hero h1 .w:hover {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}

.hero .sub {
  margin-top: 26px;
  max-width: 520px;
  font-size: 18px;
  color: var(--ink-2);
  line-height: 1.55;
}

.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.line > span {
  display: block;
  transform: translateY(110%);
  animation: rise 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.line:nth-child(2) > span { animation-delay: 0.1s; }
.line:nth-child(3) > span { animation-delay: 0.2s; }

@keyframes rise {
  to { transform: none; }
}

/* ---------- buttons ---------- */
.btns {
  display: flex;
  gap: 12px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: rgba(20, 18, 16, 0.4);
  backdrop-filter: blur(8px);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s;
}

.btn span {
  position: relative;
  z-index: 1;
  transition: color 0.3s;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.alt-dl {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
button.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(224, 179, 90, 0.5);
  cursor: pointer;
}
button.link:hover { color: var(--accent); }
footer button.link { color: inherit; }
.btn:hover { transform: translateY(-2px); }
.btn:hover::before { transform: none; }
.btn:hover span { color: var(--bg); }

.btn:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* ---------- hero portrait ---------- */
.portrait {
  position: relative;
  height: 100%;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

/* The cutout deliberately bleeds past the layout column (right: -8%); the
   bleed is clipped at the page edge by overflow-x on html/body. */

.portrait img {
  position: absolute;
  z-index: 1;
  /* anchor to the viewport's right edge, not the 1280px column: bleed like the mockup */
  right: calc(-1 * max(40px, (100vw - var(--max)) / 2 + 40px) - 2vw);
  bottom: 0;
  /* figure is ~1.07:1 — size so it never grows wider than its column + the bleed */
  height: min(92vh, 860px, calc((100vw - 620px - 40px) * 1.05));
  width: auto;
  max-width: none;
  /* warm duotone-ish: desaturate, pull highlights down so the white shirt sits in the palette */
  filter: contrast(1.02) brightness(0.9) saturate(0.95);
  mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  transition: filter 0.8s;
  animation: fadein 1.6s 0.3s both;
  will-change: transform;
}

/* Hover variants (body[data-hover]):
   "none"  — portrait filter is static, nothing changes on hover (variant A)
   "site"  — DEFAULT on pointer devices. Whole page sits in muted monochrome until the pointer
             enters it, then warms up together with the portrait (variant B).
   Touch devices never :hover, so all of this is gated to (hover: hover) — otherwise phones get
   stuck in the muted state permanently. */
body[data-hover="none"] .portrait img { transition: none; }

@media (hover: hover) and (pointer: fine) {
  body[data-hover="site"] .bgv video,
  body[data-hover="site"] .portrait img,
  body[data-hover="site"] .ghost,
  body[data-hover="site"] .spark,
  body[data-hover="site"] em,
  body[data-hover="site"] .btn.primary,
  body[data-hover="site"] .pillar .num {
    transition: filter 0.9s ease, opacity 0.9s ease, color 0.9s ease, -webkit-text-stroke-color 0.9s ease;
  }
  body[data-hover="site"]:not(:hover) .bgv video { filter: grayscale(1) brightness(0.6); }
  body[data-hover="site"]:not(:hover) .portrait img { filter: grayscale(1) contrast(0.95) brightness(0.62); }
  body[data-hover="site"]:not(:hover) em,
  body[data-hover="site"]:not(:hover) .spark,
  body[data-hover="site"]:not(:hover) .pillar .num { color: #bdb6a8; }
  body[data-hover="site"]:not(:hover) .ghost { -webkit-text-stroke-color: rgba(200, 195, 185, 0.3); color: rgba(200,195,185,0.05); }
  body[data-hover="site"]:not(:hover) .btn.primary { filter: saturate(0); }
}


@keyframes fadein {
  from { opacity: 0; transform: translateY(20px); }
}

/* outlined ghost word behind the photo */
.ghost {
  position: absolute;
  left: -10%;
  top: -4%;
  z-index: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(120px, 15vw, 220px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(224, 179, 90, 0.45);
  letter-spacing: -0.04em;
  will-change: transform;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

.tag-card {
  position: absolute;
  z-index: 3; /* above the portrait img (1) and the ghost (0) */
  left: 6%;
  bottom: 12%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(20, 18, 16, 0.75);
  backdrop-filter: blur(10px);
  animation: fadein 1.2s 1s both;
}

.tag-card b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 16px;
}

.tag-card-sub {
  color: var(--ink-2);
  font-size: 12.5px;
}

/* ---------- hero ask-bar ---------- */
.askbar {
  margin-top: 30px;
  max-width: 560px;
  position: relative;
}

.askbar form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(20, 18, 16, 0.55);
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.askbar form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(224, 179, 90, 0.12);
}

.askbar .spark {
  color: var(--accent);
  font-size: 15px;
}

/* iOS Safari zooms the page on focusing any input < 16px and the zoom sticks —
   with a fixed 100vw panel on top that shows up as text clipped at the left edge. */
.askbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: 0;
}

.askbar input::placeholder { color: var(--muted); }

.askbar button[type='submit'] {
  border: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.25s;
}

.askbar button[type='submit']:hover { background: var(--accent); }

.kbd {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  margin-right: 4px;
}

/* question chips — shared by hero ask-bar and the panel */
.qs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.q-chip {
  font: inherit;
  font-size: 13px;
  color: var(--ink-2);
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(20, 18, 16, 0.4);
  cursor: pointer;
  transition: 0.2s;
}

.q-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- kinetic marquee band ---------- */
.band {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(20, 18, 16, 0.6);
  backdrop-filter: blur(6px);
  overflow: hidden;
  padding: 16px 0;
}

.band .track {
  display: flex;
  width: max-content;
  contain: layout;
  animation: mq 38s linear infinite;
}

.band:hover .track { animation-play-state: paused; }

.band span {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 40px;
  letter-spacing: -0.02em;
  padding: 0 28px;
  white-space: nowrap;
  color: var(--ink-2);
}

.band span i {
  font-style: italic;
  color: var(--accent);
}

.band span:nth-child(odd) { color: var(--ink); }

@keyframes mq {
  to { transform: translateX(-50%); }
}

/* ---------- sections ---------- */
section {
  padding: 90px 0;
  position: relative;
}

.sec-h {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  margin-bottom: 40px;
  align-items: baseline;
}

.sec-h h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 44px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.sec-h p {
  color: var(--ink-2);
  max-width: 520px;
}

.blurin {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(12px);
  transition: opacity 0.9s, filter 0.9s, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.blurin.in {
  opacity: 1;
  filter: none;
  transform: none;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- what I bring ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.pillar {
  padding: 0 28px 0 0;
  margin-right: 28px;
  border-right: 1px solid var(--line);
}

.pillar:last-child {
  border-right: 0;
  margin-right: 0;
  padding-right: 0;
}

.pillar .num {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 300;
  font-style: italic;
  color: var(--accent);
  line-height: 1;
}

.pillar h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  margin: 18px 0 6px;
  line-height: 1.2;
}

.pillar .l {
  font-size: 13.5px;
  color: var(--accent-2);
  margin-bottom: 10px;
}

.pillar p {
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- experience ---------- */
.exp {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
}

.year {
  position: sticky;
  top: 120px;
  height: fit-content;
}

.year b {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: 84px;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent);
}

.year span {
  color: var(--muted);
  font-size: 14px;
}

.jobs {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.job {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: padding-left 0.3s, opacity 0.3s;
}

@media (hover: hover) and (pointer: fine) {
  .jobs:has(.job:hover) .job:not(:hover) { opacity: 0.4; }
  .job:hover { padding-left: 10px; }
}

.job .p {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  padding-top: 6px;
}

.job h3 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.job .c {
  color: var(--ink-2);
  font-size: 14px;
  margin-top: 4px;
}

.job .plus {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1;
  transition: transform 0.35s;
}

.job.open .plus {
  transform: rotate(45deg);
  color: var(--accent);
}

.job .body {
  grid-column: 2 / 4;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s;
  opacity: 0;
}
.job .body > .inner { min-height: 0; overflow: hidden; }
.job.open .body { grid-template-rows: 1fr; opacity: 1; }

.job .blurb {
  font-size: 14.5px;
  color: var(--ink-2);
  margin-top: 12px;
  max-width: 640px;
}

.job ul {
  padding-left: 16px;
  margin: 12px 0;
  font-size: 14.5px;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.job li::marker { color: var(--accent); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-2);
}

/* per-row / per-pillar ask affordance */
.ask {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  margin-top: 12px;
  background: transparent;
  cursor: pointer;
  transition: 0.2s;
}

.ask:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- side projects ---------- */
.rows {
  border-top: 1px solid var(--line);
}

.prow {
  display: grid;
  grid-template-columns: 1fr 260px 60px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding 0.3s;
}

@media (hover: hover) and (pointer: fine) {
  .prow:hover { padding-left: 12px; }
  .rows:has(.prow:hover) .prow:not(:hover) { opacity: 0.4; }
}

.prow h3 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 38px;
  letter-spacing: -0.015em;
  transition: color 0.3s;
}

.prow:hover h3 { color: var(--accent); }

.prow .t {
  color: var(--ink-2);
  font-size: 14px;
}

.prow .a {
  font-size: 24px;
  color: var(--muted);
  text-align: right;
  transition: 0.3s;
}

.prow:hover .a {
  color: var(--accent);
  transform: translate(4px, -4px);
}

.prow .pv {
  position: absolute;
  right: 340px;
  top: 50%;
  width: 210px;
  height: 136px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #2a241e, #3a3128);
  transform: translateY(-50%) scale(0.8) rotate(-4deg);
  opacity: 0;
  transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 18px;
}

.prow:hover .pv {
  opacity: 1;
  transform: translateY(-50%) scale(1) rotate(-2deg);
}

/* ---------- stack ---------- */
.stack {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 60px;
}

.stack h4 {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.stack ul {
  list-style: none;
  font-size: 15px;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---------- footer ---------- */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

footer a:hover { color: var(--accent); }

/* ---------- slide-over ask panel ---------- */
.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100vw);
  z-index: 80;
  background: rgba(27, 24, 21, 0.92);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--line);
  transform: translateX(105%);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -40px 0 80px -40px rgba(0, 0, 0, 0.8);
}

.panel.open { transform: none; }

.panel .hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.panel .hd b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
}

.panel .hd small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.panel .x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.panel .x:hover { color: var(--ink); }

.panel .log {
  flex: 1;
  overflow: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14.5px;
}

.msg {
  max-width: 88%;
  padding: 11px 15px;
  border-radius: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.msg.me {
  align-self: flex-end;
  background: var(--accent);
  color: var(--bg);
  border-bottom-right-radius: 3px;
}

.msg.ai {
  align-self: flex-start;
  background: var(--bg-2);
  border-bottom-left-radius: 3px;
}

.msg.ai a {
  color: var(--accent);
  text-decoration: underline;
}

.msg.ai strong { color: #fff; }

/* "context: <company>" marker above a scoped question */
.panel .ctx {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  padding: 6px 10px;
  border: 1px dashed rgba(224, 179, 90, 0.4);
  border-radius: 4px;
}

.panel-qs {
  margin: 0;
  padding: 0 22px 16px;
}

.panel form {
  display: flex;
  border-top: 1px solid var(--line);
}

.panel input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 16px 22px;
  font: inherit;
  background: transparent;
  color: var(--ink);
  outline: 0;
}

.panel input::placeholder { color: var(--muted); }

.panel button.send {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0 22px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.panel button.send:disabled {
  color: var(--muted);
  cursor: default;
}

/* streaming indicator */
.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.3s infinite;
}

.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }

@keyframes blink {
  0%, 60%, 100% { opacity: 0.25; }
  30% { opacity: 1; }
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.scrim.open {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- floating ask pill ---------- */
.fab {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.9);
  transform: translateY(90px);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.25s;
}

.fab.show { transform: none; }
.fab:hover { background: var(--accent); }

.fab .kbd {
  color: inherit;
  border-color: rgba(0, 0, 0, 0.25);
  margin: 0;
}

/* ---------- clean / full mode ---------- */
body.clean [data-optional] { display: none !important; }

.modebar {
  position: fixed;
  left: 26px;
  bottom: 26px;
  z-index: 60;
  display: flex;
  gap: 6px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.modebar button {
  font: inherit;
  color: var(--ink-2);
  background: rgba(20, 18, 16, 0.7);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 9px;
  cursor: pointer;
}

.modebar button.on {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- email gate modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 9, 8, 0.72);
  backdrop-filter: blur(6px);
}

.modal[hidden] { display: none; }

.modal-box {
  position: relative;
  width: min(420px, 100%);
  padding: 30px 28px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.9);
}

.modal-box h3 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.modal-box > p {
  color: var(--ink-2);
  font-size: 14px;
  margin: 12px 0 20px;
}

.modal-x {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-x:hover { color: var(--ink); }

#gateForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#gateForm input {
  font: inherit;
  font-size: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  outline: 0;
  transition: border-color 0.2s;
}

#gateForm input::placeholder { color: var(--muted); }
#gateForm input:focus { border-color: var(--accent); }

#gateForm .btn {
  justify-content: center;
  margin-top: 6px;
}

/* honeypot — off-screen for humans, tempting for naive bots */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.gate-err {
  min-height: 18px;
  font-size: 13px;
  color: #e08a6a;
}

.gate-err.gate-ok { color: #7ed37e; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .wrap { padding: 0 20px; }
  .nav-in { padding: 16px 20px; }
  .nav ul { display: none; }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 24px 0 0;
    gap: 0;
  }

  /* the cutout is wider than a phone at 380px tall — clip it, don't scroll */
  .portrait {
    min-height: 0;
    height: 380px;
    margin: 10px -20px 0;
    justify-content: center;
    overflow: hidden;
  }

  .portrait img {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    height: 380px;
    max-width: none;
  }

  .tag-card { left: 20px; bottom: 20px; }
  .ghost { display: none; }

  .band span { font-size: 26px; padding: 0 16px; }

  section { padding: 60px 0; }
  .sec-h { grid-template-columns: 1fr; gap: 10px; }
  .sec-h h2 { font-size: 36px; }

  .pillars { grid-template-columns: 1fr; gap: 30px; }
  .pillar { border: 0; padding: 0; margin: 0; }

  .exp { grid-template-columns: 1fr; }
  .year { position: static; }
  .year b { font-size: 56px; }

  .job { grid-template-columns: 1fr auto; }
  .job .p { grid-column: 1 / 3; order: -1; padding: 0; }
  .job .body { grid-column: 1 / 3; }
  .job h3 { font-size: 24px; }

  .prow { grid-template-columns: 1fr 40px; }
  .prow .t,
  .prow .pv { display: none; }
  .prow h3 { font-size: 28px; }

  .stack { grid-template-columns: 1fr; }

  .btns { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }

  .askbar .kbd { display: none; }
  .fab { right: 16px; bottom: 16px; }
  /* the full/clean switch is a recruiter-desktop affordance; on phones it just floats over text */
  .modebar { display: none; }
  /* room under the last section so the floating ask-pill never sits on the footer text */
  footer { padding-bottom: 90px; }

  .panel {
    left: 0;
    right: 0;
    width: auto;
    height: 100dvh;
    border-left: 0;
  }

  footer { padding: 30px 20px; }
}

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

  html { scroll-behavior: auto; }
  .line > span { transform: none; }

  .reveal,
  .blurin {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .bgv video { display: none; }
}

/* ---------- print ---------- */
@media print {
  .bgv, .grain, .progress, .nav, .fab, .modebar,
  .panel, .scrim, .askbar, .band, .modal {
    display: none !important;
  }

  body { background: #fff; color: #111; }

  .reveal, .blurin { opacity: 1; transform: none; filter: none; }
  .job .body { grid-template-rows: 1fr; opacity: 1; }
}
