/* Caipher website. Tokens from docs/design/DESIGN_SYSTEM.md (dark only, like the app). */

@font-face {
  font-family: "Unbounded";
  src: url("/assets/unbounded-bold-wordmark.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #000000;
  --gray950: #0a0c0c;
  --gray900: #111414;
  --gray850: #1a1e1e;
  --gray800: #242a2a;
  --gray750: #232929;
  --gray700: #343c3c;
  --gray450: #8c9696;
  --gray300: #b9c2c2;
  --gray50: #f2f5f5;
  --white: #ffffff;
  --aqua: #77f2ef;
  --aqua-pressed: #56d6d3;
  --aqua-tint: #0f2a2a;
  --lime: #3cf014;
  --lime-tint: #12280b;

  --bg: var(--black);
  --surface: var(--gray900);
  --raised: var(--gray850);
  --line: var(--gray750);
  --line-strong: var(--gray700);
  --text: var(--gray50);
  --text-2: var(--gray300);
  --text-3: var(--gray450);

  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --brand: "Unbounded", var(--ui);
  --gutter: 20px;
  --radius: 20px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: var(--aqua); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible,
.store:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 12px;
  background: var(--raised);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}

/* Wordmark: Unbounded Bold, the "ai" in aqua with its static glow (DESIGN_SYSTEM §3.3). */
.wordmark {
  font-family: var(--brand);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
}
.wordmark .ai {
  color: var(--aqua);
  text-shadow: 0 0 0.3em rgba(119, 242, 239, 0.9);
}

/* Header with the site nav on every page. Phones keep every link visible as a wrapped row. */
.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  padding-top: 12px;
  padding-bottom: 8px;
}
.site-head a.home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--white);
  text-decoration: none;
}
.site-head img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}
.site-head .wordmark { font-size: 20px; }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  font-size: 15px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--text-2);
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] {
  color: var(--aqua);
}

/* Hero */
.hero {
  text-align: center;
  padding: 56px 0 48px;
}
.hero .icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  display: block;
  margin: 0 auto 28px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 60px rgba(119, 242, 239, 0.18);
}
.hero .wordmark {
  font-size: clamp(52px, 15vw, 104px);
}
.hero .tagline {
  margin: 18px auto 0;
  max-width: 22ch;
  font-size: clamp(20px, 5.2vw, 28px);
  line-height: 1.3;
  color: var(--text-2);
  font-weight: 500;
}
.cta {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--aqua);
  color: var(--black);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
}
.store:hover { background: var(--aqua-pressed); text-decoration: none; }
.store svg { width: 20px; height: 20px; flex: none; }
.cta .note {
  color: var(--text-3);
  font-size: 14px;
  margin: 0;
}

/* Feature rows */
#features { scroll-margin-top: 16px; }
.section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 12px;
}
.features {
  list-style: none;
  margin: 0;
  padding: 8px 0 24px;
  display: grid;
  gap: 16px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  gap: 20px;
}
.feature h3 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.feature p {
  margin: 0;
  color: var(--text-2);
  max-width: 46ch;
}

/* The small drawings inside each row */
.visual {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.35;
  min-width: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border-radius: 12px;
}
.row + .row { margin-top: 8px; }
.row .dot {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gray800);
  flex: none;
}
.row .main { flex: 1; min-width: 0; }
.row .title { display: block; color: var(--text); font-weight: 600; }
.row .sub {
  display: block;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row.dim { opacity: 0.55; }
.tag {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--aqua-tint);
  color: var(--aqua);
}
.tag.done {
  background: var(--lime-tint);
  color: var(--lime);
}
.money { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.beats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.beat {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-weight: 500;
}
.beat.on {
  border-color: var(--aqua);
  color: var(--aqua);
}
.line {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: var(--gray800);
  margin-top: 8px;
}
.line.w90 { width: 90%; }
.line.w75 { width: 75%; }
.line.w60 { width: 60%; }

.studio {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.frame {
  width: 108px;
  aspect-ratio: 9 / 16;
  flex: none;
  border-radius: 14px;
  background:
    radial-gradient(60% 40% at 50% 34%, #2a3333 0%, rgba(42, 51, 51, 0) 100%),
    linear-gradient(180deg, #161b1b 0%, #0b0e0e 100%);
  border: 1px solid var(--line-strong);
  position: relative;
  overflow: hidden;
}
.frame .cap {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 30%;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.15;
  color: var(--white);
  text-shadow: 0 1px 0 #000, 0 0 3px #000, 0 0 6px #000;
}
.frame .cap b {
  display: block;
  font-size: 19px;
}
.timeline {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}
.strip {
  position: relative;
  height: 40px;
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, #1a2020 0 22px, #141919 22px 44px);
}
.strip::before,
.strip::after {
  content: "";
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 8px;
  border-radius: 4px;
  background: var(--aqua);
}
.strip::before { left: 12%; }
.strip::after { right: 18%; }
.ticks {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--text-3);
  font-size: 12px;
}
.ticks span {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface);
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 96px;
  padding: 0 4px;
}
.chart span {
  flex: 1;
  border-radius: 6px 6px 3px 3px;
  background: var(--gray800);
}
.chart span.on { background: var(--aqua); }
.chart .h30 { height: 30%; }
.chart .h45 { height: 45%; }
.chart .h55 { height: 55%; }
.chart .h40 { height: 40%; }
.chart .h100 { height: 100%; }
.chart .h65 { height: 65%; }
.chart .h35 { height: 35%; }
.chart-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--text-3);
}
.chart-foot strong { color: var(--text); font-weight: 600; }

.closing {
  text-align: center;
  padding: 48px 0 64px;
}
.closing .more { margin: 20px 0 0; }
.closing h2 {
  margin: 0;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.01em;
}

/* Footer */
.foot {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--text-3);
  font-size: 15px;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 14px;
}
.foot nav a { padding: 4px 0; }
.foot p { margin: 0; }

/* Legal pages */
.doc {
  padding: 40px 0 64px;
}
.doc .wrap { max-width: 760px; }
.doc h1 {
  font-size: clamp(30px, 7vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  font-weight: 700;
}
.doc h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 40px 0 10px;
  font-weight: 650;
}
.doc h3 {
  font-size: 18px;
  line-height: 1.35;
  margin: 28px 0 8px;
  font-weight: 600;
}
.doc p,
.doc li { color: var(--text-2); }
.doc strong { color: var(--text); font-weight: 600; }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc .updated { color: var(--text-3); margin: 0 0 24px; }
.doc .lead { font-size: 19px; color: var(--text); }
.doc h3[id], .doc h2[id] { scroll-margin-top: 16px; }
.doc .toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 8px;
}
.doc .toc a {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 15px;
}
.doc ol.steps { padding-left: 24px; }
.doc ol.steps li { color: var(--text); padding-left: 4px; }
.doc ol { padding-left: 22px; }
.doc .table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.doc table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 15px;
}
.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
.doc th {
  color: var(--text);
  background: var(--surface);
  font-weight: 600;
}
.doc tr:last-child td { border-bottom: 0; }

/* 404 */
.missing {
  text-align: center;
  padding: 96px 0;
}
.missing h1 { font-weight: 700; }
.missing h1 {
  font-size: 32px;
  margin: 0 0 10px;
}
.missing p { color: var(--text-2); margin: 0 0 24px; }

@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .hero { padding: 96px 0 72px; }
  .hero .icon { width: 120px; height: 120px; border-radius: 27px; }
  .cta { flex-direction: row; justify-content: center; gap: 16px; }
  .features { gap: 20px; }
  .feature {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 36px;
    gap: 36px;
  }
  .feature h3 { font-size: 26px; }
  .visual { padding: 16px; }
}
