/* Rubberduck Me — the whole site's styles.
 *
 * The Content-Security-Policy served by CloudFront is `style-src 'self'`, which
 * blocks inline <style> blocks and style="" attributes alike. Everything has to
 * live here, and the pages ship no JavaScript at all. Keep it that way: the CSP
 * is the reason it can be as strict as `default-src 'none'`.
 *
 * Palette is the extension overlay's, so the site and the product look related.
 * Yellow is a fill and border colour only — #ffd93b on white is nowhere near
 * WCAG AA, so it never carries text.
 */

:root {
  --duck: #ffd93b;
  --duck-deep: #ffc61a;
  --stroke: #e0a800;
  --beak: #ff9f1a;

  --bg: #fffdf5;
  --surface: #fffefa;
  --ink: #1f2328;
  --muted: #59636e;
  --border: #e8e0c8;
  --link: #7d5e00;
  --shadow: 0 6px 24px rgb(31 35 40 / 8%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1b1e24;
    --ink: #e6e8eb;
    --muted: #9aa4b2;
    --border: #2c313a;
    /* Yellow has plenty of contrast on a dark ground, so links can use the
       brand colour here where they could not on cream. */
    --link: #ffd93b;
    --shadow: 0 6px 24px rgb(0 0 0 / 40%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- layout ---------- */

.wrap {
  width: min(1080px, 100% - 2.5rem);
  margin-inline: auto;
}

/* Long-form prose wants a much narrower measure than a marketing grid. */
.prose {
  width: min(70ch, 100% - 2.5rem);
  margin-inline: auto;
}

section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 2px solid var(--stroke);
  border-radius: 8px;
}

/* ---------- type ---------- */

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  margin: 0 0 1rem;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
}

p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: color-mix(in srgb, var(--stroke) 12%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.lede {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 46ch;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.92rem;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  display: block;
}

.nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .nav {
    display: none;
  }
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-duck {
    order: -1;
  }
}

.hero-duck {
  width: clamp(140px, 22vw, 210px);
  height: auto;
  filter: drop-shadow(0 6px 14px rgb(31 35 40 / 18%));
}

/* ---------- calls to action ---------- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-block: 1.5rem 0.75rem;
}

.cta {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid var(--stroke);
  background: var(--duck);
  color: #4a3b00;
}

.cta:hover {
  background: #ffe36b;
}

/* The pre-launch state. Not a <button disabled>: that drops out of the tab
   order, so nobody using a keyboard or screen reader can reach it to find out
   why it is unavailable. */
.cta--soon {
  background: transparent;
  color: var(--muted);
  border-style: dashed;
  cursor: default;
}

.cta--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.cta--ghost:hover {
  background: color-mix(in srgb, var(--duck) 18%, transparent);
}

/* ---------- generic cards / grids ---------- */

.grid-3 {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
}

.card p:last-child {
  margin-bottom: 0;
}

/* A left rule in duck yellow — the one place the brand colour carries weight
   without carrying text. */
.rule-left {
  border-left: 4px solid var(--duck);
  padding-left: 1rem;
}

/* ---------- screenshot rows ---------- */

.shot {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.shot:last-child {
  margin-bottom: 0;
}

.shot img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* Alternate sides on wide screens; stack in source order when narrow.
   The rows live in their own .shots wrapper so nth-child counts only shots —
   counting them among the section's other children offsets the alternation. */
.shot:nth-child(even) .shot-figure {
  order: 2;
}

@media (max-width: 820px) {
  .shot {
    grid-template-columns: 1fr;
  }
  .shot:nth-child(even) .shot-figure {
    order: 0;
  }
}

figure {
  margin: 0;
}

/* ---------- two-column explainer ---------- */

.cols-2 {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.stack-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.stack-list li:last-child {
  border-bottom: 0;
}

/* ---------- FAQ ---------- */

.faq {
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 650;
  list-style-position: outside;
}

.faq summary::marker {
  color: var(--stroke);
}

.faq details p {
  margin-top: 0.75rem;
  margin-bottom: 0;
  color: var(--muted);
}

/* ---------- tables (privacy retention) ---------- */

.table-scroll {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: color-mix(in srgb, var(--duck) 16%, transparent);
  font-weight: 650;
  white-space: nowrap;
}

/* ---------- callout ---------- */

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--duck);
  border-radius: 0 12px 12px 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.callout :last-child {
  margin-bottom: 0;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 2.5rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
}

.site-footer nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

@media (max-width: 560px) {
  .site-footer nav {
    margin-left: 0;
  }
}

/* ---------- legal pages ---------- */

.legal h2 {
  margin-top: 2.5rem;
  padding-top: 0.5rem;
  font-size: 1.35rem;
}

.legal h2:first-of-type {
  margin-top: 1.5rem;
}

.legal ul {
  padding-left: 1.2rem;
}

.legal li {
  margin-bottom: 0.4rem;
}

.updated {
  color: var(--muted);
  font-size: 0.93rem;
}
