/* Home: x.ai-style landing. Centered statement hero, three live tiles,
   a news-style "latest" row, closing call to the archive. */
:root {
  --bg: #ffffff;
  --fg: #0f1419;
  --muted: #5d6770;
  --panel: #f4f4f2;
  --hair: #e4e6e8;
  --term: #111214;
  --term-fg: #e7e9ea;
  --term-dim: #7b838a;
  --accent: #ff6b1a;
  --accent-2: #ffbb2e;
  --font: "Geist", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --fg: #eceff1; --muted: #8e979f; --panel: #141618; --hair: #26292d;
    --term: #0b0c0d; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --fg: #eceff1; --muted: #8e979f; --panel: #141618; --hair: #26292d;
  --term: #0b0c0d; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap, .nav-inner, .foot-inner, main > section {
  max-width: 1320px; margin-inline: auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}

/* Nav */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.nav-inner { display: flex; align-items: center; gap: 40px; padding-block: 18px; }
.wordmark { display: flex; gap: 6px; font-weight: 800; font-size: 17px; letter-spacing: 0.04em; }
.wordmark span:nth-child(2) { color: var(--muted); }
.nav-links { display: flex; gap: 32px; font-size: 16px; }
.nav-links a { color: var(--fg); opacity: .82; transition: opacity .15s; }
.nav-links a:hover { opacity: 1; }
.nav-cta { margin-left: auto; display: flex; gap: 10px; }

.pill { display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; padding: 11px 22px; font-weight: 500; font-size: 15px; white-space: nowrap; transition: transform .15s ease, background .15s; }
.pill:hover { transform: translateY(-1px); }
.pill-dark { background: var(--fg); color: var(--bg); }
.pill-soft { background: var(--panel); color: var(--fg); }
.pill-lg { padding: 16px 30px; font-size: 17px; }

/* Hero */
.hero { text-align: center; padding-block: 104px 88px; display: flex; flex-direction: column; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 12px; padding: 6px 8px 6px 8px; border: 1px solid var(--hair); border-radius: 999px; font-size: 16px; margin-bottom: 40px; transition: border-color .15s; }
.badge:hover { border-color: var(--muted); }
.badge-new { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); padding: 3px 12px; border-radius: 999px; font-size: 14px; }
.badge-arrow { width: 28px; height: 28px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 13px; }
h1 { font-size: clamp(42px, 7.6vw, 104px); line-height: 1.02; letter-spacing: -0.045em; font-weight: 500; }
.mark { position: relative; white-space: nowrap; }
.mark::after { content: ""; position: absolute; left: 0.02em; right: 0.02em; bottom: -0.04em; height: 0.05em; min-height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2) 50%, var(--hair)); transform-origin: left; animation: draw 1.1s .3s cubic-bezier(.2,.8,.2,1) both; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.lede { margin-top: 32px; font-size: clamp(17px, 1.7vw, 22px); max-width: 52ch; color: var(--fg); opacity: .86; }
.hero-cta { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* Showcase tiles */
.showcase { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.tile { position: relative; border-radius: 28px; overflow: hidden; height: 500px; display: flex; flex-direction: column; transition: transform .25s ease; }
.tile:hover { transform: translateY(-3px); }
.tile-light { background: var(--panel); }
.tile-dark { background: var(--term); color: var(--term-fg); }
.tile-stage { flex: 1; display: grid; place-items: center; padding: 28px; min-height: 0; }
.tile-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 28px 26px; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.explore { font-size: 20px; }
.explore .arr { display: inline-block; transition: transform .2s; }
.tile:hover .explore .arr { transform: translateX(4px); }

/* Cenvara phone (real screenshots) */
.app-stage { place-items: end center; padding: 30px 28px 0; overflow: hidden; }
.phone-shot {
  position: relative; width: min(250px, 72%); aspect-ratio: 585 / 1266; max-width: 100%;
  border-radius: 34px 34px 0 0; overflow: hidden; background: #0d0f10;
  box-shadow: 0 0 0 6px #15181a, 0 0 0 7px #2e3236, 0 30px 60px -30px rgba(0,0,0,.6);
  transform: translateY(18%); transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.tile-app:hover .phone-shot { transform: translateY(12%); }
.phone-shot picture { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.phone-shot picture.on { opacity: 1; }
.phone-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.tile-name { display: inline-flex; align-items: center; gap: 10px; }
.tile-name img { width: 28px; height: 28px; border-radius: 22.5%; }
.tile-app .tile-foot { position: relative; z-index: 2; padding-top: 18px; background: linear-gradient(to top, var(--panel) 70%, transparent); margin-top: -40px; }

/* terminal */
.term { flex: 1; display: flex; flex-direction: column; min-height: 0; font-family: var(--mono); font-size: 14px; }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 22px 24px 14px; border-bottom: 1px solid #23262a; color: var(--term-dim); }
.term-bar i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 12px; }
.term-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.term-body p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 8px; transition: opacity .3s; }
.t-cmd { color: #5fd38d; font-weight: 400; }
.t-dim { color: var(--term-dim); }
.t-tag { margin-left: auto; color: #6aa8ff; }
.t-ok { color: var(--accent-2); }
.term-body.replay p { opacity: 0; }

/* stats */
.stat-stage { align-content: center; justify-items: center; gap: 6px; text-align: center; }
.stat-big { font-size: clamp(64px, 7vw, 96px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-cap { color: var(--muted); font-size: 15px; }
.creators { display: flex; margin: 34px 0 10px; }
.creators i { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--panel); margin-left: -8px; background: linear-gradient(140deg, var(--fg), color-mix(in srgb, var(--fg) 45%, var(--panel))); }
.creators i:nth-child(3n) { background: linear-gradient(140deg, var(--accent), var(--accent-2)); }
.creators i:first-child { margin-left: 0; }
.creators b { width: 30px; height: 30px; border-radius: 50%; margin-left: -8px; display: grid; place-items: center; background: var(--bg); border: 2px solid var(--panel); font-size: 14px; }

/* Latest */
.latest { padding-block: 140px 40px; }
.lead-story { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 56px; align-items: center; }
.lead-text { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.date { color: var(--muted); font-size: 18px; }
.lead-text h3 { font-size: clamp(40px, 5vw, 72px); font-weight: 500; letter-spacing: -0.045em; line-height: 1.02; }
.lead-text p:not(.date) { font-size: 20px; opacity: .86; max-width: 34ch; }
.lead-art { border-radius: 28px; aspect-ratio: 16 / 9; max-width: 100%; display: grid; place-items: center; overflow: hidden; position: relative;
  background:
    radial-gradient(60% 80% at 22% 18%, rgba(140, 92, 255, .95), transparent 60%),
    radial-gradient(55% 70% at 88% 12%, rgba(255, 70, 140, .9), transparent 62%),
    radial-gradient(70% 90% at 70% 110%, rgba(255, 120, 60, .55), transparent 60%),
    #0b0b12; }
.lead-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(40% 50% at 45% 55%, rgba(0,0,0,.65), transparent 70%); }
.lead-word { position: relative; z-index: 1; color: #fff; font-size: clamp(34px, 5.4vw, 80px); font-weight: 500; letter-spacing: -0.045em; }

.stories { margin-top: 100px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.story { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.thumb { aspect-ratio: 16 / 9; max-width: 100%; border-radius: 18px; display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 500; letter-spacing: -0.02em; overflow: hidden; position: relative; transition: transform .25s; }
.story:hover .thumb { transform: translateY(-3px); }
.th-graphite { background: radial-gradient(70% 90% at 80% 20%, #f2f2f2, transparent 55%), linear-gradient(135deg, #111 30%, #3c3c3c); }
.th-ember { background: radial-gradient(70% 80% at 30% 0%, #b8501a, transparent 60%), linear-gradient(120deg, #e8692a, #f6b78d); }
.th-split { background: linear-gradient(90deg, #ea6060 0 42%, #4b1418 42%); justify-items: end; padding-right: 9%; font-size: 22px; }
.th-split .quote { position: absolute; left: 12%; top: 50%; transform: translateY(-50%); display: flex; gap: 12px; }
.th-split .quote i { width: 18px; height: 52px; border-radius: 9px; background: #fff; transform: skewX(-8deg); }
.th-dusk { background: radial-gradient(60% 80% at 50% 40%, #050505, transparent 70%), linear-gradient(180deg, #5d636b, #2c3036 60%, #9aa0a6); }
.meta { font-size: 15px; display: flex; gap: 8px; }
.meta i { font-style: normal; color: var(--muted); }
.story .title { font-size: 21px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; }
.story:hover .title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* Closer + footer */
.closer { text-align: center; padding-block: 140px 120px; display: flex; flex-direction: column; align-items: center; gap: 36px; }
.closer h2 { font-size: clamp(36px, 5.6vw, 76px); font-weight: 500; letter-spacing: -0.045em; line-height: 1.04; }
.foot { border-top: 1px solid var(--hair); }
.foot-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 26px; color: var(--muted); font-size: 14px; }
.foot-links { display: flex; gap: 22px; }
.foot-links a:hover { color: var(--fg); }

/* Responsive */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .showcase { grid-template-columns: 1fr 1fr; }
  .showcase .tile:last-child { grid-column: span 2; }
  .stories { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .stories .story:last-child { grid-column: span 2; }
  .stories .story:last-child .thumb { aspect-ratio: 21 / 9; }
}
@media (max-width: 720px) {
  .wrap, .nav-inner, .foot-inner, main > section {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .nav-inner { padding-block: 14px; }
  .hide-sm { display: none; }
  .pill { padding: 10px 18px; }
  .pill-lg { padding: 14px 24px; font-size: 16px; }
  .hero { padding-block: 64px 56px; }
  .badge { font-size: 14px; margin-bottom: 28px; }
  .showcase { grid-template-columns: 1fr; }
  .showcase .tile:last-child { grid-column: auto; }
  .tile { height: 440px; border-radius: 24px; }
  .latest { padding-block: 96px 20px; }
  .lead-story { grid-template-columns: 1fr; gap: 28px; }
  .stories { grid-template-columns: 1fr; margin-top: 56px; }
  .stories .story:last-child { grid-column: auto; }
  .stories .story:last-child .thumb { aspect-ratio: 16 / 9; }
  .closer { padding-block: 96px 80px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Language toggle + badge icon */
.pill-ghost { background: transparent; color: var(--fg); border: 1px solid var(--hair); font: inherit; font-size: 15px; cursor: pointer; padding: 10px 16px; }
.pill-ghost:hover { border-color: var(--muted); }
.lang-globe { font-size: 11px; font-weight: 600; border: 1px solid currentColor; border-radius: 5px; padding: 0 4px; line-height: 16px; }
.badge-icon { width: 22px; height: 22px; border-radius: 22.5%; }
.th-graphite { gap: 12px; grid-auto-flow: column; }
.th-graphite img { width: 44px; height: 44px; border-radius: 22.5%; box-shadow: 0 6px 18px -6px rgba(0,0,0,.6); }

/* CJK */
:lang(zh) h1, :lang(zh) h2, :lang(zh) .lead-text h2, :lang(zh) .closer h2 { letter-spacing: 0; line-height: 1.16; }
:lang(zh) .lede, :lang(zh) .lead-text p { line-height: 1.75; }
.lead-text h2 { font-size: clamp(40px, 5vw, 72px); font-weight: 500; letter-spacing: -0.045em; line-height: 1.02; }

/* Scroll motion — scroll-driven, so content is static where unsupported */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero > * { animation: hero-out linear both; animation-timeline: scroll(root); animation-range: 0 70vh; }
    .hero h1 { animation-range: 0 60vh; }
    @keyframes hero-out { to { opacity: 0; transform: translateY(-60px) scale(.96); filter: blur(4px); } }

    .tile { animation: tile-in linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .tile:nth-child(2) { animation-range: entry 6% entry 80%; }
    .tile:nth-child(3) { animation-range: entry 12% entry 90%; }
    @keyframes tile-in { from { opacity: 0; transform: translateY(80px) scale(.96); } }

    .lead-text > * { animation: rise linear both; animation-timeline: view(); animation-range: entry 10% entry 70%; }
    .lead-art { animation: art-in linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; background-size: 160% 160%; }
    @keyframes art-in { from { opacity: .2; transform: scale(.9); border-radius: 60px; background-position: 0% 0%; } to { background-position: 100% 100%; } }
    .lead-word { animation: word-in linear both; animation-timeline: view(); animation-range: entry 30% cover 50%; }
    @keyframes word-in { from { letter-spacing: .2em; opacity: 0; } }

    .story { animation: rise linear both; animation-timeline: view(); animation-range: entry calc(var(--d) * 6%) entry calc(70% + var(--d) * 8%); }
    @keyframes rise { from { opacity: 0; transform: translateY(48px); } }

    .closer h2 { animation: closer-in linear both; animation-timeline: view(); animation-range: entry 10% cover 45%; }
    @keyframes closer-in { from { opacity: 0; transform: scale(.88); filter: blur(6px); } }
  }
}

@media (max-width: 720px) {
  .br-lg { display: none; }
  .hero-cta { flex-direction: column; align-items: stretch; width: 100%; max-width: 340px; }
  .hero-cta .pill { justify-content: center; }
  .nav-cta { gap: 8px; }
  .pill-ghost { padding: 9px 12px; font-size: 14px; }
  .nav-cta .pill-dark { padding: 10px 16px; font-size: 14px; }
  .phone-shot { width: min(230px, 66%); }
  .badge { gap: 8px; }
  .badge-icon { display: none; }
}
@media (max-width: 480px) {
  .nav-cta .pill-dark { display: none; }
}
@media (max-width: 380px) {
  .wordmark { font-size: 15px; gap: 4px; }
}
.tile-name img, .badge-icon { outline: 1px solid var(--hair); outline-offset: -1px; }

.th-photo { background: #111; }
.th-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.th-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,.1) 60%); }
.th-photo span { position: relative; z-index: 1; }
.story:hover .th-photo img { transform: scale(1.05); }
