/* pilefall.app: the app's look (app/lib/design/tokens.dart, docs/design.md): the dark desk, sleeves, foil gold;
   Bricolage Grotesque for display, Figtree for text, JetBrains Mono for what is printed on a card. Dark first, as the
   app's camera screens are; light follows the reader's system. */

@font-face { font-family: "Bricolage"; src: url("fonts/BricolageGrotesque-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/Figtree-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/Figtree-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/Figtree-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --desk: #0E1013; --sleeve: #171A1F; --raised: #20242B; --line: #2A2F37;
  --ink: #F2EFE8; --soft: #A4A8B0; --foil: #F2B544; --on-foil: #1B1406; --matched: #3CC48A; --unsure: #F07A4F;
  --glow: rgba(242, 181, 68, 0.16);
  --radius: 22px; --radius-m: 14px;
  --wrap: 1120px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --desk: #F4F1EA; --sleeve: #FFFFFF; --raised: #EAE5DA; --line: #DCD5C8;
    --ink: #16181D; --soft: #5B5F68; --foil: #B9781A; --on-foil: #FFFFFF; --matched: #1E8A5C; --unsure: #C4502A;
    --glow: rgba(185, 120, 26, 0.14);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--desk); color: var(--ink); font: 400 17px/1.6 "Figtree", system-ui, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--foil); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: "Bricolage", "Figtree", sans-serif; font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0.4em; }
h1 { font-size: clamp(40px, 6vw, 68px); }
h2 { font-size: clamp(30px, 4vw, 44px); }
h3 { font-size: 22px; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--foil); color: var(--on-foil); padding: 8px 14px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--foil); outline-offset: 3px; border-radius: 6px; }

/* the mark: the app's icon (app/tool/icon/: the striped parachute bringing a holo card down onto the pile) */
.brand { display: inline-flex; align-items: center; gap: 12px; font: 800 24px/1 "Bricolage", sans-serif; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand img { width: 36px; height: 36px; border-radius: 9px; flex: none; box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent); }

.site-head { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--desk) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.site-head .wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.langs { margin-left: auto; display: flex; gap: 2px; }
.langs a { font: 600 13px/1 "Figtree", sans-serif; letter-spacing: 0.06em; color: var(--soft); text-decoration: none; padding: 8px 8px; border-radius: 8px; }
.langs a:hover, .langs a[aria-current] { color: var(--ink); background: var(--sleeve); }
.head-link { font-weight: 600; color: var(--ink); text-decoration: none; font-size: 15px; }
.head-link:hover { color: var(--foil); }

/* hero: the pitch beside pile mode itself */
.hero { position: relative; overflow: hidden; padding: 72px 0 40px; }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto auto; width: 70%; height: 120%;
  background: radial-gradient(closest-side, var(--glow), transparent 70%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.kicker { font: 500 14px/1 "JetBrains Mono", monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--foil); margin-bottom: 18px; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--soft); max-width: 36em; }
.free { font-size: 15px; color: var(--soft); margin-top: 22px; }
.free b { color: var(--ink); }
.hero.lost { padding: 120px 0; text-align: center; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.store { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 14px; border-radius: 14px;
  background: var(--ink); color: var(--desk); text-decoration: none; min-width: 172px; }
.store svg { width: 26px; height: 26px; }
.store small { display: block; font-size: 12px; line-height: 1.1; opacity: 0.8; }
.store b { display: block; font-size: 18px; line-height: 1.2; }
.store.soon { background: var(--sleeve); color: var(--ink); border: 1px solid var(--line); }
.store.soon small { color: var(--soft); opacity: 1; }

/* an app screen in a phone's outline */
.phone { margin: 0 auto; max-width: 330px; padding: 10px; border-radius: 46px; background: #050607;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--line); }
.phone img { border-radius: 37px; width: 100%; }
/* the hero: pile mode in front, a set's progress behind it */
.hero-shot { position: relative; min-height: 640px; }
.hero-shot .front { position: relative; z-index: 2; transform: translateX(-20%) rotate(-2deg); }
.hero-shot .back { position: absolute; z-index: 1; top: 48px; right: -2%; width: 74%; transform: rotate(6deg); }
.hero-shot .back .phone { max-width: 270px; }
/* a feature's pair: the scanner in front, its result behind */
.pair { position: relative; min-height: 600px; }
.pair .front { position: relative; z-index: 2; transform: translateX(-14%) rotate(-2deg); }
.pair .back { position: absolute; z-index: 1; top: 40px; right: 0; width: 74%; transform: rotate(5deg); }
.pair .back .phone { max-width: 260px; }

.intro { padding: 36px 0 24px; }
.intro p { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.45; text-align: center; color: var(--ink); }

.feature { padding: 64px 0; }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.feature.flip .feature-copy { order: 2; }
.feature-copy ul { list-style: none; padding: 0; margin: 18px 0 0; }
.feature-copy li { position: relative; padding: 0 0 14px 34px; color: var(--soft); }
.feature-copy li strong, .feature-copy li b { color: var(--ink); }
.feature-copy li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 22px; border-radius: 4px;
  background: var(--sleeve); border: 2px solid var(--foil); transform: rotate(-8deg); }
.feature-copy p { color: var(--soft); }

.tiles { padding: 48px 0; }
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile { background: var(--sleeve); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 26px 18px; }
.tile-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--raised); color: var(--foil); margin-bottom: 16px; }
.tile p, .tile li { color: var(--soft); font-size: 16px; }
.tile ul { padding-left: 18px; margin: 0 0 1em; }
.tile li { margin-bottom: 6px; }
.langs-line { text-align: center; color: var(--soft); margin-top: 28px; font: 500 14px/1.5 "JetBrains Mono", monospace; letter-spacing: 0.02em; }

.cta { padding: 56px 0 88px; text-align: center; }
.cta .stores { justify-content: center; }

/* legal and help pages */
.doc-head { padding: 56px 0 8px; }
.doc-body { display: grid; grid-template-columns: 240px 1fr; gap: 48px; padding-bottom: 80px; }
.doc-body.solo { grid-template-columns: 1fr; max-width: 820px; }
.toc { position: sticky; top: 92px; align-self: start; font-size: 14px; }
.toc b { display: block; font-weight: 700; margin-bottom: 8px; }
.toc ol { padding-left: 18px; margin: 0; color: var(--soft); }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--soft); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.prose { max-width: 760px; }
.prose h2 { font-size: 28px; margin-top: 1.6em; scroll-margin-top: 90px; }
.prose h3 { font-size: 20px; margin-top: 1.4em; scroll-margin-top: 90px; }
.prose li { margin-bottom: 0.4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1em 0 1.6em; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--soft); font-weight: 600; }
.prose blockquote { margin: 1em 0; padding: 12px 18px; border-left: 3px solid var(--foil); background: var(--sleeve); border-radius: 0 12px 12px 0; }
.prose code { font: 500 0.9em "JetBrains Mono", monospace; }
mark { background: var(--foil); color: var(--on-foil); padding: 0 4px; border-radius: 4px; }

.site-foot { border-top: 1px solid var(--line); padding: 48px 0 36px; font-size: 15px; color: var(--soft); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.foot-brand p { margin: 14px 0 0; font-size: 13px; max-width: 42em; }
.site-foot h4 { color: var(--ink); font-size: 14px; margin: 6px 0 12px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin-bottom: 8px; }
.site-foot a { color: var(--soft); }
.site-foot a:hover { color: var(--ink); }
.foot-legal { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; }

@media (max-width: 860px) {
  .hero { padding: 40px 0 24px; }
  .hero-grid, .feature-grid { grid-template-columns: 1fr; gap: 36px; }
  .feature.flip .feature-copy { order: 0; }
  .feature { padding: 40px 0; }
  .tile-grid { grid-template-columns: 1fr; }
  .doc-body { grid-template-columns: 1fr; }
  .toc { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .phone { max-width: 290px; }
  .hero-shot { min-height: 0; }
  .hero-shot .front { transform: none; }
  .hero-shot .back { display: none; }
  .pair { min-height: 0; }
  .pair .front { transform: none; }
  .pair .back { display: none; }
}
@media (max-width: 520px) {
  .site-head .wrap { gap: 10px; }
  .brand { font-size: 21px; }
  .langs a { padding: 8px 5px; font-size: 12px; }
  .head-link { display: none; }
  .store { min-width: 0; flex: 1 1 150px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
