/* Tinyapps brand system.
   Swiss graphic archive: neutral paper, ink, one vermilion accent, square controls.
   Product pages re-tint the same tokens (--bg, --fg …) and keep the frame: grid,
   header, footer, type scale and the ink App Store button. */

:root {
  color-scheme: light dark;
  --paper: #f0f0ec;
  --ink: #242620;
  --muted: #616359;
  --rule: #b9bcb1;
  --soft: #e5e6de;
  --accent: #f25c38;
  --on-accent: #242620;
  --focus: #a72c13;

  /* Page tokens: product stylesheets override these. */
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-2: var(--muted);
  --line: var(--rule);
  --tint: var(--soft);
  --cta-bg: var(--ink);
  --cta-fg: var(--paper);

  --gutter: 56px;
  --max: 1280px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --font-latin: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, var(--font-cjk);
  --font-display: var(--font-latin), var(--font-cjk);
}

:lang(zh-Hant) { --font-cjk: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }
:lang(ja) { --font-cjk: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #20221e;
  --ink: #eeefe7;
  --muted: #b2b6a7;
  --rule: #53594b;
  --soft: #2a2e25;
  --focus: #ff916f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #20221e;
    --ink: #eeefe7;
    --muted: #b2b6a7;
    --rule: #53594b;
    --soft: #2a2e25;
    --focus: #ff916f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-autospace: normal;
}
:lang(en) body, :lang(es) body, body:lang(en), body:lang(es) { line-height: 1.6; }
:lang(ja) { line-break: strict; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; }
h1, h2, h3 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { word-break: auto-phrase; }

.wrap { width: min(var(--max), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -80px; left: 20px; z-index: 20; background: var(--bg); color: var(--fg); padding: 12px 16px; border: 1px solid var(--fg); }
.skip-link:focus { top: 14px; }

/* Header ---------------------------------------------------------------- */
.site-header { position: relative; z-index: 5; color: var(--header-fg, var(--fg)); }
.header-inner { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--header-rule, var(--fg)); }
.monogram { font-family: var(--font-latin); font-size: 27px; line-height: 1; font-weight: 800; letter-spacing: -1.8px; }
.monogram span { color: var(--accent); }
.site-header nav { display: flex; align-items: center; gap: 34px; font-size: 14px; }
.site-header nav > a { position: relative; padding: 12px 0; }
.site-header nav > a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.site-header nav > a:hover::after, .site-header nav > a[aria-current="page"]::after { transform: scaleX(1); }
.lang-link, .lang-menu > summary { font-size: 12px; font-weight: 600; letter-spacing: .02em; border-left: 1px solid var(--header-rule-soft, var(--line)); padding: 10px 0 10px 24px; min-height: 40px; display: inline-flex; align-items: center; }
.lang-current { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.lang-current-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-flag { display: block; width: 22px; height: 22px; flex: none; object-fit: contain; }
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; cursor: pointer; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary::after { content: ""; width: 6px; height: 6px; flex: none; margin-left: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s var(--ease); }
.lang-menu[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.lang-menu ul { position: absolute; z-index: 50; right: 0; top: calc(100% + 10px); width: min(220px, calc(100vw - 32px)); list-style: none; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 18px; padding: 8px; box-shadow: 0 20px 48px -22px rgb(0 0 0 / .34); }
.lang-menu li a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 12px; font-size: 14px; line-height: 1.25; }
.lang-menu li a .lang-current { flex: 1; }
.lang-menu li a .lang-flag { width: 24px; height: 24px; }
.lang-menu li a:hover, .lang-menu li a:focus-visible { background: var(--tint); }
.lang-menu li a[aria-current="true"] { background: var(--tint); font-weight: 700; }
.lang-check { position: relative; width: 18px; height: 18px; flex: none; border-radius: 50%; background: currentColor; }
.lang-check::after { content: ""; position: absolute; left: 5px; top: 3px; width: 5px; height: 8px; border-right: 2px solid var(--bg); border-bottom: 2px solid var(--bg); transform: rotate(45deg); }

/* Buttons ------------------------------------------------------------------ */
.btn-store {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--cta-bg); color: var(--cta-fg);
  min-height: 52px; padding: 14px 20px 14px 18px;
  font-size: 15px; font-weight: 500; line-height: 1.3;
  transition: transform .2s var(--ease), background-color .2s;
}
.btn-store:hover { transform: translateY(-3px); }
.btn-store:active { transform: translateY(0); }
.btn-store .arrow { width: 16px; height: 16px; flex: none; }
.btn-store small { display: block; font-size: 11px; font-weight: 400; opacity: .72; letter-spacing: .01em; }
.text-link { border-bottom: 1px solid currentColor; padding-bottom: 2px; transition: opacity .2s; }
.text-link:hover { opacity: .7; }

/* Shared editorial pieces ----------------------------------------------------- */
.breadcrumb { font-size: 13px; color: var(--fg-2); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; opacity: .6; }
.breadcrumb a:hover { color: var(--fg); }

.section { padding-block: clamp(72px, 10vw, 136px); }
.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px clamp(32px, 6vw, 96px); align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2 { font-size: clamp(30px, 3.8vw, 48px); line-height: 1.22; font-weight: 600; letter-spacing: -.02em; }
.section-head p { font-size: 17px; color: var(--fg-2); max-width: 34em; }
:lang(en) .section-head h2, :lang(es) .section-head h2 { font-family: var(--font-display); letter-spacing: -.035em; line-height: 1.08; font-weight: 500; }

/* Facts list (definition list) */
.facts { border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2.4fr); gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 14px; color: var(--fg-2); }
.facts dd { font-size: 16px; }
.facts dd a { border-bottom: 1px solid currentColor; }
.facts dd a:hover { opacity: .7; }
.facts dd small { display: block; font-size: 13px; color: var(--fg-2); margin-top: 4px; }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; padding: 22px 0; font-size: 18px; font-weight: 500; line-height: 1.5; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 13px; height: 13px; margin-top: .45em; background: linear-gradient(currentColor, currentColor) center / 13px 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 13px no-repeat; transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 26px; max-width: 46em; color: var(--fg-2); font-size: 16px; }
.faq .answer p + p { margin-top: .8em; }
.faq .answer a { color: var(--fg); border-bottom: 1px solid currentColor; }

/* Guides strip on product pages (guide cards share this look on guide pages). */
.guide-strip { padding-top: 0; }
.section:has(+ .guide-strip) { padding-bottom: clamp(40px, 5vw, 64px); }
.guide-strip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; border-top: 1px solid var(--line); padding-top: clamp(40px, 5vw, 64px); margin-bottom: 28px; }
.guide-strip-head h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 600; letter-spacing: -.02em; }
:lang(en) .guide-strip-head h2, :lang(es) .guide-strip-head h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -.03em; }
.guide-strip-head .text-link { font-size: 14px; white-space: nowrap; }
.guide-cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.guide-cards a { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 22px; background: var(--mm-panel, var(--st-panel, var(--bg))); border: 1px solid var(--line); transition: border-color .2s, transform .2s var(--ease); }
.p-snaptidy .guide-cards a { border-radius: 18px; }
.guide-cards a:hover { border-color: var(--fg); transform: translateY(-2px); }
.gc-title { font-size: 17px; font-weight: 600; line-height: 1.45; }
.gc-dek { font-size: 14px; color: var(--fg-2); line-height: 1.65; }
.gc-meta { margin-top: auto; font-size: 12px; color: var(--fg-2); }

/* Footer -------------------------------------------------------------------- */
.site-footer { background: var(--bg); color: var(--fg-2); font-size: 13px; }
.footer-inner { border-top: 1px solid var(--line); padding-block: 40px 28px; display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 28px 40px; align-items: start; }
.footer-mark { font-family: var(--font-latin); font-size: 30px; font-weight: 800; letter-spacing: -.07em; color: var(--fg); line-height: 1; }
.footer-mark span { color: var(--accent); }
.footer-brand p { margin-top: 12px; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 26px; }
.footer-nav a:hover { color: var(--fg); }
.preferences { display: flex; gap: 22px; }
.preferences button { padding: 6px 0; border: 0; background: transparent; font-size: 12px; min-height: 32px; color: inherit; }
.preferences button:hover { color: var(--fg); }
.footer-legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 20px; padding-top: 10px; font-size: 12px; line-height: 1.8; text-align: center; }
.footer-legal .icp-record { display: flex; align-items: center; gap: 20px; }
.footer-legal .icp-record::before { content: ""; width: 1px; height: 12px; background: var(--line); }
.footer-legal .icp-record a { white-space: nowrap; }
.icp-record { grid-column: 1 / -1; text-align: center; font-size: 12px; line-height: 1.8; }
.icp-record a:hover { text-decoration: underline; }

/* Motion -------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="off"]) { scroll-behavior: smooth; }
  html.js:not([data-motion="off"]) .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  html.js:not([data-motion="off"]) .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation: none !important; transition: none !important; }
html[data-motion="off"] { scroll-behavior: auto; }

/* Responsive ------------------------------------------------------------------ */
@media (max-width: 1000px) {
  :root { --gutter: 36px; }
  .header-inner { height: 76px; }
  .section-head { grid-template-columns: 1fr; gap: 18px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .preferences { justify-content: flex-end; }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  body { font-size: 15.5px; }
  .header-inner { height: 68px; }
  .monogram { font-size: 24px; }
  .site-header nav { gap: 18px; font-size: 13px; }
  .lang-link, .lang-menu > summary { padding-left: 14px; }
  .facts > div { grid-template-columns: 1fr; gap: 4px; padding: 15px 0; }
  .faq summary { font-size: 16.5px; padding: 19px 0; }
  .footer-inner { grid-template-columns: 1fr; gap: 22px; padding-top: 32px; }
  .preferences { justify-content: flex-start; }
  .footer-legal { flex-direction: column; gap: 4px; padding-top: 2px; }
  .footer-legal .icp-record::before { display: none; }
  .btn-store { width: 100%; justify-content: space-between; }
}
@media (max-width: 360px) {
  .site-header nav { gap: 13px; font-size: 12.5px; }
}
