/* ============================================================
   NextJobResume — style.css
   Design system: light/dark themes via CSS variables,
   responsive builder layout, print-to-PDF styles.
   ============================================================ */

/* ---------- self-hosted fonts (variable, latin subset) ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/sourceserif4-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-softer: #eff6ff;
  --accent-text: #1d4ed8;   /* accent as TEXT — always ≥4.5:1 on light surfaces */

  --bg: #f6f8fc;
  --bg-raised: #ffffff;
  --bg-subtle: #eef2f9;
  --text: #0f172a;
  --text-muted: #55637a;
  --border: #dde4ef;
  --border-strong: #c3cddd;

  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #dc2626;
  --bad-text: #b91c1c;
  --bad-soft: #fee2e2;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .05);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, .14);
  --radius: 12px;
  --radius-sm: 8px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --topbar-h: 60px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-raised: #111a2e;
  --bg-subtle: #17233c;
  --text: #e6ecf7;
  --text-muted: #97a3ba;
  --border: #24314e;
  --border-strong: #33436a;

  --accent: #2563eb;        /* fills only — white text on it passes AA */
  --accent-strong: #1d4ed8; /* hover fills */
  --accent-soft: #1e3a8a;
  --accent-softer: #16244a;
  --accent-text: #93c5fd;   /* accent as TEXT on dark surfaces */

  --ok: #22c55e;
  --ok-soft: #14351f;
  --warn: #fbbf24;
  --warn-soft: #3a2a08;
  --bad: #f87171;
  --bad-text: #f87171;
  --bad-soft: #3d1414;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--text); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.ok-text { color: var(--ok); }
.hidden { display: none !important; }
.danger { color: var(--bad); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid transparent; border-radius: 10px;
  font-weight: 600; font-size: .95rem; text-decoration: none;
  padding: 10px 18px; transition: all .15s ease;
  white-space: nowrap;
}
.btn-lg { padding: 14px 26px; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--accent-text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--accent-softer); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); }
.btn-coffee { background: #f59e0b; color: #1c1917; font-size: 1.05rem; padding: 14px 28px; box-shadow: var(--shadow-md); }
.btn-coffee:hover { background: #d97706; transform: translateY(-1px); }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .faq-q:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100; height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg-raised) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.02em;
}
.brand span { color: var(--accent-text); }
.brand-icon { width: 30px; height: 30px; border-radius: 8px; }
.topbar-links { display: flex; align-items: center; gap: 6px; }
.topbar-links > a {
  color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: .92rem;
  padding: 8px 12px; border-radius: 8px;
}
.topbar-links > a:hover { color: var(--text); background: var(--bg-subtle); }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(60% 90% at 15% 0%, var(--accent-softer) 0%, transparent 60%),
    radial-gradient(50% 80% at 90% 10%, color-mix(in srgb, #7c3aed 12%, transparent) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 880px; margin: 0 auto; text-align: center; padding: 72px 20px 56px; }
.badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent-soft); color: var(--accent-text);
  padding: 8px 16px; border-radius: 999px; font-size: .875rem; font-weight: 600;
  margin-bottom: 22px;
}
.badge .icon { width: 18px; height: 18px; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 18px; }
.hero-sub { font-size: 1.13rem; color: var(--text-muted); max-width: 640px; margin: 0 auto 30px; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.trust-row {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center;
  padding: 0; margin: 0; color: var(--text-muted); font-size: .9rem; font-weight: 500;
}
.trust-row li { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- builder layout ---------- */
.builder { max-width: 1400px; margin: 0 auto; padding: 28px 20px 60px; }
.mobile-tabs { display: none; }
.builder-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(430px, 560px);
  gap: 24px; align-items: start;
}

/* editor */
.editor-card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden;
}
.editor-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 640px; }
.step-nav {
  border-right: 1px solid var(--border); background: var(--bg-subtle);
  padding: 16px 10px; display: flex; flex-direction: column; gap: 4px;
}
.step-nav-item {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: transparent; border: none; border-radius: 10px;
  padding: 9px 10px; font-size: .88rem; font-weight: 500; color: var(--text-muted);
}
.step-nav-item:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--text); }
.step-nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.step-num {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--border); color: var(--text-muted); font-size: .78rem; font-weight: 700;
}
.step-num[data-done="1"] { background: var(--ok); color: #fff; }
.step-nav-item.active .step-num { background: var(--accent); color: #fff; }

.wizard-progress { padding: 0 0 14px; }
.wizard-progress-text { font-size: .82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.wizard-progress-bg { height: 8px; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border); overflow: hidden; }
.wizard-progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #7c3aed); transition: width .35s ease; }

.form-panel { display: none; padding: 26px 28px 30px; outline: none; }
.form-panel.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.form-panel h2 { font-size: 1.3rem; letter-spacing: -.01em; }
.panel-sub { color: var(--text-muted); font-size: .93rem; margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 6px; }
.form-group .optional { font-weight: 400; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea, .toolbar-row select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-raised); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-group textarea { resize: vertical; min-height: 44px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .toolbar-row select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: color-mix(in srgb, var(--text-muted) 65%, transparent); }
.field-hint { font-size: .8rem; color: var(--text-muted); margin: 6px 0 0; }

/* inline validation */
.req { color: var(--bad); }
.form-group input.field-error,
.form-group textarea.field-error {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent);
}
.field-error-msg { color: var(--bad); font-size: .8rem; margin: 6px 0 0; }

/* collapsible optional blocks */
.collapsible-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: var(--bg-subtle); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); padding: 11px 14px;
  font-weight: 600; font-size: .9rem; color: var(--text); text-align: left;
}
.collapsible-toggle:hover { border-color: var(--accent); color: var(--accent); }
.collapsible-toggle .chevron { margin-left: auto; transition: transform .2s ease; color: var(--text-muted); }
.collapsible-toggle[aria-expanded="true"] { border-style: solid; }
.collapsible-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.collapsible-badge {
  background: var(--ok-soft); color: var(--ok);
  font-size: .74rem; font-weight: 700; border-radius: 999px; padding: 2px 9px;
}
.collapsible-body { padding-top: 4px; }

/* live counters */
.char-counter { font-size: .78rem; color: var(--text-muted); margin: 6px 0 0; text-align: right; }
.bullet-count { margin-left: auto; font-size: .78rem; color: var(--text-muted); }

/* disabled nav buttons */
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:hover { transform: none; box-shadow: var(--shadow-sm); background: var(--accent); }

.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.entry-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.entry-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.entry-card {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 6px; margin-bottom: 14px; background: var(--bg-raised);
}
.entry-remove {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px;
  border-radius: 50%; border: none; background: var(--bg-subtle); color: var(--text-muted);
  font-size: 1.15rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.entry-remove:hover { background: var(--bad-soft); color: var(--bad); }

.entry-actions { display: flex; align-items: center; gap: 12px; padding: 0 0 12px; }
.tips-toggle { background: none; border: none; color: var(--accent-text); font-weight: 600; font-size: .82rem; padding: 0; }
.tips-box {
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 14px; font-size: .85rem;
}
.tips-box .tips-title { font-weight: 700; margin-bottom: 6px; color: var(--warn); }
.tips-box ul { margin: 0; padding-left: 18px; }
.tips-box li { margin-bottom: 3px; }

.tip-box {
  background: var(--accent-softer); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius-sm); padding: 13px 15px; font-size: .88rem; color: var(--text);
  margin: 18px 0 4px;
}

.skill-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.skill-input-row { display: flex; gap: 8px; }
.skill-input-row input { flex: 1; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 5px 12px; font-size: .82rem; font-weight: 600;
  border: 1px solid var(--border-strong); background: var(--bg-subtle); color: var(--text);
}
button.chip { cursor: pointer; }
.chip-add { background: var(--accent-softer); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-text); }
.chip-add:hover { background: var(--accent-soft); }
.chip-tag { background: var(--bg-raised); }
.chip-x {
  border: none; background: none; color: var(--text-muted); font-size: 1rem;
  padding: 0 0 0 2px; line-height: 1;
}
.chip-x:hover { color: var(--bad); }
.chip-missing { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--bad-text); }
.chip-missing:hover { filter: brightness(.96); }
.chip-hit { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }

.suggestion-box {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 14px 16px; margin-top: 18px; background: var(--bg-subtle);
}

.editor-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 28px; border-top: 1px solid var(--border); background: var(--bg-subtle);
}
.save-state { flex: 1; text-align: center; font-size: .78rem; color: var(--text-muted); }
.review-cta { text-align: center; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }

/* preview pane */
.preview-pane {
  position: sticky; top: calc(var(--topbar-h) + 16px);
  display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - var(--topbar-h) - 32px);
}
.preview-toolbar {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.toolbar-row { display: flex; align-items: center; gap: 10px; }
.toolbar-label { font-size: .8rem; font-weight: 700; color: var(--text-muted); width: 64px; flex: 0 0 64px; }
.toolbar-row select { flex: 1; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-raised); }
.accent-row { display: flex; gap: 8px; }
.accent-swatch {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0;
  box-shadow: inset 0 0 0 2px var(--bg-raised);
}
.accent-swatch.selected { border-color: var(--text); transform: scale(1.12); }
.zoom-controls { display: flex; gap: 6px; }

.preview-scroll {
  overflow: auto; padding: 4px 2px 10px; flex: 1;
  border-radius: var(--radius);
}
.paper-wrap { display: flex; justify-content: center; }
.resume-paper {
  background: #ffffff; color: #1a1a1a;
  width: 210mm; min-height: 297mm; padding: 14mm 15mm;
  box-shadow: var(--shadow-lg); border-radius: 4px;
  font-size: calc(10.5pt * var(--r-scale, 1));
  line-height: 1.42;
  zoom: 0.62;
  --accent: #2563eb;
}
@media (min-width: 1600px) { .resume-paper { zoom: .74; } }

/* score cards */
.score-cards { display: flex; flex-direction: column; gap: 14px; }
.score-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px 18px;
}
.score-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.score-card-head h3 { margin: 0; font-size: 1rem; }
.ats-hint { font-size: .74rem; color: var(--text-muted); }

.quality-ring {
  --score: 0;
  width: 54px; height: 54px; border-radius: 50%; flex: 0 0 54px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.05rem;
  background: conic-gradient(var(--ok) calc(var(--score) * 1%), var(--bg-subtle) 0);
  position: relative;
}
.quality-ring::before {
  content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--bg-raised);
}
.quality-ring span { position: relative; }

.quality-checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; }
.quality-checklist li { font-size: .8rem; color: var(--text-muted); display: flex; gap: 6px; align-items: baseline; }
.quality-checklist li.ok { color: var(--ok); font-weight: 600; }

.ats-score { display: flex; align-items: baseline; gap: 10px; }
.ats-num { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.ats-label { font-size: .8rem; color: var(--text-muted); }
.ats-score--good .ats-num { color: var(--ok); }
.ats-score--mid .ats-num { color: var(--warn); }
.ats-score--low .ats-num { color: var(--bad); }
.ats-bar { height: 8px; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border); overflow: hidden; }
.ats-bar-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.ats-fill--good { background: var(--ok); }
.ats-fill--mid { background: var(--warn); }
.ats-fill--low { background: var(--bad); }
.matched-details { margin-top: 10px; font-size: .84rem; }
.matched-details summary { cursor: pointer; color: var(--text-muted); font-weight: 600; }

.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.action-grid .btn-lg { grid-column: 1 / -1; }
.action-grid input[hidden] { display: none; }

/* toasts */
#toast-region {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 300; align-items: center;
  pointer-events: none;
}
.toast {
  background: #111827; color: #f9fafb; border-radius: 10px; padding: 11px 18px;
  font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-lg);
  display: flex; gap: 8px; align-items: center;
  opacity: 0; transform: translateY(12px); transition: all .3s ease;
  max-width: min(92vw, 480px);
  pointer-events: auto;
}
.toast--show { opacity: 1; transform: none; }
.toast-action {
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28);
  color: #f9fafb; border-radius: 8px; padding: 4px 12px;
  font-size: .8rem; font-weight: 700; margin-left: 6px; white-space: nowrap;
}
.toast-action:hover { background: rgba(255, 255, 255, .26); }
.toast--success .toast-icon { color: #4ade80; }
.toast--warn .toast-icon { color: #fbbf24; }
.toast--info .toast-icon { color: #60a5fa; }

/* modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(8, 12, 22, .55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); width: min(720px, 100%); max-height: 90vh; overflow: auto;
  padding: 24px 26px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; }
.modal-close {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--bg-subtle); color: var(--text-muted); font-size: 1.4rem; line-height: 1;
}
.modal-close:hover { background: var(--bad-soft); color: var(--bad); }
.modal textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-raised); line-height: 1.6; resize: vertical;
}
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }

/* linkedin import */
.import-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--accent-softer);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: var(--radius); padding: 16px 18px; margin: 0 0 22px;
}
.import-panel-text strong { display: block; margin-bottom: 3px; font-size: .98rem; }
.import-panel-text p { margin: 0; font-size: .86rem; color: var(--text-muted); max-width: 620px; }
.import-panel .btn { flex: 0 0 auto; }
.linkedin-option {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-subtle); padding: 12px 14px 14px; margin-bottom: 14px;
}
.linkedin-option strong { display: block; margin-bottom: 4px; }
.linkedin-option p { margin: 0 0 10px; font-size: .86rem; }
.linkedin-option code {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; font-size: .84em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.linkedin-privacy-note {
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--radius-sm); padding: 10px 12px; margin: 12px 0 0;
  font-size: .82rem; line-height: 1.5; color: var(--text);
}
.linkedin-privacy-note strong { display: inline; margin: 0; }
#linkedin-pdf-name { min-width: 0; overflow-wrap: anywhere; }

/* ---------- marketing sections ---------- */
.section { border-top: 1px solid var(--border); padding: 72px 20px; background: var(--bg-raised); }
.section:nth-of-type(even) { background: var(--bg); }
.section-inner { max-width: 1120px; margin: 0 auto; }
.section-inner--narrow { max-width: 780px; }
.section-title { text-align: center; font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 10px; }
.section-sub { text-align: center; color: var(--text-muted); max-width: 560px; margin: 0 auto 44px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 1.7rem; display: block; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: .92rem; }

.steps-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step-card {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); position: relative;
}
.step-big {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 800; font-size: 1.1rem; margin-bottom: 14px;
}
.step-card h3 { font-size: 1.05rem; }
.step-card p { margin: 0; color: var(--text-muted); font-size: .92rem; }

.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: none; border: none; text-align: left;
  padding: 17px 20px; font-size: 1rem; font-weight: 600; color: var(--text);
}
.faq-chevron { transition: transform .2s ease; color: var(--text-muted); }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 20px 18px; color: var(--text-muted); }
.faq-a p { margin: 0; }
.faq-item.open .faq-a { display: block; }

.support-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--accent), #7c3aed);
  border-radius: 20px; padding: 44px 48px; color: #fff;
  box-shadow: var(--shadow-lg);
}
.support-inner h2 { color: #fff; }
.support-inner p { margin: 0; opacity: .92; max-width: 520px; }

.footer { background: var(--bg); border-top: 1px solid var(--border); padding: 44px 20px 28px; }
.footer-inner {
  max-width: 1120px; margin: 0 auto; display: flex; justify-content: space-between;
  gap: 30px; flex-wrap: wrap; margin-bottom: 26px;
}
.footer-brand p { color: var(--text-muted); font-size: .9rem; max-width: 320px; margin: 8px 0 0; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: .92rem; }
.footer-links a:hover { color: var(--accent-text); }
.footer-note { text-align: center; color: var(--text-muted); font-size: .8rem; margin: 0; }

/* ---------- resume paper typography ---------- */
.resume-paper { font-family: var(--font-sans); }
.resume-paper .r-header { margin-bottom: 10pt; }
.resume-paper .r-name { font-size: 20pt; font-weight: 700; letter-spacing: -.01em; margin: 0 0 2pt; }
.resume-paper .r-title { margin: 0 0 4pt; font-weight: 600; color: var(--accent-text); font-size: 11.5pt; }
.resume-paper .r-contacts { margin: 0; font-size: 9pt; color: #4a4a4a; }
.resume-paper .r-sep { margin: 0 5pt; color: #b0b0b0; }

.resume-paper .r-section { margin-bottom: 11pt; break-inside: avoid; }
.resume-paper .r-h2 {
  font-size: 10.5pt; text-transform: uppercase; letter-spacing: .09em;
  color: var(--accent-text); border-bottom: 1.2pt solid var(--accent);
  padding-bottom: 2.5pt; margin: 0 0 7pt; font-weight: 700;
}
.resume-paper .r-summary { margin: 0 0 11pt; color: #2c2c2c; }
.resume-paper .r-chips { display: flex; flex-wrap: wrap; gap: 4pt; margin-bottom: 5pt; }
.resume-paper .r-chip {
  border: .8pt solid color-mix(in srgb, var(--accent) 45%, #ffffff);
  color: #273142; border-radius: 3pt; padding: 1pt 6pt; font-size: 8.8pt; background: #f7f9fd;
}
.resume-paper .r-soft { margin: 0; font-size: 9pt; color: #4a4a4a; }
.resume-paper .r-soft-label { font-weight: 700; color: #273142; }

.resume-paper .r-entry { margin-bottom: 8.5pt; break-inside: avoid; }
.resume-paper .r-entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10pt; }
.resume-paper .r-entry-title { margin: 0; font-size: 10.5pt; font-weight: 700; }
.resume-paper .r-at { font-weight: 500; color: #4a4a4a; }
.resume-paper .r-entry-meta { font-size: 9pt; color: #666; white-space: nowrap; }
.resume-paper .r-bullets { margin: 3pt 0 0; padding-left: 14pt; }
.resume-paper .r-bullets li { margin-bottom: 2pt; }
.resume-paper .r-desc { margin: 1pt 0 0; font-size: 9.5pt; color: #3a3a3a; }
.resume-paper .r-desc--muted { color: #666; font-size: 9pt; }

/* template variants */
.tpl-classic { font-family: var(--font-serif); --accent: #1f2937 !important; }
.tpl-classic .r-header--center { text-align: center; }
.tpl-classic .r-name { font-size: 21pt; }
.tpl-classic .r-title { color: #374151; font-style: italic; font-weight: 600; }
.tpl-classic .r-h2 { color: #1f2937; border-bottom-color: #9ca3af; letter-spacing: .12em; }

.tpl-modern .r-header--band {
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #7c3aed));
  color: #fff; margin: -14mm -15mm 12pt; padding: 11mm 15mm 9mm;
}
.tpl-modern .r-header--band .r-title { color: rgba(255, 255, 255, .92); }
.tpl-modern .r-header--band .r-contacts { color: rgba(255, 255, 255, .88); }
.tpl-modern .r-header--band .r-sep { color: rgba(255, 255, 255, .55); }

.tpl-compact { font-size: calc(9.8pt * var(--r-scale, 1)); }
.tpl-compact .r-header--left { border-bottom: 2pt solid var(--accent); padding-bottom: 6pt; }
.tpl-compact .r-name { font-size: 17pt; }
.tpl-compact .r-section { margin-bottom: 8pt; }
.tpl-compact .r-entry { margin-bottom: 6pt; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .builder-grid { grid-template-columns: 1fr; }
  .preview-pane {
    position: static; max-height: none;
    display: none;
  }
  .mobile-tabs {
    display: flex; background: var(--bg-subtle); border: 1px solid var(--border);
    border-radius: 12px; padding: 5px; gap: 5px; margin-bottom: 16px;
  }
  .pane-tab {
    flex: 1; border: none; background: transparent; padding: 10px; border-radius: 9px;
    font-weight: 600; color: var(--text-muted); font-size: .95rem;
  }
  .pane-tab.active { background: var(--bg-raised); color: var(--text); box-shadow: var(--shadow-sm); }
  body.show-preview .editor-pane { display: none; }
  body.show-preview .preview-pane { display: flex; }
  .resume-paper { zoom: .58; }
}
@media (min-width: 1181px) {
  .mobile-hidden { display: revert; }
}

@media (max-width: 720px) {
  .topbar-links > a { display: none; }
  .topbar .btn { padding: 7px 12px; font-size: .82rem; }
  .topbar-inner { padding: 0 12px; gap: 8px; }
  .hero-inner { padding: 48px 18px 40px; }
  .editor-body { grid-template-columns: 1fr; }
  .step-nav { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 10px; }
  .step-nav-item { flex: 0 0 auto; }
  .step-label { white-space: nowrap; }
  .form-panel { padding: 20px 18px 24px; }
  .entry-grid, .entry-grid--2, .entry-grid--3 { grid-template-columns: 1fr; }
  .skill-columns { grid-template-columns: 1fr; }
  .quality-checklist { grid-template-columns: 1fr; }
  .feature-grid, .steps-row { grid-template-columns: 1fr; }
  .support-inner { padding: 30px 24px; }
  .resume-paper { zoom: .42; }
  .action-grid { grid-template-columns: 1fr; }
  .desktop-br { display: none; }
}

/* ---------- print / PDF ---------- */
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; }
  .topbar, .hero, .section, .footer, .mobile-tabs, .no-print, #toast-region, .modal-overlay, .skip-link { display: none !important; }
  .builder { padding: 0; max-width: none; }
  .builder-grid { display: block; }
  .editor-pane { display: none !important; }
  .preview-pane {
    display: block !important; position: static; max-height: none;
    padding: 0; margin: 0;
  }
  .preview-toolbar, .score-cards { display: none !important; }
  .preview-scroll { overflow: visible; padding: 0; }
  .paper-wrap { display: block; }
  .resume-paper {
    zoom: 1 !important;
    width: 210mm; min-height: auto; box-shadow: none; border-radius: 0;
    margin: 0; padding: 13mm 14mm;
    font-size: calc(10.5pt * var(--r-scale, 1));
  }
  .resume-paper .r-entry, .resume-paper .r-section { break-inside: avoid; }
  .tpl-modern .r-header--band { margin: 0 0 12pt; padding: 10mm 14mm 8mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.pagination-wrap { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.pagination-info { margin: 0; font-size: .85rem; color: var(--text-muted); text-align: center; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.page-btn {
  min-width: 38px; height: 38px; padding: 0 13px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--bg-raised);
  color: var(--text); font-weight: 600; font-size: .9rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s, background .15s;
}
.page-btn:hover:not(:disabled):not(.active) { border-color: var(--accent); color: var(--accent-text); background: var(--accent-softer); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: .45; cursor: default; }
.page-ellipsis { color: var(--text-muted); padding: 0 2px; }
.admin-card .pagination-wrap { margin-top: 18px; }

/* ============================================================
   BLOG
   ============================================================ */
.blog-hero { border-bottom: 1px solid var(--border); }
.blog-hero .hero-inner { padding-bottom: 36px; }
.blog-controls { max-width: 640px; margin: 0 auto; text-align: left; }
#blog-search {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border-strong);
  border-radius: 12px; background: var(--bg-raised); font-size: 1rem;
  box-shadow: var(--shadow-sm);
}
#blog-search:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.blog-tags { justify-content: center; margin-top: 14px; }
.blog-tags .chip { cursor: pointer; }
.chip-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-sm { font-size: .72rem; padding: 2px 9px; }

.blog-section-body { padding: 44px 20px 72px; }
.blog-grid {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.blog-grid--narrow { grid-template-columns: 1fr 1fr; }
.blog-card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease; overflow: hidden;
  display: flex;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.blog-card-link { display: block; padding: 0; color: inherit; text-decoration: none; width: 100%; }
.blog-card-cover {
  position: relative; aspect-ratio: 1200 / 630; overflow: hidden;
  background: var(--bg-subtle); border-bottom: 1px solid var(--border);
}
.blog-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.blog-card:hover .blog-card-cover img { transform: scale(1.035); }
.cover-emoji {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(255, 255, 255, .93); border-radius: 10px;
  padding: 4px 9px; font-size: 1.25rem; line-height: 1;
  box-shadow: var(--shadow-sm);
}
.blog-card-body { padding: 20px 22px 22px; }
.blog-card-emoji { font-size: 1.9rem; display: block; margin-bottom: 10px; }
.blog-card-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.blog-card-title { font-size: 1.08rem; letter-spacing: -.01em; margin: 0 0 8px; }
.blog-card-excerpt { font-size: .9rem; color: var(--text-muted); margin: 0 0 12px; }
.blog-card-more { color: var(--accent-text); font-weight: 600; font-size: .88rem; }

/* single post */
.post-view { padding: 40px 20px 72px; }
.post-container { max-width: 760px; margin: 0 auto; }
.back-link { color: var(--accent-text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.post-cover {
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-md);
  margin: 26px 0 6px; aspect-ratio: 1200 / 630; background: var(--bg-subtle);
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-head { margin: 0 0 8px; }
.post-title { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.02em; margin-bottom: 12px; }
.post-body {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 34px; box-shadow: var(--shadow-sm);
  font-size: 1.02rem; line-height: 1.7; margin-top: 20px;
}
.post-body h2 { font-size: 1.35rem; letter-spacing: -.01em; margin: 1.6em 0 .5em; }
.post-body h2:first-child { margin-top: 0; }
.post-body h3 { font-size: 1.1rem; margin: 1.4em 0 .4em; }
.post-body ul, .post-body ol { padding-left: 22px; margin: 0 0 1em; }
.post-body li { margin-bottom: .45em; }
.post-body blockquote {
  margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--accent);
  background: var(--accent-softer); border-radius: 0 8px 8px 0; color: var(--text-muted);
}
.post-body blockquote p { margin: 0; }
.post-body code {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; font-size: .86em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.post-body a { color: var(--accent-text); font-weight: 600; }
.post-more-title { margin-top: 40px; font-size: 1.3rem; }
.post-cta {
  margin-top: 34px; padding: 28px 30px; border-radius: 16px;
  background: linear-gradient(120deg, var(--accent), #7c3aed);
  color: #fff; box-shadow: var(--shadow-md); text-align: center;
}
.post-cta h3 { color: #fff; margin-bottom: 8px; }
.post-cta p { opacity: .92; margin-bottom: 18px; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 72px; }
.admin-tag {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 2px 7px; margin-left: 4px;
}
.admin-card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 24px 26px; margin-bottom: 18px;
}
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-head h1 { margin: 0; font-size: 1.5rem; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-form { max-width: 320px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th {
  text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); padding: 8px 10px; border-bottom: 2px solid var(--border);
}
.admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table a { color: var(--text); font-weight: 600; text-decoration: none; }
.admin-table a:hover { color: var(--accent); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn { padding: 4px 9px; font-size: .78rem; }
.status-pill {
  display: inline-block; font-size: .74rem; font-weight: 700;
  border-radius: 999px; padding: 3px 10px;
}
.status-pill.published { background: var(--ok-soft); color: var(--ok); }
.status-pill.draft { background: var(--warn-soft); color: var(--warn); }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 18px; align-items: start; }
.preview-card { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - 120px); overflow: auto; }
.preview-title { font-size: 1rem; margin-bottom: 12px; }
.preview-card .post-body { padding: 20px 22px; font-size: .95rem; box-shadow: none; }
.image-preview-row { margin-top: 10px; }
.image-preview-row img {
  width: 100%; aspect-ratio: 1200 / 630; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border); display: block;
}
.admin-card code {
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; font-size: .84em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 900px) {
  .blog-grid { grid-template-columns: 1fr 1fr; }
  .editor-grid { grid-template-columns: 1fr; }
  .preview-card { position: static; max-height: none; }
}
@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
  .post-body { padding: 22px 18px; }
  .admin-table th:nth-child(3), .admin-table td:nth-child(3),
  .admin-table th:nth-child(4), .admin-table td:nth-child(4) { display: none; }
}
