/* Dive2SSI — styled to match bilalunderwater.com
 * Palette from the main site: deep green-teal #014844, dark teal #013F4E,
 * button teal #005E68, soft aqua #AFD6D4, warm sand #E5DECE.
 * Type: Marcellus (headings) + Afacad (body), like the main site.
 * Fonts are self-hosted (assets/fonts/) so the site stays fully offline. */
@font-face {
  font-family: 'Marcellus'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/marcellus-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Afacad'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/afacad-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Afacad'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/afacad-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Afacad'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('fonts/afacad-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Afacad'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('fonts/afacad-latin-700-normal.woff2') format('woff2');
}
:root {
  --brand: #014844;        /* headings & primary text (site's deep green-teal) */
  --brand-dark: #013F4E;   /* dark sections / footer */
  --teal: #005E68;         /* buttons (site's pill buttons) */
  --teal-hover: #01737e;
  --aqua: #AFD6D4;         /* site background */
  --aqua-soft: #c8e2e0;
  --sand: #E5DECE;         /* warm sand sections */
  --sand-soft: #F3EFE5;
  --paper: #FFFDF8;        /* cards */
  --ink: #123f3c;
  --muted: #476b68;
  --ok: #0e7c5b;
  --warn: #a6621b;
  --err: #b3372b;
  --radius: 16px;
  --font-display: 'Marcellus', 'Times New Roman', serif;
  --font-body: 'Afacad', 'Segoe UI', -apple-system, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--ink);
  background: var(--aqua);
  line-height: 1.6;
}
a { color: var(--teal); }
code {
  background: var(--sand-soft); border: 1px solid var(--sand);
  padding: 1px 7px; border-radius: 6px; font-size: 0.9em;
}

/* Header — dark teal band like the site's footer/hero overlays */
.site-header {
  background: linear-gradient(170deg, var(--brand-dark) 0%, #02525d 100%);
  color: #fff;
  padding: 30px 22px 36px;
}
.site-header .inner, main, .site-footer .inner { max-width: 1080px; margin: 0 auto; }
.logo-link { display: inline-block; margin-bottom: 14px; }
.site-logo { height: 62px; width: auto; display: block; }

/* Brand logo chips (hub cards + brand headers) */
.brand-logo {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px; min-width: 92px; padding: 6px 12px; border-radius: 10px;
  vertical-align: middle;
}
.brand-logo img { max-height: 30px; max-width: 130px; width: auto; object-fit: contain; display: block; }
.brand-logo.tone-light { background: #ffffff; border: 1px solid var(--sand); }
.brand-logo.tone-dark { background: var(--brand-dark); border: 1px solid var(--brand); }
.brand-logo-text {
  font-family: var(--font-display); letter-spacing: 1px; font-size: 1.05rem; text-transform: uppercase;
}
.brand-logo-text.tone-light { color: var(--brand); }
.brand-logo-text.tone-dark { color: #fff; }
.hub-card .brand-logo { height: 52px; }
.site-header .brand-mark .brand-logo { height: 40px; min-width: 78px; }
.site-header .brand-logo.tone-light { background: #fff; }

/* Hero (home) */
.eyebrow {
  font-family: var(--font-body); text-transform: uppercase; letter-spacing: 2.5px;
  font-size: 0.82rem; color: var(--aqua); margin: 0 0 14px; font-weight: 600;
}
.hero-title { margin: 0 0 14px; line-height: 1.05; }
.hero-title span { display: block; font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 6vw, 3.7rem); letter-spacing: -0.5px; }
.hero-title .accent { color: var(--aqua); }
.hero-cta { margin-top: 22px; }
.hub-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.fmt-chips { font-size: 0.76rem; letter-spacing: 0.5px; color: var(--muted); font-weight: 600; }

/* Stat band */
.stat-band {
  display: flex; gap: 30px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(150deg, var(--brand-dark), #02525d);
  color: #fff; border-radius: var(--radius); padding: 34px 34px;
}
.stat-figure { font-family: var(--font-display); font-size: clamp(3.4rem, 9vw, 5.6rem); line-height: 1; color: var(--aqua); }
.stat-copy { flex: 1 1 340px; }
.stat-copy h2 { color: #fff; margin: 4px 0 8px; }
.stat-copy .eyebrow { color: var(--aqua); }
.stat-copy .d2s-muted { color: var(--aqua-soft); }
.mt0 { margin-top: 0; }
.adv-toggle-row { margin: 14px 0 0; }
.cta-row { margin-top: 16px; }
.d2s-btn-link { text-decoration: none; display: inline-block; }
.cta-panel h2 { margin-top: 0; }
.wordmark {
  font-family: var(--font-display);
  letter-spacing: 3px; font-size: 0.86rem; text-transform: uppercase;
  color: var(--aqua); margin-bottom: 18px;
}
.wordmark a { color: var(--aqua); text-decoration: none; }
.wordmark a:hover { color: #fff; }
.wordmark .sep { opacity: 0.5; margin: 0 8px; }
.site-header h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.1rem);
  letter-spacing: -0.5px;
  color: #fff;
}
.site-header p.tagline {
  margin: 0; max-width: 64ch; color: var(--aqua-soft);
  font-size: 1.08rem;
}
.brand-mark { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark .bubble { font-size: 1.2em; }

main { padding: 34px 22px 70px; }
section { margin-bottom: 40px; }
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: -0.3px;
  margin: 0 0 14px;
  color: var(--brand);
}
.d2s-muted { color: var(--muted); }

/* Panels — warm paper cards on the aqua background, like the site's sand sections */
.panel {
  background: var(--paper);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: 0 2px 10px rgba(1, 63, 78, 0.07);
}
.panel + .panel { margin-top: 18px; }
.panel h2 { margin-top: 0; }
.callout {
  border-left: 4px solid var(--teal);
  background: var(--sand-soft);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 14px 0;
}
.callout.good { border-left-color: var(--ok); background: #eaf4ee; }
.callout.warn { border-left-color: var(--warn); background: #f8efdd; }
.steps { padding-left: 1.3em; margin: 10px 0; }
.steps li { margin: 7px 0; }

/* Drop zone */
.d2s-dropzone {
  border: 2px dashed var(--teal);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 44px 22px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  outline: none;
}
.d2s-dropzone:hover, .d2s-dropzone:focus-visible, .d2s-dragover {
  background: var(--sand-soft);
  border-color: var(--brand);
}
.d2s-dropzone .big { font-size: 2.3rem; display: block; margin-bottom: 8px; }
.d2s-dropzone strong { color: var(--brand); font-size: 1.12rem; }
.d2s-formats { font-size: 0.94rem; color: var(--muted); margin-top: 8px; }

/* Options */
.d2s-options { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end; margin-top: 4px; }
.d2s-field { display: flex; flex-direction: column; gap: 5px; font-size: 0.95rem; color: var(--muted); }
.d2s-field input, .d2s-field select {
  padding: 9px 12px; border: 1px solid var(--sand); border-radius: 10px;
  font-size: 1rem; font-family: var(--font-body);
  background: #fff; color: var(--ink); min-width: 155px;
}
.d2s-field input:focus, .d2s-field select:focus { outline: 2px solid var(--aqua); border-color: var(--teal); }
#d2s-advanced-toggle {
  background: none; border: none; color: var(--teal); cursor: pointer; padding: 0;
  font-size: 0.98rem; font-family: var(--font-body); text-decoration: underline;
}
#d2s-advanced { margin-top: 12px; }

/* Results table */
.d2s-summary-main { margin: 8px 0; font-size: 1.05rem; }
.d2s-error { color: var(--err); margin: 4px 0; font-size: 0.95rem; }
.d2s-table-wrap { overflow-x: auto; border: 1px solid var(--sand); border-radius: var(--radius); background: var(--paper); }
.d2s-table { border-collapse: collapse; width: 100%; font-size: 0.94rem; min-width: 920px; }
.d2s-table th {
  text-align: left; padding: 12px 9px;
  background: var(--sand); color: var(--brand);
  font-family: var(--font-body); font-weight: 600;
  position: sticky; top: 0; white-space: nowrap;
}
.d2s-table td { padding: 7px 9px; border-top: 1px solid var(--sand-soft); }
.d2s-table tbody tr:nth-child(even) { background: #fbf8f1; }
.d2s-in {
  border: 1px solid var(--sand); border-radius: 8px; padding: 6px 7px;
  font-size: 0.92rem; font-family: var(--font-body); background: #fff; color: var(--ink);
}
.d2s-in-num { width: 78px; }
.d2s-in-dt { width: 182px; }
.d2s-in-type { width: 132px; }
.d2s-notes { font-size: 0.86rem; color: var(--muted); max-width: 230px; }

.d2s-genbar { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* Buttons — pill-shaped like the main site */
.d2s-btn {
  border-radius: 300px;
  padding: 11px 26px;
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, transform 0.08s;
}
.d2s-btn:active { transform: scale(0.98); }
.d2s-btn-primary { background: var(--teal); color: #fff; font-weight: 600; }
.d2s-btn-primary:hover { background: var(--teal-hover); }
.d2s-btn-primary:disabled { background: #8fb4b1; cursor: not-allowed; }
.d2s-btn-ghost { background: var(--paper); border-color: var(--teal); color: var(--teal); }
.d2s-btn-ghost:hover { background: var(--sand-soft); }
.d2s-btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }

/* QR gallery */
.d2s-gallery-head { margin-top: 34px; }
.d2s-gallery-tools { display: flex; gap: 12px; margin: 12px 0 4px; flex-wrap: wrap; }
.d2s-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  margin-top: 16px;
}
.d2s-card {
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
  transition: opacity 0.15s, box-shadow 0.12s;
  box-shadow: 0 2px 8px rgba(1, 63, 78, 0.06);
}
.d2s-card canvas { max-width: 100%; height: auto; cursor: zoom-in; border-radius: 6px; }
.d2s-card-title {
  font-family: var(--font-display);
  color: var(--brand); margin-top: 8px; font-size: 1.02rem;
}
.d2s-card-meta { color: var(--muted); font-size: 0.9rem; margin-top: 3px; min-height: 1.2em; }
.d2s-scanned-label {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 10px;
  font-size: 0.95rem; color: var(--muted); cursor: pointer;
}
.d2s-scanned-cb { accent-color: var(--teal); width: 16px; height: 16px; }
.d2s-done { opacity: 0.32; }
.d2s-done canvas { filter: grayscale(1); }

/* Focus / scan-one-by-one modal */
.d2s-modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(1, 63, 78, 0.82);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.d2s-modal[hidden] { display: none; }
.d2s-noscroll { overflow: hidden; }
.d2s-modal-box {
  background: #fff; border-radius: 20px;
  padding: 26px 28px 20px;
  max-width: 560px; width: 100%;
  text-align: center; position: relative;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}
.d2s-modal-close {
  position: absolute; top: 10px; right: 16px;
  background: none; border: none; font-size: 2rem; line-height: 1;
  color: var(--muted); cursor: pointer;
}
.d2s-modal-close:hover { color: var(--err); }
.d2s-modal-counter { font-size: 0.95rem; color: var(--muted); margin-bottom: 6px; }
.d2s-modal-qr { max-width: 100%; height: auto; }
.d2s-modal-title { font-family: var(--font-display); font-size: 1.35rem; color: var(--brand); margin-top: 8px; }
.d2s-modal-meta { color: var(--muted); margin-top: 2px; }
.d2s-modal-nav { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.d2s-modal-hint { font-size: 0.82rem; color: var(--muted); margin: 14px 0 0; }

/* Hub cards */
.hub-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); }
.hub-card {
  background: var(--paper);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none; color: var(--ink);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  display: block;
  box-shadow: 0 2px 8px rgba(1, 63, 78, 0.06);
}
.hub-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(1, 63, 78, 0.14); border-color: var(--teal); }
.hub-card .emoji { font-size: 1.7rem; }
.hub-card h3 {
  margin: 10px 0 4px;
  font-family: var(--font-display); font-weight: 400; font-size: 1.35rem;
  color: var(--brand);
}
.hub-card p { margin: 0; font-size: 0.94rem; color: var(--muted); }
.hub-card .badge {
  display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.4px;
  background: var(--aqua); color: var(--brand-dark); border-radius: 300px; padding: 3px 13px; margin-top: 10px;
}
.hub-card .badge.native { background: #d7ecdf; color: var(--ok); }

.how-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.how-step {
  background: var(--sand-soft);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  padding: 20px;
}
.how-step .n {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--teal); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.05rem;
  margin: 0 10px 10px 0; vertical-align: middle;
}
.how-step strong { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; color: var(--brand); }

details.faq {
  background: var(--paper);
  border: 1px solid var(--sand);
  border-radius: 12px;
  padding: 14px 18px; margin: 10px 0;
}
details.faq summary { cursor: pointer; font-weight: 600; color: var(--brand); }
details.faq summary:hover { color: var(--teal); }
details.faq p { margin: 10px 0 2px; }

/* Footer — dark teal like the main site */
.site-footer { background: var(--brand-dark); color: var(--aqua); padding: 30px 22px; font-size: 0.92rem; }
.site-footer a { color: #fff; }
.site-footer p { margin: 7px 0; }
.site-footer .foot-mark { font-family: var(--font-display); letter-spacing: 3px; text-transform: uppercase; font-size: 0.85rem; margin-bottom: 12px; color: var(--aqua); }

/* Print: QR cards only, big and paginated */
@media print {
  body { background: #fff; }
  .site-header, .site-footer, .panel, .d2s-dropzone, #d2s-results, .d2s-gallery-tools, .d2s-scanned-label, .d2s-modal, .noprint { display: none !important; }
  main { padding: 0; max-width: none; }
  .d2s-gallery-head h2, .d2s-gallery-head p { display: none; }
  .d2s-grid { grid-template-columns: repeat(2, 1fr); gap: 8mm; }
  .d2s-card { border: 1px solid #ccc; page-break-inside: avoid; box-shadow: none; }
  .d2s-done { opacity: 1; }
  .d2s-done canvas { filter: none; }
}

@media (max-width: 640px) {
  .d2s-options { flex-direction: column; align-items: stretch; }
  .d2s-modal-box { padding: 20px 14px 16px; }
}
