/* Tentti — tentti.app.
   One column, centred, no framework. Colours are tokens so light and dark
   stay in sync. The palette is the app's: Tentti blue from the icon, and the
   soft course colours (tint for washes, deep for glyphs and text). */

:root {
  --brand: #2163ee;          /* Color.accentFill in the app */
  --tint: #e9effd;           /* brand mixed into --bg: top of the wash, and the status-bar strip */

  --bg: #f2f3f7;             /* systemGroupedBackground, a touch cooler */
  --surface: #ffffff;
  --ink: #0d1117;
  --ink-2: #5b6472;
  --ink-3: #8b94a3;
  --line: #e3e6ec;
  --fill: rgba(118, 118, 128, .12);
  --shadow: 0 1px 2px rgba(13, 17, 23, .04), 0 18px 40px -22px rgba(13, 17, 23, .22);

  /* course colours: tint / deep, as in CourseColor.swift */
  --indigo: #8e95dd; --indigo-ink: #4d55b0;
  --teal:   #77bdb3; --teal-ink:   #2f7f75;
  --coral:  #de8b88; --coral-ink:  #a8484a;
  --amber:  #ddb36a; --amber-ink:  #946a1e;
  --purple: #ab97d6; --purple-ink: #6a519e;
  --orange: #e09f76; --orange-ink: #a35c30;

  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #4c8cff;
    --tint: #0c1528;
    --bg: #000000;
    --surface: #1c1c1e;
    --ink: #f2f4f7;
    --ink-2: #a2a9b6;
    --ink-3: #6e7581;
    --line: #2c2c30;
    --fill: rgba(118, 118, 128, .24);
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 18px 40px -22px rgba(0, 0, 0, .8);

    /* in dark mode the ink is the tint itself, like CourseColor.ink */
    --indigo-ink: var(--indigo);
    --teal-ink: var(--teal);
    --coral-ink: var(--coral);
    --amber-ink: var(--amber);
    --purple-ink: var(--purple);
    --orange-ink: var(--orange);
  }
}

* { box-sizing: border-box; }

/* The page colour lives on <html>: Safari on iPhone paints the status-bar
   strip (viewport-fit=cover) from the root. */
html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  color: var(--ink);
  font: 400 16px/1.55 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100svh;
}

/* Soft brand wash behind the fold, fading down from exactly --tint. */
.wash {
  position: fixed;
  inset: 0 0 auto 0;
  height: 70vh;
  background: linear-gradient(var(--tint), color-mix(in srgb, var(--tint) 40%, transparent) 45%, transparent);
  pointer-events: none;
  z-index: -1;
}

/* Safari 26 on iPhone colours the status-bar strip from the first fixed,
   hit-testable element at the top; background-clip leaves this one unpainted. */
.status-tint {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 0;
  padding-top: max(12px, env(safe-area-inset-top));
  background-color: var(--tint);
  background-clip: content-box;
}

a { color: color-mix(in srgb, var(--brand) 88%, var(--ink)); }

/* ── hero ───────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: clamp(32px, 7vh, 64px) 0 8px;
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 11%, transparent);
  color: color-mix(in srgb, var(--brand) 80%, var(--ink));
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
}

.appicon {
  display: block;
  margin: 28px auto 22px;
  width: 104px;
  height: 104px;
  border-radius: 23.4px;     /* ≈ iOS squircle at this size */
  box-shadow: var(--shadow);
}

h1 {
  margin: 0;
  font-family: var(--round);
  font-size: clamp(44px, 10vw, 60px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
}

.lede {
  margin: 14px auto 0;
  max-width: 30ch;
  color: var(--ink-2);
  font-size: clamp(17px, 4.4vw, 19px);
  line-height: 1.5;
}

.lede strong { display: block; color: var(--ink); font-family: var(--round); font-weight: 600; }

/* ── the exam stack: the Exams tab, as a picture ────────── */

.stack {
  margin: 40px auto 0;
  max-width: 400px;
  display: grid;
  gap: 10px;
  text-align: left;
  font-family: var(--round);
}

.next {
  --c: var(--indigo); --c-ink: var(--indigo-ink);
  padding: 16px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--c) 28%, transparent), color-mix(in srgb, var(--c) 8%, transparent)),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  box-shadow: var(--shadow);
}

.next-top { display: flex; align-items: flex-start; gap: 12px; }
.next-top .what { flex: 1; min-width: 0; padding-top: 2px; }
.next-top .what b { display: block; font-size: 18px; font-weight: 700; line-height: 1.25; }
.next-top .what span { display: block; color: var(--ink-2); font-size: 14px; }

.count { text-align: right; color: var(--c-ink); line-height: 1; }
.count b { display: block; font-size: 46px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.count span { display: block; margin-top: 4px; font-size: 13px; font-weight: 500; opacity: .75; }

.focus-btn {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--indigo-ink) 92%, #000);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .focus-btn { background: #4d55b0; }
  .next { background:
    linear-gradient(135deg, color-mix(in srgb, var(--c) 42%, transparent), color-mix(in srgb, var(--c) 14%, transparent)),
    var(--surface); }
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 12px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.row .what { flex: 1; min-width: 0; }
.row b { display: block; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .what span { display: block; color: var(--ink-2); font-size: 13px; }
.row .days { color: var(--c-ink); font-size: 16px; font-weight: 600; white-space: nowrap; }
.row.fade { opacity: .45; }

/* CourseBadge: the glyph in its course's ink, on the course wash */
.cb {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  color: var(--c-ink);
  font-family: var(--round);
  font-size: 16px;
  font-weight: 600;
}
.next .cb { width: 52px; height: 52px; border-radius: 14px; font-size: 18px; background: color-mix(in srgb, var(--c) 30%, transparent); }
.cb svg { width: 22px; height: 22px; }

.indigo { --c: var(--indigo); --c-ink: var(--indigo-ink); }
.teal   { --c: var(--teal);   --c-ink: var(--teal-ink); }
.coral  { --c: var(--coral);  --c-ink: var(--coral-ink); }
.amber  { --c: var(--amber);  --c-ink: var(--amber-ink); }
.purple { --c: var(--purple); --c-ink: var(--purple-ink); }
.orange { --c: var(--orange); --c-ink: var(--orange-ink); }

/* ── features ───────────────────────────────────────────── */

.section { margin-top: 72px; text-align: left; }

.section h2 {
  margin: 0 0 14px 4px;
  font-family: var(--round);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.feats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.feats li {
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feats .cb { width: 36px; height: 36px; border-radius: 10px; margin-bottom: 12px; }
.feats .cb svg { width: 19px; height: 19px; }
.feats b { display: block; font-family: var(--round); font-size: 16px; font-weight: 600; }
.feats p { margin: 3px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; }

@media (max-width: 420px) {
  .feats { grid-template-columns: 1fr; }
  .feats li { display: grid; grid-template-columns: 36px 1fr; column-gap: 14px; align-items: start; }
  .feats .cb { grid-row: span 2; margin: 0; }
}

/* ── Pro ────────────────────────────────────────────────── */

.pro {
  padding: 20px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pro-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pro-head b { font-family: var(--round); font-size: 19px; font-weight: 700; }
.pro-head span { color: var(--ink-3); font-size: 14px; }

.pro ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.pro li { display: flex; gap: 12px; align-items: baseline; color: var(--ink-2); font-size: 15px; }
.pro li::before {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand);
  translate: 0 -2px;
}
.pro li strong { color: var(--ink); font-weight: 600; }

.free {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
}

.note {
  margin: 56px auto 0;
  color: var(--ink-2);
  font-size: 15px;
}

/* ── footer ─────────────────────────────────────────────── */

footer {
  width: 100%;
  max-width: 600px;
  margin-top: auto;
  padding: 48px 0 max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 13px;
}

footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
footer a { color: var(--ink-3); text-decoration: none; }
footer a:hover { color: var(--ink-2); }

/* ── legal and support pages ────────────────────────────── */

.doc {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(24px, 4vh, 40px) 0 8px;
}

.home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--round);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
  text-decoration: none;
}
.home img { width: 32px; height: 32px; border-radius: 7.2px; }

.doc h1 { margin-top: 36px; font-size: clamp(32px, 7vw, 42px); line-height: 1.1; }
.updated { margin-top: 10px; color: var(--ink-3); font-size: 14px; }
.summary {
  margin: 24px 0 4px;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.doc h2 { margin: 34px 0 8px; font-family: var(--round); font-size: 19px; letter-spacing: -.01em; }
.doc h3 { margin: 22px 0 4px; font-size: 16px; }
.doc p, .doc li { color: var(--ink-2); }
.doc p + p { margin-top: 10px; }
.doc ul { margin: 8px 0 0; padding-left: 20px; }
.doc li + li { margin-top: 6px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a:not(.home) {
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}

/* ── motion: the stack settles in, once ─────────────────── */

@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; translate: 0 14px; } }
  .stack > * { animation: rise .7s cubic-bezier(.2, .8, .3, 1) both; }
  .stack > :nth-child(2) { animation-delay: .08s; }
  .stack > :nth-child(3) { animation-delay: .16s; }
  .row.fade { animation-name: rise-fade; }
  @keyframes rise-fade { from { opacity: 0; translate: 0 14px; } to { opacity: .45; } }
}
