/* Twine website. Colours, type and the red thread follow docs/Twine_Design_Rules.md. */

@font-face { font-family: 'Gabarito'; font-weight: 600; font-display: swap; src: url('fonts/Gabarito_600SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Gabarito'; font-weight: 700; font-display: swap; src: url('fonts/Gabarito_700Bold.ttf') format('truetype'); }
@font-face { font-family: 'Gabarito'; font-weight: 800; font-display: swap; src: url('fonts/Gabarito_800ExtraBold.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/Inter_400Regular.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('fonts/Inter_500Medium.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/Inter_600SemiBold.ttf') format('truetype'); }

:root {
  --bg: #F5F6F3;
  --surface: #FFFFFF;
  --sunken: #ECEEE9;
  --text: #1C2230;
  --muted: #5B6372;
  --border: #E1E3DD;
  --primary: #1C2230;
  --on-primary: #FFFFFF;
  --accent: #C0342A;
  --todo: #2F7A4E;
  --event: #2C64A8;
  --shadow: 0 1px 2px rgba(28, 34, 48, 0.06), 0 8px 24px rgba(28, 34, 48, 0.08);
  --radius: 16px;
  --display: 'Gabarito', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wide: 1080px;
  --narrow: 720px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121722;
    --surface: #1A2030;
    --sunken: #0D111A;
    --text: #ECEEF2;
    --muted: #A3AAB8;
    --border: #2A3245;
    --primary: #ECEEF2;
    --on-primary: #121722;
    --accent: #F0604F;
    --todo: #5DBB84;
    --event: #6EA2E6;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

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

h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.03em; }
h2 { font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-weight: 600; font-size: 1.15rem; }
p { margin: 0 0 1em; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 16px; z-index: 10; }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: var(--narrow); }

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

.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.site-header.scrolled { border-bottom-color: var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }

.logo { display: inline-flex; flex-direction: column; text-decoration: none; color: var(--text); }
.logo span { font: 800 26px/1 var(--display); letter-spacing: -0.04em; }
.logo svg { width: 64px; height: 10px; margin-top: 1px; }

.nav { display: flex; gap: 22px; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 16px/1 var(--display); text-decoration: none; border: 1.5px solid transparent;
  transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn small { display: block; font: 500 11px/1.2 var(--body); opacity: 0.75; }
.btn .label { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.btn svg { width: 20px; height: 20px; flex: none; }

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

.hero { padding: 56px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero .lede { font-size: 1.2rem; color: var(--muted); max-width: 34ch; }
.hero .stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero .note { margin-top: 14px; font-size: 14px; color: var(--muted); }
.eyebrow { display: inline-block; font: 700 12px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }

/* The phone: a chat message tied by the thread to the todo and date it made. */
.phone {
  justify-self: center; width: min(360px, 100%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 36px;
  box-shadow: var(--shadow); padding: 22px 18px 26px; position: relative;
}
.phone-top { display: flex; align-items: center; gap: 10px; padding: 0 4px 14px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.phone-top b { font: 700 17px/1.2 var(--display); }
.phone-top b i { font-style: normal; color: var(--muted); }
.phone-top small { color: var(--muted); font-size: 13px; display: block; }
.avatars { display: flex; margin-left: auto; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 12px/1 var(--display); color: #fff; border: 2px solid var(--surface); margin-left: -8px; }

.bubble { background: var(--sunken); border-radius: 18px 18px 18px 6px; padding: 10px 14px; width: fit-content; max-width: 86%; font-size: 15px; line-height: 1.45; }
.bubble.mine { background: var(--primary); color: var(--on-primary); border-radius: 18px 18px 6px 18px; margin-left: auto; }
.who { font: 600 13px/1 var(--display); color: var(--muted); margin: 0 0 6px 4px; }
.msg { margin-bottom: 12px; }

.tied { position: relative; padding-left: 34px; margin: 4px 0 10px; }
.tied svg.thread { position: absolute; left: 6px; top: -18px; width: 26px; height: calc(100% + 6px); overflow: visible; }
.item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; font-size: 15px; }
.item small { display: block; color: var(--muted); font-size: 12.5px; }
.check { width: 20px; height: 20px; border: 2px solid var(--todo); border-radius: 6px; flex: none; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--event); flex: none; margin: 0 4px; }

/* -------------------------------------------------------------- sections */

section { padding: 72px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
section.alt .card { background: var(--bg); }
.card p { color: var(--muted); margin: 0; font-size: 15.5px; }
.tile { width: 40px; height: 40px; border-radius: 12px; background: var(--sunken); display: grid; place-items: center; margin-bottom: 16px; color: var(--text); }
.tile svg { width: 22px; height: 22px; }
.tile.todo { color: var(--todo); }
.tile.event { color: var(--event); }
.tile.thread { color: var(--accent); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.step { position: relative; padding-top: 52px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: var(--primary); color: var(--on-primary);
  font: 700 17px/1 var(--display);
}
.step p { color: var(--muted); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list svg { width: 22px; height: 22px; flex: none; color: var(--todo); margin-top: 2px; }

.cta { text-align: center; }
.cta .stores { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 24px; }

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

.page { padding: 48px 0 80px; }
.page h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
.page .updated { color: var(--muted); font-size: 15px; margin-bottom: 32px; }
.page h2 { font-size: 1.45rem; margin-top: 2em; }
.page h3 { margin-top: 1.5em; }
.page ul, .page ol { padding-left: 1.3em; }
.page li { margin-bottom: 0.4em; }
.page table { width: 100%; border-collapse: collapse; margin: 1em 0 1.5em; font-size: 15px; }
.page th, .page td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.page th { font: 600 14px/1.3 var(--display); color: var(--muted); }
.table-scroll { overflow-x: auto; }
.callout { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; padding: 16px 20px; margin: 1.5em 0; }
.callout p:last-child { margin: 0; }

details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 10px; }
summary { cursor: pointer; padding: 16px 20px; font: 600 17px/1.35 var(--display); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 22px; line-height: 1; }
details[open] summary::after { content: '−'; }
details > div { padding: 0 20px 16px; color: var(--muted); }
details > div p:last-child { margin: 0; }

.contact { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }

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

.site-footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .hero .wrap, .split { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .grid, .steps { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .nav .hide-small { display: none; }
  .grid, .steps { grid-template-columns: 1fr; }
  section { padding: 56px 0; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
