/* Quip design system. Lilac board, navy ink, orange action, cards with a hard shadow. */
:root {
  --lilac: #b8a6ff;
  --lilac-deep: #9c86f5;
  --mist: #efeaff;
  --navy: #1d1340;
  --navy-soft: #3a2f66;
  --orange: #ff7a1a;
  --mint: #6ff0c8;
  --yellow: #ffd23f;
  --pink: #ff8fb1;
  --white: #ffffff;
  --muted: #5b5480;
  --wide: 125%;
  --radius: 16px;
  --shadow: 6px 6px 0 var(--navy);
  --display: "Archivo", "Arial Black", system-ui, sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
  --tabbar: 0px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; }
body { background: var(--mist); color: var(--navy); font: 500 16px/1.55 var(--body); padding-bottom: var(--tabbar); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--navy); color: var(--white); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Type */
.display { font-family: var(--display); font-weight: 900; font-stretch: var(--wide); letter-spacing: -.03em; line-height: .95; }
h1, h2, h3 { margin: 0; }
.h1 { font: 900 clamp(40px, 6vw, 80px)/.95 var(--display); font-stretch: var(--wide); letter-spacing: -.03em; }
.h2 { font: 900 clamp(30px, 4vw, 52px)/1 var(--display); font-stretch: var(--wide); letter-spacing: -.025em; }
.h3 { font: 900 22px/1.1 var(--display); font-stretch: 112%; }
.lead { font-size: clamp(17px, 1.6vw, 20px); max-width: 36ch; }
.muted { color: var(--muted); }

/* Logo: QUIP printed on a tilted orange card */
.logo { display: inline-block; background: var(--orange); color: var(--navy); font: 900 24px/1 var(--display); font-stretch: var(--wide); letter-spacing: -.02em; padding: 7px 12px 5px; border: 3px solid var(--navy); border-radius: 10px; box-shadow: 4px 4px 0 var(--navy); transform: rotate(-3deg); text-decoration: none; transition: transform .15s; }
.logo:hover { transform: rotate(-6deg) scale(1.03); }
.logo.sm { font-size: 16px; padding: 5px 8px 3px; border-width: 2px; box-shadow: 3px 3px 0 var(--navy); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 24px; border-radius: 999px; font-weight: 800; text-decoration: none; border: 3px solid var(--navy); background: var(--white); color: var(--navy); transition: transform .1s, box-shadow .1s; white-space: nowrap; }
.btn:active { transform: translate(2px, 2px); }
.btn.go { background: var(--orange); box-shadow: 4px 4px 0 var(--navy); }
.btn.go:active { box-shadow: 2px 2px 0 var(--navy); }
.btn.dark { background: var(--navy); color: var(--white); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 16px; font-size: 14px; border-width: 2px; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* Cards */
.card { background: var(--white); border: 3px solid var(--navy); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--navy); }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--navy); color: var(--white); font-size: 13px; font-weight: 700; }
.chip.light { background: rgba(255,255,255,.7); color: var(--navy); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--lilac); border-bottom: 3px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--navy); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.topbar nav ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.topbar nav a { display: block; padding: 8px 14px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.topbar nav a:hover { background: rgba(255,255,255,.45); }
.topbar nav a[aria-current="page"] { background: var(--navy); color: var(--white); }
.topbar .acct { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--navy); background: var(--mint); display: grid; place-items: center; font-weight: 900; text-decoration: none; }

/* Bottom tab bar: phones and the installed app */
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--white); border-top: 3px solid var(--navy); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); }
.tabbar ul { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 0; padding: 0; }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; font-size: 12px; font-weight: 700; text-decoration: none; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { background: var(--lilac); }
@media (max-width: 820px) {
  :root { --tabbar: 74px; }
  .topbar nav { display: none; }
  .topbar .wrap { height: 62px; }
  .tabbar { display: block; }
}
@media (display-mode: standalone) {
  :root { --tabbar: 74px; }
  .tabbar { display: block; }
  .topbar nav { display: none; }
  .install-btn { display: none !important; }
}

/* Sections */
.section { padding: clamp(56px, 9vw, 112px) 0; }
.section.white { background: var(--white); }
.section.lilac { background: var(--lilac); }
.section.navy { background: var(--navy); color: var(--white); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 36px; }
.section-head p { margin: 10px 0 0; max-width: 46ch; }

/* Page header for inner pages */
.pagehead { background: var(--lilac); padding: 36px 0 48px; }
.pagehead p { margin: 12px 0 0; }

/* Ad slot. Only on content pages, never inside a game. */
.ad-slot { margin: 32px auto; max-width: 728px; min-height: 90px; border: 2px dashed rgba(29,19,64,.25); border-radius: 12px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 14px; }
.input { width: 100%; padding: 12px 14px; border: 3px solid var(--navy); border-radius: 12px; background: var(--white); }

/* Footer */
.footer { background: var(--navy); color: var(--white); padding: 48px 0 32px; }
.footer .wrap { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.footer h4 { margin: 0 0 10px; font-size: 14px; color: var(--lilac); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer a { text-decoration: none; opacity: .9; }
.footer a:hover { opacity: 1; text-decoration: underline; }
.footer .logo { box-shadow: 4px 4px 0 var(--lilac); }
.footer .fine { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.15); padding-top: 18px; font-size: 13px; opacity: .7; }
@media (max-width: 820px) { .footer .wrap { grid-template-columns: 1fr 1fr; } .footer .brand { grid-column: 1 / -1; } }

/* Cookie choice */
.consent { position: fixed; left: 16px; right: 16px; bottom: calc(16px + var(--tabbar)); z-index: 60; max-width: 520px; margin-left: auto; padding: 18px; }
.consent p { margin: 0 0 12px; font-size: 14px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--tabbar)); transform: translateX(-50%); background: var(--navy); color: var(--white); padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 70; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Pro */
.adfree .ad-slot { display: none !important; }
.topbar nav a.pro-link { background: var(--navy); color: var(--yellow, #ffd400); padding-left: 16px; padding-right: 16px; }
.topbar nav a.pro-link:hover { background: var(--orange); color: var(--navy); }
.pro-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: #ffd400; font: 900 12px/1 var(--display); letter-spacing: .08em; padding: 5px 9px; border-radius: 999px; text-transform: uppercase; vertical-align: middle; }
.pro-lock { border: 3px dashed var(--navy); border-radius: var(--radius); padding: 18px 20px; background: #fff8d6; }
.pro-lock p { margin: 6px 0 12px; }

/* Background patterns. Very faint, a different one per surface: classroom doodles on the page,
   confetti on lilac, chalk marks on navy, notebook dots on white. */
:root {
  --pat-doodle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300' fill='none' stroke='%231d1340' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg opacity='.075'%3E%3Cpath d='M40 22l5 11 12 1-9 8 3 12-11-6-11 6 3-12-9-8 12-1z'/%3E%3Cpath d='M150 28h48a10 10 0 0 1 10 10v18a10 10 0 0 1-10 10h-28l-13 11v-11h-7a10 10 0 0 1-10-10V38a10 10 0 0 1 10-10z'/%3E%3Cpath d='M162 46h30M162 54h18'/%3E%3Cpath d='M18 160q10-12 20 0t20 0 20 0 20 0'/%3E%3Cpath d='M240 132a12 12 0 1 1 16 11c-4 2-4 5-4 9'/%3E%3Ccircle cx='252' cy='163' r='1.6'/%3E%3Cpath d='M74 252v16M66 260h16'/%3E%3Ccircle cx='104' cy='96' r='8'/%3E%3Cpath d='M228 236c-7 2-9 9-7 16M241 236c-7 2-9 9-7 16'/%3E%3Cpath d='M214 92l9 9 9-9 9 9'/%3E%3Cpath d='M52 98l10 17H42z'/%3E%3Cpath d='M150 196l26-26 8 8-26 26-11 3z'/%3E%3Cpath d='M270 22v10M265 27h10'/%3E%3C/g%3E%3Ctext x='118' y='272' font-family='Georgia,serif' font-size='30' font-style='italic' fill='%231d1340' stroke='none' opacity='.07'%3EAa%3C/text%3E%3C/svg%3E");
  --pat-confetti: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='%23fff' opacity='.32'%3E%3Ccircle cx='20' cy='24' r='3'/%3E%3Crect x='80' y='14' width='16' height='5' rx='2.5' transform='rotate(30 88 16)'/%3E%3Ccircle cx='124' cy='92' r='2.2'/%3E%3Cpath d='M40 100l7 12H33z'/%3E%3Crect x='96' y='130' width='14' height='5' rx='2.5' transform='rotate(-25 103 132)'/%3E%3Ccircle cx='150' cy='40' r='1.8'/%3E%3Ccircle cx='70' cy='60' r='1.6'/%3E%3Cpath d='M136 150a6 6 0 0 1 12 0' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
  --pat-chalk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cg opacity='.06'%3E%3Cpath d='M30 30v14M23 37h14'/%3E%3Cpath d='M150 60q8-10 16 0t16 0'/%3E%3Ccircle cx='70' cy='150' r='9'/%3E%3Cpath d='M180 170l12 12M192 170l-12 12'/%3E%3Cpath d='M110 100l6 12h-12z'/%3E%3C/g%3E%3Ctext x='20' y='112' font-family='Georgia,serif' font-size='22' font-style='italic' fill='%23fff' stroke='none' opacity='.06'%3Eabc%3C/text%3E%3Ctext x='140' y='212' font-family='Georgia,serif' font-size='20' fill='%23fff' stroke='none' opacity='.06'%3E%3F!%3C/text%3E%3C/svg%3E");
}
body { background-image: var(--pat-doodle); background-size: 300px 300px; }
html .section.lilac, html .pagehead, html .hero { background-image: var(--pat-confetti); background-size: 160px 160px; }
html .section.navy, html .footer, html .deal, html .prohead { background-image: var(--pat-chalk); background-size: 220px 220px; }
html .section.white { background-image: radial-gradient(rgba(29,19,64,.07) 1.4px, transparent 1.6px); background-size: 24px 24px; }
@media print { body, .section, .pagehead, .footer { background-image: none !important; } }
