/* Flowwish — shared styles for the homepage (en / zh), privacy pages and 404. */
:root {
  color-scheme: light dark;
  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #1b1c1f;
  --ink-2: #4a4a4a;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --line-strong: #d2d2d2;
  --accent: #d63f2a;
  --accent-ink: #b5341f;
  --btn-bg: #1b1c1f;
  --btn-ink: #ffffff;
  --btn-hover: #383a40;
  --scene-hi: #ffffff;
  --scene-shadow: .14;
  --grain-blend: multiply;
  --grain-opacity: .075;
  --shadow: 0 2px 3px #00000003, 0 10px 28px #00000006;
  --shadow-hover: 0 3px 6px #00000006, 0 16px 36px #0000000e;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --surface: #1b1c20;
    --ink: #f2efe8;
    --ink-2: #c8c5be;
    --muted: #9a9893;
    --line: #2a2b30;
    --line-strong: #3d3e45;
    --accent: #e8452c;
    --accent-ink: #f08a74;
    --btn-bg: #f2efe8;
    --btn-ink: #17191e;
    --btn-hover: #ffffff;
    --scene-hi: #2a2b30;
    --scene-shadow: .55;
    --grain-blend: screen;
    --grain-opacity: .045;
    --shadow: 0 1px 2px #00000040, 0 10px 28px #00000033;
    --shadow-hover: 0 2px 4px #00000050, 0 18px 40px #00000059;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html:lang(zh) body { line-height: 1.7; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 0 28px; }

/* Logo: the paper boat and the outlined EB Garamond Italic wordmark, written by brand/generate.py.
   The SVG is sized in font units (1em = 1000), so font-size sets the logo size; the sail takes the accent. */
.wordmark { line-height: 1; white-space: nowrap; color: var(--ink); }
.wm { display: inline-block; width: auto; height: 1.033em; vertical-align: -.307em; }
.wm .sail { fill: var(--accent); }
.wm-stack { height: 2.12em; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; }
.topbar .mini { font-size: 30px; }
.lang-switch { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; margin-left: auto; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 13px; line-height: 1; transition: border-color .2s, color .2s; }
.lang-switch:hover { border-color: var(--line-strong); color: var(--ink); }
.lang-switch svg { width: 15px; height: 15px; }

/* Hero */
.hero { padding: 40px 0 80px; text-align: center; }
.hero .wordmark { font-size: clamp(64px, 19vw, 100px); }
.hero .boat { animation: boat-in 1.1s cubic-bezier(.2, .8, .2, 1) .15s both; }
@keyframes boat-in { from { opacity: 0; transform: translateX(-160px); } }
.statement { max-width: 30em; margin: 30px auto 0; color: var(--ink-2); font-size: clamp(18px, 2.1vw, 22px); line-height: 1.45; letter-spacing: -.012em; text-wrap: balance; }
.byline { margin-top: 12px; color: var(--muted); font-size: 14px; }
.byline .dot { margin: 0 .55em; color: var(--accent); }
:lang(zh) .statement { letter-spacing: 0; }

/* App groups */
.group + .group { margin-top: 64px; }
.group-head { margin-bottom: 22px; }
.group-head h2 { font-family: var(--display); font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
.group-head p { margin-top: 6px; color: var(--muted); font-size: 15px; }
:lang(zh) .group-head h2 { letter-spacing: 0; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* App card — the whole card follows its primary action (stretched link). */
.app { --fade: to bottom; --scene-soft: var(--soft, #f6f6f6); --scene-tint: var(--tint, #e8e8e8); position: relative; isolation: isolate; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); transition: box-shadow .3s, border-color .3s; }
@media (prefers-color-scheme: dark) {
  .app { --scene-soft: color-mix(in srgb, var(--soft, #f6f6f6) 9%, var(--surface)); --scene-tint: color-mix(in srgb, var(--tint, #e8e8e8) 17%, var(--surface)); }
}
.app-visual { position: relative; isolation: isolate; display: grid; place-items: center; height: 236px; overflow: hidden; background: var(--surface); background: linear-gradient(var(--fade), transparent 45%, var(--surface) 100%), radial-gradient(ellipse at 26% 3%, var(--scene-hi) 0%, var(--scene-soft) 45%, var(--scene-tint) 100%); }
.app-visual::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background-image: url("paper-grain.svg"); opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend); -webkit-mask-image: linear-gradient(var(--fade), #000 60%, transparent 100%); mask-image: linear-gradient(var(--fade), #000 60%, transparent 100%); }
.scene-shadow { position: absolute; left: 50%; top: calc(50% + 66px); width: 142px; height: 20px; border-radius: 50%; background: #000; filter: blur(16px); opacity: var(--scene-shadow); transform: translateX(-50%); transition: transform .45s ease, opacity .45s ease; }
.icon-float { position: relative; z-index: 2; width: 156px; height: 156px; flex-shrink: 0; }
.icon-shell { position: relative; width: 100%; height: 100%; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.app-icon { display: block; width: 100%; height: 100%; border-radius: 22%; object-fit: cover; filter: drop-shadow(0 14px 12px #0000001b) drop-shadow(0 2px 1px #0000001f); transition: filter .45s ease; }
/* macOS icons ship with transparent padding; scale them to match the iOS icons. */
.app-icon.pad-124 { position: absolute; width: 124.2718%; height: 124.2718%; left: -12.1359%; top: -12.1359%; border-radius: 0; }
.app-icon.pad-116 { position: absolute; width: 116.3636%; height: 116.3636%; left: -8.1818%; top: -9.0909%; border-radius: 0; }

.app-body { flex: 1; display: flex; flex-direction: column; padding: 22px 26px 24px; }
.app-name { font-family: var(--display); font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -.025em; }
.app-platforms { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.nw { white-space: nowrap; }
.app-description { margin-top: 12px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.app-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin-top: auto; padding-top: 22px; }
.app-links { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 13px; }
.app-links a { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; }
.app-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.app-links svg { width: 14px; height: 14px; }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 25px; }
.stretched:focus-visible { outline: none; }
.stretched:focus-visible::after { outline: 2px solid var(--ink); outline-offset: -3px; }

.store-button { display: block; border-radius: 8px; }
.store-badge { display: block; width: 120px; height: 40px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 10px; font: 500 14px/1 var(--sans); white-space: nowrap; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); border: 1px solid var(--btn-bg); }
.btn-outline { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn-primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn-outline:hover { border-color: var(--muted); }

@media (hover: hover) and (pointer: fine) {
  .app:hover { border-color: var(--line-strong); box-shadow: var(--shadow-hover); }
  .app:hover .icon-shell { transform: translateY(-8px) scale(1.025); }
  .app:hover .app-icon { filter: drop-shadow(0 24px 16px #00000020) drop-shadow(0 2px 1px #0000001a); }
  .app:hover .scene-shadow { transform: translateX(-50%) scale(1.08); opacity: calc(var(--scene-shadow) * .72); }
  .app:hover .btn-primary { background: var(--btn-hover); border-color: var(--btn-hover); }
  .app:hover .btn-outline { border-color: var(--muted); }
}

/* Horizontal card: App Store apps on desktop, the odd last card on tablets. */
@media (min-width: 941px) {
  .grid-2 .app { --fade: to right; flex-direction: row; }
  .grid-2 .app-visual { flex: 0 0 40%; height: auto; min-height: 300px; }
  .grid-2 .app-body { justify-content: center; padding: 30px 32px 28px 8px; }
}
@media (min-width: 651px) and (max-width: 940px) {
  .grid-2, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 .app:last-child:nth-child(odd) { --fade: to right; grid-column: 1 / -1; flex-direction: row; }
  .grid-3 .app:last-child:nth-child(odd) .app-visual { flex: 0 0 40%; height: auto; min-height: 260px; }
  .grid-3 .app:last-child:nth-child(odd) .app-body { justify-content: center; padding: 28px 30px 26px 8px; }
}

/* Footer */
.site-footer { margin-top: 96px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 24px; padding-top: 28px; padding-bottom: 44px; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); font-size: 13px; transition: border-color .2s, color .2s; }
.pill:hover { border-color: var(--line-strong); color: var(--ink); }
.pill svg { width: 15px; height: 15px; flex-shrink: 0; }
.colophon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: 13px; }
.colophon a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Waitlist dialog */
body.waitlist-open { overflow: hidden; }
.waitlist { position: fixed; width: min(400px, calc(100% - 40px)); max-height: calc(100svh - 40px); margin: auto; padding: 30px; overflow: auto; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px #00000026; }
.waitlist::backdrop { background: #0000004d; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.waitlist [hidden] { display: none !important; }
.waitlist-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.waitlist-close:hover { background: var(--bg); color: var(--ink); }
.waitlist-close svg { width: 16px; height: 16px; }
.waitlist-title { padding-right: 18px; font-family: var(--display); font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -.025em; }
:lang(zh) .waitlist-title { letter-spacing: 0; }
.waitlist-title:focus { outline: none; }
.waitlist-copy { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.waitlist-form { margin-top: 22px; }
.waitlist-label { display: block; margin-bottom: 8px; color: var(--ink-2); font-size: 13px; }
.waitlist-email { display: block; width: 100%; height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: 16px var(--sans); }
.waitlist-email:focus { border-color: var(--ink); outline: 3px solid color-mix(in srgb, var(--ink) 10%, transparent); outline-offset: 1px; }
.waitlist-email[aria-invalid="true"] { border-color: var(--accent-ink); }
.waitlist-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.waitlist-feedback { margin-top: 10px; color: var(--accent-ink); font-size: 13px; line-height: 1.6; }
.waitlist-submit { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; margin-top: 18px; padding: 10px 16px; border: 1px solid var(--btn-bg); border-radius: 10px; background: var(--btn-bg); color: var(--btn-ink); font: 500 15px var(--sans); cursor: pointer; transition: background .2s; }
.waitlist-submit:hover { background: var(--btn-hover); }
.waitlist-submit:disabled { opacity: .65; cursor: wait; }
.waitlist-privacy { margin-top: 16px; color: var(--muted); font-size: 12px; text-align: center; }
.waitlist-privacy a { text-decoration: underline; text-underline-offset: 3px; }
.waitlist-privacy a:hover { color: var(--ink); }

/* Document pages (privacy, 404) */
.narrow { width: min(720px, 100%); margin: 0 auto; padding: 0 24px; }
.doc { width: min(720px, 100%); margin: 0 auto; padding: 8px 24px 0; }
.doc-card { padding: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; }
.doc-card h1 { font-family: var(--display); font-size: clamp(28px, 5vw, 36px); line-height: 1.15; font-weight: 600; letter-spacing: -.03em; }
.doc-card h2 { margin-top: 32px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.doc-card p { margin-top: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.75; }
.doc-card p a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.doc-card .updated { margin-top: 12px; color: var(--muted); font-size: 13px; }
:lang(zh) .doc-card h1, :lang(zh) .doc-card h2 { letter-spacing: 0; }
.doc-foot { width: min(720px, 100%); margin: 0 auto; padding: 24px 24px 48px; color: var(--muted); font-size: 13px; }
.doc-foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.doc-card .note { margin-top: 6px; color: var(--muted); font-size: 13px; }
.notfound { padding-top: 64px; padding-bottom: 64px; text-align: center; }
.notfound .code { color: var(--accent-ink); font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: .08em; }
.notfound h1 { margin-top: 10px; }
.notfound .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }

/* Phones: compact list cards. */
@media (max-width: 650px) {
  .wrap { padding: 0 18px; }
  .topbar { min-height: 64px; }
  .hero { padding: 28px 0 56px; }
  .statement { margin-top: 22px; }
  .group + .group { margin-top: 48px; }
  .group-head { margin-bottom: 16px; }
  .group-head h2 { font-size: 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 14px; }
  .app { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; column-gap: 16px; padding: 18px 18px 16px; border-radius: 22px; }
  .app-visual, .app-body { display: contents; }
  .app-visual::before, .scene-shadow { display: none; }
  .icon-float { z-index: 0; grid-column: 1; grid-row: 1; width: 76px; height: 76px; }
  .app-icon { filter: drop-shadow(0 4px 6px #00000014) drop-shadow(0 1px 1px #00000014); }
  .app-head { grid-column: 2; grid-row: 1; }
  .app-name { font-size: 20px; }
  .app-description { grid-column: 1 / -1; margin-top: 14px; }
  .app-actions { grid-column: 1 / -1; padding-top: 16px; }
  .stretched::after { border-radius: 21px; }
  .site-footer { margin-top: 72px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .doc, .narrow { padding: 0 16px; }
  .notfound { padding-top: 44px; padding-bottom: 44px; }
  .doc-card { padding: 30px 22px; border-radius: 20px; }
  .doc-foot { padding: 20px 16px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .app:hover .icon-shell { transform: none; }
  .app:hover .scene-shadow { transform: translateX(-50%); }
}
