/* House of Cairn: the studio site (redesign, owner's request of 2026-11-06).
   The studio is the warm paper and ink around the apps; each app gets a band in its own identity
   (studio ADR 0010): Linecheck in marigold and ink with its chain, the .cc band in cream, ink and coral
   with its two-sided card. The cairn mark is now stacked from the apps' colours.
   Motion is CSS only, scroll-driven where the browser supports it, and off with reduced motion. */

:root {
  /* Studio: warm paper and ink. */
  --bg: #fbf7f0;
  --bg-2: #f4eee4;
  --card: #ffffff;
  --line: #e4dacb;
  --fg: #1e1b24;            /* ink, shared by both apps' icons */
  --fg-soft: #564c44;       /* 8.0:1 on --bg */
  --accent: #1e1b24;        /* links and focus are ink, underlined */
  --accent-soft: #ffe6ba;   /* cream */
  --stone-1: #1e1b24;       /* the cairn: ink, marigold, coral, sand */
  --stone-2: #ffb21f;
  --stone-3: #ff5a3c;
  --stone-4: #b9ab93;
  --shadow: rgb(30 27 36 / 0.16);

  /* Linecheck (docs/design/identity.md in its repository) */
  --lc-ground: linear-gradient(180deg, #ffcd45 0%, #ffb21f 100%);
  --lc-ink: #1c1a17;        /* 9.6:1 on marigold */
  --lc-soft: #3d3426;       /* 7.0:1 on #ffb21f */
  --lc-strip: #fff4d6;
  --lc-chain: #1c1a17;
  --lc-faint: #c9bfa8;
  --lc-slow: #a34b00;       /* 5.6:1 on the strip */
  --lc-head: #1c1a17;
  --lc-motif: rgb(28 26 23 / 0.09);

  /* The .cc band (docs/design/identity.md in its app's repository) */
  --cc-ground: linear-gradient(180deg, #fff5e1 0%, #ffe6ba 100%);
  --cc-ink: #1e1b24;        /* 14:1 on cream */
  --cc-soft: #4f4842;       /* 7.3:1 on #ffe6ba */
  --cc-speaker: #1e1b24;
  --cc-coral: #ff5a3c;      /* fills only, with ink on them (5.5:1) */
  --cc-small: #a8351b;      /* small shapes in light: coral text, 6:1 on cream (identity, "Small shapes") */
  --cc-head: #1e1b24;
  --cc-motif: rgb(255 90 60 / 0.12);

  --font-display: "Unbounded", "Avenir Next", "Futura", system-ui, sans-serif;
  --font-body: "Instrument Sans", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: clamp(0.84rem, 0.8rem + 0.15vw, 0.92rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.55rem, 1.3rem + 1.2vw, 2.3rem);
  --step-3: clamp(2.2rem, 1.5rem + 3.4vw, 4.4rem);

  --radius-card: 28px;
  --radius-pill: 999px;
  --measure: 62ch;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}

/* Light and dark follow the visitor's system setting (studio ADR 0009). Each app's band takes its
   icon's dark appearance. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110e; --bg-2: #1a1814; --card: #211d18; --line: #35302a;
    --fg: #f0e6da; --fg-soft: #c2b6a8; --accent: #f0e6da; --accent-soft: #3a2e12;
    --stone-1: #f0e6da; --stone-2: #ffc33a; --stone-3: #ff6a4a; --stone-4: #8c806e;
    --shadow: rgb(0 0 0 / 0.5);
    --lc-ground: linear-gradient(180deg, #24211c 0%, #12110e 100%);
    --lc-ink: #ece6da; --lc-soft: #c9c0b0; --lc-strip: #2a2418; --lc-chain: #ece6da;
    --lc-faint: #5a5244; --lc-slow: #ff9558; --lc-head: #ffc33a; --lc-motif: rgb(255 195 58 / 0.1);
    --cc-ground: linear-gradient(180deg, #211c17 0%, #0f0d0b 100%);
    --cc-ink: #ffe9c4; --cc-soft: #d4c8bb; --cc-speaker: #ffe9c4; --cc-coral: #ff6a4a; --cc-small: #ff6a4a;
    --cc-head: #ffe9c4; --cc-motif: rgb(255 106 74 / 0.06);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12110e; --bg-2: #1a1814; --card: #211d18; --line: #35302a;
  --fg: #f0e6da; --fg-soft: #c2b6a8; --accent: #f0e6da; --accent-soft: #3a2e12;
  --stone-1: #f0e6da; --stone-2: #ffc33a; --stone-3: #ff6a4a; --stone-4: #8c806e;
  --shadow: rgb(0 0 0 / 0.5);
  --lc-ground: linear-gradient(180deg, #24211c 0%, #12110e 100%);
  --lc-ink: #ece6da; --lc-soft: #c9c0b0; --lc-strip: #2a2418; --lc-chain: #ece6da;
  --lc-faint: #5a5244; --lc-slow: #ff9558; --lc-head: #ffc33a; --lc-motif: rgb(255 195 58 / 0.1);
  --cc-ground: linear-gradient(180deg, #211c17 0%, #0f0d0b 100%);
  --cc-ink: #ffe9c4; --cc-soft: #d4c8bb; --cc-speaker: #ffe9c4; --cc-coral: #ff6a4a; --cc-small: #ff6a4a;
  --cc-head: #ffe9c4; --cc-motif: rgb(255 106 74 / 0.06);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--step-0)/1.6 var(--font-body);
  overflow-x: clip;
}
.wrap {
  max-width: 1180px; margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.14em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; text-wrap: balance; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; max-width: var(--measure); }
img { max-width: 100%; }
.label { font: 500 var(--step--1)/1.4 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-soft); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; padding: 10px 16px; border-radius: var(--radius-pill); background: var(--card); color: var(--fg); }
.skip:focus { left: 16px; }

/* Header: the wordmark and the cairn mark, stacked from the apps' colours. */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font: 700 1.05rem/1 var(--font-display); white-space: nowrap; letter-spacing: -0.01em; }
.wordmark svg { width: 34px; height: 34px; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a {
  color: var(--fg); text-decoration: none; font-weight: 600; font-size: var(--step--1);
  padding: 8px 14px; border-radius: var(--radius-pill);
}
.top nav a:hover { background: var(--bg-2); }

/* Hero: the studio line, and the cairn with the two apps as its top stones. */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding-block: clamp(20px, 5vw, 64px) clamp(40px, 7vw, 96px); }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero h1 { font-size: var(--step-3); }
.hero h1 .mark { position: relative; white-space: nowrap; }
.hero h1 .mark::after {
  content: ""; position: absolute; left: -0.06em; right: -0.06em; bottom: -0.02em; height: 0.2em; z-index: -1;
  border-radius: var(--radius-pill); background: var(--stone-2);
}
.hero h1 { position: relative; z-index: 0; }
.hero .lede { font-size: var(--step-1); color: var(--fg-soft); line-height: 1.5; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; }
.jump a {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600;
  padding: 8px 18px 8px 8px; border-radius: var(--radius-pill); color: #1c1a17;
  box-shadow: 0 6px 18px -8px var(--shadow); transition: transform 0.2s ease;
}
.jump a:hover { transform: translateY(-2px); }
.jump img { width: 34px; height: 34px; border-radius: 10px; }
.jump .to-lc { background: #ffb21f; }
.jump .to-cc { background: #ff5a3c; color: #1e1b24; }
.platforms { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 500 var(--step--1)/1 var(--font-mono); padding: 9px 13px; border-radius: var(--radius-pill);
  background: var(--card); border: 1px solid var(--line); color: var(--fg);
}

.cairn { position: relative; display: grid; justify-items: center; align-content: end; min-height: 100%; padding-top: 12px; }
.cairn::before {
  content: ""; position: absolute; inset: 6% 2% 0; border-radius: 48% 48% 40px 40px;
  background: radial-gradient(55% 50% at 50% 62%, var(--accent-soft), transparent 72%);
}
.stone { position: relative; display: block; transform: rotate(var(--tilt, 0deg)); animation: settle 0.9s cubic-bezier(.2,.9,.25,1) both; animation-delay: var(--delay, 0s); }
.stone.app { width: clamp(96px, 15vw, 150px); aspect-ratio: 1; border-radius: 23%; overflow: hidden; box-shadow: 0 16px 30px -12px var(--shadow); transition: transform 0.3s cubic-bezier(.2,.9,.25,1); }
.stone.app img { display: block; width: 100%; height: 100%; }
.stone.app:hover, .stone.app:focus-visible { transform: rotate(calc(var(--tilt, 0deg) * -1)) translateY(-6px) scale(1.04); }
.stone.pebble { width: clamp(30px, 4.5vw, 46px); aspect-ratio: 1.3; border-radius: 50%; background: var(--stone-3); margin-bottom: -4px; }
.stone.base { height: clamp(50px, 7vw, 70px); border-radius: 50% / 50%; box-shadow: 0 14px 26px -14px var(--shadow); }
.stone.b1 { width: clamp(200px, 30vw, 330px); background: var(--stone-1); }
.stone.b2 { width: clamp(150px, 22vw, 240px); background: var(--stone-4); margin-bottom: -6px; }
.cairn .app.lc { margin-bottom: -10px; margin-right: 18%; }
.cairn .app.cc { margin-bottom: -12px; margin-left: 22%; }
.cairn-note { position: relative; margin-top: 14px; font-size: var(--step--1); color: var(--fg-soft); text-align: center; }

@keyframes settle {
  0% { opacity: 0; transform: translateY(-48px) rotate(calc(var(--tilt, 0deg) * 3)); }
  60% { opacity: 1; transform: translateY(4px) rotate(var(--tilt, 0deg)); }
  82% { transform: translateY(-2px) rotate(var(--tilt, 0deg)); }
  100% { opacity: 1; transform: translateY(0) rotate(var(--tilt, 0deg)); }
}

/* App bands: full width, each in its app's own identity. */
.band { position: relative; overflow: hidden; padding-block: clamp(56px, 9vw, 120px); isolation: isolate; }
.band .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.band.flip .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.band.flip .app-copy { order: 2; }
.app-copy { display: grid; gap: 20px; min-width: 0; align-content: start; }
.app-id { display: flex; align-items: center; gap: 16px; }
.app-id img { width: clamp(72px, 9vw, 104px); height: auto; aspect-ratio: 1; border-radius: 23%; box-shadow: 0 14px 28px -12px rgb(0 0 0 / 0.35); }
.app-id .name { font: 700 var(--step-1)/1 var(--font-display); letter-spacing: -0.01em; }
.app-id .kind { font: 500 var(--step--1)/1.4 var(--font-mono); letter-spacing: 0.05em; text-transform: uppercase; margin-top: 6px; }
.band h2 { font-size: var(--step-3); }
.band .pitch { font-size: var(--step-1); line-height: 1.5; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 12px; align-items: baseline; font-weight: 600; }
.facts li::before { content: ""; flex: none; width: 1.3em; height: 0.62em; border-radius: var(--radius-pill); border: 0.16em solid currentColor; transform: translateY(0.02em) rotate(-38deg); }
.stores { display: flex; flex-wrap: wrap; gap: 10px; }
.store {
  display: inline-grid; gap: 2px; padding: 10px 18px; border-radius: 16px; border: 2px solid currentColor;
  font: 600 var(--step-0)/1.2 var(--font-body);
}
.store small { font: 500 0.72rem/1.2 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }

/* Linecheck: marigold ground, ink line; the chain strip. */
.band.lc { background: var(--lc-ground); color: var(--lc-ink); }
.band.lc h2 { color: var(--lc-head); }
.band.lc .kind, .band.lc .pitch { color: var(--lc-soft); }
.band.lc .motif { position: absolute; z-index: -1; right: -6vw; top: -8vw; width: clamp(320px, 52vw, 720px); color: var(--lc-motif); transform: rotate(-38deg); }

.strip { width: min(100%, 420px); padding: 16px 18px 12px; border-radius: 22px; background: var(--lc-strip); box-shadow: 0 10px 24px -14px rgb(0 0 0 / 0.35); }
.strip svg { display: block; width: 100%; height: auto; overflow: visible; }
.strip .link { fill: none; stroke: var(--lc-chain); stroke-width: 6; }
.strip text { fill: var(--lc-ink); font: 600 13px var(--font-body); text-anchor: middle; }
.strip .weak .link { stroke: var(--lc-slow); }
.strip .weak text { fill: var(--lc-slow); font-weight: 700; }
.strip .l1, .strip .l2, .strip .l3, .strip .l4, .strip .weak-move { transform-box: view-box; }
.strip .weak-move { transform: translate(0, 7px) rotate(10deg); transform-origin: 134px 23px; }
.strip-caption { margin-top: 6px; font-size: var(--step--1); color: var(--lc-ink); }

/* .cc: cream ground, ink and coral halves; the card opens at its crease. */
.band.cc { background: var(--cc-ground); color: var(--cc-ink); }
.band.cc h2 { color: var(--cc-head); }
.band.cc .kind, .band.cc .pitch { color: var(--cc-soft); }
.band.cc h2 .word { position: relative; white-space: nowrap; z-index: 0; }
.band.cc h2 .word::after {
  content: ""; position: absolute; left: -0.08em; right: -0.08em; bottom: 0.02em; height: 0.24em; z-index: -1;
  border-radius: var(--radius-pill); background: var(--cc-coral);
}
.band.cc .motif { position: absolute; z-index: -1; left: -10vw; bottom: -12vw; width: clamp(340px, 56vw, 760px); color: var(--cc-motif); transform: rotate(-8deg); }
.card-open { width: clamp(150px, 22vw, 220px); perspective: 600px; }
.card-open svg { display: block; width: 100%; height: auto; overflow: visible; }
.card-open .speaker { fill: var(--cc-speaker); transform-box: fill-box; transform-origin: 100% 50%; }
.card-open .lens { fill: var(--cc-coral); transform-box: fill-box; transform-origin: 0% 50%; }

/* Phones: drawn frames around the identity sheets' screens. */
.phones { display: flex; justify-content: center; align-items: flex-end; padding-block: 12px 4px; min-width: 0; }
.phone {
  flex: none; width: clamp(128px, 17vw, 218px); margin-inline: calc(clamp(128px, 17vw, 218px) * -0.12);
  border: clamp(5px, 0.7vw, 8px) solid #16140f; border-radius: clamp(24px, 3.4vw, 42px); background: #16140f;
  box-shadow: 0 28px 50px -24px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(255 255 255 / 0.06);
  overflow: hidden; transform: rotate(var(--r, 0deg)) translateY(var(--y, 0px));
  transition: transform 0.35s cubic-bezier(.2,.9,.25,1);
  margin-block: 0;
}
.phone picture, .phone img { display: block; width: 100%; height: auto; aspect-ratio: 393 / 852; border-radius: clamp(19px, 2.7vw, 34px); }
.band.cc .phone img { aspect-ratio: 402 / 874; }
.phone:nth-child(1) { --r: -6deg; --y: 18px; z-index: 1; }
.phone:nth-child(2) { --r: 0deg; --y: -10px; z-index: 2; width: clamp(140px, 19vw, 240px); }
.phone:nth-child(3) { --r: 6deg; --y: 18px; z-index: 1; }
.phone:hover { --y: -18px; z-index: 3; }
.phone figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shots-note { margin-top: 26px; text-align: center; font-size: var(--step--1); max-width: none; }
.band.lc .shots-note { color: var(--lc-soft); }
.band.cc .shots-note { color: var(--cc-soft); }
.phones-wrap { min-width: 0; }

/* Studio sections */
section.studio { padding-block: clamp(48px, 7vw, 96px); }
section.studio + section.studio { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 10px; margin-bottom: clamp(24px, 3vw, 40px); }
.section-head h2 { font-size: var(--step-2); }
.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.way { display: grid; gap: 12px; align-content: start; padding: 26px; border-radius: var(--radius-card); background: var(--card); border: 1px solid var(--line); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.way:hover, .way:focus-within { transform: translateY(-4px); box-shadow: 0 18px 32px -20px var(--shadow); }
.way svg { width: 76px; height: 56px; }
.way h3 { font-size: var(--step-1); }
.way p { color: var(--fg-soft); }
.fold-demo .leaf-r { transform-box: fill-box; transform-origin: 0% 50%; transition: transform 0.6s cubic-bezier(.2,.9,.25,1); }
.way:hover .fold-demo .leaf-r, .way:focus-within .fold-demo .leaf-r { transform: scaleX(0.12); }

.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center; }
.story blockquote { margin: 0; padding: clamp(24px, 4vw, 40px); border-radius: var(--radius-card); background: var(--fg); color: var(--bg); display: grid; gap: 14px; }
.story blockquote p { font: 600 var(--step-2)/1.2 var(--font-display); letter-spacing: -0.01em; }
.story blockquote footer { font-size: var(--step--1); opacity: 0.85; }
.story .text { display: grid; gap: 14px; color: var(--fg-soft); font-size: var(--step-1); line-height: 1.5; }
.story .text .label { font-size: var(--step--1); }

.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.address { font: 500 var(--step-1)/1.2 var(--font-mono); color: var(--fg); user-select: all; overflow-wrap: anywhere; }
.button {
  font: 600 var(--step--1)/1 var(--font-body); cursor: pointer;
  padding: 12px 20px; border-radius: var(--radius-pill); background: transparent; color: var(--fg); border: 2px solid var(--fg);
}
.button:hover { background: var(--bg-2); }
.button[data-done] { background: var(--accent-soft); color: var(--fg); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 28px 40px; border-top: 1px solid var(--line); color: var(--fg-soft); font-size: var(--step--1); }
.foot nav { display: flex; gap: 18px; }
.foot a { color: var(--fg-soft); }

/* Long-form pages (privacy, support, terms): one readable column on a paper card, with the apps'
   two colours as a thin stripe on top. The words are approved text; only the look changes. */
.doc {
  position: relative; display: grid; gap: 18px; max-width: 76ch; margin: clamp(8px, 3vw, 32px) 0 clamp(40px, 6vw, 72px);
  padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 64px); border-radius: var(--radius-card);
  background: var(--card); border: 1px solid var(--line); overflow: hidden;
  font-size: clamp(1.02rem, 0.98rem + 0.2vw, 1.12rem); line-height: 1.7;
}
.doc::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: linear-gradient(90deg, var(--stone-2) 0 50%, var(--stone-3) 50% 100%); }
.doc p, .doc li { max-width: 68ch; }
/* A long address set against text with no spaces (ja, zh, th: "…subscriptionsにアクセス") is one
   unbreakable run; let it break where it must, or it widens the column past the card's edge. */
.doc p, .doc li { overflow-wrap: anywhere; }
.doc h1 { font-size: var(--step-3); margin-bottom: 2px; }
.doc h2 { font-size: var(--step-1); margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.doc h3 { font: 600 var(--step-0)/1.35 var(--font-body); letter-spacing: 0; margin-top: 8px; }
.doc ul, .doc ol { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.doc li::marker { color: var(--fg-soft); }
.doc .updated { font: 500 var(--step--1)/1.4 var(--font-mono); color: var(--fg-soft); }
.doc .contact { padding: 16px 18px; border-radius: 18px; background: var(--bg-2); }

/* Scroll-driven motion where supported: the chain joins and its weak link lifts, the card opens,
   the phones rise. Elsewhere, and with reduced motion, everything shows its end state. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .strip .l1 { animation: join-1 linear both; }
    .strip .l2 { animation: join-2 linear both; }
    .strip .l3 { animation: join-3 linear both; }
    .strip .l4 { animation: join-4 linear both; }
    .strip .weak-move { animation: lift linear both; }
    .strip .l1, .strip .l2, .strip .l3, .strip .l4, .strip .weak-move { animation-timeline: view(); animation-range: entry 20% cover 45%; }
    .card-open .speaker { animation: open-speaker linear both; animation-timeline: view(); animation-range: entry 15% cover 40%; }
    .card-open .lens { animation: open-lens linear both; animation-timeline: view(); animation-range: entry 15% cover 40%; }
    .phone { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
  }
}
@keyframes join-1 { 0%, 10% { opacity: 0.25; transform: translateX(-14px); } 30%, 100% { opacity: 1; transform: none; } }
@keyframes join-2 { 0%, 25% { opacity: 0.25; transform: translateX(-14px); } 45%, 100% { opacity: 1; transform: none; } }
@keyframes join-3 { 0%, 40% { opacity: 0.25; transform: translateX(-14px); } 60%, 100% { opacity: 1; transform: none; } }
@keyframes join-4 { 0%, 55% { opacity: 0.25; transform: translateX(-14px); } 75%, 100% { opacity: 1; transform: none; } }
@keyframes lift { 0%, 78% { transform: none; } 100% { transform: translate(0, 7px) rotate(10deg); } }
@keyframes open-speaker { 0% { transform: rotateY(80deg); } 100% { transform: none; } }
@keyframes open-lens { 0% { transform: rotateY(-80deg); } 100% { transform: none; } }
@keyframes rise { 0% { opacity: 0; translate: 0 60px; } 100% { opacity: 1; translate: 0 0; } }

/* Layout: phone first. */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .cairn { order: -1; }
  .band .wrap, .band.flip .wrap { grid-template-columns: minmax(0, 1fr); }
  .band.flip .app-copy { order: 0; }
  .story { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .top { flex-wrap: wrap; gap: 6px; }
  .top nav { gap: 0; margin-left: -10px; }
  .top nav a { padding: 8px 10px; }
  .stone.app { width: 96px; }
  .phone { width: 122px; margin-inline: -12px; border-width: 5px; border-radius: 22px; }
  .phone:nth-child(2) { width: 136px; }
  .phone picture, .phone img { border-radius: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stone, .phone, .jump a, .way, .stone.app { animation: none !important; transition: none !important; }
  .fold-demo .leaf-r { transition: none; }
}

/* The .cc band's list marks are its capsule words, not Linecheck's links. */
.band.cc .facts li::before { border: 0; background: var(--cc-small); height: 0.5em; transform: none; }
@media (max-width: 560px) {
  .doc { margin-inline: -16px; border-radius: 0; border-inline: 0; padding: 32px 16px 40px; }
}

/* The 404 page: the cairn has fallen over. */
.doc.lost .fallen { width: 160px; height: 70px; }

/* Product pages (houseofcairn.app/<app>): the studio's paper around a hero in the app's own
   identity (studio ADR 0010). Each app sets the --app-* values in assets/apps/<slug>.css. */
.pp-hero { position: relative; overflow: hidden; isolation: isolate; padding-block: clamp(36px, 7vw, 96px) clamp(48px, 8vw, 110px); background: var(--app-ground); color: var(--app-ink); }
.pp-hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.pp-hero .motif { position: absolute; z-index: -1; right: -6vw; top: -6vw; width: clamp(320px, 50vw, 700px); color: var(--app-motif); transform: rotate(var(--motif-turn, -20deg)); }
.pp-hero .app-copy { gap: 22px; }
.pp-hero .kind, .pp-hero .pitch, .pp-hero .sub { color: var(--app-soft); }
.pp-hero h1 { font: 800 var(--step-3)/1.05 var(--app-display); letter-spacing: -0.025em; color: var(--app-head); }
.pp-hero .sub { font: 600 var(--step-1)/1.35 var(--app-display); letter-spacing: -0.01em; }
.pp-hero .pitch { font-size: var(--step-1); line-height: 1.5; }
.pp-hero .stores { margin-top: 4px; }
.pp-hero .phones-wrap .shots-note { color: var(--app-soft); }

.pp-sec { padding-block: clamp(44px, 6vw, 84px); }
.pp-sec + .pp-sec { border-top: 1px solid var(--line); }
.pp-sec .section-head h2 { font-family: var(--app-display); font-weight: 800; }
.pp-sec .section-head .label { color: var(--app-link); }
.pp-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.pp-features li {
  position: relative; display: grid; gap: 10px; align-content: start; padding: 26px 24px 24px; overflow: hidden;
  border-radius: var(--radius-card); background: var(--card); border: 1px solid var(--line);
}
.pp-features li::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--app-fill); }
.pp-features h3 { font: 700 var(--step-1)/1.2 var(--app-display); letter-spacing: -0.01em; }
.pp-features p { color: var(--fg-soft); }
.pro {
  display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: var(--radius-pill); vertical-align: 0.2em;
  font: 600 0.7rem/1.4 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--app-fill); color: var(--app-on-fill);
}

.pp-open { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.pp-open .text { display: grid; gap: 16px; }
.pp-open .text p { color: var(--fg-soft); font-size: var(--step-1); line-height: 1.5; }
.pp-open .text h2 { font: 800 var(--step-2)/1.08 var(--app-display); }
.wide-shot { margin: 0; display: grid; gap: 12px; }
.wide-shot .frame {
  border: clamp(6px, 0.8vw, 10px) solid #16140f; border-radius: clamp(20px, 2.6vw, 32px); background: #16140f; overflow: hidden;
  box-shadow: 0 28px 50px -26px var(--shadow);
}
.wide-shot img { display: block; width: 100%; height: auto; border-radius: clamp(14px, 1.8vw, 22px); }
.wide-shot figcaption, .pp-shots figcaption { font-size: var(--step--1); color: var(--fg-soft); text-align: center; }

.pp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.pp-facts > div { display: grid; gap: 12px; align-content: start; padding: 26px 24px; border-radius: var(--radius-card); background: var(--app-tint); color: var(--app-tint-ink); }
.pp-facts h2 { font: 700 var(--step-1)/1.2 var(--app-display); }
.pp-facts p { color: inherit; }
.pp-facts a { color: inherit; font-weight: 600; }
.pp-facts .address { font-size: var(--step-0); }

.pp-hero .phones .phone figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.band .more {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: var(--radius-pill);
  font-weight: 600; text-decoration: none; border: 2px solid currentColor; color: inherit;
}
.band .more:hover { text-decoration: underline; }
.band .more::after { content: "→"; }

@media (max-width: 860px) {
  .pp-hero .wrap, .pp-open { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .pp-hero .phone { animation: none !important; transition: none !important; }
}

/* Languages (studio docs/languages.md): every page in the studio's 17 languages.
   The header links to the list under the page; translated terms and privacy open with a note that
   the English version governs. */
.top nav a.lang-link { display: inline-flex; align-items: center; gap: 6px; }
.globe { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.6; flex: none; }
.langs { max-width: 76ch; margin: 0 0 clamp(32px, 5vw, 56px); display: grid; gap: 10px; }
.langs h2 { display: flex; align-items: center; gap: 8px; font: 600 var(--step--1)/1.4 var(--font-body); letter-spacing: 0; color: var(--fg-soft); }
.langs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: var(--step--1); }
.langs a { font-family: var(--font-body); display: inline-block; padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.langs a:hover { background: var(--bg-2); }
.langs a[aria-current] { background: var(--fg); border-color: var(--fg); color: var(--bg); font-weight: 600; }
.doc .translation-note { padding: 12px 16px; border-radius: 14px; background: var(--bg-2); font-size: var(--step--1); line-height: 1.55; }
.doc h1 { overflow-wrap: break-word; hyphens: auto; }
/* The breadcrumb on an app's own privacy and support pages: the index the page sits under, then
   the app (the current page, not a link). Small and quiet, in the card above the title; it wraps on
   a phone. The separator is hidden from screen readers (the list already says there are two). */
.doc .crumbs ol { list-style: none; margin: 0 0 -8px; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; font: 500 var(--step--1)/1.5 var(--font-body); color: var(--fg-soft); }
.doc .crumbs li { max-width: none; }
.doc .crumbs li + li::before { content: "›"; content: "›" / ""; margin-inline: 0.5em; }
.doc .crumbs a { color: var(--fg-soft); }
.doc .crumbs [aria-current] { color: var(--fg); }

/* Scripts the site's own fonts don't carry use the system's fonts, chosen by each page's lang:
   Cyrillic and Vietnamese (Instrument Sans and the subsets served here are Latin only), Chinese,
   Japanese, Korean, Thai and Devanagari. Headings drop the display face's tight tracking, and
   Thai and Devanagari get room for their marks above and below the line. */
:lang(ru), :lang(vi) {
  --font-display: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-body: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:lang(ja) { --font-display: var(--font-body); --font-body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", "Noto Sans CJK JP", system-ui, sans-serif; }
:lang(ko) { --font-display: var(--font-body); --font-body: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", system-ui, sans-serif; }
:lang(zh-Hant) { --font-display: var(--font-body); --font-body: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans CJK TC", system-ui, sans-serif; }
:lang(zh-Hans) { --font-display: var(--font-body); --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", system-ui, sans-serif; }
:lang(th) { --font-display: var(--font-body); --font-body: Thonburi, "Leelawadee UI", "Noto Sans Thai", "Noto Sans Thai UI", system-ui, sans-serif; }
:lang(hi) { --font-display: var(--font-body); --font-body: "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", "Noto Sans Devanagari", system-ui, sans-serif; }
:lang(ja), :lang(ko), :lang(zh), :lang(th), :lang(hi) { --font-mono: var(--font-body); }
html:is(:lang(ja), :lang(ko), :lang(zh), :lang(th), :lang(hi), :lang(ru), :lang(vi)) :is(h1, h2, h3) { letter-spacing: 0; }
html:is(:lang(th), :lang(hi)) :is(h1, h2, h3) { line-height: 1.4; }
html:is(:lang(th), :lang(hi)) .doc { line-height: 1.8; }
.wordmark { font-family: "Unbounded", "Avenir Next", "Futura", system-ui, sans-serif; }   /* the name stays in its face in every language */

/* On a phone the language button sits at the right of the wordmark's row, so the header's links
   keep their own row. A long name on a narrow phone ends in an ellipsis rather than wrapping. */
@media (max-width: 560px) {
  .top { position: relative; }
  .top nav { flex-basis: 100%; }
  .top nav a.lang-link {
    position: absolute; top: 18px; right: -10px; display: block; max-width: calc(100% - 200px);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .top nav a.lang-link .globe { vertical-align: -0.17em; margin-right: 6px; }
}

/* Japanese headings and short labels break between phrases, not inside a word, where the browser
   can (word-break: auto-phrase; others ignore it and break as before). */
html:lang(ja) :is(h1, h2, h3, .kind, .label, .cairn-note, figcaption, .shots-note) { word-break: auto-phrase; }
/* A phrase kept whole can be wider than a phone: "プライバシーポリシー" is ten wide characters. The
   doc title shrinks to fit one on a narrow screen, and breaks inside it only if it still can't. */
html:lang(ja) .doc h1 { font-size: min(var(--step-3), 9vw); overflow-wrap: anywhere; }

/* The launch-email sign-up (parts/signup.html): one line, the note beside it. */
.signup { margin-top: 28px; max-width: 34rem; }
.signup-title { font-weight: 600; margin: 0 0 8px; }
.signup-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.signup-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.signup input[type="email"] { flex: 1 1 14rem; min-width: 0; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--fg-soft); border-radius: 999px; padding: 10px 16px; }
.signup input[type="email"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.signup-note { margin: 8px 0 0; font-size: var(--step--1); color: var(--fg-soft); }
.pp-sec .signup { margin-top: clamp(32px, 4vw, 48px); }

/* The language offer (assets/lang-offer.js): on an English page, one quiet line above everything,
   in the visitor's language, with a link to this page in it and a close button. It wraps on a phone;
   the button keeps a 40 px target without making the line taller. It's set in the system's font, so
   it doesn't move or rewrap when the web fonts arrive. */
.lang-offer { display: flex; align-items: center; justify-content: space-between; gap: 4px 8px; padding: 6px max(8px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px)); background: var(--bg-2); color: var(--fg); border-bottom: 1px solid var(--line); font: 500 var(--step--1)/1.45 system-ui, sans-serif; }
.lang-offer p { max-width: none; min-width: 0; overflow-wrap: anywhere; text-wrap: pretty; }
.lang-offer:lang(ja) p { word-break: auto-phrase; }
.lang-offer a { color: var(--fg); font-weight: 600; }
.lang-offer-close { flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin-block: -8px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--fg); cursor: pointer; }
.lang-offer-close:hover { background: var(--bg); }
.lang-offer-close:focus-visible { border-radius: 50%; outline-offset: -3px; }
.lang-offer-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
