/* CV Builder: hmsk.life terminal design (docs/design/DESIGN.md). Monochrome green, amber only for the main action. */
@font-face { font-family: "Martian Mono"; src: url("/assets/fonts/MartianMono.woff2") format("woff2"), url("fonts/MartianMono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/assets/fonts/Geist.woff2") format("woff2"), url("fonts/Geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --primary: #00FF9C; --secondary: #1E5C40; --accent: #FFB547;
  --bg: #0B0F0C; --surface: #121A15; --text: #E4F2E8; --muted: #8FA898; --border: #26372D;
  --xs: 8px; --sm: 12px; --md: 20px; --lg: 32px; --xl: 56px;
  --mono: "Martian Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 6px; --max: 1080px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(900px 500px at 10% -10%, rgba(0,255,156,.06), transparent 60%); background-repeat: no-repeat;
  padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .35; }
.ic { width: 1em; height: 1em; fill: currentColor; flex: none; }
.dim { color: var(--muted); }
.small { font-size: 13px; }
.ps { color: var(--primary); user-select: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: var(--xs); background: var(--accent); color: var(--bg); padding: var(--xs) var(--sm); font: 600 13px/1 var(--mono); border-radius: 4px; z-index: 30; }
.skip:focus { left: var(--sm); }
kbd { font: 500 10px/1 var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 2px 4px; margin-right: 6px; }

/* strip back to hmsk.life */
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--sm); padding: var(--xs) 16px; border-bottom: 1px solid var(--border);
  font: 400 12px/1.4 var(--mono); background: #070a08; }
.strip a { color: var(--muted); }
.strip a:hover { color: var(--text); }
.strip .strip__home { color: var(--text); font-weight: 600; }
.strip__sp { display: none; }
.strip__lang { margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font: 600 11px/1 var(--mono); padding: 5px var(--xs); }
.strip__lang:hover { color: var(--primary); border-color: var(--primary); }

/* top + tabs */
.top { position: sticky; top: 0; z-index: 10; background: rgba(11,15,12,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.top__in { max-width: var(--max); margin: 0 auto; padding: var(--xs) var(--md) 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--lg); }
.logo { margin: 0; padding: var(--xs) 0; font: 600 14px/1 var(--mono); white-space: nowrap; }
.logo__u { color: var(--primary); }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--md)); padding: 0 var(--md); flex: 1 1 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 500 12px/1 var(--mono); padding: var(--sm) 7px; white-space: nowrap; min-height: 44px; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.tabs button[aria-current="page"]::before { content: ">"; margin-right: 4px; }
@media (min-width: 420px) { .tabs button { font-size: 13px; padding: var(--sm) 10px; } }
@media (min-width: 760px) { .tabs { flex: 0 1 auto; margin: 0 0 0 auto; padding: 0; } .top__in { padding-top: 0; } }

.banner { max-width: var(--max); margin: var(--sm) auto 0; padding: var(--xs) var(--md); font: 400 13px/1.5 var(--mono); color: var(--muted); }
.banner::before { content: "# "; color: var(--primary); }
.banner a { color: var(--primary); text-decoration: underline; margin-left: var(--xs); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--xs); min-height: 44px; padding: var(--sm) var(--md); border-radius: var(--radius);
  font: 600 13px/1 var(--mono); border: 1px solid transparent; background: none; transition: background .15s, border-color .15s, color .15s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn--amber { background: var(--accent); color: var(--bg); }
.btn--amber:hover { background: #FFC56E; }
.btn--ghost { color: var(--text); border-color: var(--border); }
.btn--ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn--sm { min-height: 36px; padding: var(--xs) var(--sm); font-size: 12px; }
.btn--danger:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-col { display: grid; gap: var(--sm); max-width: 360px; margin-bottom: var(--md); }
.file-btn { cursor: pointer; position: relative; }
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; }
.linkish:hover { color: var(--text); }
.linkish.danger:hover { color: var(--accent); }
.ibtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: none; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); }
.ibtn:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }

/* forms */
.field { display: grid; gap: 6px; margin: 0 0 var(--sm); }
.flag { font: 400 12px/1 var(--mono); color: var(--primary); }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px var(--sm); font: 400 16px/1.4 var(--sans); }
.field textarea { resize: vertical; min-height: 110px; max-width: 620px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); }
.toast { position: fixed; left: 50%; bottom: calc(var(--md) + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--secondary); color: var(--primary); font: 500 13px/1.4 var(--mono); padding: var(--xs) var(--md); border-radius: var(--radius); transition: opacity .2s, transform .2s; max-width: calc(100vw - 2 * var(--md)); z-index: 40; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }


/* ---------- CV Builder ---------- */
:root { --max: 1440px; }
.field textarea { max-width: none; min-height: 0; }
.pad { padding: var(--md); }
.strip__lang { margin-left: auto; }

/* header bar: format switch, template, actions */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--xs) var(--sm); padding: var(--xs) 0 var(--sm); flex: 1 1 100%; }
.bar__sp { flex: 1 1 0; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.seg button { background: none; border: 0; border-right: 1px solid var(--border); color: var(--muted); font: 500 12px/1 var(--mono); padding: var(--xs) var(--sm); min-height: 36px; white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--secondary); color: var(--primary); }
.tpl { display: inline-flex; align-items: center; gap: var(--xs); }
.tpl select { min-height: 36px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 var(--xs); font: 400 13px/1 var(--mono); }
.tpl select:focus { outline: none; border-color: var(--primary); }
@media (max-width: 560px) { .bar__sp { display: none; } .bar .btn--amber { flex: 1 1 auto; } }
@media (max-width: 999px) { .top { position: static; } }
@media (min-width: 1000px) { .tabs { display: none; } .bar { flex: 1 1 auto; padding: var(--xs) 0; } .top__in { flex-wrap: nowrap; } }

/* layout: editor | preview side by side on wide screens, tabs on phones */
.layout { max-width: var(--max); margin: 0 auto; padding: var(--md); outline: none; }
.layout[data-view="edit"] .pv { display: none; }
.layout[data-view="preview"] .editor { display: none; }
@media (min-width: 1000px) {
  .layout { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.2fr); gap: var(--lg); align-items: start; }
  .layout[data-view] .pv, .layout[data-view] .editor { display: block; }
  .pv { position: sticky; top: calc(var(--top-h, 60px) + var(--sm)); max-height: calc(100vh - var(--top-h, 60px) - var(--lg)); overflow: auto; padding-right: 4px; }
}

/* editor */
.sec { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: var(--sm); }
.sec > summary { cursor: pointer; list-style: none; padding: var(--sm) var(--md); font: 600 13px/1.3 var(--mono); color: var(--text); min-height: 44px; display: flex; align-items: center; gap: 6px; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::after { content: "+"; margin-left: auto; color: var(--muted); }
.sec[open] > summary::after { content: "-"; }
.sec > summary:hover { color: var(--primary); }
.sec__in { padding: 0 var(--md) var(--md); }
.fgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sm); }
@media (min-width: 560px) { .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .f-wide { grid-column: span 1; } }
.field input, .field select, .field textarea { background: var(--bg); }
.flag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip-de { font: 400 10px/1 var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 3px 5px; }
.layout:not([data-fmt="de"]) .de-only { opacity: .55; }
.layout:not([data-fmt="de"]) .de-only:focus-within { opacity: 1; }
.chk { display: flex; align-items: center; gap: var(--xs); min-height: 44px; font-size: 14px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--primary); }
.f-chk { align-self: end; }
.item { position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sm); margin: 0 0 var(--sm); min-width: 0; }
.item__h { padding: 0 6px; font: 600 12px/1.3 var(--mono); color: var(--primary); max-width: calc(100% - 130px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__btns { position: absolute; top: -14px; right: var(--sm); display: flex; gap: 4px; background: var(--surface); padding: 0 4px; }
.ibtn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); }
.ibtn:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.ibtn--del:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.add { margin-top: var(--xs); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--xs); margin: var(--sm) 0; }
.file-btn { cursor: pointer; position: relative; }
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo { display: flex; align-items: center; gap: var(--sm); }
.photo img { width: 60px; height: 80px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; }
.linkish:hover { color: var(--text); }
.saved { min-height: 1.5em; margin: var(--xs) 0 0; font-family: var(--mono); }

/* preview column */
.pv__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--xs); font: 400 12px/1.5 var(--mono); margin-bottom: var(--xs); }
.pv__meta b { color: var(--primary); }
#pagecount.over b { color: var(--accent); }
.over-msg { color: var(--accent); }
.checks { list-style: none; margin: 0 0 var(--sm); padding: 0; font: 400 12px/1.5 var(--mono); }
.checks:empty { display: none; }
.ck::before { content: "# "; color: var(--primary); }
.ck--warn { color: var(--text); }
.ck--warn::before { content: "! "; color: var(--accent); }
.ck--info { color: var(--muted); }
.stage { position: relative; overflow: hidden; margin-bottom: var(--md); }
.paper { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; color: #111; box-shadow: 0 0 0 1px var(--border), 0 12px 40px rgba(0,0,0,.45); box-sizing: border-box; }
.guide { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--accent); pointer-events: none; }
.guide::after { content: attr(data-label); position: absolute; right: 6px; top: 2px; font: 600 11px/1 var(--mono); color: #8a5a00; background: #fff4e0; padding: 2px 5px; border-radius: 3px; }
.tips { border: 1px dashed var(--border); border-radius: var(--radius); padding: 0 var(--md); margin-bottom: var(--md); font-size: 14px; }
.tips summary { cursor: pointer; padding: var(--sm) 0; font: 600 13px/1.3 var(--mono); color: var(--primary); min-height: 44px; display: flex; align-items: center; }
.tips ul { margin: 0 0 var(--sm); padding-left: 18px; }
.tips li { margin-bottom: 4px; }
.offer { margin: 0 0 var(--md); padding: var(--sm) var(--md); border: 1px dashed var(--border); border-radius: var(--radius); font-size: 14px; }
.offer p { margin: 0 0 4px; }

/* ---------- the CV document (preview and PDF) ---------- */
.cv { --ink: #141414; --soft: #4a4a4a; --rule: #bdbdbd; --acc: #141414;
  font: 400 10.5pt/1.42 "Geist", "Helvetica Neue", Arial, sans-serif; color: var(--ink); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.cv a { color: inherit; text-decoration: none; }
.cv h1 { font-size: 22pt; line-height: 1.1; font-weight: 700; margin: 0; letter-spacing: -.01em; color: var(--acc); }
.cv h2 { font-size: 10.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 14pt 0 6pt; padding-bottom: 3pt; border-bottom: .75pt solid var(--rule); color: var(--acc); break-after: avoid; }
.cv h3 { font-size: 10.5pt; font-weight: 700; margin: 0; }
.cv p { margin: 0; }
.cv ul { margin: 2pt 0 0; padding-left: 13pt; }
.cv li { margin: 0 0 1.5pt; }
.cv-headline { font-size: 12pt; color: var(--soft); margin-top: 3pt !important; }
.cv-kicker { font-size: 8.5pt; text-transform: uppercase; letter-spacing: .14em; color: var(--soft); margin-bottom: 4pt !important; }
.cv-org, .cv-sub { color: var(--soft); }
.cv-entry { break-inside: avoid; }
.cv-statement { text-align: left; }

/* German: tabular rows */
.cv--de .cv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18pt; padding-bottom: 6pt; }
.cv-photo { width: 3.4cm; height: 4.5cm; object-fit: cover; flex: none; }
.cv-row { display: grid; grid-template-columns: 3.5cm minmax(0, 1fr); gap: 0 12pt; margin-bottom: 6pt; break-inside: avoid; }
.cv-l { color: var(--soft); }
.cv-sign { display: flex; justify-content: space-between; gap: 36pt; margin-top: 30pt; break-inside: avoid; }
.cv-sign > div { flex: 1 1 0; max-width: 7cm; }
.cv-sign p { min-height: 26pt; display: flex; align-items: flex-end; border-bottom: .75pt solid var(--ink); padding-bottom: 2pt; }
.cv-sign span { display: block; font-size: 8pt; color: var(--soft); margin-top: 2pt; }
/* German modern: sidebar */
.cv-grid { display: grid; grid-template-columns: 5.4cm minmax(0, 1fr); gap: 0 18pt; }
.cv-side { background: #eef4f0; padding: 12pt; font-size: 9.5pt; align-self: start; }
.cv-side .cv-photo { width: 100%; height: auto; aspect-ratio: 3 / 4; display: block; margin-bottom: 8pt; }
.cv-side__sec h2 { margin-top: 10pt; }
.cv-side__sec p { margin: 0 0 5pt; overflow-wrap: anywhere; }
.cv-side__sec p span { display: block; font-size: 7.5pt; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); }
.cv-main > .cv-head { display: block; padding-bottom: 4pt; }
.cv-main .cv-row { grid-template-columns: 3cm minmax(0, 1fr); }

/* UK and US: one column, plain structure (ATS) */
.cv--uk .cv-head, .cv--us .cv-head { text-align: center; padding-bottom: 2pt; }
.cv-contact { color: var(--soft); margin-top: 4pt !important; font-size: 9.5pt; }
.cv-sep { color: var(--rule); }
.cv-permit { font-size: 9.5pt; color: var(--soft); margin-top: 2pt !important; }
.cv-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12pt; }
.cv-when { white-space: nowrap; color: var(--soft); flex: none; }
.cv--uk .cv-entry, .cv--us .cv-entry { margin-bottom: 7pt; }
.cv-kv { margin-bottom: 2pt !important; }

/* templates */
.cv--classic { font-family: Georgia, "Times New Roman", Times, serif; }
.cv--classic h1 { font-weight: 400; font-size: 24pt; letter-spacing: 0; }
.cv--classic h2 { letter-spacing: .12em; font-weight: 400; border-bottom-color: var(--ink); }
.cv--modern { --acc: #1E5C40; --rule: #1E5C40; }
.cv--modern h2 { border-bottom-width: 1.5pt; }
.cv--uk.cv--modern .cv-head, .cv--us.cv--modern .cv-head { text-align: left; border-left: 4pt solid #1E5C40; padding-left: 10pt; }
.cv--compact { font-size: 9.5pt; line-height: 1.32; }
.cv--compact h1 { font-size: 18pt; }
.cv--compact h2 { font-size: 9.5pt; margin: 10pt 0 4pt; }
.cv--compact h3 { font-size: 9.5pt; }
.cv--compact .cv-headline { font-size: 10.5pt; }
.cv--compact .cv-row, .cv--compact .cv-entry { margin-bottom: 4pt; }
.cv--uk.cv--compact .cv-head, .cv--us.cv--compact .cv-head { text-align: left; }
.cv--compact .cv-photo { width: 2.8cm; height: 3.7cm; }

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

/* print = the PDF: only the CV, at real size */
@media print {
  .skip, .strip, .top, .banner, .toast, .editor, .pv__meta, .checks, #offer, .tips { display: none !important; }
  :root { color-scheme: light; }
  html, body { background: #fff !important; background-image: none !important; color: #000; }
  body { min-height: 0; padding: 0; }
  .layout, .layout[data-view] { display: block !important; max-width: none; margin: 0; padding: 0; }
  .layout[data-view] .pv { display: block !important; position: static; max-height: none; overflow: visible; padding: 0; }
  .stage { height: auto !important; overflow: visible; position: static; margin: 0; }
  .paper { position: static; transform: none !important; width: auto !important; padding: 0 !important; min-height: 0 !important; box-shadow: none; left: auto !important; }
  .guide { display: none; }
}
