/* Himotoki landing page. Palette mirrors @msr2903/ui/tokens (the app's teal,
   paper neutrals) and the home hero / share-card teal. */

:root {
  --canvas: #fafaf8;
  --surface: #ffffff;
  --panel: #f1efe9;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --border: #e8e6e1;
  --brand: #2a9d8f;
  --brand-ink: #1f7a6f;
  --brand-soft: rgba(42, 157, 143, 0.12);
  --hero: #1d6a61;
  --hero-deep: #164f49;
  --on-hero: #ffffff;
  --on-hero-muted: rgba(255, 255, 255, 0.78);
  --cord: #e8262b;
  --phone-shadow: 0 30px 60px -20px rgba(20, 40, 38, 0.35), 0 12px 24px -12px rgba(0, 0, 0, 0.25);

  --font-display: 'Newsreader', 'Noto Serif JP', Georgia, serif;
  --font-body: 'Inter', 'Noto Sans JP', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-jp-serif: 'Noto Serif JP', 'Hiragino Mincho ProN', serif;

  --wrap: 1120px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #141413;
    --surface: #1c1c1a;
    --panel: #22221f;
    --ink: #e8e6e1;
    --muted: #a3a09a;
    --border: #2e2e2b;
    --brand: #3dbeb0;
    --brand-ink: #4ecfc0;
    --brand-soft: rgba(61, 190, 176, 0.14);
    --hero: #164f49;
    --hero-deep: #0f3a35;
    --phone-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 12px 24px -12px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme="dark"] {
  --canvas: #141413;
  --surface: #1c1c1a;
  --panel: #22221f;
  --ink: #e8e6e1;
  --muted: #a3a09a;
  --border: #2e2e2b;
  --brand: #3dbeb0;
  --brand-ink: #4ecfc0;
  --brand-soft: rgba(61, 190, 176, 0.14);
  --hero: #164f49;
  --hero-deep: #0f3a35;
  --phone-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 12px 24px -12px rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--brand-ink); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 60%, transparent); outline-offset: 3px; border-radius: 6px; }

/* ── Nav ─────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--hero) 92%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  color: var(--on-hero);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.brand img { border-radius: 9px; }
.nav-links { display: flex; align-items: center; gap: 24px; font-size: 15px; font-weight: 500; }
.nav-links a { color: var(--on-hero-muted); text-decoration: none; }
.nav-links a:hover { color: var(--on-hero); }
.nav-links .nav-cta {
  color: var(--hero); background: #fff; padding: 8px 16px; border-radius: 999px; font-weight: 600;
}
.nav-links .nav-cta:hover { color: var(--hero-deep); }

@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ── Hero ────────────────────────────────────────── */

.hero {
  position: relative;
  background: linear-gradient(180deg, var(--hero) 0%, var(--hero) 70%, var(--hero-deep) 100%);
  color: var(--on-hero);
  overflow: hidden;
  padding: 56px 0 0;
}
.cord {
  position: absolute; left: -8%; top: 0; width: 125%; height: 100%; z-index: 0;
  overflow: visible; pointer-events: none;
}
.cord path {
  fill: none; stroke: var(--cord); stroke-width: 5; stroke-linecap: round; opacity: 0.9;
  stroke-dasharray: 2600; stroke-dashoffset: 2600;
  animation: draw-cord 2.4s cubic-bezier(.6,.1,.2,1) .2s forwards;
}
@keyframes draw-cord { to { stroke-dashoffset: 0; } }

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
}
.eyebrow { font-size: 14px; letter-spacing: 0.04em; color: var(--on-hero-muted); margin-bottom: 20px; }
.eyebrow [lang="ja"] { font-family: var(--font-jp-serif); font-size: 16px; color: #fff; letter-spacing: 0.1em; }
.hero h1 {
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 12ch;
}
.lede { margin-top: 22px; font-size: 19px; line-height: 1.55; color: var(--on-hero-muted); max-width: 34ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 34px; }
.cta-row.center { justify-content: center; }
.badges { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-row.center .badges { justify-content: center; }
@media (max-width: 560px) {
  .badges { flex-direction: column; width: 100%; max-width: 280px; }
  .cta-row.center .badges { margin: 0 auto; }
}

.text-link { font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link.on-dark { color: #fff; }

/* Store buttons, in the style of the official black badges */
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 56px; min-width: 186px; padding: 8px 20px 8px 16px;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid #a6a6a6; border-radius: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.store-badge svg { width: 28px; height: 28px; color: #fff; flex: none; margin-top: -3px; }
.store-badge[data-store="android"] svg { width: 26px; height: 26px; margin-top: 0; }
.badge-text { display: flex; flex-direction: column; line-height: 1.05; }
.badge-text small { font-size: 12px; font-weight: 500; letter-spacing: 0.01em; }
.badge-text strong { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-family: -apple-system, 'SF Pro Display', var(--font-body); }
a.store-badge[href]:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(0,0,0,.6); }
.store-badge[aria-disabled="true"] { cursor: default; }

.hero-phones {
  position: relative;
  height: 600px;
  align-self: end;
}
.hero-phones .phone { position: absolute; bottom: -90px; }
.phone-front { width: 290px; right: 22%; z-index: 2; }
.phone-back { width: 262px; right: 0; bottom: -40px !important; transform: rotate(6deg); opacity: .96; }

@media (max-width: 900px) {
  .hero { padding-top: 40px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { max-width: 14ch; }
  .hero-phones { height: 400px; width: 100%; max-width: 440px; margin: 0 auto; }
  .phone-front { width: 230px; right: auto; left: 8%; }
  .phone-back { width: 210px; right: 4%; }
}

/* ── Phone frame ─────────────────────────────────── */

.phone {
  margin: 0;
  position: relative;
  padding: 9px;
  border-radius: 46px;
  background: linear-gradient(145deg, #2b2b29, #0c0c0b 40%, #1d1d1b);
  box-shadow: var(--phone-shadow), inset 0 0 0 1px rgba(255,255,255,.08);
}
.phone img { border-radius: 37px; width: 100%; aspect-ratio: 804 / 1748; background: #151514; }

/* Looping demo layered over a feature phone's still screen (demos.js) */
.screen { position: relative; border-radius: 37px; overflow: hidden; isolation: isolate; }
.demo-layer { position: absolute; inset: 0; opacity: 0; transition: opacity .4s ease; }
.demo-layer.is-ready { opacity: 1; }
.phone .demo-layer img {
  position: absolute; inset: 0; height: 100%; border-radius: 0; visibility: hidden; will-change: transform, opacity;
}
.demo-strokes { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; }
.demo-strokes path { fill: none; stroke: #e8e6e1; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.demo-tap {
  position: absolute; z-index: 5; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, .32); border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); opacity: 0; pointer-events: none;
}
.demo-toggle {
  position: absolute; left: 50%; bottom: -54px; z-index: 3; transform: translateX(-50%);
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35); cursor: pointer;
}
.demo-toggle[hidden] { display: none; }
.demo-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.demo-toggle .i-play, .demo-toggle.is-paused .i-pause { display: none; }
.demo-toggle.is-paused .i-play { display: block; }
.phone::after {
  content: ''; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 30%; height: 22px; border-radius: 999px; background: #000;
}

/* ── Features ────────────────────────────────────── */

.features { max-width: var(--wrap); margin: 0 auto; padding: 120px var(--gutter) 40px; display: grid; gap: 140px; }

.feature {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 72px;
  align-items: center;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}
.feature.flip { grid-template-columns: 300px 1fr; }
.feature.flip .feature-copy { order: 2; }
.feature .phone { width: 300px; }

.kicker {
  display: inline-block;
  font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand-ink); background: var(--brand-soft);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 18px;
}
.feature h2 { font-size: clamp(30px, 3.6vw, 42px); line-height: 1.12; max-width: 18ch; }
.feature p:not(.kicker) { margin-top: 18px; color: var(--muted); max-width: 46ch; }
.points { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--ink); }
.points li { position: relative; padding-left: 26px; font-size: 16px; }
.points li::before {
  content: ''; position: absolute; left: 2px; top: .62em; width: 12px; height: 2px; border-radius: 2px; background: var(--cord);
}

@media (max-width: 800px) {
  .features { padding-top: 120px; gap: 96px; }
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 40px; justify-items: center; text-align: center; }
  .feature.flip .feature-copy { order: 0; }
  .feature h2, .feature p:not(.kicker) { margin-left: auto; margin-right: auto; }
  .feature .phone { width: min(270px, 76vw); }
  .points { justify-items: center; }
  .points li { text-align: left; }
}

/* ── Extras ──────────────────────────────────────── */

.extras { padding: 120px 0 40px; }
.extras h2 { font-size: clamp(28px, 3.2vw, 38px); text-align: center; max-width: 22ch; margin: 0 auto 48px; }
.extras-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.extras-grid li {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px 24px 28px;
}
.glyph {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  background: var(--brand-soft); color: var(--brand-ink);
  font-family: var(--font-jp-serif); font-size: 26px; font-weight: 600; margin-bottom: 18px;
}
.extras-grid h3 { font-size: 21px; line-height: 1.25; }
.extras-grid p { margin-top: 8px; font-size: 15.5px; color: var(--muted); }

@media (max-width: 960px) { .extras-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .extras-grid { grid-template-columns: 1fr; } }

/* ── Download ────────────────────────────────────── */

.download { padding: 100px 0 120px; }
.download-inner {
  position: relative;
  text-align: center;
  background: var(--hero);
  color: var(--on-hero);
  border-radius: 32px;
  padding: 64px var(--gutter) 56px;
  overflow: hidden;
}
.download-icon { margin: 0 auto 24px; border-radius: 22px; box-shadow: 0 16px 32px -12px rgba(0,0,0,.45); }
.download h2 { font-size: clamp(36px, 5vw, 56px); line-height: 1.05; }
.download-inner > p { margin-top: 10px; color: var(--on-hero-muted); font-size: 18px; }
.download .cta-row { margin-top: 30px; }
.download-alt { margin-top: 28px !important; font-size: 15px !important; }
.download-alt a { color: #fff; font-weight: 600; }

/* ── Footer ──────────────────────────────────────── */

.footer { border-top: 1px solid var(--border); padding: 36px 0 48px; font-size: 14px; color: var(--muted); }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: 14px 32px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); }
.footer-brand img { border-radius: 7px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: flex-end; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-note { grid-column: 1 / -1; font-size: 13px; }

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}

/* ── Sticky "Get" bar (phones only) ──────────────── */

.sticky-get {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px -12px rgba(0,0,0,.35);
  transform: translateY(140%);
  visibility: hidden;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s linear .3s;
}
.sticky-get.is-shown { transform: none; visibility: visible; transition-delay: 0s; }
.sticky-get[hidden] { display: none; }
.sticky-get img { border-radius: 10px; }
.sticky-text { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.sticky-text strong { font-size: 15px; }
.sticky-text span { font-size: 13px; color: var(--muted); }
.sticky-btn {
  background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none;
  padding: 8px 22px; border-radius: 999px;
}
@media (min-width: 801px) { .sticky-get { display: none !important; } }
@media (max-width: 800px) { .footer { padding-bottom: calc(110px + env(safe-area-inset-bottom)); } }

/* ── Reveal on scroll ────────────────────────────── */

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cord path { animation: none; stroke-dashoffset: 0; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .sticky-get, .store-badge { transition: none; }
}
