/* Tobira website. Colours are the app's tokens (shared/tokens): light and the warm dark ramp. */
:root {
  --bg: #FAF8F4; --muted-bg: #F1ECE3; --raised: #FFFFFF;
  --text: #1A1714; --muted: #5C554D; --faint: #72695F;
  --rule: #E3DCCF; --rule-strong: #C8BFB0;
  --accent: #B8302B; --on-accent: #FFF8F3; --teal: #0F766E;
  --shadow: 40 24 12;
  --serif: ui-serif, "New York", "Hiragino Mincho ProN", "Songti SC", "Songti TC", "AppleMyungjo", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1D1813; --muted-bg: #26201A; --raised: #2B2520;
    --text: #F2EDE6; --muted: #B5ACA1; --faint: #A1978C;
    --rule: #4A4037; --rule-strong: #62564B;
    --accent: #E8786D; --on-accent: #1A1714; --teal: #3FB3A3;
    --shadow: 8 5 2;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; overflow-wrap: break-word; }
img { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; overflow-wrap: anywhere; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Top bar: brand + language on the first row, page links on the second; one row from 820px */
.top { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--bg) 92%, transparent);
       border-bottom: 1px solid var(--rule); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.bar { max-width: 64rem; margin: 0 auto; padding: 4px 16px; display: grid; grid-template-columns: 1fr auto;
       grid-template-areas: "brand lang" "pages pages"; align-items: center; column-gap: 16px; }
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; justify-self: start;
         color: var(--text); text-decoration: none; font: 600 1.0625rem/1 var(--serif); letter-spacing: 0.02em; }
.brand img { display: block; width: 40px; height: 40px; border-radius: 22.5%; box-shadow: 0 0 0 1px rgb(var(--shadow) / 0.08); }
.pages { grid-area: pages; display: flex; white-space: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; }
.pages a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; color: var(--muted);
           text-decoration: none; font-size: 0.9375rem; }
.pages a:hover { color: var(--text); }
.pages a[aria-current] { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent);
                         text-decoration-thickness: 2px; text-underline-offset: 8px; }
.lang { grid-area: lang; position: relative; }
.lang summary { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; cursor: pointer;
                list-style: none; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); font-size: 0.9375rem; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ""; width: 6px; height: 6px; margin-top: -3px; border: solid currentColor;
                       border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.lang[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.lang summary:hover { color: var(--text); border-color: var(--rule-strong); }
.lang nav { position: absolute; right: 0; top: calc(100% + 6px); display: grid; min-width: 11rem; padding: 6px;
            background: var(--raised); border: 1px solid var(--rule); border-radius: 14px;
            box-shadow: 0 12px 32px rgb(var(--shadow) / 0.16); }
.lang nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.lang nav a:hover { background: var(--muted-bg); }
.lang nav a[aria-current] { color: var(--accent); font-weight: 600; }
@media (min-width: 820px) {
  .bar { grid-template-columns: auto 1fr auto; grid-template-areas: "brand pages lang"; padding: 8px 24px; }
  .pages { justify-content: center; margin: 0; overflow: visible; }
}

main { max-width: 64rem; margin: 0 auto; padding: 0 16px; }

/* Type */
h1 { font: 600 2.125rem/1.2 var(--serif); margin: 0 0 12px; text-wrap: balance; }
h2 { font: 600 1.375rem/1.3 var(--serif); margin: 0 0 8px; text-wrap: balance; }
h3 { font-size: 1rem; margin: 16px 0 4px; }
:lang(ja) h1, :lang(ja) h2 { word-break: auto-phrase; }
:lang(ja), :lang(zh-Hans), :lang(zh-Hant) { line-break: strict; }
p { margin: 0 0 12px; }
.lead, .note, .meta { color: var(--muted); }
.lead { font-size: 1.125rem; }
.meta { font-size: 0.875rem; }
ul { margin: 0 0 12px; padding-left: 1.2rem; }
ul.plain { padding: 0; list-style: none; }
li { margin: 0 0 6px; }

/* App Store badge */
.cta { margin: 24px 0 0; }
.cta a { display: inline-block; border-radius: 8px; transition: opacity 0.15s ease; }
.cta a:hover { opacity: 0.82; }
.cta svg { display: block; height: 48px; width: auto; }

/* Screenshots: the page rounds the corners and draws the frame */
.shot { display: block; width: 260px; height: auto; margin: 0 auto; border-radius: 36px; background: var(--muted-bg);
        box-shadow: 0 0 0 1px var(--rule-strong), 0 24px 48px -16px rgb(var(--shadow) / 0.28); }

/* Landing */
.hero { display: grid; gap: 40px; padding: 40px 0 56px; }
.hero .copy { max-width: 34rem; }
.features { display: grid; gap: 0; }
.feature { display: grid; gap: 28px; padding: 48px 0; border-top: 1px solid var(--rule); }
.feature .copy { max-width: 30rem; }
.feature p { color: var(--muted); }
.closing { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 -16px; padding: 56px 16px;
           background: var(--muted-bg); text-align: center; }
.closing .mark { width: 88px; height: 88px; border-radius: 22.5%; box-shadow: 0 10px 28px rgb(var(--shadow) / 0.2); }
.closing .name { margin: 12px 0 0; font: 600 1.375rem/1.2 var(--serif); }
.closing .tagline { margin: 0; color: var(--muted); font-family: var(--serif); }
.closing .cta { margin-top: 16px; }
@media (min-width: 720px) {
  .feature { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; padding: 64px 0; }
  .feature:nth-child(even) .copy { order: 2; }
  .feature .copy { justify-self: center; }
}
@media (min-width: 820px) {
  .hero { grid-template-columns: 1fr auto; align-items: center; gap: 64px; padding: 72px 24px 80px; }
  h1 { font-size: 2.75rem; }
  .hero .shot { width: 320px; border-radius: 44px; }
  .closing { margin: 0; border-radius: 24px; margin-bottom: 48px; }
}

/* Legal and support pages */
.page { max-width: 40rem; margin: 0 auto; padding: 40px 0 24px; }
.page section { border-top: 1px solid var(--rule); padding-top: 24px; margin-top: 24px; }
.card { background: var(--raised); border: 1px solid var(--rule); border-radius: 14px; padding: 20px; margin: 24px 0; }
.card > :last-child { margin-bottom: 0; }
.table { overflow-x: auto; margin: 0 0 12px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; }

/* One-line footer */
.site-foot { max-width: 64rem; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--rule);
             color: var(--faint); font-size: 0.875rem; text-align: center; }
.site-foot p { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 1em; }
.site-foot a { display: inline-flex; align-items: center; min-height: 44px; }

@media (prefers-reduced-motion: reduce) { .cta a { transition: none; } }
