/* ==========================================================================
   CADER — site styles
   Everything here is what does not belong in a Tailwind utility class:
   layout wrapper, screenshot frames, scroll-in motion, print, reduced motion.
   ========================================================================== */

:root {
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #5c6b80;          /* >=5:1 on white and on --surface */
  --line: #e2e8f0;
  --surface: #f7f8fa;
  --brand: #1978e5;          /* accent fills, markers, focus ring */
  --brand-text: #1565c4;     /* brand blue for text and buttons: >=4.5:1 on white */
  --brand-dark: #11529e;
  --shot-bg: #0b1220;
  --wrap-pad: 1.25rem;       /* single source of truth: .wrap padding and full-bleed */
}
@media (min-width: 640px)  { :root { --wrap-pad: 1.5rem; } }
@media (min-width: 1024px) { :root { --wrap-pad: 2rem; } }

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; }

/* Anchors sit below the sticky header ------------------------------------ */
:target,
section[id],
h2[id] { scroll-margin-top: 6rem; }

/* Tabbing must not park a control under the sticky header ---------------- */
a, button, summary, [tabindex] { scroll-margin-top: 5.5rem; }

/* Visually hidden. Tailwind ships this too; repeated here so the page still
   behaves if the utility stylesheet is unavailable. --------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip link -------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-radius: 0 0 0.5rem 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Focus ------------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
.on-dark :focus-visible,
.band-dark :focus-visible { outline-color: #7db3f2; }

/* Layout ----------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--wrap-pad);
  padding-right: var(--wrap-pad);
}

.wrap-narrow { max-width: 780px; }

/* Hero ------------------------------------------------------------------- */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: -8rem 0 auto 0;
  height: 40rem;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(48% 60% at 18% 8%, rgba(25, 120, 229, 0.12), transparent 68%),
    radial-gradient(38% 50% at 82% 0%, rgba(15, 23, 42, 0.06), transparent 70%);
}

.hero-points { list-style: none; margin: 0; padding: 0; }
.hero-points > li { position: relative; padding-left: 1.05rem; }
.hero-points > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.45rem;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

/* Dark bands: flat ink reads as a void, so give them one soft light source */
.band-dark {
  position: relative;
  background-image:
    radial-gradient(58% 46% at 12% 0%, rgba(37, 99, 235, 0.18), transparent 62%),
    radial-gradient(46% 38% at 96% 4%, rgba(56, 189, 248, 0.07), transparent 66%);
}

/* Header ----------------------------------------------------------------- */
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-link:hover { color: var(--ink); background: var(--surface); }
.nav-link[aria-current="page"] { color: var(--ink); font-weight: 600; }

.nav-link-mobile {
  display: block;
  padding: 0.75rem 0.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.nav-link-mobile[aria-current="page"] { color: var(--brand-text); }

/* Menu button: one glyph per state, driven by aria-expanded */
[data-nav-toggle] .icon-close { display: none; }
[data-nav-toggle][aria-expanded="true"] .icon-open { display: none; }
[data-nav-toggle][aria-expanded="true"] .icon-close { display: block; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.625rem 1.05rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--brand-text);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16), 0 8px 18px -10px rgba(21, 101, 196, 0.6);
}
.btn-primary:hover { background: var(--brand-dark); }

.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface); border-color: #cbd5e1; }

.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #e8eef6; }

.btn-outline-dark { background: transparent; color: #e2e8f0; border-color: rgba(226, 232, 240, 0.28); }
.btn-outline-dark:hover { background: rgba(226, 232, 240, 0.09); border-color: rgba(226, 232, 240, 0.5); }

.btn-lg { padding: 0.8rem 1.35rem; font-size: 1rem; }

/* Language switcher ------------------------------------------------------ */
.lang {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fff;
}
.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.lang-btn:hover { color: var(--ink); background: var(--surface); }
.lang-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Screenshot frames ------------------------------------------------------ */
.shot {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--shot-bg);
  border: 1px solid rgba(148, 163, 184, 0.34);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.10),
    0 18px 40px -16px rgba(15, 23, 42, 0.30),
    0 52px 90px -40px rgba(15, 23, 42, 0.45);
}
.shot-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  background: #111c2e;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.shot-dot {
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background: #334155;
  flex: none;
}
.shot-tab {
  margin-left: 0.6rem;
  min-width: 0;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shot-view { display: block; }
.shot-img {
  display: block;
  width: 100%;
  height: auto;
}

/* Dark mat, for screenshots placed on a light section.
   It has to differ from the frame it holds, otherwise it just makes the
   black rectangle bigger. */
.shot-mat {
  background: linear-gradient(158deg, #1c2b46 0%, #121e33 46%, #0b1220 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 0.75rem;
  box-shadow: 0 24px 60px -34px rgba(15, 23, 42, 0.55);
}
@media (min-width: 768px) { .shot-mat { padding: 1.25rem; } }

.shot-cap {
  margin: 0.85rem 0 0;
  max-width: 78ch;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}
.shot-cap-dark { color: #94a3b8; }

/* Below md the screenshot frame goes edge to edge so the image gets the full
   width of the phone. It is scaled to fit: a panned image reads as a broken,
   cropped one, and half of it never gets seen. */
@media (max-width: 767px) {
  .shot-figure { margin-left: calc(var(--wrap-pad) * -1); margin-right: calc(var(--wrap-pad) * -1); }
  .shot-figure .shot-mat {
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .shot-figure .shot {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
  .shot-figure .shot-cap { padding-left: var(--wrap-pad); padding-right: var(--wrap-pad); }

  .shot-view { overflow: hidden; }
  .shot-view > .shot-img {
    width: 100%;
    max-width: 100%;
  }
}

/* Cards ------------------------------------------------------------------ */
.card-grid { counter-reset: card; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.35rem 1.35rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -18px rgba(15, 23, 42, 0.4);
}
.card-grid > .card { counter-increment: card; }
.card-grid > .card::before {
  content: counter(card, decimal-leading-zero);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-desc {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted);
}
.card-more {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 1.0625rem;
  line-height: 1.1;
  font-weight: 600;
  color: var(--brand-text);
  transition: transform 0.15s ease;
}
.card:hover .card-more { transform: translateX(3px); }

.card-dark {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.035);
  padding: 1.35rem;
}

/* Bullets ---------------------------------------------------------------- */
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks > li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.7rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #334155;
}
.ticks > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62rem;
  width: 0.6rem;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
}
.ticks-dark > li { color: #cbd5e1; }
.ticks-dark > li::before { background: #60a5fa; }

/* Numbered steps --------------------------------------------------------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.4rem;
  margin-bottom: 1.1rem;
  font-size: 1rem;
  line-height: 1.7;
  color: #334155;
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brand-text);
  font-variant-numeric: tabular-nums;
}

/* Tables ----------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
}
.table-wrap-dark {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.03);
}
.fmt {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.fmt th {
  text-align: left;
  padding: 0.85rem 1.1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.fmt td {
  padding: 0.85rem 1.1rem;
  vertical-align: top;
  line-height: 1.55;
  color: #475569;
  border-bottom: 1px solid var(--line);
}
.fmt tr:last-child td { border-bottom: 0; }
.fmt td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }

.fmt-dark th { color: #94a3b8; border-bottom-color: rgba(148, 163, 184, 0.3); }
.fmt-dark td { color: #cbd5e1; border-bottom-color: rgba(148, 163, 184, 0.16); }
.fmt-dark td:first-child { color: #fff; }

/* Three prose columns cannot survive a phone. Below md each row becomes a
   card: name, format, note. Explicit ARIA roles keep the table semantics
   that `display: block` would otherwise throw away. */
@media (max-width: 767px) {
  .table-wrap,
  .table-wrap-dark {
    overflow-x: visible;
    border: 0;
    border-radius: 0;
    background: none;
  }
  .fmt { min-width: 0; display: block; }
  .fmt thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .fmt tbody { display: block; }
  .fmt tr {
    display: block;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: #fff;
  }
  .fmt tr + tr { margin-top: 0.6rem; }
  .fmt td,
  .fmt tr:last-child td {
    display: block;
    padding: 0;
    border: 0;
  }
  .fmt td:first-child {
    white-space: normal;
    font-size: 1rem;
    line-height: 1.4;
  }
  .fmt td.mono {
    margin-top: 0.4rem;
    white-space: normal;
    font-size: 0.8125rem;
    color: var(--brand-text);
  }
  .fmt td:last-child { margin-top: 0.5rem; }

  .fmt-dark tr {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(148, 163, 184, 0.22);
  }
  .fmt-dark td.mono { color: #93c5fd; }
}

.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.875em;
  white-space: nowrap;
}

/* Timeline (About) ------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
  position: relative;
  padding: 0 0 2rem 2rem;
  border-left: 1px solid var(--line);
}
.timeline > li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.45rem;
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background: var(--brand);
}

/* Placeholder marker ----------------------------------------------------- */
.placeholder {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px dashed #f59e0b;
  border-radius: 0.3rem;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.placeholder-dark {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fcd34d;
}

/* Inline link ------------------------------------------------------------ */
.link {
  color: var(--brand-text);
  text-decoration: none;
  border-bottom: 1px solid rgba(21, 101, 196, 0.35);
  font-weight: 500;
}
.link:hover { border-bottom-color: var(--brand-text); }
.link-dark { color: #7db3f2; border-bottom-color: rgba(125, 179, 242, 0.4); }
.link-dark:hover { border-bottom-color: #7db3f2; }

/* Rules and eyebrows ----------------------------------------------------- */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow-brand { color: var(--brand-text); }
.eyebrow-dark { color: #94a3b8; }

.index-num {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Chip nav (Product page) ------------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover { border-color: #cbd5e1; color: var(--ink); background: var(--surface); }

/* Scroll-in motion ------------------------------------------------------- */
/* Only applied when JavaScript is running, so content is never hidden if
   the script does not load. */
html.js .reveal {
  opacity: 0;
  translate: 0 14px;
  transition: opacity 0.5s ease-out, translate 0.5s ease-out;
}
html.js .reveal.is-visible {
  opacity: 1;
  translate: 0 0;
}

/* Reduced motion --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal,
  html.js .reveal.is-visible {
    opacity: 1;
    translate: none;
    transition: none;
  }
  .card:hover { transform: none; }
  .card:hover .card-more { transform: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print ------------------------------------------------------------------ */
@media print {
  .site-header,
  .lang,
  .skip-link,
  .no-print { display: none !important; }

  body { background: #fff; color: #000; }

  /* Scroll-in elements never get their observer callback on a print render */
  html.js .reveal {
    opacity: 1 !important;
    translate: none !important;
  }

  .band-dark {
    background: #fff !important;
    background-image: none !important;
    color: #000 !important;
  }
  .hero::before { display: none !important; }
  .band-dark h1,
  .band-dark h2,
  .band-dark h3,
  .band-dark p,
  .band-dark li,
  .band-dark td { color: #000 !important; }

  .shot { box-shadow: none; border: 1px solid #cbd5e1; }
  .shot::after { display: none !important; }
  .shot-figure { margin-left: 0; margin-right: 0; }
  .shot-view { overflow: visible !important; }
  .shot-view > .shot-img { width: 100%; min-width: 0; max-width: 100%; }
  .shot-mat { background: none; border: 0; box-shadow: none; padding: 0; }
  .card, .card-dark { break-inside: avoid; }
  figure { break-inside: avoid; }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #444;
  }
}

/* ---------- contact form ---------- */
.field-label{display:block;font-size:.8125rem;font-weight:600;color:var(--text);margin-bottom:.375rem}
.field{width:100%;border:1px solid var(--line);border-radius:.625rem;background:#fff;color:var(--text);
  padding:.625rem .75rem;font:inherit;font-size:.9375rem;line-height:1.5;transition:border-color .15s,box-shadow .15s}
.field:hover{border-color:#cbd5e1}
.field:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(25,120,229,.15)}
.field[aria-invalid="true"]{border-color:#dc2626}
.field[aria-invalid="true"]:focus{box-shadow:0 0 0 3px rgba(220,38,38,.15)}
textarea.field{resize:vertical;min-height:5.5rem}
.form-status{margin:0;font-size:.875rem;line-height:1.5;min-height:1.25rem}
.form-status[data-state="error"]{color:#b91c1c}
.form-status[data-state="ok"]{color:#15803d}
