/* Tokira — shared styles for index / privacy / support.
   Palette and type are taken from the app itself (Theme.swift, dark):
   background #10131B→#050608, dial face #151A24→#0C0F16, header ink #ADC2BF,
   running accent #7AF2D3, paused accent #FFB74D, Pro gold #FFD54F.        */

@font-face {
  font-family: "DSEG7";
  src: url("../fonts/DSEG7Classic-Bold.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  interpolate-size: allow-keywords;

  --bg-top: #10131b;
  --bg-bottom: #050608;
  --face: #151a24;
  --face-deep: #0c0f16;
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, .72);
  --ink-3: rgba(255, 255, 255, .46);
  --sage: #adc2bf;
  --mint: #7af2d3;
  --mint-soft: rgba(122, 242, 211, .14);
  --amber: #ffb74d;
  --gold: #ffd54f;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .18);
  --glass: rgba(255, 255, 255, .045);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
          "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --seg: "DSEG7", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(20px, 5vw, 64px);
  --measure: 40rem;
  --radius-screen: 38px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg-bottom) 100vh) var(--bg-bottom);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:lang(en) body, body:lang(en) { line-height: 1.65; }

/* One language at a time. The <html data-lang> attribute is set before first paint. */
html[data-lang="ja"] [lang="en"]:not(html),
html[data-lang="en"] [lang="ja"]:not(html) { display: none !important; }

img { max-width: 100%; display: block; }
a { color: var(--mint); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.25; text-wrap: balance; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { font-feature-settings: "palt"; letter-spacing: .02em; }
/* Japanese wraps only between phrases (文節), in every browser: the <wbr> between phrases
   are written into the HTML by design/tools/tokira_wbr.py, and keep-all stops breaks
   anywhere else. overflow-wrap is the safety net for a phrase wider than its box. */
:lang(ja) { word-break: keep-all; overflow-wrap: anywhere; }
/* Interface labels never wrap mid-word, even on the narrowest screens. */
.brand, .nav-links a, .lang button, .btn, .pro-tag, .footer-links a { white-space: nowrap; overflow-wrap: normal; }
.phrase { display: inline-block; }
p { margin: 0; }
p + p { margin-top: 1em; }

:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 10px; background: var(--mint); color: #04221a; font-weight: 700;
}
.skip:focus { top: 12px; }

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

/* ---------------------------------------------------------------- Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 13, 19, .72);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.05rem; letter-spacing: .01em;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 26px; margin: 0; padding: 0; list-style: none; font-size: .9375rem; }
.nav-links a { color: var(--ink-2); text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }

/* Language switch — a two-segment control with a sliding thumb, like the app's segmented pickers. */
.lang {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr;
  padding: 3px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line);
}
.lang button {
  position: relative; z-index: 1; appearance: none; border: 0; background: none; cursor: pointer;
  font: 700 .78rem/1 var(--sans); letter-spacing: .04em; color: var(--ink-3);
  padding: 7px 13px; border-radius: 999px; transition: color .25s;
}
.lang button[aria-pressed="true"] { color: var(--mint); }
.lang-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px;
  background: var(--mint-soft); box-shadow: inset 0 0 0 1px rgba(122, 242, 211, .45);
  transition: transform .3s cubic-bezier(.3, .7, .2, 1);
}
html[data-lang="en"] .lang-thumb { transform: translateX(100%); }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: 700 .9375rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--glass); color: var(--ink);
  transition: background .2s, border-color .2s;
}
.btn:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.btn-mint { background: rgba(122, 242, 211, .16); border-color: rgba(122, 242, 211, .5); color: var(--mint); }
.btn-mint:hover { background: rgba(122, 242, 211, .24); }

/* Apple's official "Download on the App Store" badge, used as delivered (black, ja/en).
   Apple's rules: no edits, angles, animation or hover effects; at least 40px tall on screen;
   keep clear space of a quarter of its height (12px at 48px) free of other elements. */
.store-badge { display: inline-flex; flex: none; line-height: 0; border-radius: 10px; }
.store-badge img { display: block; width: auto; height: 48px; }
.store-badge:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }

/* ---------------------------------------------------------------- Hero */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, rgba(122, 242, 211, .10), transparent);
  pointer-events: none;
}
.hero-grid {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(32px, 6vw, 80px); align-items: center;
  padding-top: clamp(56px, 9vw, 112px); padding-bottom: clamp(64px, 9vw, 120px);
}
.hero h1 { font-size: clamp(2.6rem, 6.2vw, 4.75rem); font-weight: 900; line-height: 1.08; letter-spacing: -.02em; }
:lang(ja) .hero h1 { letter-spacing: .01em; line-height: 1.14; }
.lede { margin-top: 28px; max-width: 30em; font-size: 1.125rem; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 40px; }
.hero-actions .text-link { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.hero-actions .text-link:hover { color: var(--ink); text-decoration: underline; }
.req { margin-top: 22px; font-size: .875rem; color: var(--ink-3); }

/* Live stopwatch dial */
.dial-wrap { --accent: var(--mint); justify-self: center; width: min(100%, 460px); }
.dial-wrap[data-state="paused"] { --accent: var(--amber); }
.dial { width: 100%; height: auto; display: block; overflow: visible; }
.dial .face { fill: url(#face); }
.dial .bezel { fill: none; stroke: rgba(255, 255, 255, .09); stroke-width: 1.5; }
.dial .tk-fine { stroke: rgba(255, 255, 255, .16); stroke-width: 1; }
.dial .tk-sec { stroke: rgba(255, 255, 255, .38); stroke-width: 1.4; }
.dial .tk-five { stroke: rgba(255, 255, 255, .85); stroke-width: 2.2; stroke-linecap: round; }
.dial .dial-num text { fill: rgba(255, 255, 255, .62); font: 600 15px var(--sans); text-anchor: middle; dominant-baseline: central; }
.dial .sub-ring { fill: rgba(0, 0, 0, .18); stroke: rgba(255, 255, 255, .12); }
.dial .tk-sub { stroke: rgba(255, 255, 255, .4); stroke-width: 1; }
.dial .sub-num text { fill: rgba(255, 255, 255, .45); font: 600 8px var(--sans); text-anchor: middle; dominant-baseline: central; }
.dial .sub-hand { stroke: var(--sage); stroke-width: 1.6; stroke-linecap: round; }
.dial .ghost { fill: rgba(255, 255, 255, .055); }
.dial .readout, .dial .ghost { font: 26px var(--seg); text-anchor: middle; }
.dial .readout { fill: var(--accent); transition: fill .3s; }
.dial .hand line { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; transition: stroke .3s; }
.dial .hand circle { fill: var(--face-deep); stroke: var(--accent); stroke-width: 2.4; transition: stroke .3s; }
.dial-controls { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.dial-controls .btn { min-width: 132px; }
.dial-wrap[data-state="paused"] .btn-mint { color: var(--amber); border-color: rgba(255, 183, 77, .5); background: rgba(255, 183, 77, .14); }
.dial-wrap:not([data-state="idle"]) .when-idle,
.dial-wrap:not([data-state="running"]) .when-running,
.dial-wrap:not([data-state="paused"]) .when-paused { display: none; }
.dial-note { margin-top: 12px; text-align: center; font-size: .8125rem; color: var(--ink-3); }

/* ---------------------------------------------------------------- Sections */
.section { padding: clamp(80px, 11vw, 144px) 0; }
.section-head { max-width: 36rem; }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.875rem); letter-spacing: -.01em; }
.section-head p { margin-top: 18px; color: var(--ink-2); font-size: 1.125rem; }

.pro-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font: 800 .6875rem/1 var(--sans); letter-spacing: .08em; vertical-align: .25em; margin-left: .5em;
  color: var(--gold); background: rgba(255, 152, 0, .18); box-shadow: inset 0 0 0 1px rgba(255, 152, 0, .5);
}

/* ---------------------------------------------------------------- Feature tour */
.tour { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 72px; }
.steps { display: grid; gap: 88px; }
.step h3 { font-size: clamp(1.375rem, 2.4vw, 1.75rem); }
.step p { margin-top: 14px; color: var(--ink-2); max-width: 30em; }
.step-shot { margin: 28px auto 0; width: min(280px, 78vw); }

.screen {
  position: relative; aspect-ratio: 440 / 894; border-radius: var(--radius-screen); overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 8px #07080b,
    0 0 0 9px rgba(255, 255, 255, .14),
    0 40px 80px -20px rgba(0, 0, 0, .8);
}
.screen img { width: 100%; height: 100%; object-fit: cover; }

.device { display: none; }

@media (min-width: 960px) {
  html.js .tour { grid-template-columns: minmax(0, 1fr) 320px; gap: 0 clamp(48px, 8vw, 120px); align-items: start; }
  html.js .steps { display: grid; gap: 0; }
  html.js .step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; opacity: .38; transition: opacity .4s; }
  html.js .step.is-active { opacity: 1; }
  html.js .step-shot { display: none; }
  html.js .device {
    display: block; position: sticky; top: max(88px, calc(50vh - 262px)); width: 290px; justify-self: end;
    grid-column: 2; grid-row: 1;
  }
  html.js .device img { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
  html.js .device[data-active="1"] [data-screen="1"],
  html.js .device[data-active="2"] [data-screen="2"],
  html.js .device[data-active="3"] [data-screen="3"],
  html.js .device[data-active="4"] [data-screen="4"],
  html.js .device[data-active="5"] [data-screen="5"] { opacity: 1; }
}

/* ---------------------------------------------------------------- Privacy band */
.private { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .015); }
.private-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: grid; grid-template-columns: 36px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.facts li:first-child { border-top: 0; padding-top: 6px; }
.facts svg { width: 28px; height: 28px; stroke: var(--sage); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-top: 3px; }
.facts strong { display: block; font-size: 1.0625rem; }
.facts span { display: block; color: var(--ink-2); font-size: .9375rem; margin-top: 2px; }
.private .more { display: inline-block; margin-top: 24px; font-weight: 600; }

/* ---------------------------------------------------------------- Pro */
.pro-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.price { margin-top: 32px; display: flex; align-items: baseline; gap: 2px 14px; flex-wrap: wrap; }
.price-amount { font: 900 3rem/1 var(--sans); letter-spacing: -.01em; color: var(--gold); font-variant-numeric: tabular-nums; }
.price-note { color: var(--ink-2); font-size: .9375rem; }
.compare { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.compare caption { text-align: left; }
.compare th, .compare td { padding: 16px 12px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.compare th:first-child, .compare td:first-child { text-align: left; padding-left: 0; }
.compare thead th { font-size: .8125rem; font-weight: 700; color: var(--ink-3); border-bottom-color: var(--line-strong); }
.compare thead th.col-pro { color: var(--gold); }
.compare tbody th { font-weight: 600; }
.compare tbody th small { display: block; font-weight: 400; color: var(--ink-3); font-size: .8125rem; line-height: 1.5; margin-top: 2px; }
.compare td { color: var(--ink-2); white-space: nowrap; }
.compare td.col-pro { color: var(--ink); }
.compare svg { width: 20px; height: 20px; display: inline-block; vertical-align: middle; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.compare .yes { stroke: var(--mint); }
.compare .col-pro .yes { stroke: var(--gold); }
.compare .no { stroke: var(--ink-3); }
.table-note { margin-top: 14px; font-size: .8125rem; color: var(--ink-3); }

/* ---------------------------------------------------------------- Closing */
.closing { text-align: center; }
.closing h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); }
.closing p { margin-top: 16px; color: var(--ink-2); }
.closing .store-link { margin-top: 36px; }

/* ---------------------------------------------------------------- Footer */
.footer { border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: .875rem; color: var(--ink-3); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.footer .brand { font-size: .95rem; }
.footer .brand img { width: 24px; height: 24px; border-radius: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.footer-links a, .footer-copy a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover, .footer-copy a:hover { color: var(--ink); text-decoration: underline; }
.footer-copy { width: 100%; margin-top: 4px; }

/* ---------------------------------------------------------------- Document pages (privacy / support) */
.doc-head { padding-top: clamp(56px, 8vw, 104px); padding-bottom: 8px; }
.doc-head h1 { font-size: clamp(1.5rem, 8vw, 3.5rem); font-weight: 900; letter-spacing: -.01em; }
.doc-head .meta { margin-top: 14px; color: var(--ink-3); font-size: .9375rem; }
.doc-head .lede { margin-top: 18px; max-width: 46rem; }
.doc { padding-bottom: clamp(72px, 10vw, 128px); }
.doc-body { max-width: var(--measure); }
.doc-body h2 { font-size: 1.375rem; margin-top: 56px; }
.doc-body h2 + p { margin-top: 12px; }
.doc-body p, .doc-body li { color: var(--ink-2); }
.doc-body ul { padding-left: 1.25em; margin: 12px 0 0; }
.doc-body li + li { margin-top: 6px; }

/* Privacy policy: one plain column. */
.policy { margin-top: 40px; }

/* FAQ — native <details>, so it works without JavaScript and with the keyboard. */
.faq-group { margin-top: 56px; max-width: 46rem; }
.faq-group h2 { font-size: 1.125rem; color: var(--sage); margin-bottom: 8px; }
.qa { border-bottom: 1px solid var(--line); }
.qa:first-of-type { border-top: 1px solid var(--line); }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 4px; cursor: pointer; list-style: none; font-weight: 700; font-size: 1.0625rem; line-height: 1.5;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: var(--mint); }
.qa-icon { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong); transition: transform .3s, box-shadow .3s; }
.qa-icon::before, .qa-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.6px; margin: -.8px 0 0 -5.5px; background: currentColor; border-radius: 1px; }
.qa-icon::after { transform: rotate(90deg); }
.qa[open] .qa-icon { transform: rotate(45deg); box-shadow: inset 0 0 0 1px rgba(122, 242, 211, .6); color: var(--mint); }
.qa .answer { padding: 0 4px 24px; color: var(--ink-2); max-width: 40rem; }
.qa::details-content { block-size: 0; overflow-y: clip; transition: block-size .32s ease, content-visibility .32s allow-discrete; }
.qa[open]::details-content { block-size: auto; }


/* ---------------------------------------------------------------- Contact form (support page)
   Structure comes from /form/contact.css; only the colours are set here. */
.contact { margin-top: 72px; max-width: 46rem; padding-top: 56px; border-top: 1px solid var(--line); }
.contact h2 { font-size: clamp(1.625rem, 3vw, 2rem); }
.contact-lede { margin-top: 14px; color: var(--ink-2); }
.contact-open { margin-top: 28px; }
.contact noscript p { margin-top: 20px; color: var(--ink-3); }
.contact .cf-form {
  --cf-text: var(--ink);
  --cf-muted: var(--ink-3);
  --cf-field-bg: rgba(255, 255, 255, .04);
  --cf-border: var(--line-strong);
  --cf-border-focus: var(--mint);
  --cf-accent: var(--mint);
  --cf-accent-soft: rgba(122, 242, 211, .14);
  --cf-error: #ff8a80;
  --cf-radius: 14px;
  margin-top: 36px;
}
.contact .cf-form a { color: var(--mint); }
.contact .btn[disabled] { opacity: .5; cursor: default; }
.cf-success {
  margin-top: 36px; padding: 28px 30px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(122, 242, 211, .08), rgba(122, 242, 211, .02));
  box-shadow: inset 0 0 0 1px rgba(122, 242, 211, .3);
}
.cf-success h3 { font-size: 1.25rem; color: var(--mint); }
.cf-success h3:focus { outline: none; }
.cf-success p { margin-top: 10px; color: var(--ink-2); }

/* ---------------------------------------------------------------- Small screens */
@media (max-width: 959px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .dial-wrap { width: min(100%, 400px); }
  .private-grid, .pro-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 400px) {
  .lede, .section-head p { font-size: 1rem; }
  .cf-success { padding: 24px 22px; }
  .qa summary { font-size: 1rem; }
  .compare { font-size: .875rem; }
}
@media (max-width: 640px) {
  .nav-inner { gap: 16px; }
  .nav-links .opt { display: none; }
  .compare th, .compare td { padding: 14px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
