/* ==========================================================================
   Cap Mosaic Maker — design system
   Warm, bottle-cap-inspired palette on a modern SaaS structure.
   ========================================================================== */

:root {
  /* Palette */
  --bg: #faf6f0;            /* warm off-white */
  --bg-soft: #f3ecdf;       /* deeper warm wash for alt sections */
  --ink: #2b2521;           /* dark charcoal */
  --ink-soft: #5c534b;      /* secondary text */
  --ink-faint: #857a6f;     /* captions, meta */
  --accent: #d5581c;        /* bottle-cap orange */
  --accent-dark: #b24312;   /* hover / strong */
  --accent-soft: #fbe3d4;   /* orange tint fill */
  --teal: #2e7d74;          /* muted teal */
  --teal-soft: #dcebea;
  --gold: #f2b134;          /* warm yellow highlight */
  --gold-soft: #fdf0d3;
  --card: #ffffff;
  --line: #e7ddcd;          /* subtle borders */
  --line-strong: #d8cbb6;
  --danger: #b3261e;

  /* Type */
  --font-body: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  /* Shape */
  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 22px;
  --shadow-s: 0 1px 2px rgba(43, 37, 33, .06), 0 2px 8px rgba(43, 37, 33, .05);
  --shadow-m: 0 2px 6px rgba(43, 37, 33, .07), 0 10px 28px rgba(43, 37, 33, .09);

  --container: 1120px;
  --header-h: 68px;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.18; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: .35em; }
small, .small { font-size: .85rem; color: var(--ink-faint); }
code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; padding: .1em .35em; font-size: .9em; }

/* ---------- Accessibility helpers ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus { left: 0; color: #fff; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 22px; }
.section { padding: 72px 0; }
.section--soft { background: var(--bg-soft); }
.section--tight { padding: 48px 0; }
.section-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.section-head p { color: var(--ink-soft); font-size: 1.08rem; }
.eyebrow {
  display: inline-block; font-family: var(--font-body); font-size: .78rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--teal);
  margin-bottom: .7rem;
}
.lead { font-size: 1.16rem; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 600 1rem/1 var(--font-body);
  padding: .85rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--secondary { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn--secondary:hover { background: var(--teal); color: #fff; }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn--lg { padding: 1.05rem 1.9rem; font-size: 1.06rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn-row--center { justify-content: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 246, 240, .92);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: 20px;
  height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; letter-spacing: -.01em; }
.brand__name em { font-style: normal; color: var(--accent); }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-block; padding: .55rem .8rem; border-radius: var(--radius-s);
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .98rem;
}
.site-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--accent-dark); font-weight: 700; }
.site-nav .btn { margin-left: 10px; padding: .62rem 1.15rem; }

/* Nav dropdown (Versions) */
.has-dropdown { position: relative; }
.nav-drop__toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .55rem .8rem; border: 0; border-radius: var(--radius-s);
  background: none; cursor: pointer; font: inherit;
  color: var(--ink-soft); font-weight: 500; font-size: .98rem;
}
.nav-drop__toggle:hover { background: var(--bg-soft); color: var(--ink); }
.nav-drop__toggle[data-current="true"] { color: var(--accent-dark); font-weight: 700; }
.nav-drop__caret { transition: transform .18s ease; }
.has-dropdown[data-open="true"] .nav-drop__caret { transform: rotate(180deg); }
.site-nav .nav-drop {
  position: absolute; top: calc(100% + 2px); left: 0; min-width: 264px; z-index: 60;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s);
  box-shadow: var(--shadow-m); padding: 6px;
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity .15s ease, visibility 0s linear .22s;
}
/* Invisible bridge across the gap, so slow mouse moves keep hover alive */
.site-nav .nav-drop::before {
  content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px;
}
.site-nav .has-dropdown[data-open="true"] .nav-drop {
  visibility: visible; opacity: 1; pointer-events: auto; transition: opacity .15s ease;
}
@media (min-width: 901px) {
  .site-nav .has-dropdown:hover .nav-drop,
  .site-nav .has-dropdown:focus-within .nav-drop {
    visibility: visible; opacity: 1; pointer-events: auto; transition: opacity .15s ease;
  }
}
.site-nav .nav-drop a { display: block; padding: .55rem .75rem; }
.site-nav .nav-drop__name { display: block; font-weight: 600; color: var(--ink); }
.site-nav .nav-drop__desc { display: block; font-size: .79rem; font-weight: 400; color: var(--ink-faint); }

.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: #fff; cursor: pointer; padding: 10px;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; height: 2px; background: var(--ink); border-radius: 2px; position: relative;
}
.nav-toggle span::before { position: absolute; top: -7px; width: 100%; }
.nav-toggle span::after { position: absolute; top: 7px; width: 100%; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 10px 22px 18px; display: none;
  }
  .site-nav[data-open="true"] { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a { display: block; padding: .8rem .9rem; }
  .site-nav .btn { margin: 10px 0 0; justify-content: center; }
  .site-nav .nav-drop__toggle { display: flex; width: 100%; justify-content: space-between; padding: .8rem .9rem; }
  .site-nav .nav-drop {
    position: static; min-width: 0; box-shadow: none; border: 0; border-radius: 0;
    padding: 2px 0 4px 16px;
    display: none; visibility: visible; opacity: 1; pointer-events: auto; transition: none;
  }
  .site-nav .has-dropdown[data-open="true"] .nav-drop { display: flex; }
  .site-nav .nav-drop::before { display: none; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding: 16px 0 0; font-size: .88rem; color: var(--ink-faint); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs li { margin: 0; display: flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: "›"; color: var(--line-strong); }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-dark); text-decoration: underline; }

/* ---------- Page hero (subpages) ---------- */
.page-hero { padding: 56px 0 8px; }
.page-hero .lead { max-width: 760px; }

/* ---------- Hero (home) ---------- */
.hero { padding: 72px 0 72px; overflow: hidden; }
.hero__intro { max-width: 780px; }
.hero h1 { margin-bottom: .35em; }
.hero .lead { max-width: 34em; }
.hero__ctas { margin-top: 28px; }
.hero__note { margin-top: 14px; font-size: .9rem; color: var(--ink-faint); }
.hero__showcase { position: relative; margin-top: 44px; }
.hero__showcase > img {
  width: 100%; border-radius: var(--radius-l); box-shadow: var(--shadow-m);
  border: 1px solid var(--line);
}
.hero__detail {
  position: absolute; right: 22px; bottom: 22px; margin: 0;
  width: clamp(150px, 24%, 260px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow-m);
}
.hero__detail img { border-radius: calc(var(--radius) - 6px); }
.hero__detail figcaption { font-size: .76rem; line-height: 1.4; color: var(--ink-faint); padding: 7px 4px 2px; }
@media (max-width: 620px) {
  .hero__detail {
    position: static; width: 100%; max-width: 280px; margin: 14px auto 0;
    display: flex; align-items: center; gap: 10px;
  }
  .hero__detail img { width: 84px; flex: none; }
  .hero__detail figcaption { padding: 0; }
}

/* Legacy two-column hero helpers (kept for reuse) */
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero__art { position: relative; }
.hero__art img {
  border-radius: var(--radius-l); box-shadow: var(--shadow-m);
  border: 1px solid var(--line);
}
.hero__art::before {
  content: ""; position: absolute; inset: -26px -26px auto auto; width: 150px; height: 150px;
  background: radial-gradient(circle at center, var(--gold) 0 38%, transparent 39%);
  opacity: .5; z-index: -1; border-radius: 50%;
}

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-s);
}
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card--link { display: block; text-decoration: none; color: inherit; transition: box-shadow .15s ease, transform .15s ease; }
.card--link:hover { box-shadow: var(--shadow-m); transform: translateY(-2px); color: inherit; }
.card--link h3 { color: var(--accent-dark); }
.card__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-dark); margin-bottom: 14px;
}
.card__icon--teal { background: var(--teal-soft); color: var(--teal); }
.card__icon--gold { background: var(--gold-soft); color: #9a6a08; }
.card .more { font-weight: 600; color: var(--accent-dark); font-size: .95rem; }

/* Split feature block */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center; }
.split--rev > :first-child { order: 2; }
.split img { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-s); }

/* Version cards (home section 2) */
.version-card { position: relative; overflow: hidden; }
.version-card::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--accent);
}
.version-card--teal::after { background: var(--teal); }
.version-card ul { color: var(--ink-soft); }

/* Steps */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 12px;
}
.step h3 { font-size: 1.05rem; margin-bottom: .3em; }
.step p { color: var(--ink-soft); font-size: .95rem; margin: 0; }

/* Comparison table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-s); }
table.compare { border-collapse: collapse; width: 100%; min-width: 640px; }
.compare th, .compare td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { background: var(--bg-soft); font-family: var(--font-display); font-size: 1.05rem; }
.compare tbody tr:last-child td, .compare tbody tr:last-child th { border-bottom: 0; }
.compare tbody th { font-weight: 600; color: var(--ink); }
.pill { display: inline-block; padding: .12em .6em; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.pill--yes { background: var(--teal-soft); color: var(--teal); }
.pill--no { background: #f6e3e1; color: var(--danger); }
.pill--tbc { background: var(--gold-soft); color: #8a6107; }

/* FAQ */
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 600; font-size: 1.02rem;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.4rem; color: var(--accent); flex: none; }
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-a { padding: 0 22px 18px; color: var(--ink-soft); }
.faq-item .faq-a p:last-child { margin-bottom: 0; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gallery-grid--preview { grid-template-columns: repeat(3, 1fr); }
.gallery-item {
  margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: var(--card); box-shadow: var(--shadow-s);
}
.gallery-item button { all: unset; cursor: zoom-in; display: block; width: 100%; }
.gallery-item button:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }
.gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .25s ease; }
.gallery-item button:hover img { transform: scale(1.03); }
.gallery-item figcaption { padding: 10px 14px; font-size: .85rem; color: var(--ink-faint); }

dialog.lightbox {
  border: 0; padding: 0; border-radius: var(--radius); max-width: min(92vw, 1100px);
  background: #181410; color: #f5efe6; box-shadow: var(--shadow-m);
}
dialog.lightbox::backdrop { background: rgba(24, 20, 16, .82); }
dialog.lightbox .lightbox__stage {
  overflow: hidden; max-height: 78vh; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius) var(--radius) 0 0;
}
dialog.lightbox img {
  max-height: 78vh; width: auto; max-width: 92vw; margin: 0;
  touch-action: none; user-select: none; -webkit-user-drag: none; cursor: zoom-in;
}
dialog.lightbox .lightbox__bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 12px 16px; font-size: .9rem; }
dialog.lightbox .lightbox__caption { flex: 1; }
dialog.lightbox .lightbox__hint { opacity: .5; font-size: .78rem; white-space: nowrap; }
dialog.lightbox .lightbox__zoom { font-variant-numeric: tabular-nums; opacity: .8; min-width: 3.2em; text-align: right; }
@media (max-width: 640px) { dialog.lightbox .lightbox__hint { display: none; } }
dialog.lightbox button.lightbox__close {
  all: unset; cursor: pointer; font-size: 1.5rem; line-height: 1; padding: 6px 10px; border-radius: 8px; color: #f5efe6;
}
dialog.lightbox button.lightbox__close:hover { background: rgba(255,255,255,.12); }

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff; border-radius: var(--radius-l); padding: 56px 40px; text-align: center;
  box-shadow: var(--shadow-m);
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.88); max-width: 40em; margin: 0 auto 26px; }
.cta-band .btn--primary { background: #fff; color: var(--accent-dark); }
.cta-band .btn--primary:hover { background: var(--gold-soft); }
.cta-band .btn--secondary { color: #fff; border-color: rgba(255,255,255,.75); }
.cta-band .btn--secondary:hover { background: rgba(255,255,255,.14); color: #fff; }

/* Pricing */
.price-card { text-align: center; padding: 40px 30px; position: relative; }
.price-card .price { font-family: var(--font-display); font-size: 3rem; font-weight: 700; color: var(--ink); }
.price-card .price small { font-size: 1.05rem; font-family: var(--font-body); color: var(--ink-faint); font-weight: 500; }
.price-card ul { text-align: left; margin: 22px 0; }
.note-box {
  border: 1px dashed var(--line-strong); background: var(--gold-soft);
  border-radius: var(--radius); padding: 16px 20px; font-size: .95rem; color: #6b5312;
}
.note-box strong { color: #5c450c; }

/* Article (learn) */
.article { max-width: 760px; margin: 0 auto; }
.article h2 { margin-top: 1.6em; }
.article img { border-radius: var(--radius); border: 1px solid var(--line); margin: 18px 0; }
.article-meta { color: var(--ink-faint); font-size: .9rem; margin-bottom: 26px; }

/* Footer */
.site-footer { background: #241f1b; color: #cfc5b8; margin-top: 80px; }
.site-footer a { color: #e8dfd2; text-decoration: none; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.site-footer__grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; padding: 56px 0 36px;
}
.site-footer h2, .site-footer h3 { color: #fff; font-size: 1rem; font-family: var(--font-body); font-weight: 700; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; font-size: .95rem; }
.site-footer__brand p { font-size: .92rem; max-width: 30em; }
.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding: 20px 0 26px;
  font-size: .85rem; color: #9c9184; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 12px; color: #fff; }

/* Responsive */
@media (max-width: 980px) {
  .hero__grid, .split, .split--rev { grid-template-columns: 1fr; gap: 34px; }
  .split--rev > :first-child { order: 0; }
  .grid--4, .steps { grid-template-columns: repeat(2, 1fr); }
  .grid--3, .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .section { padding: 52px 0; }
  .hero { padding: 48px 0; }
  .grid--2, .grid--3, .grid--4, .steps, .gallery-grid, .gallery-grid--preview { grid-template-columns: 1fr; }
  .cta-band { padding: 40px 22px; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 26px; }
  .btn-row .btn { flex: 1 1 auto; justify-content: center; }
}
