/* ============================================================
   Soft Swiss / Neo-Brutalist Light
   ============================================================ */

/* ---------- Fonts (self-hosted, Latin subset) ---------- */
@font-face { font-family: "Space Grotesk"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/space-grotesk-400.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/space-grotesk-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/jetbrains-mono-500.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --paper: #F6F3EC;
  --paper-2: #EEEAE0;
  --ink: #16201B;
  --ink-soft: #4A5750;
  --emerald: #10B981;
  --emerald-deep: #047857;
  --emerald-tint: #D8F3E6;

  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --bw: 2px;                    /* border width */
  --r: 6px;                     /* radius */
  --shadow: 4px 4px 0 var(--ink);
  --shadow-hover: 2px 2px 0 var(--ink);
  --max: 1120px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.125rem);   /* 17 to 18px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--emerald-deep); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--ink); }
mark { color: var(--ink); }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: .02em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--emerald-deep); outline-offset: 3px; border-radius: var(--r); }

.skip { position: absolute; left: var(--gutter); top: -100px; z-index: 50; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: var(--r); padding: .6rem 1rem; color: var(--ink); font-weight: 700; }
.skip:focus { top: .75rem; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: var(--bw) solid var(--ink); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; min-height: 64px; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.nav a { font-family: var(--font-mono); font-weight: 500; font-size: .85rem; color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--emerald-deep); }
.menu-btn { display: none; }

@media (max-width: 899px) {
  .js .menu-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; font: 500 .85rem var(--font-mono); color: var(--ink); background: var(--paper); border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-hover); cursor: pointer; }
  .js .nav { display: none; flex-basis: 100%; padding-bottom: .5rem; }
  .js .nav.is-open { display: block; }
  .js .nav ul { flex-direction: column; gap: 0; }
  .js .nav a { width: 100%; border-top: 1px solid rgba(22, 32, 27, .2); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .6rem 1.4rem;
  font: 700 1rem var(--font-head);
  color: var(--ink); text-decoration: none;
  border: var(--bw) solid var(--ink); border-radius: var(--r);
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { color: var(--ink); transform: translate(2px, 2px); box-shadow: var(--shadow-hover); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn--emerald { background: var(--emerald); }
.btn--paper { background: var(--paper); }
.btn--small { min-height: 44px; padding: .4rem 1rem; font-size: .9rem; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero__grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .07;
  width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto;
  background-image: repeating-linear-gradient(to right, var(--ink) 0 1px, transparent 1px calc(100% / 12));
  border-right: 1px solid var(--ink);
}
.hero__inner { position: relative; }
.hero__loc { color: var(--ink-soft); font-size: .9rem; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.display { font-weight: 700; font-size: clamp(4rem, 12vw, 8.5rem); letter-spacing: -.045em; line-height: .92; }
.display span { display: block; }
.title-line { margin: clamp(1.25rem, 3vw, 2rem) 0 1rem; font: 700 clamp(1.2rem, 2.4vw, 1.75rem)/1.25 var(--font-head); letter-spacing: -.01em; max-width: 40ch; text-wrap: balance; }
.title-line mark { background: var(--emerald-tint); box-shadow: 0 0 0 4px var(--emerald-tint); }
.tv { display: none; }
html[data-view="overview"] .tv-overview,
html[data-view="data"] .tv-data,
html[data-view="accounts"] .tv-accounts { display: inline; }
.pitch { max-width: 56ch; font-size: clamp(1.1rem, .5vw + 1rem, 1.25rem); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.75rem 0; }

/* View toggle (only works with JS, so hidden without it) */
.view { display: none; }
.js .view { display: block; margin-top: 2rem; }
.label { font-size: .8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .5rem; }
.seg { display: inline-flex; border: var(--bw) solid var(--ink); border-radius: var(--r); background: var(--paper); overflow: hidden; max-width: 100%; }
.seg button { min-height: 44px; padding: 0 1.1rem; font: 500 .9rem var(--font-mono); color: var(--ink); background: var(--paper); border: 0; border-right: var(--bw) solid var(--ink); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--emerald); font-weight: 500; }
.seg button:hover { background: var(--emerald-tint); }
.seg button[aria-pressed="true"]:hover { background: var(--emerald); }
.seg button:focus-visible { outline-offset: -5px; }
.hint { font-size: .8rem; color: var(--ink-soft); margin: .6rem 0 0; }

/* ---------- Career stair ---------- */
.stair__label { margin-top: clamp(2rem, 5vw, 3.5rem); }
.stair { display: flex; align-items: flex-end; gap: 1rem; padding-bottom: 4px; }
.step {
  flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem;
  padding: 1rem; background: var(--paper-2);
  border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow);
}
.step:nth-child(1) { height: 120px; }
.step:nth-child(2) { height: 170px; }
.step:nth-child(3) { height: 220px; }
.step:nth-child(4) { height: 280px; }
.step--top { background: var(--emerald); }
.step__role { font: 700 clamp(1rem, 1.6vw, 1.3rem)/1.15 var(--font-head); }
.step__yr { font-size: .9rem; }

@media (max-width: 639px) {
  .stair { flex-direction: column; align-items: flex-start; gap: .85rem; }
  .step { flex: none; flex-direction: row; align-items: center; justify-content: space-between; height: auto !important; min-height: 64px; }
  .step:nth-child(1) { width: 62%; }
  .step:nth-child(2) { width: 74%; }
  .step:nth-child(3) { width: 87%; }
  .step:nth-child(4) { width: 100%; }
}
@media (max-width: 420px) {
  .step { flex-direction: column; align-items: flex-start; gap: .25rem; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: var(--bw) solid var(--ink); }
.band { background: var(--paper-2); }
.section__head { margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.idx { font-size: .85rem; color: var(--emerald-deep); letter-spacing: .1em; margin-bottom: .5rem; }
.section h2 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -.03em; font-weight: 700; }
.about { max-width: 62ch; font-size: clamp(1.15rem, .6vw + 1rem, 1.35rem); line-height: 1.6; }

/* ---------- Ledger (experience, education) ---------- */
.ledger { border-top: var(--bw) solid var(--ink); border-bottom: var(--bw) solid var(--ink); }
.row { display: grid; gap: .75rem; padding: 1.5rem .75rem; border-top: 1px solid rgba(22, 32, 27, .3); }
.row:first-child { border-top: 0; }
.row--current { background: var(--emerald-tint); }
.row__date { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.row__date span + span { margin-left: .25em; }
.row__role h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: -.01em; }
.co { margin: .35rem 0 0; color: var(--ink-soft); font-size: .95rem; }
.tag-current { display: inline-block; margin-top: .6rem; padding: .1rem .5rem; font-size: .75rem; letter-spacing: .1em; background: var(--emerald); color: var(--ink); border: var(--bw) solid var(--ink); border-radius: var(--r); }
.row__bullets { display: grid; gap: .6rem; }
.row__bullets li { position: relative; padding-left: 1.1rem; font-size: .98rem; }
.row__bullets li::before { content: ""; position: absolute; left: 0; top: .7em; width: .5rem; height: .5rem; background: var(--ink); }

@media (min-width: 900px) {
  .row { grid-template-columns: repeat(12, 1fr); column-gap: 1.5rem; padding: 1.75rem 1rem; }
  .row__date { grid-column: 1 / span 2; }
  .row__date span { display: block; }
  .row__date span + span { margin-left: 0; }
  .row__role { grid-column: 3 / span 4; }
  .row__bullets { grid-column: 7 / span 6; }
  .row--edu { align-items: baseline; }
  .row--edu h3 { grid-column: 1 / span 7; }
  .row--edu .school { grid-column: 8 / span 5; }
}
.row--edu h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
.school { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* highlight markers set by the view toggle */
.hl { border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
html[data-view="data"] .hl[data-tags~="data"],
html[data-view="accounts"] .hl[data-tags~="accounts"] {
  background: var(--emerald-tint);
  box-shadow: 0 0 0 3px var(--emerald-tint);
  text-decoration: underline; text-decoration-color: var(--emerald); text-decoration-thickness: 3px; text-underline-offset: 4px;
}
.row--current .hl[data-tags] { --hl-bg: var(--paper); }
html[data-view="data"] .row--current .hl[data-tags~="data"],
html[data-view="accounts"] .row--current .hl[data-tags~="accounts"] { background: var(--paper); box-shadow: 0 0 0 3px var(--paper); }

/* ---------- Skills ---------- */
.skills { display: grid; gap: 2.25rem 3rem; }
@media (min-width: 768px) { .skills { grid-template-columns: 1fr 1fr; } }
.skill h3 { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .85rem; }
.tags { display: flex; flex-wrap: wrap; gap: .6rem; }
.tags li { padding: .35rem .8rem; font-size: .95rem; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: var(--r); }
html[data-view="data"] .skill[data-lead="data"],
html[data-view="accounts"] .skill[data-lead="accounts"] { order: -1; }
html[data-view="data"] .skill[data-lead="data"] h3,
html[data-view="accounts"] .skill[data-lead="accounts"] h3 { color: var(--ink); }
html[data-view="data"] .skill[data-lead="data"] .tags li,
html[data-view="accounts"] .skill[data-lead="accounts"] .tags li { background: var(--emerald-tint); }

/* ---------- Achievement cards ---------- */
.cards { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .cards { grid-template-columns: 1fr 1fr; gap: 2rem; } }
.card {
  padding: 1.5rem; background: var(--paper-2);
  border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translate(2px, 2px); box-shadow: var(--shadow-hover); }
.card__n { display: block; font-size: clamp(2.25rem, 4vw, 3.25rem); line-height: 1; color: var(--emerald-deep); margin-bottom: 1rem; }
.card h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -.015em; margin-bottom: .6rem; }
.card p { margin: 0; color: var(--ink-soft); }
html[data-view="data"] .card[data-tags~="data"],
html[data-view="accounts"] .card[data-tags~="accounts"] { background: var(--emerald-tint); }
html[data-view="data"] .card[data-tags~="data"] p,
html[data-view="accounts"] .card[data-tags~="accounts"] p { color: var(--ink); }

/* ---------- Contact ---------- */
.contact { border-top: var(--bw) solid var(--ink); border-bottom: var(--bw) solid var(--ink); }
.crow { display: grid; gap: .25rem; padding: 1.25rem .75rem; border-top: 1px solid rgba(22, 32, 27, .3); align-items: baseline; }
.crow:first-child { border-top: 0; }
.clabel { font-size: .85rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .1em; }
.cval { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; font: 700 clamp(1.15rem, 3.2vw, 2rem)/1.2 var(--font-head); letter-spacing: -.015em; overflow-wrap: anywhere; }
.cval a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 768px) { .crow { grid-template-columns: 12rem 1fr; padding: 1.5rem 1rem; } }

/* ---------- Footer, 404 ---------- */
.footer { padding: 1.75rem 0; border-top: var(--bw) solid var(--ink); }
.footer p { margin: 0; font-size: .85rem; color: var(--ink-soft); }
.nf { display: grid; min-height: 100vh; align-items: center; }
.nf__inner { padding: 3rem 0; }
.nf__h { font-size: clamp(3rem, 10vw, 6.5rem); margin: .5rem 0 1.25rem; }

/* ---------- Motion (only if the visitor allows it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .step { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 120ms + 150ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

  .js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
  .js .reveal.in { opacity: 1; transform: none; }
  /* cards keep their hover transition after reveal */
  .js .card.reveal.in { transition: opacity .5s ease, transform .12s, box-shadow .12s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Print: plain CV ---------- */
@media print {
  :root { --paper: #fff; --paper-2: #fff; --emerald-tint: #fff; --shadow: none; --shadow-hover: none; }
  body { font-size: 10.5pt; line-height: 1.45; color: #000; background: #fff; }
  .topbar, .skip, .actions, .view, .hero__grid, .footer, .stair__label, .stair, #copy-email, .tag-current { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .card, .btn, .step { box-shadow: none !important; }
  .section { padding: 1rem 0; border-top: 1px solid #000; }
  .hero { padding: 0 0 1rem; }
  .display { font-size: 34pt; }
  .display span { display: inline; }
  .title-line { font-size: 14pt; }
  .tv { display: none !important; }
  .tv-overview { display: inline !important; }
  .row--current { background: #fff; }
  @page { margin: 13mm; }
  #experience { break-before: page; }
  .row, .card, .skill, .crow { break-inside: avoid; }
  .section__head { break-after: avoid; }
  body { font-size: 10pt; line-height: 1.4; }
  .idx { color: #333; margin-bottom: .1rem; }
  .section { padding: .7rem 0; }
  .section h2 { font-size: 18pt; }
  .section__head { margin-bottom: .5rem; }
  .about { font-size: 11pt; max-width: none; }
  .row { padding: .35rem 0; gap: .15rem; }
  .row__role h3 { font-size: 12pt; }
  .co { margin: .1rem 0 0; font-size: 9pt; }
  .row__date { font-size: 8.5pt; }
  .row__bullets { gap: .15rem; }
  .row__bullets li { font-size: 9.5pt; }
  .skills { gap: .75rem 2rem; }
  .skill h3 { margin-bottom: .35rem; }
  .tags { gap: .3rem; }
  .tags li { font-size: 9pt; padding: .1rem .5rem; }
  .card h3 { font-size: 12pt; margin-bottom: .2rem; }
  .card p { font-size: 9.5pt; }
  .card__n { font-size: 16pt; margin-bottom: .2rem; color: #333; }
  .row--edu h3 { font-size: 11pt; }
  .cval { font-size: 12pt; }
  .crow { padding: .4rem 0; }
  a { color: #000; }
  html[data-view] .hl { background: none !important; box-shadow: none !important; text-decoration: none !important; }
  html[data-view] .card { background: #fff !important; }
  .cards { gap: .75rem; }
  .card { padding: .75rem; }
}
