:root {
  color-scheme: dark;
  --page: #000000;
  --surface: #080808;
  --surface-strong: #050505;
  --surface-raised: #111111;
  --surface-hover: #0d0d0d;
  --surface-disabled: #292929;
  --ink: #f5f5f5;
  --muted: #a3a3a3;
  --quiet: #777777;
  --line: #222222;
  --line-strong: #343434;
  --line-hover: #555555;
  --line-card: #1a1a1a;
  --line-tile: #1b1b1b;
  --separator: #555555;
  --icon: #d8d8d8;
  --disabled-ink: #a8a8a8;
  --code: #a8c0ff;
  --selection: #244ba8;
  --hero-grid: rgba(255, 255, 255, .022);
  --accent: #2d64eb;
  --accent-hover: #2858d1;
  --error: #ffb4aa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--page);
  color: var(--ink);
  caret-color: var(--accent);
  scrollbar-color: var(--line-strong) var(--page);
  scroll-behavior: smooth;
}

:root[data-theme="light"] {
  color-scheme: light;
  --page: #ffffff;
  --surface: #f8f9fb;
  --surface-strong: #ffffff;
  --surface-raised: #f3f4f6;
  --surface-hover: #f1f3f5;
  --surface-disabled: #e5e7eb;
  --ink: #171717;
  --muted: #595959;
  --quiet: #737373;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --line-hover: #9ca3af;
  --line-card: #d1d5db;
  --line-tile: #e5e7eb;
  --separator: #9ca3af;
  --icon: #525252;
  --disabled-ink: #737373;
  --code: #1d4ed8;
  --selection: #bfdbfe;
  --hero-grid: rgba(0, 0, 0, .035);
  --accent: #2858d1;
  --accent-hover: #1f4ab8;
  --error: #b42318;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-width: 320px; background: var(--page); }
::selection { color: var(--ink); background: var(--selection); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 0.22em; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }

.container { width: min(1176px, calc(100% - 104px)); margin-inline: auto; }
.visually-hidden { 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: fixed; z-index: 10; inset: 10px auto auto 10px; padding: 10px 14px; border-radius: 8px; color: var(--ink); background: var(--accent); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: relative; z-index: 5; border-bottom: 1px solid var(--line); background: var(--page); }
.header-inner { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 650; letter-spacing: -0.025em; white-space: nowrap; }
.brand-suffix { color: var(--muted); font-weight: 520; }
.main-nav { display: flex; align-items: center; gap: clamp(19px, 2.8vw, 36px); }
.main-nav a { color: var(--muted); text-decoration: none; font-size: 14px; transition: color 150ms ease-out; }
.main-nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle, .menu-toggle { width: 40px; height: 40px; padding: 9px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: transparent; cursor: pointer; }
.theme-toggle { display: inline-grid; place-items: center; border: 0; }
.menu-toggle { display: none; }
.theme-toggle:hover, .menu-toggle:hover { border-color: var(--line-hover); background: var(--surface-hover); }
.theme-toggle svg, .menu-toggle svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon { display: none; }
:root[data-theme="dark"] .theme-icon--sun, :root[data-theme="light"] .theme-icon--moon { display: block; }

.hero { position: relative; isolation: isolate; min-height: 620px; padding: 121px 24px 16px; overflow: hidden; text-align: center; }
.hero::before { position: absolute; z-index: -1; inset: 0; content: ""; background-image: linear-gradient(to right, var(--hero-grid) 1px, transparent 1px), linear-gradient(to bottom, var(--hero-grid) 1px, transparent 1px); background-size: 80px 80px; mask-image: radial-gradient(ellipse at center, #000 7%, transparent 72%); }
.hero-copy { position: relative; z-index: 1; max-width: 910px; margin-inline: auto; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { max-width: 960px; margin: 0 auto 23px; font-size: clamp(2.7rem, 5.65vw, 4.5rem); font-weight: 640; letter-spacing: -0.04em; line-height: 1.045; }
.hero-lead { max-width: 680px; margin: 0 auto 31px; color: var(--muted); font-size: clamp(1.03rem, 1.45vw, 1.15rem); line-height: 1.6; }
.hero-actions { display: flex; justify-content: center; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 11px; padding: 10px 17px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 620; text-align: center; text-decoration: none; cursor: pointer; transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out; }
.button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { min-height: 52px; padding-inline: 25px; color: #ffffff; background: var(--accent); font-size: 15px; }
.button-primary:hover { background: var(--accent-hover); }
.button-primary:disabled { color: var(--disabled-ink); background: var(--surface-disabled); cursor: wait; }
.button-quiet { color: var(--ink); border-color: var(--line-strong); background: transparent; }
.button-quiet:hover { border-color: var(--line-hover); background: var(--surface-hover); }
.button-quiet:disabled { color: var(--quiet); cursor: wait; }
.text-link { color: var(--muted); font-size: 14px; text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); }
.text-link:hover { color: var(--ink); text-decoration-color: currentColor; }
.hero-secondary { display: inline-flex; align-items: center; gap: 8px; margin-top: 17px; text-decoration: none; }
.hero-secondary svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hero-note { display: flex; justify-content: center; flex-wrap: wrap; gap: 0; margin: 28px 0 0; color: var(--quiet); font-size: 13px; }
.hero-note span + span::before { margin-inline: 11px; color: var(--separator); content: "·"; }
.hero-note .note-divider { color: var(--muted); }
.hero-note .note-divider::before { content: "|"; }

.hero-ornaments { position: absolute; z-index: 0; inset: 0; pointer-events: none; }
.float-tile { position: absolute; display: grid; width: 82px; aspect-ratio: 1; place-items: center; border: 1px solid var(--line-tile); border-radius: 24px; background: var(--surface-strong); color: var(--icon); transform: translate3d(var(--shift-x, 0px), var(--shift-y, 0px), 0) rotate(var(--rotation, 0deg)); transition: transform 200ms ease-out; }
.float-tile svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.float-tile--one { top: 68px; left: calc(50% - 432px); --rotation: 7deg; }
.float-tile--two { top: 20px; left: calc(50% - 218px); width: 72px; border-radius: 21px; --rotation: -7deg; }
.float-tile--three { top: 174px; right: calc(50% - 426px); width: 92px; --rotation: 7deg; }
.float-tile--four { top: 35px; right: calc(50% - 222px); width: 78px; border-radius: 22px; --rotation: -6deg; }
.float-tile--five { top: 340px; left: calc(50% - 435px); width: 76px; border-radius: 22px; --rotation: -5deg; }
.float-tile--six { top: 322px; right: calc(50% - 430px); width: 88px; --rotation: 7deg; }

.product-preview { margin-top: 19px; margin-bottom: 112px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); }
.product-preview img { display: block; width: 100%; height: auto; }

.content-section { padding-top: 12px; border-top: 1px solid var(--line); }
.split-section { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); align-items: start; gap: clamp(64px, 10vw, 132px); padding-block: 112px 118px; }
.section-copy h2, .account-intro h1 { max-width: 12ch; margin: 0 0 22px; font-size: clamp(2.35rem, 4.3vw, 3.45rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.08; }
.account-intro h1 { margin-bottom: 20px; }
.section-copy > p, .account-intro > p { max-width: 56ch; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.principle-list { margin: 7px 0 0; border-top: 1px solid var(--line-strong); }
.principle-list > div { display: grid; grid-template-columns: minmax(128px, 0.58fr) minmax(0, 1fr); gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.principle-list dt { font-size: 15px; font-weight: 590; }
.principle-list dd { max-width: 38ch; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.ai-section { border-top: 0; }
.split-section--reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); }
.split-section--reverse .section-copy { order: 2; }
.split-section--reverse .ai-detail { order: 1; }
.ai-detail { max-width: 540px; padding-top: 7px; }
.ai-detail > p:first-child { margin-bottom: 24px; color: var(--ink); font-size: 17px; line-height: 1.65; }
.provider-list { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0; padding: 17px 0 0; border-top: 1px solid var(--line-strong); color: var(--muted); font-size: 14px; line-height: 1.5; list-style: none; }
.provider-list li { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.provider-icon { display: block; flex: none; width: 18px; height: 18px; object-fit: contain; }
:root[data-theme="light"] .provider-icon[src$="/openai-white.svg"] { filter: brightness(0); }
:root[data-theme="dark"] .provider-icon[src$="/ollama.svg"] { filter: brightness(0) invert(1); }

.download-page { padding-block: 80px 88px; }
.download-page-inner { max-width: 720px; }
.download-intro { text-align: center; }
.download-intro h1 { display: flex; align-items: center; justify-content: center; gap: 16px; max-width: none; margin: 0; font-size: clamp(2.25rem, 4vw, 2.75rem); font-weight: 520; letter-spacing: -0.035em; line-height: 1.16; }
.download-app-icon { flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); background: var(--surface); }
.download-app-icon svg { width: 29px; height: 29px; fill: currentColor; }
.download-list { display: flex; flex-direction: column; gap: 0; margin-top: 72px; }
.download-list[data-state="loading"], .download-list[data-state="empty"], .download-list[data-state="error"] { margin-top: 32px; }
.platform-group:not(:last-child) { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.platform-heading { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 18px; font-weight: 520; line-height: 1.45; }
.platform-heading img { flex: 0 0 22px; width: 22px; height: 22px; object-fit: contain; }
.platform-assets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.download-card { min-width: 0; min-height: 74px; display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 17px; border: 1px solid var(--line-card); border-radius: 10px; color: var(--ink); background: var(--surface-strong); text-align: left; text-decoration: none; cursor: pointer; transition: border-color 150ms ease-out, background-color 150ms ease-out; }
.download-card[href]:hover { border-color: var(--line-hover); background: var(--surface-hover); }
.download-card:disabled { color: var(--muted); cursor: not-allowed; }
.download-card-icon { flex: 0 0 38px; width: 38px; height: 38px; display: block; }
.download-card-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.download-card-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.download-card-name { overflow-wrap: anywhere; font-size: 15px; font-weight: 560; line-height: 1.4; }
.download-card-meta { color: var(--quiet); font-size: 13px; line-height: 1.4; }

.account-section { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.85fr); gap: clamp(50px, 9vw, 124px); align-items: start; padding-block: 112px 122px; }
.account-panel { min-height: 300px; padding: 25px 26px 27px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface-strong); }
.account-loading { min-height: 246px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); text-align: center; }
.account-loading p { margin: 0; }
.account-loading-spinner { width: 22px; height: 22px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: account-loading-spin 750ms linear infinite; }
@keyframes account-loading-spin { to { transform: rotate(360deg); } }
.auth-tabs { display: flex; gap: 22px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.auth-tab { position: relative; padding: 0 0 11px; border: 0; color: var(--muted); background: transparent; font-size: 14px; cursor: pointer; }
.auth-tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; content: ""; background: transparent; }
.auth-tab.is-active { color: var(--ink); }
.auth-tab.is-active::after { background: var(--accent); }
.field-label { display: block; margin: 0 0 8px; color: var(--muted); font-size: 14px; }
input { width: 100%; min-height: 47px; margin-bottom: 17px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--page); font-size: 16px; }
input::placeholder { color: var(--quiet); opacity: 1; }
.form-submit { width: 100%; margin-top: 4px; }
.text-button { padding: 4px 0; border: 0; color: var(--muted); background: none; font-size: 13px; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; cursor: pointer; }
.text-button:hover { color: var(--ink); text-decoration-color: currentColor; }
.auth-message { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.auth-message.is-error { color: var(--error); }
.dev-code-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.dev-code-note code { padding: 2px 5px; border: 1px solid var(--line); color: var(--code); font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.verify-intro { margin-bottom: 19px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.verify-intro strong { color: var(--ink); font-weight: 560; }
@media (prefers-reduced-motion: reduce) {
  .account-loading-spinner { animation: none; }
}

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 78px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.footer-brand { font-size: 15px; }
.footer-inner p { margin: 0; color: var(--quiet); font-size: 13px; }

@media (max-width: 900px) {
  .container { width: min(100% - 48px, 700px); }
  .header-inner { min-height: 64px; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .main-nav { position: absolute; top: 63px; right: 24px; left: 24px; display: none; align-items: stretch; gap: 0; padding: 7px 17px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-strong); }
  .main-nav.is-open { display: flex; flex-direction: column; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .main-nav a:last-child { border-bottom: 0; }
  .hero { min-height: 570px; padding-top: 88px; }
  .hero-ornaments { opacity: 0.7; }
  .float-tile--one { left: calc(50% - 310px); }
  .float-tile--two { left: calc(50% - 185px); }
  .float-tile--three { right: calc(50% - 315px); }
  .float-tile--four { right: calc(50% - 185px); }
  .float-tile--five { left: calc(50% - 310px); }
  .float-tile--six { right: calc(50% - 315px); }
  .product-preview { margin-bottom: 80px; }
  .split-section, .split-section--reverse { grid-template-columns: 1fr; gap: 42px; padding-block: 82px 90px; }
  .split-section--reverse .section-copy, .split-section--reverse .ai-detail { order: initial; }
  .section-copy h2 { max-width: 14ch; }
  .account-section { grid-template-columns: 1fr; gap: 36px; padding-block: 82px 94px; }
  .account-panel { max-width: 600px; }
}

@media (max-width: 600px) {
  .container { width: calc(100% - 40px); }
  .main-nav { top: 63px; right: 20px; left: 20px; }
  .hero { min-height: auto; padding: 78px 20px 22px; }
  .hero::before { background-size: 64px 64px; }
  .hero h1 { max-width: none; margin-bottom: 19px; font-size: clamp(1.8rem, 8.8vw, 3.5rem); line-height: 1.05; }
  .hero-lead { max-width: 42ch; margin-bottom: 25px; font-size: 16px; }
  .hero-actions .button { width: min(100%, 330px); }
  .hero-secondary { margin-top: 16px; }
  .hero-note { margin-top: 23px; font-size: 12px; }
  .hero-note span + span::before { margin-inline: 7px; }
  .hero-note .note-divider { flex-basis: 100%; margin-top: 7px; }
  .hero-note .note-divider::before { content: none; }
  .hero-ornaments { display: none; }
  .product-preview { margin-top: 12px; margin-bottom: 64px; border-radius: 12px; }
  .split-section, .split-section--reverse { gap: 28px; padding-block: 66px 72px; }
  .section-copy h2, .account-intro h1 { max-width: 15ch; margin-bottom: 16px; font-size: 2.3rem; }
  .section-copy > p, .account-intro > p { font-size: 15px; }
  .principle-list { margin-top: 0; }
  .principle-list > div { grid-template-columns: 1fr; gap: 5px; padding: 15px 0; }
  .principle-list dt { font-size: 14px; }
  .principle-list dd { max-width: 48ch; }
  .ai-detail > p:first-child { font-size: 16px; }
  .download-page { padding-block: 56px 64px; }
  .download-intro h1 { gap: 10px; font-size: clamp(1.65rem, 8.2vw, 2rem); }
  .download-app-icon { flex-basis: 42px; width: 42px; height: 42px; border-radius: 10px; }
  .download-app-icon svg { width: 25px; height: 25px; }
  .download-list { margin-top: 48px; }
  .download-list[data-state="loading"], .download-list[data-state="empty"], .download-list[data-state="error"] { margin-top: 22px; }
  .platform-group:not(:last-child) { margin-bottom: 19px; padding-bottom: 16px; }
  .platform-assets { grid-template-columns: 1fr; }
  .account-section { padding-block: 66px 74px; }
  .account-panel { min-height: 0; padding: 21px 18px 23px; border-radius: 13px; }
  .auth-tabs { gap: 18px; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; padding-block: 18px; }
}

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