/* HTML shell only: splash, unsupported-browser page, and the Compose canvas
   host. Tokens match the app's design system (CLAUDE.md §3). */
:root {
  --bg: #FFFFFF;
  --text: #000000;
  --text-secondary: #525252;
  --surface-variant: #EDEDED;
  --outline: #D4D4D4;
  --divider: #E5E5E5;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --text: #FFFFFF;
    --text-secondary: #A3A3A3;
    --surface-variant: #262626;
    --outline: #404040;
    --divider: #262626;
  }
}
@font-face {
  font-family: "Original Surfer";
  src: url("/composeResources/com.karu.sayro.web.design.resources/font/original_surfer_regular.ttf") format("truetype");
  font-display: block;
}
@font-face {
  font-family: "Exo";
  src: url("/composeResources/com.karu.sayro.web.design.resources/font/exo_regular.ttf") format("truetype");
  font-weight: 400;
  /* optional, not swap: a late Exo swapping in re-wrapped the phone landing's
     heading and shifted the page (CLS 0.066, W8). The snapshot keeps the
     fallback if Exo isn't ready at once; repeat visits have it cached. */
  font-display: optional;
}
@font-face {
  font-family: "Exo";
  src: url("/composeResources/com.karu.sayro.web.design.resources/font/exo_medium.ttf") format("truetype");
  font-weight: 500;
  font-display: optional;
}
/* Real <input>s over the canvas (DomTextField): transparent, Compose draws the frame. */
.sayro-dom-input {
  position: fixed;
  z-index: 10;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: 400 16px/24px "Exo", system-ui, sans-serif;
}
textarea.sayro-dom-input {
  resize: none;
  overflow-y: auto;
}
.sayro-dom-input::placeholder {
  color: var(--placeholder);
  opacity: 1;
}
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  overscroll-behavior: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
#app {
  position: fixed;
  inset: 0;
}
#splash, #unsupported, .noscript {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  background: var(--bg);
  text-align: center;
}
#splash { transition: opacity 200ms ease-out; }
#splash.done { opacity: 0; pointer-events: none; }
[hidden] { display: none !important; }
.wordmark {
  font-family: "Original Surfer", system-ui, sans-serif;
  font-size: 45px;
  line-height: 52px;
}
.tagline, #unsupported p, .noscript {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
  max-width: 360px;
}
a { color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  #splash { transition: none; }
}

/* ---- Snapshot (docs/W7_PLAN.md §3.1): the page as plain HTML, shown before
   the Wasm app draws (and instead of it for no-JS and unsupported browsers).
   Static pages (html.static) are only this. Flat, monochrome, Exo 400/500. */
#snapshot {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  background: var(--bg);
  font: 400 16px/24px "Exo", system-ui, sans-serif;
  display: flex;
  flex-direction: column;
}
/* A page with a snapshot shows it, not the splash. */
#snapshot ~ #splash { display: none; }
/* Signed in on "/" (early.js): the home feed is coming, so the splash, not the landing. */
html[data-session] #snapshot { display: none; }
html[data-session] #snapshot ~ #splash { display: flex; }
/* Static pages scroll like any web page: the document scrolls, body is not a
   scroll container, and overscroll isn't blocked (with the app shell's
   overscroll-behavior: none on a non-scrolling body, wheel and trackpad
   scrolling went nowhere; only the scrollbar worked). */
html.static { height: auto; overflow: auto; overscroll-behavior: auto; }
html.static body { height: auto; overflow: visible; overscroll-behavior: auto; }
html.static #snapshot { position: static; min-height: 100vh; }
#snapshot a { color: inherit; }
#snapshot :focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
.s-header {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--divider);
}
.s-header nav { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.s-header nav a, .s-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 8px;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}
.s-header nav a:hover, .s-footer nav a:hover { text-decoration: underline; }
.s-wordmark {
  font-family: "Original Surfer", system-ui, sans-serif;
  font-size: 28px;
  line-height: 36px;
  text-decoration: none;
}
.s-main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  box-sizing: border-box;
}
.s-main h1 { font-weight: 500; font-size: 32px; line-height: 40px; margin: 0 0 16px; }
.s-main h2 { font-weight: 500; font-size: 22px; line-height: 28px; margin: 32px 0 8px; }
.s-main h3 { font-weight: 500; font-size: 16px; line-height: 24px; margin: 24px 0 8px; }
.s-main p, .s-main ul, .s-main ol { margin: 0 0 16px; }
.s-main li { margin: 0 0 8px; }
.s-main strong { font-weight: 500; }
.s-main blockquote { margin: 0 0 16px; padding: 0 0 0 16px; border-left: 1px solid var(--outline); }
.s-reading { max-width: 640px; }
.s-secondary { color: var(--text-secondary); }
.s-small { font-size: 14px; line-height: 20px; }
.s-hero { text-align: center; padding: 48px 0; }
.s-hero h1 { font-size: 45px; line-height: 52px; }
.s-hero p { max-width: 640px; margin: 0 auto 24px; color: var(--text-secondary); }
.s-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.s-actions.s-start { justify-content: flex-start; }
.s-media + h1 { margin-top: 24px; }
.s-button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg) !important;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}
.s-button.secondary { background: var(--surface-variant); color: var(--text) !important; }
.s-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.s-grid li { margin: 0; }
.s-grid a { display: block; text-decoration: none; }
.s-grid img { display: block; width: 100%; height: auto; border-radius: 4px; background: var(--surface-variant); }
.s-grid span { display: block; padding: 8px 0 0; font-size: 14px; line-height: 20px; font-weight: 500; }
.s-media { display: block; max-width: 100%; height: auto; border-radius: 16px; background: var(--surface-variant); }
.s-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--surface-variant); }
.s-footer {
  padding: 24px;
  border-top: 1px solid var(--divider);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
}
.s-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.s-footer nav a { padding: 0; font-weight: 400; }
.s-footer p { margin: 8px 0 0; }
/* The unsupported-browser notice over a snapshot: a banner, not a full page. */
#snapshot > #unsupported {
  position: static;
  padding: 16px 24px;
  border-bottom: 1px solid var(--divider);
}
#snapshot > #unsupported .wordmark { display: none; }
/* No JavaScript: a snapshot page is readable as it is, so no full-page notice. */
#snapshot ~ noscript .noscript { display: none; }
/* Landing hero: the cover wall (static here; the app's version drifts), fading
   into the page from 40% down: the image-fade scrim, the one allowed gradient.
   Sizes match the app's LandingPage (hero type 57/64 from 840px, 45/52 from 600px, 36/44 below). */
.s-main > .s-hero:first-child { margin-top: -8px; padding-top: 0; }
.s-wall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 720px;
  height: 420px;
  margin: 0 auto -48px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.s-wall div { display: flex; flex-direction: column; gap: 12px; margin-top: -24px; }
.s-wall img { display: block; width: 100%; height: auto; aspect-ratio: 0.72; object-fit: cover; border-radius: 8px; background: var(--surface-variant); }
.s-hero .s-hero-wordmark { position: relative; font-family: "Original Surfer", system-ui, sans-serif; font-size: 45px; line-height: 52px; color: var(--text); margin: 0 auto 16px; }
.s-hero h1 { position: relative; font-weight: 400; font-size: 57px; line-height: 64px; margin-bottom: 16px; }
.s-badge { display: inline-flex; min-height: 48px; }
.s-badge img { display: block; height: 60px; width: auto; }
@media (max-width: 839px) {
  .s-hero h1 { font-size: 45px; line-height: 52px; }
}
@media (max-width: 599px) {
  .s-wall { height: 300px; }
  .s-hero h1 { font-size: 36px; line-height: 44px; }
}
/* Phone widths: the app's compact page margin. */
@media (max-width: 599px) {
  .s-header, .s-footer { padding-left: 16px; padding-right: 16px; }
  .s-main { padding-left: 16px; padding-right: 16px; }
}
/* Signed in on this browser (early.js): no "Sign in" in the HTML header. */
html[data-signed-in] .s-signin { display: none; }
