/* ============================================================
   public-site.css — additions every public page loads after warm-owner.css
   (linked by app/i18n_site.py::finish). Tokens come from warm-owner.css;
   this file declares no new colours.
   ============================================================ */

/* ---- content is visible without JavaScript ----
   warm-owner.css hides .reveal blocks until a script adds .in. That left the
   page blank below the hero with scripts off, and in full-page captures.
   The hidden state now applies only once /static/js/js-flag.js has run. */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---- language menu: a <details>, so it opens without script ---- */
.lang-menu { position: relative; font-size: 13px; }
.lang-menu summary { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 4px 9px; border-radius: 8px; cursor: pointer; list-style: none; color: var(--tx-mid); font-weight: 600; white-space: nowrap; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--tx-hi); background: var(--paper-2); }
.lang-menu .lang-globe { flex: none; }
.lang-menu .lang-caret { font-size: 10px; opacity: .7; }
.lang-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 320px; padding: 8px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: 0 14px 34px rgba(26,23,18,.14); }
.lang-list a { display: flex; align-items: center; min-height: 36px; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--tx-mid); white-space: nowrap; }
.lang-list a:hover { color: var(--tx-hi); background: var(--paper-2); }
.lang-list a[aria-current="true"] { color: var(--gr-ink); background: var(--gr-dim); font-weight: 600; }
.mobile-menu .lang-menu { display: none; }
@media (max-width: 1360px) {
  .nav-cta > .lang-menu { display: none; }
  .mobile-menu { max-height: calc(100vh - 68px); overflow-y: auto; overscroll-behavior: contain; }
  .mobile-menu .lang-menu { display: block; padding: 6px 0 4px; border-bottom: 1px solid var(--hairline); }
  .mobile-menu .lang-menu summary { font-size: 15px; min-height: 44px; padding-inline: 0; }
  .mobile-menu .lang-list { position: static; width: auto; box-shadow: none; border: 0; padding: 0 0 8px; background: transparent; }
  .mobile-menu .lang-list a { border-bottom: 0; padding: 8px 10px; min-height: 40px; font-size: 15px; }
}
.foot-bottom .foot-langs { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px 4px; }
.foot-langs a { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 9px; border-radius: 6px; }
.foot-langs a[aria-current="true"] { color: var(--tx-hi); font-weight: 600; }

/* ---- header fit ----
   Seven or eight links, the language menu, sign-in and the call to action
   must stay on one row in every language, and German or Indonesian labels
   are long. The link row is one line high and wraps: a link that does not
   fit drops to a second line that is clipped away, last link first, instead
   of pushing the call to action off the screen. Every link is also in the
   footer and the mobile menu. */
.nav-links { gap: 0 clamp(12px, 1.3vw, 24px); flex: 1 1 0; min-width: 0; flex-wrap: wrap; height: 40px; overflow: hidden; align-content: flex-start; padding-block: 4px; margin-block: -4px; }
.nav-links a { height: 32px; flex: none; }
.nav-cta { gap: 12px; }
html:not([lang="en"]) .nav-links a, html:not([lang="en"]) .nav-signin { font-size: 14px; }
/* Between the hamburger breakpoint and a wide screen there is no room for the
   two sister-site links as well; they stay in the footer and the menu. */
@media (max-width: 1540px) { .nav-links .nav-buzz, .nav-links .nav-sep { display: none; } }

/* ---- hit areas: nothing a finger must press is under 24px tall ---- */
.nav-links a, .nav-signin { display: inline-flex; align-items: center; min-height: 32px; }
.foot-col a { padding: 6px 0; min-height: 28px; }
.foot-bottom a { display: inline-block; padding: 5px 2px; }
.foot-note a { display: inline-block; padding: 4px 0; }
a.seek, .eco-foot a, .text-link { display: inline-flex; align-items: center; min-height: 28px; }
.announce a { display: inline-block; padding: 3px 0; }

/* ---- focus is visible everywhere, not only in the nav ---- */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--gr); outline-offset: 3px; border-radius: 4px; }
.hero a:focus-visible, .panel-dark a:focus-visible, .sov-hero a:focus-visible { outline-color: var(--brass); }

/* ---- hero field: a slow WebGL2 current behind the hero (hero-field.js) ----
   It lives inside the hero, under the content, and is masked away from the
   text column so the words always sit on flat ink. */
.has-field { position: relative; overflow: hidden; isolation: isolate; }
.has-field > .wrap { position: relative; z-index: 1; }
.hero-field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s var(--ease); }
.hero-field.is-live { opacity: 1; }
/* The still that shows when motion is off or WebGL2 is missing. */
.has-field::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 70% at 86% 18%, rgba(56,182,124,.16), transparent 62%),
    radial-gradient(ellipse 45% 60% at 70% 96%, rgba(196,165,116,.13), transparent 60%); }

/* ---- module flow strip: the line fills as the section scrolls by ---- */
.flow-progress { position: relative; height: 3px; margin-top: 16px; border-radius: 3px; background: rgba(244,239,228,.12); overflow: hidden; }
.flow-progress i { position: absolute; inset: 0; transform-origin: left center; background: linear-gradient(90deg, var(--gr-hi), var(--brass)); border-radius: 3px; }
.flow-progress i { transform: scaleX(1); }
.is-tracking .flow-progress i { transform: scaleX(var(--flow, 0)); }
[data-step] { transition: color .35s var(--ease), opacity .35s var(--ease); }
.is-tracking [data-step]:not(.is-on) { opacity: .45; }

/* ---- pointer depth on cards (site.js sets --mx/--my on hover) ---- */
.card, .eco-card, .atelier-card { position: relative; }
.js .card::after, .js .eco-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s var(--ease);
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(56,182,124,.10), transparent 70%); }
.js .card:hover::after, .js .eco-card:hover::after { opacity: 1; }

/* ---- home: sovereign AI band ---- */
.sov-band { background: var(--ink-navy); color: var(--tx-inv); border-radius: var(--radius); padding: clamp(26px, 4vw, 44px); display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(22px, 4vw, 48px); align-items: center; border: 1px solid rgba(196,165,116,.26); }
.sov-band .eyebrow { color: var(--brass); }
.sov-band .eyebrow::before { background: var(--brass); }
.sov-band h2 { color: var(--tx-hi); margin-top: 14px; }
.sov-band p { color: var(--tx-mid); margin-top: 14px; max-width: 56ch; }
.sov-band .hero-ctas { margin-top: 22px; }
.sov-band .btn-line { border-color: rgba(196,165,116,.5); color: var(--tx-hi); background: transparent; }
.sov-band .btn-line:hover { border-color: var(--brass); background: rgba(196,165,116,.12); }
.sov-band-art { width: 100%; height: auto; display: block; }
@media (max-width: 860px) { .sov-band { grid-template-columns: 1fr; } .sov-band-art { max-width: 340px; margin-inline: auto; } }

/* ---- small helpers used instead of inline style attributes ---- */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-22 { margin-top: 22px; } .mt-28 { margin-top: 28px; }
.center { text-align: center; }
.measure { max-width: 68ch; }
.brand-agi { color: var(--gr); }
.announce a { color: inherit; text-decoration: underline; }
.text-link { color: var(--gr-ink); text-decoration: underline; text-underline-offset: 4px; }
.foot-addr { font-style: normal; margin-top: 12px; line-height: 1.7; }
.foot-addr a { display: inline; }
.foot-brand { margin-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero-field { display: none; }
  .flow-progress i { transform: none; }
  .js .card::after, .js .eco-card::after { display: none; }
}
body.menu-open { overflow: hidden; }

/* the yin-yang mark, drawn with tokens (no hex in markup) */
.mark .mk-disc { fill: var(--surface); stroke: var(--hairline); }
.mark .mk-yin, .mark .mk-dot-b { fill: var(--mark); }
.mark .mk-dot-a { fill: var(--surface); }
.sb-u { fill: rgba(244,239,228,.05); stroke: var(--brass); stroke-width: 1.5; }
.sb-g { fill: var(--gr-hi); opacity: .85; }
.sov-band:hover .sb-g { opacity: 1; }
.hero.has-field .hero-video video { position: relative; }
.hero-video video { height: auto; }
.cto-card .avatar img { width: 54px; height: 54px; }

/* ---- scripts other than Latin ----
   Fonts the visitor already has (no downloads), each script's own rhythm,
   and no capitals or letter-spacing where the script has neither. */
:lang(zh-Hans) { --font: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif; --serif: "Fraunces", "Songti SC", "Noto Serif SC", "Noto Serif CJK SC", "PingFang SC", "Microsoft YaHei", serif; }
:lang(ja) { --font: "Inter", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", sans-serif; --serif: "Fraunces", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Noto Serif CJK JP", serif; }
:lang(ko) { --font: "Inter", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif; --serif: "Fraunces", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif; }
:lang(th) { --font: "Inter", "Thonburi", "Leelawadee UI", "Noto Sans Thai", sans-serif; --serif: "Fraunces", "Thonburi", "Leelawadee UI", "Noto Sans Thai", sans-serif; }
:lang(hi) { --font: "Inter", "Kohinoor Devanagari", "Nirmala UI", "Noto Sans Devanagari", sans-serif; --serif: "Fraunces", "Kohinoor Devanagari", "Nirmala UI", "Noto Sans Devanagari", sans-serif; }
html:lang(zh-Hans), html:lang(ja), html:lang(ko), html:lang(th), html:lang(hi) { --mono: var(--font); }
html:lang(zh-Hans) :is(.eyebrow, .kicker, .foot-col h3, .badge, .arch-badge, .atelier-kicker, .eco-role, .sov-size-for, .pm-cap, .arch-meta b, .tag, .metric .mlabel),
html:lang(ja) :is(.eyebrow, .kicker, .foot-col h3, .badge, .arch-badge, .atelier-kicker, .eco-role, .sov-size-for, .pm-cap, .arch-meta b, .tag, .metric .mlabel),
html:lang(ko) :is(.eyebrow, .kicker, .foot-col h3, .badge, .arch-badge, .atelier-kicker, .eco-role, .sov-size-for, .pm-cap, .arch-meta b, .tag, .metric .mlabel),
html:lang(th) :is(.eyebrow, .kicker, .foot-col h3, .badge, .arch-badge, .atelier-kicker, .eco-role, .sov-size-for, .pm-cap, .arch-meta b, .tag, .metric .mlabel),
html:lang(hi) :is(.eyebrow, .kicker, .foot-col h3, .badge, .arch-badge, .atelier-kicker, .eco-role, .sov-size-for, .pm-cap, .arch-meta b, .tag, .metric .mlabel) { letter-spacing: 0; text-transform: none; }
html:lang(zh-Hans) :is(h1, h2, h3, .display), html:lang(ja) :is(h1, h2, h3, .display), html:lang(ko) :is(h1, h2, h3, .display) { letter-spacing: 0; line-height: 1.28; }
html:lang(zh-Hans) .display, html:lang(ja) .display, html:lang(ko) .display { line-height: 1.22; }
html:lang(zh-Hans) body, html:lang(ja) body, html:lang(ko) body { line-height: 1.75; }
html:lang(ja) body { line-break: strict; }
html:lang(ko) :is(h1, h2, h3, .display, .lead, p, li) { word-break: keep-all; }
html:lang(th) body, html:lang(hi) body { line-height: 1.85; }
html:lang(th) :is(h1, h2, h3, .display), html:lang(hi) :is(h1, h2, h3, .display) { letter-spacing: 0; line-height: 1.4; }
html:lang(th) .display, html:lang(hi) .display { line-height: 1.34; }
html:lang(th) .lead, html:lang(hi) .lead { line-height: 1.7; }
/* Long words (German, Indonesian, Portuguese): let a heading break rather than overflow. */
html:not([lang="en"]) :is(h1, h2, h3, .display, .btn, .card h3) { overflow-wrap: anywhere; }
/* German: a slightly smaller headline keeps whole words on a line; no automatic hyphenation in display type. */
html:lang(de) .hero .display, html:lang(de) .sov-hero .display { font-size: clamp(34px, 3.7vw, 52px); max-width: none; }
html:lang(de) :is(h1, h2, h3, .display) { hyphens: manual; }
html:not([lang="en"]) .hero .display, html:not([lang="en"]) .sov-hero .display { max-width: 18ch; }

/* ---- 404 under a language prefix ---- */
.not-found { padding-block: clamp(60px, 12vw, 140px); max-width: 720px; }
.not-found .lead { margin-top: 14px; }
.not-found-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 26px; font-weight: 600; }
/* CJK headlines: full-width glyphs run wider than Latin at the same size, and a
   Japanese line should break between phrases, not inside a word. */
html:lang(zh-Hans) .hero .display, html:lang(ja) .hero .display, html:lang(ko) .hero .display,
html:lang(zh-Hans) .sov-hero .display, html:lang(ja) .sov-hero .display, html:lang(ko) .sov-hero .display { font-size: clamp(32px, 3.5vw, 50px); max-width: none; }
html:lang(ja) :is(h1, h2, h3, .display, .lead) { word-break: auto-phrase; overflow-wrap: normal; }
html:lang(th) .hero .display, html:lang(hi) .hero .display, html:lang(th) .sov-hero .display, html:lang(hi) .sov-hero .display { font-size: clamp(32px, 3.8vw, 54px); }
