/* ============================================================
   CraftCV — marketing/design-system layer
   Used by Django pages (home, gallery, examples, dashboard).
   The resume documents themselves live in /static/cv/resume/resume.css.
   The editor SPA bundles its own CSS via Vite.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --paper: #FBFAF8;
  --surface: #ffffff;
  --ink: #15151a;
  --ink-2: #45454e;
  --muted: #85858f;
  --line: #e9e6e1;
  --line-soft: #f1efec;
  --iris: #5b4fe8;
  --iris-deep: #4637d1;
  --iris-soft: rgba(91, 79, 232, .08);
  --iris-glow: rgba(91, 79, 232, .28);
  --teal: #0d9488;
  --teal-soft: rgba(13, 148, 136, .1);
  --gold: #b98a2f;
  --gold-soft: rgba(185, 138, 47, .1);
  --radius-s: 10px;
  --radius: 14px;
  --radius-l: 22px;
  --shadow-card: 0 1px 2px rgba(21, 21, 26, .05), 0 8px 28px rgba(21, 21, 26, .07);
  --shadow-pop: 0 2px 6px rgba(21, 21, 26, .06), 0 24px 64px rgba(21, 21, 26, .14);
  --font-display: 'Montserrat', 'Inter', sans-serif;
  --font-text: 'Inter', 'Helvetica Neue', sans-serif;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.16; letter-spacing: -.015em; }
p { margin: 0; }
a { color: var(--iris); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: var(--iris); color: #fff; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1360px; margin: 0 auto; padding: 0 24px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--iris); background: var(--iris-soft);
  border: 1px solid rgba(91, 79, 232, .22);
  padding: 6px 12px; border-radius: 999px;
}
.eyebrow--teal { color: var(--teal); background: var(--teal-soft); border-color: rgba(13, 148, 136, .25); }

.section { padding: 84px 0; }
.section--tight { padding: 56px 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; margin: 14px 0 12px; }
.section-head p { color: var(--ink-2); font-size: 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 14.5px; line-height: 1;
  padding: 14px 22px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
  text-decoration: none !important;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn--primary {
  background: var(--iris); color: #fff;
  box-shadow: 0 1px 2px rgba(70, 55, 209, .5), 0 8px 24px var(--iris-glow);
}
.btn--primary:hover { background: var(--iris-deep); transform: translateY(-1px); }
.btn--ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: #000; }
.btn--lg { padding: 17px 28px; font-size: 15.5px; border-radius: 14px; }
.btn--sm { padding: 9px 14px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }

.link-arrow { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.link-arrow svg { width: 14px; height: 14px; transition: transform .15s ease; }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__in { display: flex; align-items: center; height: 64px; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand__mark {
  width: 33px; height: 33px; border-radius: 9px;
  background: linear-gradient(135deg, var(--iris), var(--iris-deep));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px var(--iris-glow);
}
.brand__mark svg { width: 18px; height: 18px; }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -.02em; }
.brand__name em { color: var(--iris); font-style: normal; }
.nav__links { display: flex; gap: 4px; }
.nav__links a {
  color: var(--ink-2); font-size: 14px; font-weight: 600;
  padding: 8px 13px; border-radius: 9px; text-decoration: none;
  transition: background .13s ease, color .13s ease;
}
.nav__links a:hover { background: var(--line-soft); color: var(--ink); }
.nav__links a.is-active { color: var(--iris); background: var(--iris-soft); }
.nav__spacer { flex: 1; }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.nav__burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink-2); }
.nav__burger svg { width: 22px; height: 22px; display: block; }
.nav__drawer { display: none; border-top: 1px solid var(--line-soft); padding: 8px 0; }
.nav__drawer a { display: block; padding: 11px 13px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; text-decoration: none; }
.nav__drawer a:hover { background: var(--line-soft); color: var(--ink); }
.nav__drawer.is-open { display: block; }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__burger { display: block; }
  .nav__actions .btn span { display: none; }
  .nav__actions .btn { padding: 12px 14px; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 84px; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(620px 380px at 12% -6%, rgba(91, 79, 232, .13), transparent 65%),
    radial-gradient(520px 340px at 88% 10%, rgba(13, 148, 136, .09), transparent 65%);
}
.hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(34px, 4.6vw, 56px); font-weight: 800; margin: 18px 0 18px; }
.hero h1 .grad {
  background: linear-gradient(92deg, var(--iris) 10%, var(--teal) 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__sub { font-size: 17.5px; color: var(--ink-2); max-width: 52ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__proof { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 34px; color: var(--muted); font-size: 13px; font-weight: 600; }
.hero__proof span { display: inline-flex; gap: 7px; align-items: center; }
.hero__proof svg { width: 14px; height: 14px; color: var(--teal); }

.hero__stage { position: relative; display: flex; justify-content: center; }
.hero__card {
  width: min(380px, 100%); border-radius: var(--radius-l);
  background: var(--surface); box-shadow: var(--shadow-pop);
  border: 1px solid var(--line-soft);
  padding: 14px; position: relative;
}
.hero__frame {
  position: relative; border-radius: 14px; overflow: hidden;
  background: #fff; aspect-ratio: 794 / 1123;
}
.hero__frame > .cv-doc-scale { position: absolute; inset: 0; transform-origin: top left; }
.hero__float {
  position: absolute; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-card);
  font-size: 12px; font-weight: 700; color: var(--ink-2);
  padding: 10px 13px; display: flex; gap: 8px; align-items: center;
}
.hero__float svg { width: 14px; height: 14px; }
.hero__float--pdf { bottom: 26px; left: -28px; color: #be123c; }
.hero__float--ats { top: 34px; right: -24px; color: var(--teal); }
.hero__switcher { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; }
.hero__switcher button {
  flex: none; font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  padding: 7px 11px; border-radius: 999px; cursor: pointer;
  transition: all .13s ease; white-space: nowrap;
}
.hero__switcher button:hover { border-color: var(--iris); color: var(--iris); }
.hero__switcher button.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; gap: 44px; }
  .hero { padding: 52px 0 64px; }
  .hero__float--pdf { left: 4px; }
  .hero__float--ats { right: 4px; }
}

/* ---------- template cards / gallery ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 22px; }
.tpl-card {
  display: block; border-radius: var(--radius-l); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-card); text-decoration: none !important;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tpl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); border-color: var(--line); }
.tpl-card__frame { position: relative; aspect-ratio: 794 / 1123; background: #fff; overflow: hidden; }
.tpl-card__frame > .cv-doc-scale { position: absolute; inset: 0; transform-origin: top left; }
.tpl-card__body { padding: 14px 16px 16px; border-top: 1px solid var(--line-soft); }
.tpl-card__name { font-family: var(--font-display); font-weight: 800; font-size: 15.5px; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-card__desc { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.45; }
.tpl-card__cta { margin-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--iris); display: inline-flex; align-items: center; gap: 5px; }
.tpl-card__cta svg { width: 12px; height: 12px; }

.badge {
  font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
}
.badge--ats { background: var(--teal-soft); color: var(--teal); }
.badge--new { background: var(--iris-soft); color: var(--iris); }
.badge--photo { background: var(--gold-soft); color: var(--gold); }

.collection { margin-bottom: 64px; }
.collection__head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.collection__head h2 { font-size: 24px; font-weight: 800; }
.collection__head p { color: var(--muted); font-size: 14px; max-width: 46ch; }

/* ---------- features ---------- */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.feat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-l); padding: 26px 22px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.feat:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.feat__icon {
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--iris-soft); color: var(--iris);
}
.feat__icon svg { width: 20px; height: 20px; }
.feat h3 { font-size: 16px; font-weight: 800; margin-bottom: 7px; }
.feat p { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 26px 22px; background: var(--surface);
}
.step::before {
  counter-increment: step; content: counter(step);
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  margin-bottom: 16px;
}
.step h3 { font-size: 16.5px; font-weight: 800; margin-bottom: 7px; }
.step p { font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* ---------- editor preview mock / detail page ---------- */
.detail-hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; padding: 56px 0; }
.detail-hero h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; margin: 14px 0 14px; }
.detail-hero .lede { color: var(--ink-2); font-size: 16.5px; max-width: 52ch; }
.detail-hero__frame {
  position: relative; border-radius: var(--radius-l); overflow: hidden;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  aspect-ratio: 794 / 1123; max-width: 460px; margin: 0 auto; width: 100%;
}
.detail-hero__frame > .cv-doc-scale { position: absolute; inset: 0; transform-origin: top left; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 980px) { .detail-hero { grid-template-columns: 1fr; padding: 40px 0; } }

.spec-list { list-style: none; margin: 22px 0; padding: 0; display: grid; gap: 10px; }
.spec-list li { display: flex; gap: 10px; font-size: 14px; color: var(--ink-2); align-items: flex-start; }
.spec-list svg { width: 15px; height: 15px; color: var(--teal); flex: none; margin-top: 3px; }

/* ---------- FAQ ---------- */
.faq { max-width: 720px; margin: 0 auto; display: grid; gap: 12px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.faq summary {
  font-weight: 700; font-size: 15px; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--muted); transition: transform .15s ease; flex: none;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 10px; color: var(--ink-2); font-size: 14px; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative; overflow: hidden;
  border-radius: var(--radius-l);
  background: linear-gradient(120deg, #1b1b24 0%, #26244a 60%, var(--iris-deep) 130%);
  color: #fff; text-align: center; padding: 72px 32px;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(500px 260px at 85% 20%, rgba(255, 255, 255, .12), transparent 60%);
  pointer-events: none;
}
.cta-band h2 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; margin-bottom: 14px; position: relative; }
.cta-band p { color: rgba(255, 255, 255, .75); font-size: 16px; max-width: 52ch; margin: 0 auto 28px; position: relative; }
.cta-band .btn { position: relative; }

/* ---------- forms (dashboard etc.) ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 44px 0 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; font-weight: 800; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 5px; }

.empty {
  text-align: center; padding: 90px 20px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius-l);
}
.empty svg { width: 44px; height: 44px; margin-bottom: 14px; color: var(--line); }
.empty h2 { font-size: 19px; color: var(--ink); margin-bottom: 6px; }
.empty p { font-size: 14px; margin-bottom: 22px; }

.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; padding-bottom: 70px; }
.res-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-l); overflow: hidden; text-decoration: none !important;
  box-shadow: var(--shadow-card); transition: transform .15s ease, box-shadow .15s ease;
}
.res-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.res-card__thumb { aspect-ratio: 794 / 1123; background: #f4f2ef; overflow: hidden; position: relative; }
.res-card__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .25s ease; }
.res-card:hover .res-card__thumb img { transform: scale(1.02); }
.res-card__thumb .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #d3cfc9; }
.res-card__thumb .ph svg { width: 46px; height: 46px; }
.res-card__body { padding: 14px 16px 16px; border-top: 1px solid var(--line-soft); }
.res-card__title { font-weight: 800; font-size: 15px; color: var(--ink); display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.res-card__meta { display: flex; gap: 10px; margin-top: 7px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.res-card__views { display: inline-flex; gap: 5px; align-items: center; }
.res-card__views svg { width: 12px; height: 12px; }

/* ---------- example pages ---------- */
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.ex-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 24px; text-decoration: none !important; box-shadow: var(--shadow-card);
  transition: transform .15s ease, box-shadow .15s ease; display: block;
}
.ex-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.ex-card h3 { color: var(--ink); font-size: 17px; margin-bottom: 8px; }
.ex-card p { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.ex-card .link-arrow { margin-top: 14px; }

.ex-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; padding: 48px 0 64px; align-items: start; }
.ex-copy h1 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; margin: 14px 0 16px; }
.ex-copy .intro { color: var(--ink-2); font-size: 16.5px; line-height: 1.6; }
.ex-copy h2 { font-size: 20px; margin: 34px 0 12px; font-weight: 800; }
.ex-copy dl { margin: 0; }
.ex-copy dt { font-weight: 700; font-size: 14.5px; margin-top: 18px; }
.ex-copy dd { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.ex-frame {
  position: sticky; top: 84px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l);
  overflow: hidden; box-shadow: var(--shadow-pop);
  max-height: calc(100vh - 110px); display: flex; flex-direction: column;
}
.ex-frame .doc-scroll { overflow: auto; }
@media (max-width: 980px) { .ex-layout { grid-template-columns: 1fr; } .ex-frame { position: relative; top: 0; max-height: none; } }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line-soft); background: var(--surface); margin-top: auto; }
.footer__in { padding: 56px 0 28px; }
.footer__grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 36px; }
.footer__brand p { color: var(--muted); font-size: 13.5px; margin-top: 14px; max-width: 34ch; line-height: 1.6; }
.footer h4 { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer ul a { color: var(--ink-2); font-size: 14px; }
.footer__base { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding: 22px 0; margin-top: 44px; color: var(--muted); font-size: 13px; }
@media (max-width: 820px) { .footer__grid { grid-template-columns: 1fr 1fr; } }

/* ---------- misc ---------- */
.notice { background: var(--gold-soft); border: 1px solid rgba(185, 138, 47, .3); color: #8a6420; border-radius: var(--radius); padding: 12px 16px; font-size: 13.5px; }
.skip-link { position: absolute; left: -9999px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

.fade-in { animation: fadeUp .45s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* scale helper for embedded engine previews */
.cv-doc-scale { width: 794px; }
