/* Couchpad site: the app's etched-glass look on an aluminium frame, in a light and a dark variant. */

:root {
  color-scheme: light dark;
  --frame-top: #cfcfd3;
  --frame-bottom: #a7a7ae;
  --glass-top: #f5f4f0;
  --glass-bottom: #eae9e4;
  --glass-edge: rgba(255, 255, 255, 0.95);
  --glass-inner: rgba(0, 0, 0, 0.1);
  --shadow: rgba(0, 0, 0, 0.3);
  --ink: rgba(0, 0, 0, 0.8);
  --ink-soft: rgba(0, 0, 0, 0.62);
  --etch: rgba(0, 0, 0, 0.5);
  --etch-light: rgba(255, 255, 255, 0.95);
  --etch-dark: rgba(0, 0, 0, 0.22);
  --rule-dark: rgba(0, 0, 0, 0.13);
  --rule-light: rgba(255, 255, 255, 0.95);
  --pill: rgba(0, 0, 0, 0.055);
  --pill-edge: rgba(0, 0, 0, 0.14);
  --raised-top: #faf9f6;
  --raised-bottom: #e5e4df;
  --raised-edge: rgba(0, 0, 0, 0.2);
  --link: #6e5206;
  --accent: #dba72b;
  --wordmark: rgba(0, 0, 0, 0.85);
}

@media (prefers-color-scheme: dark) {
  :root {
    --frame-top: #3a3a3e;
    --frame-bottom: #1d1d20;
    --glass-top: #313134;
    --glass-bottom: #262629;
    --glass-edge: rgba(255, 255, 255, 0.14);
    --glass-inner: rgba(0, 0, 0, 0.5);
    --shadow: rgba(0, 0, 0, 0.6);
    --ink: rgba(255, 255, 255, 0.9);
    --ink-soft: rgba(255, 255, 255, 0.68);
    --etch: rgba(255, 255, 255, 0.5);
    --etch-light: rgba(0, 0, 0, 0.6);
    --etch-dark: rgba(255, 255, 255, 0.12);
    --rule-dark: rgba(0, 0, 0, 0.55);
    --rule-light: rgba(255, 255, 255, 0.1);
    --pill: rgba(0, 0, 0, 0.22);
    --pill-edge: rgba(255, 255, 255, 0.1);
    --raised-top: #5d5d61;
    --raised-bottom: #424246;
    --raised-edge: rgba(0, 0, 0, 0.55);
    --link: #f0c658;
    --wordmark: #f0c658;
  }
}

/* The wordmark's typeface: Fredoka, under the SIL Open Font Licence (assets/fonts/OFL.txt), served from this site. */
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* Leave room for the sticky header when jumping to a section or anchor. */
[id] { scroll-margin-top: 60px; }
/* A section's top rule sits just above it. Landing exactly under the 52px header hides that rule
   behind the header, so the header's own engraved line is the only one showing. */
section[id] { scroll-margin-top: 52px; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px 16px 40px;
  background: linear-gradient(var(--frame-top), var(--frame-bottom)) fixed;
  color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* The glass pad that holds the page. */
.pad {
  max-width: 980px;
  margin: 0 auto;
  border-radius: 38px;
  background: linear-gradient(var(--glass-top), var(--glass-bottom));
  box-shadow: 0 24px 60px -10px var(--shadow);
  overflow: clip; /* clip, not hidden, so the sticky header still works */
  position: relative;
}
/* The engraved edge sits in an overlay so the header's solid background can't cover it. */
.pad::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 20;
  box-shadow:
    inset 0 0 0 1px var(--glass-edge),
    inset 0 0 0 3px var(--glass-inner);
}

.inner { padding-left: clamp(20px, 6vw, 64px); padding-right: clamp(20px, 6vw, 64px); }

/* Engraved lines, built like the app's divider: a faint dark line with a light one right under it. */
.rule { height: 2px; border: 0; margin: 0; background: linear-gradient(var(--rule-dark) 1px, var(--rule-light) 1px); }

/* Etched headings and labels. */
.etched {
  color: var(--etch);
  text-shadow: 0 1px 0 var(--etch-light), 0 -0.5px 0.4px var(--etch-dark);
}

h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(34px, 6vw, 56px); font-weight: 700; }
h2 { font-size: clamp(26px, 4vw, 34px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 650; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(18px, 2.4vw, 22px); color: var(--ink-soft); max-width: 36em; margin-left: auto; margin-right: auto; }

/* Hero */
.hero { text-align: center; padding-top: 56px; padding-bottom: 64px; }
.hero h1 { max-width: 14em; margin: 0 auto 18px; }

/* The app icon and the wordmark, at the top of the home page. */
.hero-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 36px; }
.hero-brand img { width: 120px; height: 120px; border-radius: 22.5%; box-shadow: 0 18px 36px -8px var(--shadow), 0 2px 6px var(--shadow); }
.wordmark {
  color: var(--wordmark);
  font-family: "Fredoka", ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600; font-size: clamp(40px, 9vw, 58px); line-height: 1; letter-spacing: -0.01em;
}
.actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: center; margin-top: 30px; }

/* A button standing proud of the glass, like the Connect button in the app. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 20px 0 16px;
  border-radius: 10px;
  border: 1px solid #a6a6a6; /* the badge's outline grey */
  background: linear-gradient(var(--raised-top), var(--raised-bottom));
  color: var(--ink);
  font-weight: 650;
  font-size: 17px;
  text-decoration: none;
}
/* Apple's official badge, used unmodified. */
.app-store { display: inline-flex; line-height: 0; }
.app-store img { display: block; height: 52px; width: auto; }
/* In a setup step, keep the badge at its own size, not the full-width screenshot style. */
.step-shots .app-store { justify-self: start; }
.step-shots .app-store img { width: auto; height: 52px; border-radius: 0; box-shadow: none; }
/* Two lines of text, like the App Store badge beside it. */
.button svg { width: 26px; height: 26px; flex: none; }
.button-label { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.button-label small { font-size: 11px; font-weight: 500; letter-spacing: 0.01em; }
.button-label strong { font-size: 21px; font-weight: 650; }
.button:hover { filter: brightness(1.03); }
.button:active { background: var(--pill); }
.note { color: var(--ink-soft); font-size: 15px; }
.fine { color: var(--ink-soft); font-size: 14px; margin-top: 14px; }

/* Sections */
section { padding-top: 56px; padding-bottom: 56px; }
.section-head { margin-bottom: 28px; }
.section-head p { color: var(--ink-soft); margin-top: 8px; max-width: 38em; }

.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  padding: 24px;
  border-radius: 24px;
  background: var(--pill);
  border: 1px solid var(--pill-edge);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 0 var(--rule-light);
}
.card h3 { margin-bottom: 10px; }
.card p, .card li { color: var(--ink-soft); font-size: 16px; }
.card ul { margin: 0; padding-left: 1.1em; }
.card li { margin-bottom: 4px; }

.steps { counter-reset: step; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: step; padding: 4px 0; }
.steps h3 { display: flex; align-items: center; gap: 12px }
.steps h3::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--raised-edge);
  background: linear-gradient(var(--raised-top), var(--raised-bottom));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 4px var(--shadow);
  font-weight: 700;
}
.steps h3 { margin-bottom: 6px; }
.steps p { color: var(--ink-soft); font-size: 16px; }
.step-shots { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: center; }
.step-shots img { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 10px 24px -10px var(--shadow), 0 2px 5px var(--shadow); }
/* Phone screenshots are tall; keep them narrow. */
.step-shots img[height="1425"] { max-width: 260px; justify-self: center; }
/* The setup guide lays each step out as a row: its words, then its screenshots. */
.page.guide { max-width: 980px; }
.guide .steps { grid-template-columns: 1fr; gap: 44px; padding: 0; }
.guide .steps li { margin-bottom: 0; }
.guide .steps + .fine { margin-top: 44px; }
/* The same etched line as the page's <hr>s, between steps (an <hr> isn't allowed inside a list). */
.guide .steps li + li { position: relative; padding-top: 44px; }
.guide .steps li + li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(var(--rule-dark) 1px, var(--rule-light) 1px); }
@media (min-width: 760px) {
  .guide .steps li { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: 32px; align-items: center; }
  .step-shots { grid-template-columns: 1fr 1fr; }
}

/* Features: each one is its words, then a phone screenshot. */
.feature { padding: 36px 0; }
.feature:first-child { padding-top: 12px; }
.feature + .feature { position: relative; }
.feature + .feature::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(var(--rule-dark) 1px, var(--rule-light) 1px); }
.feature-text .sub { margin-top: 0; }
.feature-shot img { display: block; width: 100%; max-width: 260px; height: auto; border-radius: 18px; box-shadow: 0 10px 24px -10px var(--shadow), 0 2px 5px var(--shadow); }
@media (max-width: 759px) { .feature-shot { margin-top: 20px; } }
@media (min-width: 760px) {
  .feature { display: grid; grid-template-columns: 1fr 260px; gap: 32px; align-items: start; }
}

/* Text pages (support, privacy) */
.page { padding-top: 48px; padding-bottom: 72px; max-width: 760px; margin: 0 auto; }
.page h1, .page .title { font-size: clamp(30px, 5vw, 44px); margin-bottom: 14px; }
.page .sub { font-size: 24px; margin: 40px 0 12px; }
.page ul, .page ol { padding-left: 1.3em; }
.page li { margin-bottom: 6px; }
.meta { color: var(--ink-soft); font-size: 15px; }

details { border-radius: 18px; background: var(--pill); border: 1px solid var(--pill-edge); padding: 4px 20px; margin-bottom: 12px; }
summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--ink-soft); font-weight: 500; }
details[open] summary::after { content: "–"; }
details > :not(summary) { color: var(--ink-soft); }
details p:last-child, details ul:last-child, details ol:last-child { margin-bottom: 16px; }
kbd { font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 6px; border-radius: 6px; background: var(--pill); border: 1px solid var(--pill-edge); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; height: 52px; display: flex; align-items: center; background: var(--glass-top); box-shadow: 0 1px 0 var(--rule-dark), 0 2px 0 var(--rule-light); font-size: 15px; }
.site-header nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 36px; width: 100%; }
.site-header a { color: var(--ink-soft); text-decoration: none; }
.site-header a:hover, .site-header a[aria-current] { color: var(--ink); }
.site-header a[aria-current] { font-weight: 600; }

/* Footer */
.site-footer { padding-top: 28px; padding-bottom: 36px; color: var(--ink-soft); font-size: 14px; }

@media (max-width: 560px) {
  body { padding: 12px 10px 28px; }
  .pad { border-radius: 28px; }
  section { padding-top: 40px; padding-bottom: 40px; }
}

/* Screenshots */
.shots { display: grid; gap: 28px 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.shots figure { margin: 0; }
.shots .wide { grid-column: 1 / -1; }
.shots img { display: block; width: 100%; height: auto; border-radius: 26px; box-shadow: 0 18px 40px -12px var(--shadow), 0 2px 6px var(--shadow); }
.shots .mac img { border-radius: 22px; }
.shots figure:not(.wide) img { max-width: 340px; margin: 0 auto; }
.shots .mac img { max-width: 100%; }
.shots figcaption { margin-top: 14px; text-align: center; color: var(--ink-soft); font-size: 15px; }
@media (min-width: 820px) {
  .shots { grid-template-columns: repeat(4, 1fr); }
  /* The Mac menu is the odd one out in shape, so it sits level with the middle of the phone screens. */
  .shots .mac { align-self: center; }
}
