/* Ex-Tax website styles. The v2 look from the app's Theme.swift: black and ink pages, cream
   type, red for the tempting moments, a serif display face and a red handwritten script line.
   Mobile first. System fonts only, so no font host has to be allowed in the CSP (_headers). */

:root {
  color-scheme: dark;

  /* The palette (same values as Theme.Palette in the app). */
  --black: #0d0b0b;
  --ink: #151212;
  --ink-raised: #1a1615;
  --cream: #f3eadb;
  --paper: #ecdac5;          /* the art's paper: light bands and documents */
  --red: #b5141a;            /* fills: buttons, the pass band (cream text on it: 5.7:1) */
  --red-text: #e2453c;       /* red text on black, large sizes only (4.8:1) */
  --red-text-small: #f0645a; /* red text under 18pt on black or ink (5.7:1 or better) */
  --red-on-paper: #b3201b;   /* red text on paper (4.9:1) */
  --muted: #bdb2a2;
  --muted-on-paper: #5e554b;

  /* What components use. Dark by default; .paper and .band-red swap them. */
  --bg: var(--black);
  --fg: var(--cream);
  --fg-muted: var(--muted);
  --accent: var(--red-text-small);
  --card: var(--ink);
  --card-raised: var(--ink-raised);
  --line: rgba(243, 234, 219, 0.25);
  --line-soft: rgba(243, 234, 219, 0.12);
  --focus: var(--red-text-small);

  --radius: 20px;
  --radius-sm: 14px;
  --gutter: 16px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  /* ui-serif is New York on Apple devices, the app's display face. */
  --font-display: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  /* Bradley Hand ships with iOS and macOS, like the app's ScriptLine. */
  --font-script: "Bradley Hand", "Snell Roundhand", "Segoe Script", "Segoe Print", "Ink Free",
    cursive;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Surfaces */

.paper {
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-muted: var(--muted-on-paper);
  --accent: var(--red-on-paper);
  --card: var(--cream);
  --card-raised: var(--cream);
  --line: rgba(21, 18, 18, 0.22);
  --line-soft: rgba(21, 18, 18, 0.12);
  --focus: var(--red-on-paper);
  background: var(--bg);
  color: var(--fg);
}

.band-red {
  --bg: var(--red);
  --fg: var(--cream);
  --fg-muted: var(--cream);
  --accent: var(--cream);
  --card: var(--ink);
  --card-raised: var(--ink-raised);
  --line: rgba(243, 234, 219, 0.4);
  --focus: var(--cream);
  background: var(--bg);
  color: var(--fg);
}

/* Layout */

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

.wrap-narrow {
  max-width: 44rem;
}

@media (min-width: 560px) {
  :root {
    --gutter: 24px;
  }
}

.site-header {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.header-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 10px 0;
}

.header-link:hover {
  color: var(--fg);
}

main {
  display: block;
  padding-bottom: 48px;
}

.band {
  padding: 56px 0;
}

section {
  padding: 32px 0;
}

.band > .wrap > section,
.band section {
  padding: 0;
}

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 28px 0 40px;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  display: inline-block;
  padding: 6px 0;
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a[aria-current="page"] {
  text-decoration: underline;
}

.site-footer p {
  margin: 4px 0;
}

/* Type */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.3rem, 9vw, 3.8rem);
}

h2 {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
}

h3 {
  font-size: 1.35rem;
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 14px;
}

.lede {
  font-size: clamp(1.15rem, 4vw, 1.4rem);
  line-height: 1.4;
  color: var(--fg);
}

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

.small {
  font-size: 0.92rem;
}

.label {
  display: block;
  margin: 0 0 10px;
  color: var(--fg-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* The red handwritten line ("I DARE YOU."). */
.script {
  display: inline-block;
  margin: 0;
  color: var(--red-text);
  font-family: var(--font-script);
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  transform: rotate(-4deg);
  transform-origin: left center;
}

.paper .script {
  color: var(--red-on-paper);
}

.band-red .script {
  color: var(--cream);
}

.section-intro {
  max-width: 40rem;
  margin-bottom: 24px;
}

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

/* Buttons. Pill shaped and at least 52px tall, like the app's ExTaxButtonStyle. */

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 22px 0 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 24px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:hover {
  opacity: 0.88;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--cream);
  color: var(--ink);
}

.paper .btn-primary {
  background: var(--ink);
  color: var(--cream);
}

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--fg-muted);
  opacity: 1;
}

.store-soon {
  display: inline-block;
  padding: 12px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-weight: 600;
  text-align: center;
}

@media (min-width: 560px) {
  .actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

/* Cards and lists */

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
}

.card-raised {
  background: var(--card-raised);
}

.card + .card {
  margin-top: 16px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .grid-2,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1000px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.grid .card + .card {
  margin-top: 0;
}

.grid + .card,
.grid + .grid,
.card + .grid,
.grid + p {
  margin-top: 16px;
}

.card h3 {
  margin-bottom: 6px;
}

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

.card .label {
  margin-bottom: 6px;
}

.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 56px;
  min-height: 40px;
}

.steps > li:last-child {
  padding-bottom: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -4px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.steps h3 {
  margin-bottom: 4px;
}

.steps p {
  margin-bottom: 0;
}

.steps p + p {
  margin-top: 8px;
}

.ticks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.ticks li {
  position: relative;
  padding-left: 30px;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

.pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
}

.pill-red {
  border-color: var(--red-text-small);
  color: var(--red-text-small);
}

/* Landing hero */

.hero {
  padding: 28px 0 40px;
  text-align: center;
}

.hero .wrap {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.hero-mark {
  margin: 0;
  font-size: clamp(4.2rem, 21vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.hero-art {
  width: min(100%, 460px);
  margin: 10px auto 0;
  border-radius: 10px;
}

.hero .script {
  justify-self: start;
  margin: 4px 0 6px max(0px, calc(50% - 230px));
  text-align: left;
  transform: rotate(-6deg);
}

.hero-line {
  margin: 8px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 7.5vw, 2.8rem);
  line-height: 1.1;
}

.hero .lede {
  max-width: 34rem;
  margin: 0 auto 4px;
  color: var(--fg-muted);
}

.hero .actions {
  justify-content: center;
}

.fine-print {
  margin-top: 4px;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

/* A drawing of the line at work, built in HTML so it stays sharp. */

.demo {
  display: grid;
  gap: 32px;
  align-items: center;
}

@media (min-width: 900px) {
  .demo {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 56px;
  }
}

.phone {
  width: min(100%, 340px);
  margin: 0 auto;
  padding: 10px;
  border-radius: 44px;
  background: #000;
  border: 1px solid var(--line);
}

.phone-screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 440px;
  padding: 18px 14px 22px;
  border-radius: 34px;
  background: #000;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.35;
}

.phone-contact {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid #222;
  font-size: 0.8rem;
}

.phone-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #5c5a60;
  font-size: 1.15rem;
  font-weight: 600;
}

.phone-meta {
  margin: 4px 0 0;
  color: #9a989f;
  font-size: 0.75rem;
  text-align: center;
}

.bubble {
  max-width: 82%;
  margin: 0;
  padding: 9px 13px;
  border-radius: 18px;
}

.bubble-out {
  align-self: flex-end;
  background: #1f7a35;
  color: #fff;
}

.bubble-in {
  align-self: flex-start;
  background: #2c2a2e;
  color: #fff;
}

.push {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 18px;
  background: #2c2a2e;
  color: #fff;
  font-size: 0.88rem;
}

.push b {
  display: block;
}

.push-app {
  display: block;
  margin-bottom: 4px;
  color: #b8b6bd;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The price ladder */

.pass-head {
  display: grid;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
}

@media (min-width: 760px) {
  .pass-head {
    grid-template-columns: 1fr auto;
  }
}

.pass-head img {
  width: 190px;
  border-radius: 12px;
}

.ladder {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.ladder caption {
  padding-bottom: 10px;
  color: var(--fg-muted);
  font-size: 0.92rem;
  text-align: left;
}

.ladder th,
.ladder td {
  padding: 14px 4px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: baseline;
}

.ladder thead th {
  padding-top: 0;
  color: var(--fg-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ladder tbody th {
  font-weight: 400;
}

.ladder td {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  text-align: right;
}

.ladder thead th:last-child {
  text-align: right;
}

.ladder tbody tr:last-child th,
.ladder tbody tr:last-child td {
  border-bottom: 0;
}

/* Ranks and scenes */

.ranks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.ranks li {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.ranks span {
  color: var(--fg-muted);
}

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

@media (min-width: 720px) {
  .scenes {
    grid-template-columns: repeat(4, 1fr);
  }
}

.scenes figure {
  margin: 0;
}

.scenes img {
  display: block;
  width: 100%;
  border-radius: 12px;
}

.scenes figcaption {
  margin-top: 6px;
  color: var(--fg-muted);
  font-size: 0.88rem;
}

/* Art next to text */

.split {
  display: grid;
  gap: 24px;
  align-items: start;
}

@media (min-width: 760px) {
  .split {
    grid-template-columns: auto 1fr;
    gap: 36px;
  }
}

.split-art {
  width: 150px;
  border-radius: 12px;
}

/* Callouts */

.callout {
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--line-soft);
}

.callout h2,
.callout h3 {
  margin-bottom: 8px;
}

.callout h2 {
  font-size: clamp(1.5rem, 5vw, 1.9rem);
}

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

/* Help stays plain: no art, no jokes, the numbers first. */
.callout-help {
  border-left: 4px solid var(--cream);
}

.draft-banner {
  margin: 0 0 24px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid #8a6a1c;
  background: #fff1c2;
  color: #3d2c00;
  font-size: 0.95rem;
}

.placeholder {
  padding: 1px 6px;
  border-radius: 6px;
  background: #fff1c2;
  color: #3d2c00;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.help-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.help-list li {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--card-raised);
  border: 1px solid var(--line-soft);
}

.help-list strong {
  display: block;
  margin-bottom: 2px;
}

.help-list a {
  font-weight: 700;
}

/* Long-form documents (privacy, terms) on a paper sheet */

.sheet {
  margin-top: 24px;
  padding: 28px var(--gutter) 36px;
  border-radius: var(--radius);
}

@media (min-width: 560px) {
  .sheet {
    padding: 40px 44px 48px;
  }
}

.prose {
  max-width: 44rem;
}

.prose h1 {
  font-size: clamp(2.2rem, 8vw, 3rem);
}

.prose h2 {
  margin-top: 40px;
  font-size: clamp(1.5rem, 5vw, 1.85rem);
}

.prose h3 {
  margin-top: 24px;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 1.3em;
}

.prose li {
  margin-bottom: 8px;
}

.prose li > ul {
  margin-top: 8px;
}

.prose .help-list {
  padding-left: 0;
}

.prose .help-list li {
  margin-bottom: 0;
}

.prose .meta {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.prose .ladder {
  margin: 4px 0 18px;
}

.prose .ladder td {
  font-size: 1.5rem;
}

.toc {
  margin: 20px 0 8px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line-soft);
}

.toc h2 {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.toc ol {
  margin: 0;
  padding-left: 1.3em;
  columns: 1;
}

@media (min-width: 640px) {
  .toc ol {
    columns: 2;
    column-gap: 32px;
  }
}

.toc li {
  margin-bottom: 4px;
  break-inside: avoid;
}

/* FAQ */

.faq details {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 0 18px;
}

.faq details + details {
  margin-top: 10px;
}

.faq summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 700;
  list-style-position: outside;
}

.faq details[open] summary {
  padding-bottom: 8px;
}

.faq details > div {
  padding-bottom: 16px;
}

.faq details > div p:last-child,
.faq details > div ul:last-child {
  margin-bottom: 0;
}

.faq ul {
  margin: 0 0 14px;
  padding-left: 1.3em;
}

.faq h3 {
  margin-top: 28px;
  font-size: 1.2rem;
}

/* Invite page */

.invite-hero {
  padding-top: 28px;
  padding-bottom: 8px;
}

.invite-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.invite-head h1 {
  flex: 1;
  font-size: clamp(2rem, 8vw, 3rem);
}

.invite-art {
  flex: none;
  width: 92px;
  border-radius: 12px;
}

.invite-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
}

.invite-role p {
  margin: 0;
}

.status-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.spinner {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 4px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--cream);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hint {
  margin-top: 4px;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.notfound {
  padding-top: 40px;
}

.notfound img {
  width: 190px;
  margin-bottom: 20px;
  border-radius: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
  .btn {
    transition: none;
  }
  .btn:active {
    transform: none;
  }
}
