/* clearpaneapp.com | Clearpane only. Hand-written. Tokens from DESIGN.md and
   BRAND.md: Paper, Ink, Pine. Newsreader for display, Instrument Sans for text.
   Engine mechanism lives in /scrollcraft.css and is never restyled here. */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-var.woff2") format("woff2");
  font-weight: 400 650; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-italic-var.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-var.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #F5F1EA; --card: #FFFDF9; --ink: #1C1B18; --muted: #6E6A62;
  --hairline: #E6E0D5; --accent: #2F6B5A; --on-accent: #FFFFFF;
  --mist: #DCEAE4; --clay: #B5532A;
  --frame-1: #3B7A68; --frame-2: #2A6152;
  --shadow: 30 25% 20%;

  --sc-canvas: var(--paper);
  --sc-surface: var(--card);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--muted);
  --sc-accent: var(--accent);
  --sc-accent-ink: var(--on-accent);
  --sc-shadow-color: var(--shadow);
  --sc-font-display: "Newsreader", "New York", Georgia, serif;
  --sc-font-text: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --sc-font-mono: "Instrument Sans", system-ui, sans-serif;
  /* A serif at display size wants less negative tracking than a grotesk. */
  --sc-track-tight: -0.016em;
  --sc-track-snug: -0.01em;
  --sc-r-md: 14px; --sc-r-lg: 22px;
  --bar-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151412; --card: #1F1D1A; --ink: #F5F1EA; --muted: #A39E94;
    --hairline: #2E2B27; --accent: #7FC2AE; --on-accent: #151412;
    --mist: #1F3530; --clay: #E58A61;
    --frame-1: #3B7A68; --frame-2: #2A6152;
    --shadow: 30 30% 2%;
  }
}

html { background: var(--paper); }
body { background: var(--paper); color: var(--ink); font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.1875rem); }
main { display: block; }
h1, h2, h3 { font-family: var(--sc-font-display); font-weight: 500; font-optical-sizing: auto; }
a { color: inherit; }
p a, li a, dd a { color: var(--accent); text-decoration-thickness: 1px; }
p a:hover, li a:hover, dd a:hover { text-decoration-thickness: 2px; }
.sc-display { font-weight: 500; line-height: 1.02; }
.sc-body { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------------------------------------------------------------- bar -- */
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--card); padding: .6rem 1rem; border-radius: 10px; }
.skip:focus { top: 1rem; }
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 70; height: var(--bar-h);
  display: flex; align-items: center; gap: var(--sc-5);
  padding-inline: var(--sc-gutter);
  background: var(--paper);
  border-bottom: 1px solid color-mix(in oklab, var(--hairline) 70%, transparent);
}
.bar__mark { display: block; margin-right: auto; padding: 8px 0; }
.bar__mark img { height: 28px; width: auto; }
.bar__mark .wm-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .bar__mark .wm-light { display: none; }
  .bar__mark .wm-dark { display: block; }
}
.bar nav { display: flex; gap: var(--sc-5); font-size: .95rem; }
.bar nav a { text-decoration: none; color: var(--muted); padding: 10px 2px; transition: color 160ms var(--sc-ease-out); }
.bar nav a:hover { color: var(--ink); }
@media (max-width: 860px) { .bar nav { display: none; } }

/* The one action. Same label everywhere. Flat Pine, no gradient. */
.cta {
  display: inline-flex; align-items: center; gap: .55em; white-space: nowrap;
  background: var(--accent); color: var(--on-accent);
  font: 600 1rem/1 var(--sc-font-text); letter-spacing: 0;
  padding: 1rem 1.35rem; border-radius: 999px; text-decoration: none;
  box-shadow: 0 1px 1px hsl(var(--shadow) / .18), 0 6px 16px -6px hsl(var(--shadow) / .35);
  transition: background-color 160ms var(--sc-ease-out), transform 120ms var(--sc-ease-out);
}
.cta svg { width: 1.05em; height: 1.05em; flex: none; }
.cta:hover { background: color-mix(in oklab, var(--accent) 86%, var(--ink)); }
.cta:active { transform: translateY(1px) scale(.98); }
.cta--small { font-size: .875rem; padding: .7rem 1rem; }
@media (max-width: 420px) { .bar .cta--small { font-size: .8125rem; padding: .65rem .85rem; } .bar__mark img { height: 24px; } }

/* ------------------------------------------------------- the window -- */
.window { display: block; width: 100%; height: auto; overflow: visible; }
.window__frame-fill { fill: url(#frameGrad); }
.window .clay { fill: none; stroke: var(--clay); stroke-width: 7; }
.window__shadow { filter: drop-shadow(0 18px 30px hsl(var(--shadow) / .22)) drop-shadow(0 3px 6px hsl(var(--shadow) / .16)); }

/* ---------------------------------------------------- act 1: the glass -- */
.glass-act .sc-stage { display: grid; }
.glass {
  position: relative; height: 100%;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center; gap: var(--sc-7);
  padding: calc(var(--bar-h) + var(--sc-5)) var(--sc-gutter) var(--sc-6);
  max-width: 92rem; margin-inline: auto; width: 100%;
}
.glass__copy { position: relative; align-self: center; min-height: 22rem; }
.glass__copy > div { position: absolute; inset: 0 0 auto 0; top: 50%; translate: 0 -50%; }
.glass__copy h1 { font-size: clamp(2.6rem, 1.4rem + 3.6vw, 5.2rem); line-height: 1; letter-spacing: -0.02em; max-width: 11ch; margin: 0; text-wrap: balance; }
.glass__copy .lede { font-size: clamp(1.1rem, 1rem + .4vw, 1.35rem); line-height: 1.5; color: var(--muted); max-width: 30ch; margin: var(--sc-5) 0 var(--sc-6); text-wrap: pretty; }
.glass__copy .say { font-family: var(--sc-font-display); font-size: clamp(2rem, 1.2rem + 2.4vw, 3.6rem); line-height: 1.06; letter-spacing: -0.015em; margin: 0; max-width: 14ch; text-wrap: balance; }
.glass__copy .say + p { color: var(--muted); max-width: 32ch; margin: var(--sc-4) 0 0; font-size: clamp(1.05rem, 1rem + .25vw, 1.2rem); }
.glass__win { position: relative; justify-self: center; width: min(100%, calc((100svh - var(--bar-h) - 4rem) * 0.909)); }
/* Light through the window, falling on the wall behind it. The far plane. */
.glass__light {
  position: absolute; inset: 9% -13% -7% 16%; z-index: 0; pointer-events: none;
  opacity: var(--light, .3); will-change: transform, opacity;
}
.glass__light svg { width: 100%; height: 100%; filter: blur(18px); }
.glass__light rect { fill: var(--mist); }
.glass__win .window { position: relative; z-index: 1; }

@media (max-width: 860px) {
  .glass { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: var(--sc-4); align-items: start;
           padding: calc(var(--bar-h) + var(--sc-4)) 16px var(--sc-4); }
  .glass__copy { min-height: 18.75rem; }
  .glass__copy > div { top: 0; translate: none; }
  .glass__copy h1 { font-size: clamp(2.2rem, 1.2rem + 5vw, 2.9rem); max-width: 12ch; }
  .glass__copy .lede { margin: var(--sc-3) 0 var(--sc-4); font-size: 1.05rem; max-width: 34ch; }
  .glass__copy .say { font-size: clamp(1.75rem, 1.1rem + 3.4vw, 2.3rem); max-width: 16ch; }
  .glass__copy .say + p { font-size: 1rem; }
  .glass__win { width: min(100%, calc((100svh - var(--bar-h) - 21rem) * 0.909)); align-self: start; justify-self: start; }
  .glass__light { inset: 4% -6% -3% 8%; }
}
@media (max-width: 860px) and (max-height: 700px) {
  .glass__copy { min-height: 15.5rem; }
  .glass__copy h1 { font-size: 2rem; }
  .glass__copy .lede { font-size: .98rem; margin: var(--sc-2) 0 var(--sc-3); }
  .glass__win { width: min(100%, calc((100svh - var(--bar-h) - 19.5rem) * 0.909)); }
}

/* -------------------------------------------------------- act 2: proof -- */
.proof .sc-stage { display: grid; }
.proof__in {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: var(--sc-7); align-items: center;
  padding: calc(var(--bar-h) + var(--sc-5)) var(--sc-gutter) var(--sc-6);
  max-width: 92rem; margin-inline: auto; width: 100%; height: 100%;
}
.proof__copy { position: relative; min-height: 20rem; }
.proof__copy > div { position: absolute; inset: 0 0 auto 0; top: 50%; translate: 0 -50%; }
.proof__copy h2 { font-size: clamp(2.2rem, 1.3rem + 2.6vw, 4rem); line-height: 1.02; letter-spacing: -0.018em; margin: 0 0 var(--sc-4); max-width: 12ch; }
.proof__copy p { color: var(--muted); max-width: 34ch; margin: 0; }
.proof__copy .em { color: var(--ink); font-family: var(--sc-font-display); font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem); line-height: 1.2; max-width: 20ch; }
.proof__fig { margin: 0; justify-self: center; width: min(100%, calc((100svh - var(--bar-h) - 7rem) * 0.9315)); }
.proof__labels { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: var(--sc-3); font-size: .9rem; font-weight: 600; letter-spacing: .01em; }
.proof__labels span:first-child { color: var(--clay); }
.proof__labels span:last-child { color: var(--accent); }
.proof__frame {
  position: relative; aspect-ratio: 1006 / 1080; overflow: hidden;
  border: 14px solid var(--frame-2); border-radius: 26px; background: var(--frame-2);
  box-shadow: 0 18px 40px -12px hsl(var(--shadow) / .28), 0 3px 8px hsl(var(--shadow) / .14);
}
.proof__frame > :is(img, video) { border-radius: 12px; }
@media (max-width: 860px) {
  .proof__in { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: var(--sc-4); align-items: start; padding: calc(var(--bar-h) + var(--sc-4)) 16px var(--sc-4); }
  .proof__copy { min-height: 11rem; }
  .proof__copy > div { top: 0; translate: none; }
  .proof__copy h2 { font-size: 2rem; margin-bottom: var(--sc-3); }
  .proof__copy p { font-size: 1rem; }
  .proof__copy .em { font-size: 1.45rem; }
  .proof__fig { width: min(100%, calc((100svh - var(--bar-h) - 15rem) * 0.9315)); }
  .proof__frame { border-width: 9px; border-radius: 18px; }
}

/* ------------------------------------------------------- flow chapters -- */
.chapter { padding-block: var(--sc-section); }
.chapter + .chapter { border-top: 1px solid var(--hairline); }
.chapter h2 { font-size: clamp(2.2rem, 1.4rem + 2.4vw, 3.8rem); line-height: 1.04; letter-spacing: -0.018em; margin: 0; text-wrap: balance; }
.chapter .intro { color: var(--muted); max-width: 40ch; margin: var(--sc-4) 0 0; font-size: clamp(1.1rem, 1rem + .3vw, 1.3rem); line-height: 1.5; }

/* What it handles: an index, not cards */
.handles { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: var(--sc-9); align-items: start; }
.handles dl { margin: var(--sc-7) 0 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--sc-7); }
.handles dl > div { padding: var(--sc-5) 0 var(--sc-6); border-top: 1px solid var(--hairline); }
.handles dt { font-family: var(--sc-font-display); font-size: clamp(1.35rem, 1.15rem + .5vw, 1.7rem); line-height: 1.15; letter-spacing: -0.01em; }
.handles dd { margin: var(--sc-2) 0 0; color: var(--muted); max-width: 34ch; }
.handles .fix { margin-top: var(--sc-5); color: var(--muted); max-width: 52ch; }
.handles__shot { position: sticky; top: calc(var(--bar-h) + 2rem); margin: 0; }
.shot-frame {
  border-radius: 40px; overflow: hidden; background: var(--card);
  border: 10px solid var(--ink);
  box-shadow: 0 24px 50px -18px hsl(var(--shadow) / .35), 0 4px 10px hsl(var(--shadow) / .12);
}
@media (prefers-color-scheme: dark) { .shot-frame { border-color: #2E2B27; } }
.shot-frame img { width: 100%; height: auto; }
figcaption { color: var(--muted); font-size: .9rem; margin-top: var(--sc-3); }
@media (max-width: 960px) {
  .handles { grid-template-columns: 1fr; gap: var(--sc-7); }
  .handles__shot { position: static; max-width: 300px; }
}
@media (max-width: 640px) { .handles dl { grid-template-columns: 1fr; } }

/* Privacy receipt */
.receipt-ch { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 5fr); gap: var(--sc-9); align-items: center; }
.receipt-ch .sc-stack p { color: var(--muted); max-width: 42ch; }
.receipt {
  background: var(--card); color: var(--ink);
  border-radius: 6px 6px 0 0; padding: var(--sc-6) var(--sc-6) var(--sc-7);
  box-shadow: 0 20px 44px -18px hsl(var(--shadow) / .3), 0 2px 6px hsl(var(--shadow) / .1);
  max-width: 30rem; width: 100%; justify-self: center; position: relative;
  font-variant-numeric: tabular-nums;
  /* torn bottom edge */
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 20px 10px repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat,
                conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 20px 10px repeat-x;
}
.receipt__head { display: flex; align-items: center; gap: .7rem; padding-bottom: var(--sc-4); border-bottom: 1px dashed var(--hairline); }
.receipt__head img { width: 36px; height: 36px; }
.receipt__head b { font-family: var(--sc-font-display); font-weight: 500; font-size: 1.35rem; display: block; line-height: 1.1; }
.receipt__head span { color: var(--muted); font-size: .85rem; }
.receipt ul { list-style: none; margin: 0; padding: var(--sc-3) 0; }
.receipt li { display: flex; gap: .6rem; align-items: baseline; padding: .7rem 0; }
.receipt li::after { content: none; }
.receipt li .k { flex: none; }
.receipt li .dots { flex: 1; border-bottom: 1.5px dotted color-mix(in oklab, var(--muted) 55%, transparent); transform: translateY(-.3em); }
.receipt li .v { flex: none; font-weight: 600; }
.receipt__total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--hairline); padding-top: var(--sc-4); }
.receipt__total b { font-family: var(--sc-font-display); font-weight: 500; font-size: 1.6rem; }
.receipt__total span { color: var(--accent); font-weight: 600; }
@media (max-width: 900px) { .receipt-ch { grid-template-columns: 1fr; gap: var(--sc-7); } .receipt { padding: var(--sc-5) var(--sc-5) var(--sc-6); } }
@media (max-width: 480px) { .receipt { font-size: .95rem; } .receipt li .k { flex: 0 1 auto; min-width: 0; } .receipt li .dots { min-width: .75rem; } .receipt li .v { text-align: right; } }

/* Test it yourself */
.test { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: var(--sc-9); align-items: center; }
.test__num { font-family: var(--sc-font-display); font-weight: 500; font-size: clamp(6rem, 3rem + 10vw, 12rem); line-height: .9; letter-spacing: -0.03em; margin: var(--sc-5) 0 0; color: var(--accent); }
.test__num small { font-size: .42em; letter-spacing: 0; margin-left: .05em; }
.test__sub { font-family: var(--sc-font-display); font-size: clamp(1.4rem, 1.15rem + .8vw, 2rem); margin: var(--sc-3) 0 var(--sc-5); }
.test p { color: var(--muted); max-width: 44ch; }
.test figure { margin: 0; max-width: 360px; justify-self: center; }
.test figure img { width: 100%; height: auto; border-radius: 18px; box-shadow: 0 18px 40px -16px hsl(var(--shadow) / .3); }
@media (max-width: 860px) { .test { grid-template-columns: 1fr; gap: var(--sc-7); } .test figure { max-width: 280px; justify-self: start; } }

/* iPhone and Mac */
.devices { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--sc-9); align-items: center; }
.devices .sc-stack p { color: var(--muted); max-width: 42ch; }
.devices h3 { font-size: 1.5rem; margin-top: var(--sc-6) !important; }
.widgets { position: relative; aspect-ratio: 1 / .9; }
.widgets > div { position: absolute; }
.widgets img { width: 100%; height: auto; border-radius: 26px; box-shadow: 0 20px 40px -16px hsl(var(--shadow) / .35), 0 3px 8px hsl(var(--shadow) / .12); }
.w-medium { left: 0; top: 8%; width: 78%; }
.w-standby { right: 0; top: 40%; width: 44%; z-index: 2; }
.w-standby img { border-radius: 30px; }
.w-lock { left: 8%; bottom: 0; width: 40%; z-index: 3; }
.w-lock img { border-radius: 18px; }
.w-medium .dark, .w-medium picture { display: block; }
@media (max-width: 860px) { .devices { grid-template-columns: 1fr; gap: var(--sc-7); } }

/* ------------------------------------------------------------- close -- */
.close .sc-stage { display: grid; grid-template-rows: 1fr auto; }
.close__in {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 4fr); gap: var(--sc-8); align-items: center;
  padding: calc(var(--bar-h) + var(--sc-5)) var(--sc-gutter) 0; max-width: 84rem; margin-inline: auto; width: 100%;
}
.close h2 { font-size: clamp(2.4rem, 1.4rem + 3vw, 4.6rem); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 var(--sc-6); max-width: 13ch; text-wrap: balance; }
.close__win { justify-self: center; width: min(100%, 26rem, calc((100svh - var(--bar-h) - 14rem) * .909)); }
.foot {
  padding: var(--sc-5) var(--sc-gutter) var(--sc-5); max-width: 84rem; margin-inline: auto; width: 100%;
  display: flex; flex-wrap: wrap; gap: var(--sc-3) var(--sc-6); align-items: baseline;
  font-size: .85rem; color: var(--muted); border-top: 1px solid var(--hairline);
}
.foot nav { display: flex; gap: var(--sc-5); }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }
.foot p { margin: 0; }
.foot .legal { flex-basis: 100%; font-size: .78rem; }
@media (max-width: 860px) {
  .close__in { grid-template-columns: 1fr; gap: var(--sc-5); padding: calc(var(--bar-h) + var(--sc-4)) 16px 0; }
  .close h2 { font-size: 2.2rem; margin-bottom: var(--sc-4); }
  .close__win { justify-self: start; width: min(62%, calc((100svh - 30rem) * .909)); }
  .foot { padding: var(--sc-4) 16px; gap: var(--sc-2) var(--sc-5); font-size: .8rem; }
  .foot .legal { display: none; }
}

/* ------------------------------------------------------ subpages -- */
.page { max-width: 46rem; margin-inline: auto; padding: calc(var(--bar-h) + var(--sc-8)) var(--sc-gutter) var(--sc-9); }
.page h1 { font-size: clamp(2.4rem, 1.6rem + 2.6vw, 3.8rem); line-height: 1.04; letter-spacing: -0.018em; margin: 0 0 var(--sc-3); }
.page .meta { color: var(--muted); margin: 0 0 var(--sc-7); }
.page h2 { font-size: clamp(1.5rem, 1.25rem + .8vw, 2rem); line-height: 1.15; margin: var(--sc-8) 0 var(--sc-3); letter-spacing: -0.01em; }
.page h3 { font-size: 1.25rem; margin: var(--sc-6) 0 var(--sc-2); }
.page p, .page li { max-width: 64ch; }
.page ol, .page ul { padding-left: 1.2em; }
.page li + li { margin-top: .45em; }
.page .summary { font-size: 1.2rem; line-height: 1.55; border-left: 1px solid var(--accent); padding-left: var(--sc-5); }
.page .lists { list-style: none; padding: 0; margin: 0; }
.page .lists li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: .2rem var(--sc-5); padding: .8rem 0; border-top: 1px solid var(--hairline); max-width: none; margin: 0; }
.page .lists li span { color: var(--muted); font-size: .92rem; }
@media (max-width: 640px) { .page .lists li { grid-template-columns: 1fr; } }
.page-foot { max-width: 46rem; margin-inline: auto; padding: var(--sc-6) var(--sc-gutter) var(--sc-7); border-top: 1px solid var(--hairline); color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: var(--sc-3) var(--sc-6); }
.page-foot a { color: var(--muted); }
.page-foot p { margin: 0; flex-basis: 100%; }

/* --------------------------------------------------- reduced motion -- */
@media (prefers-reduced-motion: reduce) {
  .cta, .cta:active { transition: none; transform: none; }
  .glass__light { transform: none !important; }
}
