/* ============================================================
   Dhrumil Kherde — Résumé Studio
   Editorial-minimal. Left control rail, right paper canvas.
   ============================================================ */

:root {
  --ember:  #d6552f;
  --ink:    #1b1a17;
  --cobalt: #2f5fd6;
  --forest: #2f7d5b;
  --plum:   #7d2f6b;

  --accent: var(--ember);
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);

  --paper:  #fdfcfa;
  --canvas: #e7e3da;
  --text:   #211f1b;
  --muted:  #6f6a60;
  --hair:   #e3ded3;

  --rail-bg: #15140f;
  --rail-fg: #efe9dc;
  --rail-mut:#928c7d;

  --font-disp: "Hanken Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* density-driven */
  --sec-gap: 22px;
  --job-gap: 16px;
  --line: 1.5;
}

[data-accent="ember"]  { --accent: var(--ember); }
[data-accent="ink"]    { --accent: var(--ink); }
[data-accent="cobalt"] { --accent: var(--cobalt); }
[data-accent="forest"] { --accent: var(--forest); }
[data-accent="plum"]   { --accent: var(--plum); }
[data-accent="teal"]   { --accent: #1f7a82; }

[data-density="compact"] { --sec-gap: 15px; --job-gap: 11px; --line: 1.4; }

/* ── Template defaults (overridden inline by the font picker) ── */
[data-template="editorial"] { --font-disp: "Fraunces", Georgia, serif;        --font-body: "Hanken Grotesk", system-ui, sans-serif; }
[data-template="minimal"]   { --font-disp: "Hanken Grotesk", system-ui, sans-serif; --font-body: "Hanken Grotesk", system-ui, sans-serif; }
[data-template="classic"]   { --font-disp: "Newsreader", Georgia, serif;       --font-body: "Newsreader", Georgia, serif; }
[data-template="bold"]      { --font-disp: "Space Grotesk", system-ui, sans-serif; --font-body: "Hanken Grotesk", system-ui, sans-serif; }
[data-template="technical"] { --font-disp: "IBM Plex Sans", system-ui, sans-serif; --font-body: "IBM Plex Sans", system-ui, sans-serif; }
[data-template="swiss"]     { --font-disp: "Archivo", system-ui, sans-serif;       --font-body: "Archivo", system-ui, sans-serif; }
[data-template="compact"]   { --font-disp: "Hanken Grotesk", system-ui, sans-serif; --font-body: "Hanken Grotesk", system-ui, sans-serif; }
[data-template="mono"]      { --font-disp: "IBM Plex Mono", monospace;             --font-body: "IBM Plex Mono", monospace; }
[data-template="timeline"]  { --font-disp: "Space Grotesk", system-ui, sans-serif; --font-body: "Hanken Grotesk", system-ui, sans-serif; }
[data-template="indexed"]   { --font-disp: "Fraunces", Georgia, serif;             --font-body: "Hanken Grotesk", system-ui, sans-serif; }
[data-template="banner"]    { --font-disp: "Space Grotesk", system-ui, sans-serif; --font-body: "Hanken Grotesk", system-ui, sans-serif; }
[data-template="brutalist"] { --font-disp: "Space Mono", monospace;                --font-body: "Space Mono", monospace; }
[data-template="magazine"]  { --font-disp: "Fraunces", Georgia, serif;             --font-body: "Newsreader", Georgia, serif; }
[data-template="blueprint"] { --font-disp: "IBM Plex Mono", monospace;             --font-body: "IBM Plex Sans", system-ui, sans-serif; }
[data-template="gradient"]  { --font-disp: "Sora", system-ui, sans-serif;          --font-body: "Hanken Grotesk", system-ui, sans-serif; }
[data-template="ledger"]    { --font-disp: "Newsreader", Georgia, serif;           --font-body: "Hanken Grotesk", system-ui, sans-serif; }

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

html, body { height: 100%; }
body { overflow-x: hidden; }

body {
  /* the app chrome (rail, top bar, picker) stays on a FIXED UI font —
     the résumé fonts only ever apply inside .paper */
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }

/* ───────────────────────── CONTROL RAIL ───────────────────────── */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 296px;
  background: var(--rail-bg);
  color: var(--rail-fg);
  display: flex;
  flex-direction: column;
  z-index: 20;
  border-right: 1px solid #000;
}

.rail__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #2a281f;
}
.rail__mark {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: .04em;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid #3a382c;
  border-radius: 9px;
  color: var(--accent);
  flex: none;
}
.rail__brandtext { display: flex; flex-direction: column; line-height: 1.25; }
.rail__brandtext strong { font-size: 14px; letter-spacing: -.01em; }
.rail__brandtext span { font-size: 12px; color: var(--rail-mut); }

.rail__scroll { flex: 1; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 26px; }

.ctrl__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--rail-mut);
  margin-bottom: 11px;
}
.ctrl__hint { font-size: 11px; color: var(--rail-mut); margin-top: 9px; line-height: 1.45; }
.ctrl__val { float: right; font-family: var(--font-mono); font-size: 10px; color: var(--accent); letter-spacing: 0; }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: #322f24; outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid var(--rail-bg); }
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid var(--rail-bg); }

.contentbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.ghostbtn {
  font-family: inherit; font-size: 11.5px; font-weight: 500; color: var(--rail-mut);
  background: #211f17; border: 1px solid #322f24; border-radius: 7px; padding: 7px 10px; cursor: pointer; transition: .15s;
}
.ghostbtn:hover { color: var(--rail-fg); border-color: var(--accent); }
.ghostbtn--warn:hover { color: #ff8a6b; border-color: #6e2b20; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--s); cursor: pointer; padding: 0; border: 0;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  transition: transform .12s ease;
}
.swatch:hover { transform: scale(1.12); }
.swatch::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--rail-fg); opacity: 0; transition: opacity .12s ease;
}
.swatch[aria-checked="true"]::after { opacity: 1; }
.swatch[aria-checked="true"] { transform: none; }

.seg {
  display: flex;
  background: #211f17;
  border: 1px solid #322f24;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.seg__btn {
  flex: 1;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--rail-mut);
  background: transparent;
  border: 0;
  border-radius: 7px;
  padding: 8px 6px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.seg__btn:hover { color: var(--rail-fg); }
.seg__btn[aria-checked="true"] {
  background: var(--accent);
  color: #fff;
}

/* template selector */
.tpl { display: flex; flex-direction: column; gap: 6px; }
.tpl__btn {
  display: flex; flex-direction: column; gap: 1px; text-align: left;
  font-family: inherit; background: #211f17; border: 1px solid #322f24;
  border-radius: 9px; padding: 9px 12px; cursor: pointer; transition: .15s;
}
.tpl__btn:hover { background: #272419; }
.tpl__name { font-size: 13.5px; font-weight: 600; color: var(--rail-fg); }
.tpl__desc { font-size: 11px; color: var(--rail-mut); }
.tpl__btn[aria-checked="true"] { border-color: var(--accent); background: #2a261b; }
.tpl__btn[aria-checked="true"] .tpl__name { color: var(--accent); }

/* custom accent swatch */
.swatch#accentCustomBtn { overflow: hidden; background: conic-gradient(from 210deg, #e0533d, #d99211, #2f7d5b, #2f5fd6, #7d2f6b, #e0533d); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.swatch#accentCustomBtn input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* font picker rows */
.fontpick { display: flex; flex-direction: column; gap: 8px; }
.fontpick__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fontpick__row > span { font-size: 12.5px; color: var(--rail-mut); }
.fontpick__btn {
  flex: 1; max-width: 180px; text-align: left; font-family: inherit; font-size: 13px;
  color: var(--rail-fg); background: #211f17; border: 1px solid #322f24; border-radius: 8px;
  padding: 8px 11px; cursor: pointer; transition: .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fontpick__btn:hover { border-color: var(--accent); }
.linkbtn {
  margin-top: 10px; font-family: inherit; font-size: 11.5px; color: var(--rail-mut);
  background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.linkbtn:hover { color: var(--rail-fg); }

.raillink {
  display: flex; align-items: center; gap: 9px; margin-top: 4px;
  font-size: 12.5px; font-weight: 500; color: var(--accent); text-decoration: none;
  border: 1px dashed #3a382c; border-radius: 9px; padding: 11px 12px; transition: .15s;
}
.raillink:hover { background: #211f17; border-color: var(--accent); }
.raillink svg { flex: none; }

.rail__foot { padding: 18px 24px 22px; border-top: 1px solid #2a281f; }
.rail__note { font-size: 10.5px; color: var(--rail-mut); margin-top: 12px; text-align: center; letter-spacing: .02em; }

.btn {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px;
  border-radius: 11px;
  border: 0;
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { filter: brightness(1.07); }
.btn--primary:active { transform: translateY(1px); }

.railtoggle {
  display: none;
  position: fixed; top: 14px; left: 14px; z-index: 30;
  font-family: var(--font-mono); font-size: 12px;
  background: var(--rail-bg); color: var(--rail-fg);
  border: 1px solid #322f24; border-radius: 9px;
  padding: 9px 13px; cursor: pointer;
}

/* ───────────────────────── STAGE / PAPER ───────────────────────── */
.stage {
  margin-left: 296px;
  min-height: 100vh;
  padding: 48px 40px 80px;
  background:
    radial-gradient(120% 80% at 50% -10%, #efece4 0%, var(--canvas) 60%);
}

.paper {
  margin: 0 auto;
  font-family: var(--font-body);   /* résumé body font (picker / template) */
  width: 210mm;            /* A4 default */
  min-height: 297mm;
  background: var(--paper);
  color: var(--text);
  padding: 19mm 18mm;
  box-shadow:
    0 1px 2px rgba(40,34,20,.06),
    0 24px 60px -28px rgba(40,34,20,.45);
  border-radius: 2px;
  font-size: 10.6pt;
  line-height: var(--line);
  position: relative;
}
[data-page="letter"] .paper { width: 216mm; min-height: 279mm; }

/* text-size knob: scale content without changing the column width */
.pdoc { zoom: var(--tscale, 1); width: calc(100% / var(--tscale, 1)); }

/* sticky top bar above the document */
.topbar {
  position: sticky; top: 12px; z-index: 15;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 0 22px; padding: 8px 9px 8px 16px;
  background: rgba(253, 252, 250, .92); backdrop-filter: blur(10px);
  border: 1px solid var(--hair); border-radius: 13px;
  box-shadow: 0 8px 24px -14px rgba(40, 34, 20, .4);
}
.topbar__label { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.topbar__label b { color: var(--text); font-weight: 600; }
.seg--light { background: #f1ede4; border: 1px solid var(--hair); flex: none; }
.seg--light .seg__btn { color: var(--muted); }
.seg--light .seg__btn:hover { color: var(--text); }
.seg--light .seg__btn[aria-checked="true"] { background: var(--accent); color: #fff; }

/* ───────────────────────── EDITOR CHROME ───────────────────────── */
[contenteditable="true"] { outline: none; border-radius: 3px; transition: background .12s, box-shadow .12s; }
[data-edit="on"] [contenteditable="true"]:hover { background: color-mix(in oklab, var(--accent) 7%, transparent); }
[data-edit="on"] [contenteditable="true"]:focus { background: color-mix(in oklab, var(--accent) 10%, transparent); box-shadow: 0 0 0 1.5px var(--accent); }
[contenteditable="true"]:empty::before { content: attr(data-ph); color: #b9b2a4; }

/* blocks get a hover toolbar in edit mode */
.block { position: relative; }
.btoolbar { display: none; }
[data-edit="on"] .block > .btoolbar {
  display: flex; gap: 2px; position: absolute; top: -11px; right: 0; z-index: 5;
  background: var(--ink); border-radius: 7px; padding: 2px; box-shadow: 0 4px 14px -4px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(3px); transition: .12s; pointer-events: none;
}
[data-edit="on"] .block:hover > .btoolbar,
[data-edit="on"] .block:focus-within > .btoolbar { opacity: 1; transform: none; pointer-events: auto; }
.btoolbar button {
  width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer;
  background: none; border: 0; color: #cfc8b8; border-radius: 5px; font-size: 12px; line-height: 1;
}
.btoolbar button:hover { background: #2e2b20; color: #fff; }
.btoolbar button[data-act="del"]:hover { background: #6e2b20; color: #fff; }
[data-edit="on"] .block { box-shadow: inset 0 0 0 1px transparent; }
[data-edit="on"] .block:hover { box-shadow: inset 0 0 0 1px var(--hair); border-radius: 6px; }

/* add buttons */
.addbtn {
  display: none; font-family: var(--font-body); font-size: 8.6pt; font-weight: 600;
  color: var(--accent); background: none; border: 1px dashed color-mix(in oklab, var(--accent) 45%, transparent);
  border-radius: 6px; padding: 4px 9px; cursor: pointer; margin-top: 6px;
}
[data-edit="on"] .addbtn { display: inline-flex; align-items: center; gap: 5px; }
.addbtn:hover { background: color-mix(in oklab, var(--accent) 8%, transparent); }
.addsection { display: none; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--hair); }
[data-edit="on"] .addsection { display: flex; }

/* summary line */
.r-summary { font-size: 9.8pt; color: #34312b; margin-top: 11px; line-height: 1.5; max-width: 62ch; }
[data-edit="off"] .r-summary:empty { display: none; }

/* free-text section */
.r-text { font-size: 9.8pt; color: #34312b; line-height: 1.55; }

/* inline delete handle (bullets, contact) */
.del-x { display: none; }
[data-edit="on"] .del-x {
  display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 6px;
  border-radius: 4px; background: #f0e7da; color: #9a6a5c; font-size: 11px; cursor: pointer;
  vertical-align: middle; user-select: none;
}
[data-edit="on"] .del-x:hover { background: #e0b3a6; color: #fff; }
.r-bullets li > [contenteditable] { display: inline; }

/* contact editing */
[data-edit="on"] .r-contact li { box-shadow: inset 0 0 0 1px var(--hair); border-radius: 4px; padding: 1px 5px; }
.r-contact__del { display: none; }
[data-edit="on"] .r-contact__del { display: inline; cursor: pointer; color: var(--muted); margin-left: 5px; font-size: .8em; }
[data-edit="on"] .r-contact__del:hover { color: #c0392b; }

/* header */
.r-head { margin-bottom: var(--sec-gap); }
.r-name {
  font-family: var(--font-disp);
  font-weight: 400;
  font-size: 33pt;
  line-height: .98;
  letter-spacing: -.02em;
  color: var(--ink);
}
.r-role {
  font-family: var(--font-mono);
  font-size: 10pt;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 9px;
}

/* ── per-template header treatments ── */
[data-template="minimal"]   .r-name { font-weight: 700; letter-spacing: -.035em; font-size: 31pt; }
[data-template="minimal"]   .r-role { font-family: var(--font-body); letter-spacing: .22em; font-weight: 600; color: var(--muted); }
[data-template="classic"]   .r-head { text-align: center; }
[data-template="classic"]   .r-name { font-weight: 500; font-size: 30pt; }
[data-template="classic"]   .r-role { font-family: var(--font-disp); font-style: italic; text-transform: none; letter-spacing: .02em; font-size: 12pt; }
[data-template="classic"]   .r-contact { justify-content: center; }
[data-template="bold"]      .r-name { font-weight: 700; font-size: 40pt; letter-spacing: -.04em; }
[data-template="bold"]      .r-role { display: inline-block; background: var(--accent); color: #fff; padding: 4px 11px; border-radius: 5px; letter-spacing: .14em; font-size: 8.6pt; }
[data-template="technical"] .r-name { font-weight: 600; font-size: 28pt; letter-spacing: -.02em; }
[data-template="technical"] .r-role { letter-spacing: .2em; }
.r-contact {
  list-style: none;
  display: flex; flex-wrap: wrap;
  gap: 6px 0;
  margin-top: 13px;
  font-size: 9.4pt;
  color: var(--muted);
}
.r-contact li { display: flex; align-items: center; }
.r-contact li::after { content: "·"; margin: 0 9px; color: var(--hair); }
.r-contact li:last-child::after { content: none; }
.r-contact a { text-decoration: none; color: var(--muted); }
.r-contact a:hover { color: var(--accent); }

/* sections */
.r-sec { margin-top: var(--sec-gap); }
.r-sec__title {
  font-family: var(--font-mono);
  font-size: 10pt;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 7px;
  margin-bottom: 13px;
  position: relative;
}
/* editorial: bottom hairline + short accent tab (default) */
.r-sec__title { border-bottom: 1px solid var(--hair); }
.r-sec__title::before {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 42px; height: 2px; background: var(--accent);
}

/* minimal: thin full rule, sans label, no accent tab */
[data-template="minimal"] .r-sec__title {
  font-family: var(--font-body); font-weight: 600; font-size: 9.5pt; letter-spacing: .16em;
  color: var(--muted); border-bottom: 1px solid var(--hair);
}
[data-template="minimal"] .r-sec__title::before { display: none; }

/* classic: centered small-caps serif with a double rule feel */
[data-template="classic"] .r-sec__title {
  font-family: var(--font-disp); font-weight: 600; font-size: 11.5pt; letter-spacing: .14em;
  text-align: center; border-bottom: 1px solid var(--ink); padding-bottom: 4px;
}
[data-template="classic"] .r-sec__title::before {
  left: 50%; transform: translateX(-50%); bottom: -3px; width: 100%; height: 1px; background: var(--ink);
}

/* bold: heavy label, thick short accent underline */
[data-template="bold"] .r-sec__title {
  font-family: var(--font-disp); font-weight: 700; font-size: 13pt; letter-spacing: -.01em;
  text-transform: uppercase; color: var(--ink); border-bottom: 0; padding-bottom: 9px;
}
[data-template="bold"] .r-sec__title::before { width: 34px; height: 4px; border-radius: 2px; bottom: 2px; }

/* technical: left accent bar, mono label */
[data-template="technical"] .r-sec__title {
  padding-left: 13px; border-bottom: 1px dashed var(--hair);
}
[data-template="technical"] .r-sec__title::before {
  content: ""; position: absolute; left: 0; top: 1px; bottom: 8px;
  width: 4px; height: auto; border-radius: 2px; background: var(--accent);
}

/* jobs */
.r-job { margin-bottom: var(--job-gap); break-inside: avoid; }
.r-job:last-child { margin-bottom: 0; }
.r-job__top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 14px;
}
.r-job__org {
  font-size: 11.6pt; font-weight: 700; letter-spacing: -.01em; color: var(--ink);
}
.r-job__loc { font-weight: 500; color: var(--muted); }
.r-job__date {
  font-family: var(--font-mono);
  font-size: 8.7pt; color: var(--muted);
  white-space: nowrap; letter-spacing: .01em;
  flex: none;
}
.r-job__role {
  font-size: 9.8pt; font-weight: 600; color: var(--accent);
  margin: 2px 0 6px;
}
.r-bullets { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.r-bullets li {
  position: relative; padding-left: 15px;
  font-size: 9.9pt; color: #34312b;
}
.r-bullets li::before {
  content: ""; position: absolute; left: 2px; top: .55em;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
}

/* per-template body accents */
[data-template="bold"] .r-bullets li::before { border-radius: 1px; width: 5px; height: 5px; top: .5em; }
[data-template="bold"] .r-job__org { font-size: 12.4pt; }
[data-template="classic"] .r-job__role { font-style: italic; color: var(--ink); font-weight: 600; }
[data-template="classic"] .r-bullets li::before { background: var(--ink); }
[data-template="classic"] .r-role { color: var(--muted); }
[data-template="minimal"] .r-bullets li::before { width: 5px; height: 1.5px; border-radius: 0; top: .72em; }
[data-template="technical"] .r-job__date { color: var(--accent); }

/* ── swiss: grid, heavy hierarchy, black rules ── */
[data-template="swiss"] .r-name { font-weight: 800; font-size: 34pt; letter-spacing: -.03em; text-transform: uppercase; }
[data-template="swiss"] .r-role { font-family: var(--font-body); font-weight: 700; letter-spacing: .04em; color: var(--ink); }
[data-template="swiss"] .r-sec__title { font-family: var(--font-body); font-weight: 800; font-size: 9.5pt; color: var(--ink); border-bottom: 2px solid var(--ink); }
[data-template="swiss"] .r-sec__title::before { display: none; }
[data-template="swiss"] .r-job__org { font-weight: 800; }
[data-template="swiss"] .r-bullets li::before { border-radius: 0; width: 5px; height: 5px; background: var(--ink); }

/* ── compact: dense, fit-more ── */
[data-template="compact"] { --sec-gap: 13px; --job-gap: 9px; --line: 1.38; }
[data-template="compact"] .r-name { font-weight: 700; font-size: 26pt; letter-spacing: -.03em; }
[data-template="compact"] .r-role { font-size: 8.5pt; letter-spacing: .2em; }
[data-template="compact"] .r-sec__title { font-family: var(--font-body); font-weight: 700; font-size: 8.8pt; letter-spacing: .12em; padding-bottom: 4px; margin-bottom: 8px; }
[data-template="compact"] .r-bullets li { font-size: 9.3pt; }
[data-template="compact"] .r-job__org { font-size: 10.6pt; }

/* ── mono: full monospace, ruled, techy ── */
[data-template="mono"] .r-name { font-weight: 600; font-size: 26pt; letter-spacing: -.04em; }
[data-template="mono"] .r-role { letter-spacing: .18em; }
[data-template="mono"] .r-sec__title { border-bottom: 1px solid var(--ink); }
[data-template="mono"] .r-sec__title::before { background: var(--accent); height: 3px; }
[data-template="mono"] .r-bullets li::before { content: "›"; background: none; width: auto; height: auto; top: 0; left: 0; color: var(--accent); font-weight: 700; }
[data-template="mono"] .r-bullets li { padding-left: 13px; }

/* ── timeline: vertical rail + dots down each entry ── */
[data-template="timeline"] .r-name { font-weight: 600; letter-spacing: -.02em; }
[data-template="timeline"] .r-job { padding-left: 18px; border-left: 2px solid var(--hair); margin-left: 4px; }
[data-template="timeline"] .r-job::after { content: ""; position: absolute; left: -6px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2.5px var(--paper); }
[data-template="timeline"] .r-sec__title::before { width: 9px; height: 9px; border-radius: 50%; bottom: -4px; }

/* ── indexed: 01 / 02 numbered sections (nods to the portfolio) ── */
[data-template="indexed"] .pdoc { counter-reset: sec; }
[data-template="indexed"] .r-name { font-weight: 400; }
[data-template="indexed"] .r-sec__title { counter-increment: sec; display: flex; align-items: baseline; gap: 11px; font-family: var(--font-body); font-weight: 700; letter-spacing: .14em; border-bottom: 1px solid var(--hair); }
[data-template="indexed"] .r-sec__title::before { content: counter(sec, decimal-leading-zero); position: static; transform: none; width: auto; height: auto; background: none; font-family: var(--font-mono); font-size: .82em; color: var(--accent); }

/* ── banner: accent header band, white text ── */
[data-template="banner"] .r-head { background: var(--accent); padding: 17px 19px; border-radius: 10px; margin-bottom: 4px; }
[data-template="banner"] .r-name { color: #fff; font-weight: 700; }
[data-template="banner"] .r-role { color: #fff; opacity: .82; }
[data-template="banner"] .r-summary, [data-template="banner"] .r-contact, [data-template="banner"] .r-contact a { color: rgba(255,255,255,.92); }
[data-template="banner"] .r-contact li::after { color: rgba(255,255,255,.45); }

/* ── magazine: editorial numerals + thick rule ── */
[data-template="magazine"] .pdoc { counter-reset: msec; }
[data-template="magazine"] .r-name { font-weight: 400; font-size: 38pt; letter-spacing: -.02em; }
[data-template="magazine"] .r-role { font-family: var(--font-body); font-style: italic; text-transform: none; letter-spacing: .02em; font-size: 12pt; color: var(--muted); }
[data-template="magazine"] .r-sec__title { counter-increment: msec; display: flex; align-items: baseline; gap: 11px; font-family: var(--font-disp); font-weight: 500; font-size: 14pt; text-transform: none; letter-spacing: 0; border-bottom: 3px solid var(--ink); padding-bottom: 5px; }
[data-template="magazine"] .r-sec__title::before { content: counter(msec) "."; position: static; transform: none; width: auto; height: auto; background: none; color: var(--accent); font-family: var(--font-disp); }
[data-template="magazine"] .r-job__org { font-family: var(--font-disp); font-weight: 600; font-size: 13pt; }

/* ── blueprint: dashed grid, mono, // markers ── */
[data-template="blueprint"] .r-name { font-weight: 600; font-size: 26pt; letter-spacing: -.03em; }
[data-template="blueprint"] .r-role { letter-spacing: .18em; }
[data-template="blueprint"] .r-sec__title { font-weight: 600; font-size: 9.5pt; border-bottom: 1px dashed var(--ink); }
[data-template="blueprint"] .r-sec__title::before { content: "//"; position: static; transform: none; width: auto; height: auto; background: none; color: var(--accent); margin-right: 7px; }
[data-template="blueprint"] .r-job { border: 1px dashed var(--hair); padding: 8px 11px; }
[data-template="blueprint"] .r-job__date { color: var(--accent); }
[data-template="blueprint"] .r-bullets li::before { content: "+"; background: none; width: auto; height: auto; top: 0; left: 0; color: var(--accent); font-weight: 700; }
[data-template="blueprint"] .r-bullets li { padding-left: 14px; }

/* ── gradient: accent name-fill ── */
[data-template="gradient"] .r-name { font-weight: 700; font-size: 34pt; letter-spacing: -.03em; background: linear-gradient(100deg, var(--accent), color-mix(in oklab, var(--accent) 38%, var(--ink))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
[data-template="gradient"] .r-sec__title::before { width: 64px; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); }
[data-template="gradient"] .r-bullets li::before { background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 40%, var(--ink))); }

/* ── ledger: ruled rows, serif ── */
[data-template="ledger"] .r-name { font-weight: 500; font-size: 28pt; }
[data-template="ledger"] .r-sec__title { font-family: var(--font-body); font-weight: 700; font-size: 9pt; letter-spacing: .16em; border-bottom: 2px solid var(--ink); }
[data-template="ledger"] .r-sec__title::before { display: none; }
[data-template="ledger"] .r-job { border-bottom: 1px solid var(--hair); padding-bottom: 9px; }
[data-template="ledger"] .r-job__org { font-family: var(--font-disp); font-weight: 600; }
[data-template="ledger"] .r-job__date { color: var(--ink); }

/* ── brutalist: boxed, heavy, mono ── */
[data-template="brutalist"] .r-name { font-weight: 700; text-transform: uppercase; font-size: 25pt; letter-spacing: -.04em; }
[data-template="brutalist"] .r-role { display: inline-block; border: 2px solid var(--ink); padding: 2px 9px; color: var(--ink); letter-spacing: .08em; font-size: 8.4pt; }
[data-template="brutalist"] .r-sec__title { background: var(--ink); color: var(--paper); padding: 4px 9px; border: 0; font-weight: 700; letter-spacing: .06em; }
[data-template="brutalist"] .r-sec__title::before { display: none; }
[data-template="brutalist"] .r-job { border: 2px solid var(--ink); padding: 9px 11px; }
[data-template="brutalist"] .r-job__role { color: var(--ink); }
[data-template="brutalist"] .r-bullets li::before { content: "—"; background: none; width: auto; height: auto; top: 0; left: 0; color: var(--ink); }
[data-template="brutalist"] .r-bullets li { padding-left: 17px; font-size: 9pt; }
[data-template="brutalist"] .r-skills__row dt { font-size: 8.6pt; }
[data-template="brutalist"] .r-skills__row dd { font-size: 8.8pt; }

/* skills */
.r-skills { display: flex; flex-direction: column; gap: 7px; }
.r-skills__row { display: grid; grid-template-columns: 118px 1fr; gap: 14px; }
.r-skills__row dt {
  font-size: 9.3pt; font-weight: 700; color: var(--ink);
  padding-top: 1px;
}
.r-skills__row dd { font-size: 9.6pt; color: #34312b; line-height: 1.5; }

/* ───────────────────────── FONT PICKER OVERLAY ───────────────────────── */
.fp {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10,9,6,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.fp[hidden] { display: none; }
.fp__panel {
  width: 480px; max-width: 100%; max-height: 78vh; display: flex; flex-direction: column;
  background: #1b1a13; color: var(--rail-fg); border: 1px solid #322f24; border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); overflow: hidden;
}
.fp__head { display: flex; gap: 10px; padding: 16px; border-bottom: 1px solid #2a281f; }
.fp__search {
  flex: 1; font-family: inherit; font-size: 14px; color: var(--rail-fg);
  background: #211f17; border: 1px solid #322f24; border-radius: 9px; padding: 11px 13px;
}
.fp__search:focus { outline: none; border-color: var(--accent); }
.fp__close { background: none; border: 0; color: var(--rail-mut); font-size: 16px; cursor: pointer; padding: 0 6px; }
.fp__close:hover { color: var(--rail-fg); }
.fp__cats { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid #2a281f; }
.fp__cat {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; color: var(--rail-mut);
  background: #211f17; border: 1px solid #322f24; border-radius: 18px; padding: 5px 11px; cursor: pointer;
}
.fp__cat[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.fp__list { list-style: none; overflow-y: auto; padding: 8px; margin: 0; }
.fp__item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 11px 13px; border-radius: 9px; cursor: pointer;
}
.fp__item:hover { background: #272419; }
.fp__item.is-current { background: #2a261b; box-shadow: inset 0 0 0 1px var(--accent); }
.fp__sample { font-size: 19px; color: var(--rail-fg); line-height: 1; }
.fp__meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--rail-mut); letter-spacing: .04em; flex: none; }
.fp__pin { font-family: var(--font-mono); font-size: 8.5px; color: var(--accent); letter-spacing: .1em; text-transform: uppercase; }
.fp__group { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--rail-mut); padding: 10px 13px 5px; }

/* ───────────────────────── RESPONSIVE ───────────────────────── */
@media (max-width: 920px) {
  .rail { transform: translateX(-100%); transition: transform .25s ease; width: 280px; }
  body.rail-open .rail { transform: none; }
  .railtoggle { display: block; }
  .stage { margin-left: 0; padding: 64px 16px 64px; }
  .paper { width: 100%; min-width: 0; padding: 28px 22px; font-size: 11px; }
  .r-job__top { flex-wrap: wrap; gap: 2px 14px; }
}

/* ───────────────────────── PRINT (the ATS export) ───────────────────────── */
@page { size: A4; margin: 13mm; }
[data-page="letter"] { }
@media print {
  @page { margin: 13mm; }
  body { background: #fff; display: block; }
  .rail, .railtoggle { display: none !important; }
  .btoolbar, .addbtn, .addsection, .del-x, .addonly, .topbar { display: none !important; }
  [data-edit="on"] .block:hover { box-shadow: none !important; }
  [data-edit="on"] .r-contact li { box-shadow: none !important; padding: 0 !important; }
  [contenteditable]:focus, [contenteditable]:hover { background: none !important; box-shadow: none !important; }
  .r-summary:empty { display: none; }
  [contenteditable]:empty::before { content: none !important; }
  /* gradient-fill name must not print as transparent */
  [data-template="gradient"] .r-name { -webkit-text-fill-color: var(--accent) !important; color: var(--accent) !important; background: none !important; }
  .stage { margin: 0; padding: 0; background: #fff; }
  .paper {
    width: auto; min-height: 0; box-shadow: none; border-radius: 0;
    padding: 0; font-size: 10pt;
    zoom: 1 !important;          /* override the on-screen fit-to-width zoom */
  }
  a { text-decoration: none; }
  .r-job { break-inside: avoid; }
  .r-sec__title { break-after: avoid; }   /* keep a heading with its first entry */
  .r-sec { break-inside: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
