/* Web fonts, served from this site and declared here (not in a late stylesheet) so a reload
   paints in the right font straight away. Each page preloads the two or three files it needs
   first. "Inter Fallback" is Arial resized to Inter's measurements, so if Inter is ever late
   the text barely moves when it swaps in. Within a family, later faces win for shared
   characters, so the small Vietnamese files are listed after latin-ext. */
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("Helvetica Neue"), local("Helvetica"); size-adjust: 107.1%; ascent-override: 90.4%; descent-override: 22.5%; line-gap-override: 0%; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 700; font-stretch: 100%; font-display: swap; src: url(fonts/bricolage-grotesque-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 700; font-stretch: 100%; font-display: swap; src: url(fonts/bricolage-grotesque-vietnamese.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 700; font-stretch: 100%; font-display: swap; src: url(fonts/bricolage-grotesque-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-vietnamese.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/inter-vietnamese.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-vietnamese.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Syne"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/syne-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Skill Swap × Loupe — type meets optics.
   Off-white paper, near-black ink, thin lines; lime only ever appears as the band at the bottom of a frame. */
:root {
  color-scheme: light;
  --bg: #fbfcfa;
  --surface: #ffffff;
  --ink: #121016;
  --muted: #57535d;
  --faint: rgba(18, 16, 22, 0.1);
  --line: rgba(18, 16, 22, 0.14);
  --line-strong: rgba(18, 16, 22, 0.32);
  --lime: #a0e866;
  --accent: #121016;
  --wave-line: rgba(93, 73, 57, 0.17);
  --danger: #b3261e;
  --cursor-dot: #121016;
  --cursor-dot-halo: rgba(255, 255, 255, 0.9);
  --cursor-ring: rgba(18, 16, 22, 0.78);
  --cursor-ring-halo: rgba(255, 255, 255, 0.62);
  --display: "Syne", "Bricolage Grotesque", "Inter", sans-serif;
  --text: "Inter", "Inter Fallback", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --radius: 22px;
}
/* Syne has no Vietnamese glyphs; Vietnamese headlines use a wide grotesk that does */
html[lang="vi"] { --display: "Bricolage Grotesque", "Inter", sans-serif; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: var(--text); font-size: 16px; line-height: 1.55; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
body.has-overlay { overflow: hidden; }
img { display: block; max-width: 100%; }
/* iOS: no double-tap zoom on taps (pinch zoom still works) */
html, a, button, input, select, textarea, label, .lang-float { touch-action: manipulation; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--line-strong); margin: 8px 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--ink); color: var(--bg); }
.container { width: min(1200px, 100% - 48px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 16px; color: var(--bg); background: var(--ink); border-radius: 999px; font-size: 13px; transform: translateY(-160%); transition: transform 0.2s ease; }
.skip-link:focus { transform: none; }
.muted { color: var(--muted); }
.caps { font-size: 8.5px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; }
.diamond { display: inline-block; width: 6px; height: 6px; flex: 0 0 auto; background: currentColor; transform: rotate(45deg); }
.diamond-lg { width: 14px; height: 14px; }

/* ---------- navigation: a frosted pill ---------- */
.site-nav { position: fixed; z-index: 30; top: 12px; left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; }
.nav-pill {
  pointer-events: auto;
  width: max-content;
  max-width: calc(100% - 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(251, 252, 250, 0.75);
  border: 1px solid rgba(18, 16, 22, 0.15);
  border-radius: 999px;
  box-shadow: 0 8px 24px -12px rgba(18, 16, 22, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-pill::-webkit-scrollbar { display: none; }
.nav-pill > a { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; min-height: 30px; padding: 0 14px; color: rgba(18, 16, 22, 0.66); border-radius: 999px; font-size: 12px; font-weight: 400; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; transition: background 0.2s ease; }
.nav-pill > a:hover { color: var(--ink); background: rgba(18, 16, 22, 0.06); }
.nav-pill > a[aria-current="page"] { color: var(--bg); background: var(--ink); }
.nav-pill .diamond-o { width: 6px; height: 6px; transition: opacity 0.2s ease; }
.nav-pill > a:not([aria-current="page"]) .diamond-o { opacity: 0; }
.corner-auth { margin-left: 0; flex-wrap: wrap; justify-content: flex-end; }
/* signed in on an earlier visit: hide the signed-out button until the account bar is drawn */
.ss-signed [data-auth-slot]:not(.is-signed), .ss-signed [data-nav-auth]:not(.is-signed) { visibility: hidden; }
.nav-sep { width: 1px; height: 18px; margin: 0 6px; flex: 0 0 auto; background: var(--line); }
.lang-switch { display: inline-flex; flex: 0 0 auto; gap: 2px; }
.lang-switch button { min-width: 28px; height: 27px; padding: 0 6px; background: none; border: 0; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; cursor: pointer; }
.lang-switch button:hover { background: var(--faint); }
.lang-switch button[aria-pressed="true"] { color: var(--bg); background: var(--ink); }
.theme-toggle { display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px; margin-left: 2px; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: 50%; cursor: pointer; transition: background-color 0.2s ease, transform 0.2s ease; }
.theme-toggle:hover { background: var(--faint); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
.theme-toggle-floating { position: fixed; z-index: 40; top: 14px; right: var(--edge); width: 44px; height: 44px; flex-basis: 44px; margin: 0; color: var(--ink); background: var(--glass); border: 0.5px solid var(--pill-edge); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.28); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.theme-toggle-floating svg { width: 19px; height: 19px; }
.nav-auth { display: flex; align-items: center; gap: 4px; margin-left: 4px; }
.nav-auth .btn-sm { min-height: 27px; padding: 0 12px; font-size: 11px; }
.nav-auth .nav-user { min-height: 34px; padding: 0 12px 0 3px; }
.nav-user .avatar { width: 26px; height: 26px; }
.nav-user-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 999px; font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn-primary { color: var(--bg); background: var(--ink); }
.btn-primary:hover { background: #2b2832; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-accent { color: var(--bg); background: var(--ink); }
.link-button { padding: 0; background: none; border: 0; font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; color: var(--ink); background: var(--lime); border-radius: 999px; font-size: 10.5px; font-weight: 600; line-height: 1; }
.avatar { width: 30px; height: 30px; aspect-ratio: 1; flex: 0 0 auto; display: inline-grid; place-items: center; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.avatar-fallback { color: var(--bg); background: var(--ink); font-size: 12px; font-weight: 600; }

/* ---------- corner details (hero and page tops) ---------- */
:root { --edge: clamp(18px, 4.2vw, 56px); --soft: #6b6870; }
.corner-tl { display: flex; align-items: flex-start; gap: clamp(14px, 2.4vw, 34px); }
.corner-tl .mark { display: block; font-size: 11px; font-weight: 600; line-height: 1.28; letter-spacing: -0.01em; text-decoration: none; }
.corner-tl .caps { display: block; color: var(--soft); font-size: 8px; font-weight: 500; letter-spacing: 0.22em; }
.corner-lines { padding-left: clamp(14px, 2.4vw, 34px); color: var(--soft); border-left: 1px solid rgba(18, 16, 22, 0.14); font-size: 10px; font-weight: 500; line-height: 1.5; }
.corner-tr { display: flex; flex-direction: column; align-items: flex-end; gap: 22px; }
.pill-link { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 1px solid rgba(18, 16, 22, 0.14); border-radius: 999px; font-size: 10px; font-weight: 500; line-height: 1.5; text-decoration: none; white-space: nowrap; transition: border-color 0.2s ease; }
.pill-link .diamond-o, .nav-pill .diamond-o { display: inline-block; width: 7px; height: 7px; flex: 0 0 auto; border: 1px solid currentColor; transform: rotate(45deg); }
.pill-link:hover { border-color: var(--ink); }
.foot-caps { font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.foot-caps .muted { color: var(--soft); font-weight: 500; letter-spacing: normal; text-transform: none; }

/* ---------- hero: one held frame ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 300px; }
.stage { position: absolute; inset: 0; overflow: hidden; isolation: isolate; }
.band { position: absolute; left: 0; right: 0; top: 0; height: 110%; background: linear-gradient(#fbfcfa 45%, rgba(251, 252, 250, 0.58) 69%, rgba(251, 252, 250, 0.3) 91%), linear-gradient(90deg, #7c3aed 0%, #9775fa 20%, #b69cf7 40%, #9fdcb5 60%, #5fce78 80%, #2f9e44 100%); will-change: transform; }
.floor { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage > .floor { top: 30%; height: 58%; }
.stage-front { position: absolute; inset: 0; }
.word { position: absolute; left: 0; right: 0; top: 55%; margin: 0; color: var(--ink); font-family: "Syne", var(--text); font-size: 16vw; font-weight: 700; line-height: 0.86; letter-spacing: -0.03em; text-align: center; white-space: nowrap; transform: translateY(calc(-50% + var(--word-shift, 0px))); }
.word-inner { display: inline-block; }
.ch { display: inline-block; }
.ch-space { width: 0.26em; }
.stage:not(.is-ready) .ch { opacity: 0; }
.stage.is-ready .ch { animation: ch-in 1.1s var(--ease) calc(200ms + var(--i) * 75ms) both; }
/* corners fade in on their own: first paint never waits for the font or the script */
.stage .corner { animation: fade 0.8s ease both; }
@keyframes ch-in { from { opacity: 0; transform: translateY(0.14em) scale(0.86); filter: blur(14px); } }
@keyframes fade { from { opacity: 0; } }

.corner { position: absolute; z-index: 2; }
.stage .corner-tl { top: 26px; left: var(--edge); }
.stage .corner-tr { top: 26px; right: var(--edge); }
.corner-bl, .corner-br { bottom: clamp(18px, 4.5vh, 42px); }
.corner-bl { left: var(--edge); }
.corner-br { right: var(--edge); display: flex; align-items: center; gap: 8px; }
.stage .is-hidden { visibility: hidden; }
.hero-cta { position: absolute; left: 50%; top: 72%; display: inline-flex; align-items: center; gap: 9px; padding: 11px 22px; color: var(--bg); background: var(--ink); border-radius: 999px; box-shadow: 0 10px 24px -12px rgba(18, 16, 22, 0.55); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; transform: translateX(-50%); transition: transform 0.3s var(--ease), box-shadow 0.3s ease; }
.hero-cta:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 16px 30px -12px rgba(18, 16, 22, 0.6); }
.hero-cta .diamond-o { width: 7px; height: 7px; flex: 0 0 auto; border: 1px solid currentColor; transform: rotate(45deg); }
.page-home .hero { touch-action: none; }
/* the home page is exactly one screen: never let a rounding pixel (Windows display scaling)
   summon a scrollbar, whose width would change the stage and refit the word in a loop */
body.page-home { overflow: hidden; }
.no-copy { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* the drop of glass (built by loupe.js) */
.lens { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; opacity: 0; transition: opacity 1.1s ease; will-change: transform; }
.lens.is-on { opacity: 1; }
.lens-body { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 1px rgba(30, 58, 38, 0.22), 0 20px 30px -6px rgba(56, 118, 40, 0.32), 0 3px 8px -2px rgba(56, 118, 40, 0.24); will-change: transform; }
.lens-glass { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; background: var(--bg); filter: url(#lens-refract) blur(0.5px) saturate(1.26) brightness(1.03) contrast(1.06); }
.lens-glass.is-simple { filter: none; }
.lens-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.lens-world > div { position: absolute; inset: 0; }
.lens-floor { position: absolute; left: 0; top: 30%; width: 100%; height: 58%; }
.lens .ch, .lens .corner { animation: none !important; opacity: 1 !important; }
.lens-lights { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; -webkit-mask-image: radial-gradient(closest-side, transparent 52%, rgba(0, 0, 0, 0.35) 68%, rgba(0, 0, 0, 0.8) 84%, #000 100%); mask-image: radial-gradient(closest-side, transparent 52%, rgba(0, 0, 0, 0.35) 68%, rgba(0, 0, 0, 0.8) 84%, #000 100%); }
.lens-light { position: absolute; inset: -45%; background: radial-gradient(ellipse 24% 24% at 50% 50%, rgba(var(--c), var(--a)) 0%, rgba(var(--c), calc(var(--a) * 0.72)) 20%, rgba(var(--c), calc(var(--a) * 0.44)) 40%, rgba(var(--c), calc(var(--a) * 0.22)) 60%, rgba(var(--c), calc(var(--a) * 0.07)) 80%, rgba(var(--c), 0) 100%); mix-blend-mode: multiply; will-change: transform; }
.lens-surface { position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 12%, rgba(255, 255, 255, 0) 21%), radial-gradient(circle at 30% 21%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.22) 3.5%, rgba(255, 255, 255, 0) 6.5%), radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 46%), radial-gradient(circle at 50% 118%, rgba(22, 44, 30, 0.2), rgba(22, 44, 30, 0) 54%), radial-gradient(circle at 50% 50%, rgba(44, 76, 52, 0) 58%, rgba(44, 76, 52, 0.1) 80%, rgba(32, 60, 40, 0.26) 93%, rgba(24, 48, 32, 0.4) 100%); }
.lens-rim { position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), inset 0 2px 1.5px -1px rgba(255, 255, 255, 0.7), inset 0 -2px 1.5px -1px rgba(255, 255, 255, 0.3), inset 0 0 10px -3px rgba(24, 48, 32, 0.45); }
.lens-ring { --rim: -30; position: absolute; inset: 0; padding: 2.2px; border-radius: inherit; background: conic-gradient(from calc(var(--rim) * 1deg), rgba(255, 255, 255, 0.92) 0deg, rgba(24, 48, 32, 0.2) 26deg, rgba(24, 48, 32, 0.2) 90deg, rgba(24, 48, 32, 0.4) 180deg, rgba(24, 48, 32, 0.2) 270deg, rgba(24, 48, 32, 0.2) 334deg, rgba(255, 255, 255, 0.92) 360deg); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .lens { transition: none; } }

/* ---------- sections ---------- */
.section { position: relative; padding: clamp(72px, 10vw, 136px) 0; border-top: 1px solid var(--line); }
.label { display: flex; align-items: baseline; gap: 10px; margin-bottom: 22px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; }
.label span:first-child { color: var(--ink); font-variant-numeric: tabular-nums; }
.label span:first-child::after { content: ""; display: inline-block; width: 28px; height: 1px; margin-left: 10px; vertical-align: middle; background: var(--line-strong); }
.section-head { max-width: 780px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-title { font-family: var(--display); font-size: clamp(2rem, 5.2vw, 4.4rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.02; text-wrap: balance; overflow-wrap: break-word; }
.section-lead { max-width: 52ch; margin-top: 20px; color: var(--muted); font-size: 1.08rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.step { padding: 28px 28px 8px 0; display: flex; flex-direction: column; gap: 12px; }
.step + .step { padding-left: 28px; border-left: 1px solid var(--line); }
.step-num, .principle-num { font-family: "Syne", var(--text); font-weight: 700; line-height: 0.9; letter-spacing: -0.03em; color: rgba(18, 16, 22, 0.1); transition: color 0.35s ease; }
.step-num { font-size: clamp(3.4rem, 6vw, 5.4rem); }
.step:hover .step-num { color: var(--ink); }
.step h3 { margin-top: 24px; font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.step p { color: var(--muted); }

/* a card standing on the still floor */
.floor-card { position: relative; overflow: hidden; min-height: 460px; display: flex; align-items: center; justify-content: center; padding: 72px 28px 120px; text-align: center; border: 1px solid var(--line); border-radius: 32px; background: var(--bg); }
.floor-card .floor { position: absolute; inset: 0; }
.band-still { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; background: linear-gradient(#fbfcfa 30%, rgba(251, 252, 250, 0.58) 62%, rgba(251, 252, 250, 0.3) 92%), linear-gradient(90deg, #7c3aed 0%, #9775fa 20%, #b69cf7 40%, #9fdcb5 60%, #5fce78 80%, #2f9e44 100%); }
.floor-card-body { position: relative; z-index: 1; max-width: 720px; display: flex; flex-direction: column; align-items: center; }
.floor-card .label { justify-content: center; }
.join-lead { max-width: 46ch; margin: 20px auto 0; color: var(--muted); font-size: 1.05rem; }
.google-button-slot { min-height: 44px; margin-top: 30px; display: flex; justify-content: center; }
.join-actions { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---------- marketplace ---------- */
.market-tools-slot { position: relative; }
.market-tools { display: flex; flex-wrap: wrap; gap: 10px; max-width: 760px; transition: transform 0.7s var(--ease); will-change: transform; }
.search-field { position: relative; flex: 1 1 260px; display: flex; min-width: 0; }
.search-input { flex: 1; width: 100%; min-width: 0; min-height: 52px; padding: 0 20px 0 48px; color: var(--ink); background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23121016' stroke-width='1.8' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>") no-repeat 18px center; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 16px; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.search-input::placeholder { color: #7a7680; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--faint); }
.market-tools .btn { min-height: 52px; }
.search-close { position: absolute; top: 50%; right: 8px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--bg); background: var(--ink); border: 0; border-radius: 50%; font-size: 12px; cursor: pointer; translate: 0 -50%; animation: fade 0.4s ease 0.25s both; }
body.searching .market-tools { position: fixed; z-index: 45; top: 16px; left: 0; right: 0; width: min(760px, 100% - 32px); margin-inline: auto; flex-wrap: nowrap; }
body.searching .search-input { padding-right: 56px; box-shadow: 0 12px 30px -16px rgba(18, 16, 22, 0.4); }
.market-stat { min-height: 1.4em; margin-top: 36px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.skill-cloud { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 0 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.chip:has(em) { padding-right: 6px; }
.chip-more { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.chip-more:hover { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.chip span { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip em { min-width: 28px; height: 28px; padding: 0 7px; display: grid; place-items: center; color: var(--ink); background: var(--faint); border-radius: 999px; font-size: 11.5px; font-style: normal; font-weight: 600; }
.chip:hover { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.chip:hover em { color: var(--ink); background: var(--bg); }
.market-hint { margin-top: 24px; color: var(--muted); font-size: 13px; }

.market-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.all-load-status { margin: 18px 0 32px; color: var(--muted); font-size: 13px; text-align: center; }
.market-card { min-height: 230px; padding: 24px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color 0.2s ease, transform 0.3s var(--ease); }
.market-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.market-card.is-unreviewed { opacity: 0.72; border-style: dashed; }
.market-owner { margin-bottom: 10px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.market-line { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.market-line strong { margin-right: 8px; color: var(--muted); font-size: 0.62em; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.market-desc { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.market-foot { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); }
.market-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.market-empty { margin-top: 24px; padding: 48px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.market-empty-actions { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }


/* ---------- fanpage ---------- */
.fan-layout { display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: start; }
.fan-card { position: sticky; top: 90px; padding: 28px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fan-id { display: flex; align-items: center; gap: 12px; }
.fan-avatar { width: 52px; height: 52px; object-fit: cover; object-position: 50% 30%; border-radius: 50%; }
.fan-name { font-weight: 600; }
.fan-sub { color: var(--muted); font-size: 12px; }
.fan-title { margin-top: 4px; font-family: var(--display); font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.fan-lead { color: var(--muted); font-size: 14.5px; }
.fan-card .btn { align-self: flex-start; }
.fan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fan-tile { margin: 0; }
.fan-tile-wide { grid-column: span 2; }
.fan-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--faint); border-radius: 16px; filter: grayscale(1) contrast(1.05); transition: filter 0.6s ease; }
.fan-tile-wide img { aspect-ratio: 16 / 7; }
.fan-tile:hover img { filter: none; }
.fan-tile figcaption { padding: 12px 2px 0; display: grid; grid-template-columns: auto 1fr; gap: 0 12px; }
.fan-num { grid-row: span 5; padding-top: 3px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; }
.fan-tile h3 { font-size: 1rem; font-weight: 600; }
.fan-tile figcaption p { color: var(--muted); font-size: 13.5px; }
/* news written by admins: date line, then the text (long posts fold to five lines) */
.fan-tile .news-date { font-size: 12px; }
.fan-tile .news-body { margin-top: 4px; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.news-tile-text { padding: 20px 20px 22px; align-self: start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.news-tile-text figcaption { padding: 0; }
/* a news tile is one link that opens the whole post */
.news-link { display: block; color: inherit; text-decoration: none; border-radius: 16px; }
.news-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.news-link:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.news-tile:hover img { filter: none; }
.news-read { grid-column: 2; margin-top: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; }
.news-more { grid-column: 1 / -1; display: flex; justify-content: center; padding-top: 6px; }
.news-empty { grid-column: 1 / -1; padding: 28px; color: var(--muted); text-align: center; border: 1px dashed var(--line-strong); border-radius: 16px; }

/* ---------- inner pages ---------- */
.page-corners { position: absolute; z-index: 2; top: 26px; left: var(--edge); right: var(--edge); display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.page-head { position: relative; min-height: min(100svh, 980px); padding-top: clamp(92px, 7vw, 104px); padding-bottom: 80px; }
.page-head > .container { position: relative; z-index: 1; }
/* the join headline starts at (almost) its fitted size, so the page doesn't jump when the script
   fine-tunes it: --fit-em is how many ems wide the word is in its font */
.page-head { --fit-col: min(1200px, 100vw - 48px); --fit-em: 2.56; }
html[lang="en"] .page-head { --fit-em: 2.95; }
.page-title.page-title-huge { display: inline-block; max-width: none; font-size: min(calc(var(--fit-col) / var(--fit-em)), 60vh); line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
.page-title { max-width: 16ch; font-family: var(--display); font-size: clamp(2.5rem, 8.4vw, 7.4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 0.98; text-wrap: balance; overflow-wrap: break-word; }
.page-intro { max-width: 50ch; margin-top: 28px; color: var(--muted); font-size: clamp(1.02rem, 1.6vw, 1.2rem); }
.page-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; overflow: hidden; }
.page-floor .floor { position: absolute; inset: 0; }

.section-ruled { border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(28px, 6vw, 96px); }
.prose { display: flex; flex-direction: column; gap: 18px; font-size: clamp(1.05rem, 1.7vw, 1.3rem); line-height: 1.55; }
.prose p:first-child { font-family: var(--display); font-size: 1.25em; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
.prose p + p { color: var(--muted); }

.principles { margin-top: clamp(36px, 5vw, 64px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 24px; }
.principle { position: relative; padding: 28px 0 32px; border-top: 1px solid var(--line); }
.principle-num { display: block; font-size: clamp(3.4rem, 5vw, 4.6rem); }
.principle:hover .principle-num { color: var(--ink); }
.principle h3, .step h3 { display: flex; align-items: center; gap: 10px; }
.principle h3::before, .step h3::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border: 1px solid currentColor; transform: rotate(45deg); }
.principle h3 { margin-top: 18px; font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; }
.principle p { max-width: 42ch; margin-top: 8px; color: var(--muted); }

.team-grid { margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.team-card { padding: 28px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.team-role { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.team-card p + p { color: var(--muted); font-size: 15px; }

/* contact */
.contact-split { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.contact-intro { position: sticky; top: 110px; }
.contact-lead { margin-top: 18px; max-width: 34ch; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.15rem); line-height: 1.55; }
.form-card { padding: clamp(22px, 4vw, 40px); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 30px 60px -44px rgba(18, 16, 22, 0.4); }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.contact-form .label { margin-bottom: 4px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 12px 16px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px; font-size: 16px; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.field textarea { resize: vertical; min-height: 150px; }
.field select { appearance: none; padding-right: 40px; background: var(--bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23121016' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 16px center; cursor: pointer; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--faint); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; font-weight: 500; }
.field-error:empty { display: none; }
.form-error { color: var(--danger); font-size: 14px; font-weight: 500; }
.form-error:empty { display: none; }
.contact-form .btn { align-self: flex-start; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-done { padding: 40px 0 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; outline: none; }
.form-done p { color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { padding: 28px 0 32px; border-top: 1px solid var(--line); font-size: 11px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 24px; }
.footer-row p:last-child { display: flex; align-items: baseline; gap: 8px; }
.footer-privacy a { color: var(--muted); text-underline-offset: 3px; }
.footer-privacy a:hover { color: var(--ink); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; translate: 0 18px; transition: opacity 0.9s var(--ease), translate 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; translate: 0 0; }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }

/* ---------- search results layer ---------- */
.all-skills { position: fixed; inset: 0; z-index: 40; overflow-y: auto; color: var(--ink); background: var(--bg); outline: none; overscroll-behavior: contain; opacity: 0; transition: opacity 0.35s ease; }
.all-skills.is-open { opacity: 1; }
.all-top { position: sticky; top: 0; z-index: 2; height: 92px; margin-bottom: -6px; background: linear-gradient(to bottom, var(--bg) 68%, rgba(251, 252, 250, 0)); pointer-events: none; }
.all-inner { width: min(1200px, 100% - 32px); margin-inline: auto; padding-bottom: 120px; }
.all-meta { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.all-count { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.all-skills.entering .market-card { animation: card-in 0.7s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms + 140ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(24px); } }

/* ---------- dialogs ---------- */
.app-dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100svh - 32px); padding: 0; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 40px 90px -30px rgba(18, 16, 22, 0.5); }
.app-dialog-wide { width: min(640px, calc(100% - 24px)); }
/* a dialog is open: the page behind stays put (dialogs scroll inside themselves) */
html.is-modal-open, html.is-modal-open body { overflow: hidden; }
html.is-modal-open { scrollbar-gutter: stable; }
.app-dialog { overscroll-behavior: contain; }
.app-dialog::backdrop { background: rgba(18, 16, 22, 0.42); backdrop-filter: blur(6px); }
.dialog-form { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.dialog-form h3 { font-family: var(--display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.dialog-form h4 { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.dialog-note { margin-top: -4px; color: var(--muted); font-size: 14px; }
.dialog-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.app-dialog input[type="text"], .app-dialog textarea { width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; font-size: 16px; font-weight: 400; resize: vertical; }
.app-dialog input:focus, .app-dialog textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--faint); }
.mode-group { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; border: 0; }
.mode-group legend { margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 600; }
.mode-option { flex-direction: row !important; align-items: flex-start; gap: 10px !important; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-weight: 400 !important; cursor: pointer; }
.mode-option:has(input:checked) { border-color: var(--ink); }
.mode-option input { margin-top: 4px; accent-color: var(--ink); }
.dialog-error { min-height: 1.2em; color: var(--danger); font-size: 14px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inbox-list { display: flex; flex-direction: column; gap: 10px; }
.inbox-empty { color: var(--muted); font-size: 14px; }
.profile-photo { display: flex; align-items: center; gap: 16px; }
.profile-photo .profile-avatar { width: 72px; height: 72px; flex: 0 0 72px; font-size: 28px; }
.profile-photo-actions { flex: 1 1 auto; }
.profile-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-form .profile-photo-pick { position: relative; flex-direction: row; font-weight: 500; cursor: pointer; }
.profile-photo-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.profile-photo-pick:focus-within { box-shadow: 0 0 0 3px var(--faint); }
.profile-photo.is-busy { opacity: 0.55; pointer-events: none; }
.avatar-crop { display: grid; gap: 10px; margin-top: 14px; }
.avatar-crop[hidden] { display: none; }
.avatar-crop-frame { position: relative; width: min(100%, 280px); aspect-ratio: 1; justify-self: center; overflow: hidden; background: var(--faint); border-radius: 18px; cursor: grab; touch-action: none; user-select: none; }
.avatar-crop-frame:active { cursor: grabbing; }
.avatar-crop-frame img { position: absolute; top: 0; left: 0; max-width: none; pointer-events: none; }
.avatar-crop-zoom { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.avatar-crop-zoom input { flex: 1; accent-color: var(--ink); }
.avatar-crop-hint { margin: -4px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; }
.avatar-crop-actions { display: flex; justify-content: flex-end; gap: 8px; }
.app-dialog input[type="datetime-local"] { width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; font: inherit; font-size: 16px; font-weight: 400; }
.inbox-item { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; font-size: 14px; }
.inbox-item p { overflow-wrap: anywhere; }
.inbox-head { display: flex; align-items: center; gap: 8px; }
.inbox-status { margin-left: auto; padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.inbox-item.is-pending { border-color: var(--ink); }
.inbox-item.is-accepted .inbox-status { background: var(--lime); border-color: transparent; }
.inbox-quote { color: var(--muted); }
.inbox-message { white-space: pre-line; }
.inbox-contact { padding: 9px 12px; background: var(--faint); border-radius: 10px; }
.inbox-actions { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; }
/* admin dialog: tabs, news form, admins */
.admin-tabs { display: flex; gap: 4px; padding: 4px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs button { flex: 1 0 auto; min-height: 34px; padding: 0 14px; color: var(--muted); background: none; border: 0; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.admin-tabs button[aria-selected="true"] { color: var(--bg); background: var(--ink); }
.admin-panel { display: flex; flex-direction: column; gap: 14px; }
.admin-panel[hidden] { display: none; }
.news-form { display: flex; flex-direction: column; gap: 12px; }
.news-photo input[type="file"] { padding: 10px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 12px; font-size: 14px; }
.news-preview { max-height: 220px; width: 100%; object-fit: cover; border-radius: 14px; }
/* the whole post */
.news-dialog { width: min(760px, calc(100% - 24px)); }
.news-article { position: relative; max-height: calc(100svh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.news-close { position: sticky; top: 14px; z-index: 2; display: flex; width: fit-content; margin: 14px 14px -48px auto; background: var(--bg); box-shadow: 0 6px 18px -8px rgba(18, 16, 22, 0.35); }
.news-hero { display: block; width: 100%; max-height: 62svh; object-fit: cover; background: var(--faint); }
.news-article-body { padding: clamp(22px, 5vw, 48px); padding-top: clamp(20px, 4vw, 36px); }
.news-meta { color: var(--muted); font-size: 13px; letter-spacing: 0.04em; }
.news-title { margin-top: 10px; font-family: var(--display); font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; overflow-wrap: anywhere; }
.rich-text { margin-top: 22px; max-width: 64ch; font-size: 16.5px; line-height: 1.7; overflow-wrap: anywhere; }
.rich-text > * + * { margin-top: 14px; }
.rich-text ul { padding-left: 1.3em; list-style: disc; }
.rich-text li + li { margin-top: 6px; }
.rich-text strong { font-weight: 700; }
/* the news editor's small toolbar */
.rich-editor { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); overflow: hidden; }
.rich-editor:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--faint); }
.rich-tools { display: flex; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); }
.rich-tools button { min-width: 34px; min-height: 32px; padding: 0 10px; color: var(--ink); background: none; border: 1px solid transparent; border-radius: 8px; font-size: 14px; cursor: pointer; }
.rich-tools button:hover { background: var(--faint); }
.rich-size select { min-height: 32px; padding: 0 26px 0 10px; color: var(--ink); background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23121016' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 9px center; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; appearance: none; -webkit-appearance: none; cursor: pointer; }
.rich-size select:hover { background-color: var(--faint); }
/* line sizes in posts: "# " large, "## " medium, "-# " small */
.rich-text .rt-lg, .np-body .rt-lg { font-family: var(--display); font-size: 1.55em; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.rich-text .rt-md, .np-body .rt-md { font-family: var(--display); font-size: 1.22em; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
.rich-text .rt-sm, .np-body .rt-sm { color: var(--muted); font-size: 0.8em; line-height: 1.5; }
.np-body .rt-lg, .np-body .rt-md { margin-top: 1.4em; }
.rich-editor textarea { display: block; width: 100%; min-height: 180px; padding: 12px 14px; background: none !important; border: 0 !important; border-radius: 0; box-shadow: none !important; resize: vertical; font-size: 16px; line-height: 1.6; }
.rich-preview { padding: 16px 18px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 12px; }
.rich-preview[hidden] { display: none; }
.rich-preview-label { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.rich-preview .rich-text { margin-top: 0; font-size: 15px; }
.rich-hint { margin-top: -6px; color: var(--muted); font-size: 12.5px; }
.cropper { display: flex; flex-direction: column; gap: 10px; }
.cropper[hidden] { display: none; }
.crop-ratios { display: flex; flex-wrap: wrap; gap: 6px; }
.crop-ratios button { min-height: 32px; padding: 0 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.crop-ratios button[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.crop-frame { position: relative; align-self: center; overflow: hidden; background: var(--faint); border-radius: 14px; cursor: grab; touch-action: none; user-select: none; }
.crop-frame:active { cursor: grabbing; }
.crop-frame img { position: absolute; left: 0; top: 0; max-width: none; pointer-events: none; }
.crop-zoom { flex-direction: row !important; align-items: center; gap: 12px !important; }
.crop-zoom input { flex: 1; accent-color: var(--ink); }
.crop-hint { margin-top: -4px; color: var(--muted); font-size: 12.5px; }
.news-admin-item { flex-direction: row; align-items: center; gap: 12px; }
.news-thumb { width: 56px; height: 56px; flex: 0 0 auto; object-fit: cover; border-radius: 10px; }
.news-admin-text { min-width: 0; flex: 1; }
.news-admin-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-add { display: flex; gap: 8px; }
.admin-add input { flex: 1; min-width: 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; font-size: 16px; }
.admin-add input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--faint); }
.admin-row { flex-direction: row; align-items: center; gap: 10px; }
.admin-email { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.admin-row .inbox-status { margin-left: 0; }
.toast { position: fixed; z-index: 100; bottom: 24px; left: 50%; max-width: min(460px, calc(100% - 24px)); padding: 12px 20px; color: var(--bg); background: var(--ink); border-radius: 999px; font-size: 13.5px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity 0.3s ease, transform 0.3s var(--ease); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .principles { grid-template-columns: 1fr 1fr; }
  .fan-layout { grid-template-columns: 1fr; }
  .fan-card { position: static; }
  .contact-split { grid-template-columns: 1fr; }
  .contact-intro { position: static; }
}
/* narrow: the corner details step down below the nav so nothing collides */
@media (max-width: 820px) {
  .stage .corner-tl, .stage .corner-tr { top: 72px; }
  .stage .corner-tr { gap: 14px; }
    .page-corners { top: 72px; }
  .page-head { padding-top: clamp(130px, 34vw, 150px); }
  .nav-user-name { display: none; }
  .nav-auth .nav-user { padding: 0 3px; }
  .steps { grid-template-columns: 1fr; }
  .step, .step + .step { padding: 24px 0; border-left: 0; }
  .step + .step { border-top: 1px solid var(--line); }
  .split { grid-template-columns: 1fr; align-items: start; }
  .team-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .page-head { --fit-col: calc(100vw - 32px); }
  .corner-tl .corner-lines { display: none; }
  .principles { grid-template-columns: 1fr; }
  .fan-grid { grid-template-columns: 1fr; }
  .fan-tile-wide { grid-column: auto; }
  .fan-tile-wide img { aspect-ratio: 4 / 3; }
  .floor-card { padding: 56px 18px 100px; border-radius: 24px; }
  body.searching .market-tools .btn { display: none; }
  .dialog-form { padding: 22px; }
  .footer-row { flex-direction: column; }
}
@media (max-width: 400px) {
  .nav-pill > a { padding: 0 10px; font-size: 12px; }
  .lang-switch button { min-width: 28px; padding: 0 5px; }
  .corner-br .muted { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .stage:not(.is-ready) .ch { opacity: 1; }
  .reveal { opacity: 1; translate: none; }
  .band { transform: none; }
}

/* ---------- page transitions ---------- */
@view-transition { navigation: auto; }
.site-nav { view-transition-name: site-nav; }
/* a plain cross-fade: scaling or blurring the page snapshot makes the text shimmer as it settles */
::view-transition-old(root) { animation: page-out 0.18s ease-out both; }
::view-transition-new(root) { animation: page-in 0.26s ease-out both; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; } }
@supports not selector(::view-transition) {
  body { animation: page-in 0.26s ease-out both; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- language switch: a small frosted pill in the bottom-right corner ---------- */
.lang-float { position: fixed; z-index: 35; right: var(--edge); bottom: calc(clamp(18px, 4.5vh, 42px) + 26px); padding: 4px; background: rgba(251, 252, 250, 0.75); border: 1px solid rgba(18, 16, 22, 0.15); border-radius: 999px; box-shadow: 0 8px 24px -12px rgba(18, 16, 22, 0.28); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); view-transition-name: lang-float; }
body.has-overlay .lang-float { display: none; }
/* the floating buttons (language, chat, account) rise above the footer instead of covering it;
   --lift is how far the footer has come into view (script.js) */
.chat-fab, .acct-fab, .acct-pop { translate: 0 calc(-1 * var(--lift, 0px)); }
@media (max-width: 640px) {
  /* narrow phones: the credit steps up above the language pill instead of sitting beside it */
  .site-footer { padding-bottom: 76px; }
}
.site-footer { padding-bottom: 80px; }

/* principles and steps: number, title and text sit on shared rows across the columns, so a
   title that wraps to two lines doesn't push its own text lower than its neighbours' */
.principle, .step { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.principle h3, .step h3 { align-items: flex-start; align-self: start; }
.principle h3::before, .step h3::before { margin-top: calc(0.62em - 5px); }
.principle p, .step p { align-self: start; }
.step { gap: 0; }
.step h3 { margin-top: 24px; }
.step p { margin-top: 12px; }

/* ---------- Apple-style type and pills ----------
   San Francisco on Apple devices (the system font, so nothing to download), Inter elsewhere,
   which is drawn along the same lines. Pills are solid and soft, without outlines: black for
   the main action, a light grey for the rest, and frosted glass for the floating bars. */
:root {
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Inter Fallback", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Inter Fallback", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --pill: #e8e8ed;
  --pill-hover: #dcdce1;
  --glass: rgba(250, 250, 252, 0.72);
  --hairline: rgba(0, 0, 0, 0.08);
}
html[lang="vi"] { --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Inter Fallback", "Segoe UI", "Helvetica Neue", Arial, sans-serif; }
body { letter-spacing: -0.011em; }
.section-title, .page-title, .news-title, .fan-title, .dialog-form h3 { font-weight: 700; letter-spacing: -0.028em; }
.prose p:first-child { font-weight: 600; letter-spacing: -0.02em; }
.step-num, .principle-num { font-family: var(--display); font-weight: 700; letter-spacing: -0.04em; }

/* buttons */
.btn { min-height: 44px; padding: 0 22px; color: var(--ink); background: var(--pill); border: 0; font-size: 15px; font-weight: 400; letter-spacing: -0.016em; transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease; }
.btn:hover { color: var(--ink); background: var(--pill-hover); }
.btn:active { transform: scale(0.98); }
.btn-sm { min-height: 32px; padding: 0 14px; font-size: 13px; }
.btn-primary, .btn-accent { color: #fff; background: #1d1d1f; }
.btn-primary:hover, .btn-accent:hover { color: #fff; background: #3a3a3c; }
.btn-ghost { background: var(--pill); }
.btn-ghost:hover { background: var(--pill-hover); }
.hero-cta { padding: 12px 24px; color: #fff; background: #1d1d1f; font-size: 15px; font-weight: 400; letter-spacing: -0.016em; box-shadow: none; }
.hero-cta:hover { background: #3a3a3c; box-shadow: none; }

/* chips */
.chip { min-height: 40px; color: var(--ink); background: var(--pill); border-color: transparent; font-weight: 400; }
.chip em { background: rgba(255, 255, 255, 0.75); font-weight: 500; }
.chip:hover { color: var(--ink); background: var(--pill-hover); border-color: transparent; }
.chip:hover em { color: var(--ink); background: #fff; }
.chip-more, .chip-more:hover { color: #fff; background: #1d1d1f; border-color: transparent; }
.chip-more:hover { background: #3a3a3c; }

/* frosted bars and small pills */
.nav-pill, .lang-float { background: var(--glass); border: 0.5px solid var(--hairline); box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.18); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.nav-pill > a { min-height: 30px; color: rgba(0, 0, 0, 0.72); font-size: 12px; font-weight: 400; letter-spacing: -0.01em; }
.nav-pill > a:hover { color: var(--ink); background: rgba(0, 0, 0, 0.05); }
.nav-pill > a[aria-current="page"] { color: #fff; background: #1d1d1f; }
.lang-switch button[aria-pressed="true"] { color: #fff; background: #1d1d1f; }
.pill-link { background: var(--glass); border: 0.5px solid var(--hairline); font-size: 11px; font-weight: 400; backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.pill-link:hover { background: #fff; }
.admin-tabs { background: var(--pill); border: 0; }
.admin-tabs button { font-weight: 500; }
.crop-ratios button { background: var(--pill); border: 0; font-weight: 400; }

/* join page head: the two first steps, and a glass index of what's further down */
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.page-index { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); /* one column per link, however many there are */ margin-top: clamp(56px, 11vh, 120px); padding: 6px 0; background: var(--glass); border: 0.5px solid var(--pill-edge); border-radius: 22px; box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.25); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); }
.page-index a { position: relative; display: grid; grid-template-columns: 1fr auto; align-content: start; row-gap: 10px; padding: 14px 20px; color: var(--ink); text-decoration: none; }
.page-index a + a { border-left: 0.5px solid rgba(0, 0, 0, 0.14); }
.page-index span { grid-column: 1; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.page-index b { grid-column: 1; font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -0.022em; line-height: 1.25; text-wrap: balance; }
.page-index i { grid-column: 2; grid-row: 1; color: var(--muted); font-size: 14px; font-style: normal; transition: transform 0.25s var(--ease), color 0.2s ease; }
.page-index a:hover i { color: var(--ink); transform: translateY(3px); }
.page-index a:hover b { text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 4px; }
@media (max-width: 900px) {
  .page-index { grid-auto-flow: row; grid-template-columns: 1fr; padding: 0 18px; }
  .page-index a, .page-index a + a { grid-template-columns: 34px 1fr auto; align-items: baseline; padding: 14px 0; border-left: 0; }
  .page-index a + a { border-top: 0.5px solid rgba(0, 0, 0, 0.14); }
  .page-index span, .page-index b { grid-column: auto; grid-row: 1; }
  .page-index i { grid-column: 3; }
}

/* light pills sit close to the page colour, so each gets a hairline black edge */
:root { --pill-edge: rgba(0, 0, 0, 0.28); }
.btn, .btn-ghost, .chip, .admin-tabs, .crop-ratios button { border: 0.5px solid var(--pill-edge); }
.btn:hover, .btn-ghost:hover, .chip:hover { border-color: rgba(0, 0, 0, 0.4); }
.nav-pill, .lang-float, .pill-link { border: 0.5px solid var(--pill-edge); }
.btn-primary, .btn-accent, .btn-primary:hover, .btn-accent:hover, .chip-more, .chip-more:hover { border-color: #1d1d1f; }
.crop-ratios button[aria-pressed="true"] { border-color: var(--ink); }
/* the light pills stay white, as they were; the hairline edge and a faint grey on hover do the rest */
:root { --pill: #fff; --pill-hover: #f2f2f5; }
.chip em { background: var(--faint); }

/* ---------- pointer: a dot that opens into a ring over anything you can press (cursor.js) ----------
   Moved with a plain transform on every mouse move (no easing, no blending), so it stays under
   the hand; only the dot-to-ring change is animated. */
@media (hover: hover) and (pointer: fine) {
  html.has-cursor:not(.is-modal-open), html.has-cursor:not(.is-modal-open) * { cursor: none !important; }
  html.has-cursor:not(.is-modal-open) :is(input:not([type="checkbox"], [type="radio"], [type="file"]), textarea, [contenteditable]) { cursor: text !important; }
}
#cursor { position: fixed; z-index: 2147483000; left: 0; top: 0; width: 8px; height: 8px; margin: -4px 0 0 -4px; box-sizing: border-box; border-radius: 50%; background: var(--cursor-dot); border: 1px solid transparent; box-shadow: 0 0 0 1px var(--cursor-dot-halo); pointer-events: none; opacity: 0; will-change: transform; transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1), height 0.35s cubic-bezier(0.22, 1, 0.36, 1), margin 0.35s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s, border-color 0.25s, box-shadow 0.25s, opacity 0.25s; }
#cursor.on { opacity: 1; }
#cursor.ring { width: 46px; height: 46px; margin: -23px 0 0 -23px; background: transparent; border-color: var(--cursor-ring); box-shadow: 0 0 0 1px var(--cursor-ring-halo), inset 0 0 0 1px var(--cursor-ring-halo); }
html.is-modal-open #cursor { opacity: 0; }
@media (hover: none), (pointer: coarse) { #cursor { display: none; } }

/* join index: the item under the pointer grows and its neighbours step aside. Transforms only,
   so it runs on the compositor and never re-lays out the row. */
@media (hover: hover) and (pointer: fine) and (min-width: 901px) {
  .page-index a { border-radius: 18px; will-change: transform; transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease, box-shadow 0.3s ease; }
  .page-index a:hover { z-index: 1; background: #fff; box-shadow: 0 22px 44px -20px rgba(0, 0, 0, 0.38); transform: scale(1.14); }
  .page-index a:has(~ a:hover) { transform: translateX(-5.6%) scale(0.96); }
  .page-index a:hover ~ a { transform: translateX(5.6%) scale(0.96); }
  .page-index a:hover b { text-decoration: none; }
  .page-index a:hover, .page-index a:hover + a { border-left-color: transparent; }
}


/* ---------- contact: laid out like a store's buy page ----------
   A headline, a still picture on the left that stays put, and on the right one question at a
   time ("Topic. What would you like to write about?") answered with tiles and plain fields. */
.buy-head { padding-top: clamp(92px, 7vw, 104px); }
.buy-title { max-width: 18ch; margin-top: 18px; font-family: var(--display); font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance; }
.buy-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: start; margin-top: clamp(36px, 5vw, 56px); padding-bottom: clamp(80px, 10vw, 140px); }

.buy-visual { position: sticky; top: 90px; }
.buy-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: min(72vh, 640px); padding: clamp(24px, 3.4vw, 40px); background: var(--bg); border: 0.5px solid var(--pill-edge); border-radius: 28px; }
.buy-panel .band { top: auto; bottom: 0; height: 62%; }
.buy-panel .floor { position: absolute; left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: 62%; }
.buy-panel-top, .buy-facts { position: relative; z-index: 1; }
.buy-panel-mark { font-family: "Syne", var(--display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.buy-panel-lead { max-width: 34ch; margin-top: 14px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.buy-facts { display: grid; gap: 2px; margin: 0; padding: 6px; list-style: none; background: var(--glass); border: 0.5px solid var(--pill-edge); border-radius: 20px; backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.buy-facts li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.35; }
.buy-facts li + li { border-top: 0.5px solid rgba(0, 0, 0, 0.1); }
.buy-fact-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; background: #fff; border-radius: 50%; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14); }
.buy-fact-icon svg, .buy-done-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.buy-form { display: flex; flex-direction: column; }
.buy-step { min-width: 0; margin: 0; padding: 0; border: 0; }
.buy-step + .buy-step { margin-top: 48px; }
.buy-q { display: block; margin-bottom: 18px; padding: 0; color: var(--muted); font-family: var(--display); font-size: clamp(1.3rem, 2vw, 1.6rem); font-weight: 600; letter-spacing: -0.022em; line-height: 1.2; }
.buy-q b { color: var(--ink); font-weight: 600; }

.buy-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.buy-option { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 108px; padding: 18px 20px; background: #fff; border: 1px solid #b6b6bb; border-radius: 14px; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.buy-option:hover { border-color: #6e6e73; }
.buy-option input { position: absolute; opacity: 0; pointer-events: none; }
.buy-option-title { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.buy-option-text { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.buy-option:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.buy-option:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.buy-step[aria-invalid="true"] .buy-option { border-color: var(--danger); }

.buy-fields { display: grid; gap: 12px; }
.float-field { position: relative; }
.float-field input, .float-field textarea { display: block; width: 100%; min-height: 58px; padding: 26px 16px 8px; color: var(--ink); background: #fff; border: 1px solid #b6b6bb; border-radius: 14px; font: inherit; font-size: 17px; letter-spacing: -0.02em; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.float-field textarea { min-height: 190px; padding-top: 30px; resize: vertical; line-height: 1.5; }
.float-field label { position: absolute; left: 17px; top: 18px; color: #6e6e73; font-size: 17px; letter-spacing: -0.02em; pointer-events: none; transform-origin: 0 0; transition: transform 0.2s ease, color 0.2s ease; white-space: nowrap; max-width: calc(100% - 34px); overflow: hidden; text-overflow: ellipsis; }
.float-field :is(input, textarea):is(:focus, :not(:placeholder-shown)) + label { transform: translateY(-10px) scale(0.72); }
.float-field :is(input, textarea):hover { border-color: #6e6e73; }
.float-field :is(input, textarea):focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.float-field [aria-invalid="true"] { border-color: var(--danger); background: #fff8f7; }
.buy-under { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.buy-count { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.buy-step .field-error { margin-top: 8px; }
.buy-under .field-error { margin-top: 0; }

.buy-summary { display: grid; gap: 16px; margin-top: 48px; padding: 24px; background: #f5f5f7; border-radius: 20px; }
.buy-summary > p:first-child { color: var(--muted); font-size: 15px; }
.buy-summary b { color: var(--ink); font-weight: 600; }
.buy-summary .form-error:empty { display: none; }
.buy-send { width: 100%; min-height: 52px; font-size: 17px; }

.buy-done { align-items: flex-start; padding: 8px 0 0; }
.buy-done .buy-title { margin-top: 0; }
.buy-done p { color: var(--muted); font-size: 17px; }
.buy-done-icon { display: grid; place-items: center; width: 52px; height: 52px; background: #f5f5f7; border-radius: 50%; }
.buy-done-icon svg { width: 26px; height: 26px; stroke-width: 2; }

@media (max-width: 900px) {
  .buy-grid { grid-template-columns: 1fr; }
  .buy-visual { position: static; }
  .buy-panel { min-height: 380px; }
}
@media (max-width: 820px) { .buy-head { padding-top: clamp(130px, 34vw, 150px); } }
@media (max-width: 640px) {
  .buy-options { grid-template-columns: 1fr; }
  .buy-option { min-height: 0; }
}

/* ---------- chat panel (chat.js) ----------
   A frosted card at the bottom right, beside the page rather than over it; full screen on phones.
   Bubbles follow the familiar messaging look: yours black on the right, theirs light grey. */
.market-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.chat { position: fixed; z-index: 60; right: 16px; bottom: 16px; display: flex; flex-direction: column; width: min(400px, calc(100vw - 32px)); height: min(660px, calc(100svh - 96px)); overflow: hidden; background: rgba(251, 251, 253, 0.9); border: 0.5px solid var(--pill-edge); border-radius: 26px; box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.35), 0 6px 18px -8px rgba(0, 0, 0, 0.18); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); opacity: 0; transform: translateY(16px) scale(0.98); transform-origin: 100% 100%; transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.chat.is-open { opacity: 1; transform: none; }
.chat[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 8px 20px; }
.chat-title { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.025em; }
.chat-icon-btn { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; padding: 0; color: var(--ink); background: rgba(0, 0, 0, 0.05); border: 0; border-radius: 50%; }
.chat-icon-btn:hover { background: rgba(0, 0, 0, 0.09); }
.chat-icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 4px 16px 10px; padding: 3px; background: rgba(118, 118, 128, 0.12); border-radius: 11px; }
.chat-tab { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 0 10px; color: var(--ink); background: none; border: 0; border-radius: 8px; font-size: 13.5px; font-weight: 500; letter-spacing: -0.01em; }
.chat-tab[aria-selected="true"] { background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); font-weight: 600; }
.chat-dot { width: 7px; height: 7px; background: #ff3b30; border-radius: 50%; }
.chat-dot[hidden] { display: none; }
.chat-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 0.5px solid rgba(0, 0, 0, 0.1); }

.chat-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px 12px; }
.chat-list-label { padding: 10px 12px 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.chat-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; color: var(--ink); text-align: left; background: none; border: 0; border-radius: 14px; }
.chat-row:hover { background: rgba(0, 0, 0, 0.045); }
.chat-row .avatar { width: 42px; height: 42px; }
.chat-row-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chat-row-top strong { overflow: hidden; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; text-overflow: ellipsis; white-space: nowrap; }
.chat-row-top time { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.chat-row-last { overflow: hidden; color: var(--muted); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.is-unread .chat-row-last { color: var(--ink); font-weight: 500; }
.chat-count { min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; color: #fff; background: #ff3b30; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.chat-empty { padding: 36px 24px; color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; }

.chat-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 0.5px solid rgba(0, 0, 0, 0.08); }
.chat-thread-head .avatar { width: 36px; height: 36px; }
.chat-thread-name { min-width: 0; display: grid; }
.chat-thread-name strong { overflow: hidden; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread-name span { color: var(--muted); font-size: 12px; }
.chat-stack { display: flex; flex: 0 0 auto; }
.chat-stack .avatar { width: 30px; height: 30px; box-shadow: 0 0 0 2px #fbfbfd; }
.chat-stack .avatar + .avatar { margin-left: -10px; }

.chat-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 16px; }
.chat-intro { margin: 6px auto 12px; max-width: 30ch; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
.chat-time { margin: 12px 0 6px; color: var(--muted); font-size: 11.5px; font-weight: 500; text-align: center; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.chat-msg.is-first { margin-top: 8px; }
.chat-msg.is-mine { align-self: flex-end; }
.chat-msg .avatar, .chat-msg .avatar-gap { width: 28px; height: 28px; flex: 0 0 auto; }
.chat-msg .avatar { order: -1; align-self: flex-start; margin-top: 18px; }
.chat-msg:not(.is-first) .avatar { visibility: hidden; }
.chat-msg.is-first:not(:has(.chat-sender)) .avatar { margin-top: 0; }
.chat-bubble-wrap { min-width: 0; display: grid; gap: 3px; }
.chat-sender { padding-left: 12px; color: var(--muted); font-size: 11.5px; }
.chat-bubble { padding: 8px 13px; color: var(--ink); background: #e9e9eb; border-radius: 18px; font-size: 15px; line-height: 1.38; letter-spacing: -0.012em; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.is-mine .chat-bubble { color: #fff; background: #1d1d1f; }
.chat-msg.is-mine .avatar, .chat-msg.is-mine .avatar-gap { order: 1; }
.chat-msg.is-mine .chat-sender { padding: 0 12px 0 0; text-align: right; }
.chat-msg.is-team .chat-bubble { background: #48484a; }

.chat-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 0.5px solid rgba(0, 0, 0, 0.08); }
.chat-input { flex: 1; min-height: 38px; max-height: 120px; padding: 8px 14px; color: var(--ink); background: #fff; border: 0.5px solid rgba(0, 0, 0, 0.22); border-radius: 19px; font: inherit; font-size: 15px; line-height: 1.4; resize: none; }
.chat-input:focus { outline: none; border-color: rgba(0, 0, 0, 0.45); }
.chat-send { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 2px; padding: 0; color: #fff; background: #1d1d1f; border: 0; border-radius: 50%; transition: opacity 0.2s ease, transform 0.15s ease; }
.chat-send:disabled { opacity: 0.25; }
.chat-send:not(:disabled):active { transform: scale(0.92); }
.chat-send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 640px) {
  .chat { inset: 0; width: auto; height: auto; border: 0; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); background: rgba(251, 251, 253, 0.97); }
  .chat-input { font-size: 16px; }
}
@media (max-width: 640px) { html.is-chat-open, html.is-chat-open body { overflow: hidden; } }

/* Keep labels readable on phones; the rail scrolls on the narrowest screens. */
@media (max-width: 640px) {
  .nav-pill { justify-content: flex-start; gap: 2px; }
  .nav-pill > a { min-height: 30px; gap: 5px; padding: 0 8px; font-size: 11.5px; }
  .nav-pill > a:not([aria-current="page"]) .diamond-o { display: none; }
}
@media (max-width: 380px) { .nav-pill > a { padding: 0 6px; font-size: 11px; letter-spacing: -0.01em; } }

/* ---------- news page (news.js): a newspaper front page ----------
   A dateline and masthead between rules, the resources as a strip of links under it, then the
   lead story beside a column of the next few, and a ruled grid of the rest. Type is the same
   system face as the rest of the site (San Francisco on Apple devices).
   Nothing moves: links underline on hover and that is all. */
.page-news { --serif: var(--display); --np-red: #b3261e; }
.np-list[hidden], .np-article[hidden], .np-hero[hidden], .np-standfirst[hidden] { display: none; }
.np-top { padding-top: clamp(92px, 7vw, 104px); }
.np-dateline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 0; color: var(--muted); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.np-dateline time::first-letter { text-transform: uppercase; }
.np-masthead { margin: clamp(18px, 3vw, 30px) 0 clamp(16px, 2.4vw, 26px); font-family: var(--serif); font-size: clamp(2.6rem, 7.4vw, 6rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1; text-align: center; }
.np-strip { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 6px 28px; padding: 12px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); font-size: 14.5px; }
.np-strip-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.np-strip a { color: var(--ink); text-decoration: none; }
.np-strip a:hover { text-decoration: underline; text-underline-offset: 3px; }

.np-list a { color: var(--ink); text-decoration: none; }
.np-list a:hover :is(h3, h4) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.np-front { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); min-height: 70svh; margin-top: 32px; padding-bottom: 40px; border-bottom: 1px solid var(--ink); }
.np-list.is-ready .np-front { min-height: 0; }
.np-list[data-count="0"] .np-front { display: none; }
.np-list[data-count="0"] .np-empty { display: block !important; }
.np-lead { padding-right: 32px; border-right: 1px solid var(--line); }
.np-lead-link { display: block; }
.np-lead-pic, .np-rail-pic, .np-grid-pic { overflow: hidden; background: #ececec; }
.np-lead-pic { aspect-ratio: 16 / 9; }
.np-rail-pic { aspect-ratio: 16 / 9; margin-bottom: 12px; }
.np-grid-pic { aspect-ratio: 3 / 2; margin-bottom: 12px; }
.np-lead-pic img, .np-rail-pic img, .np-grid-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.np-kicker { margin-top: 18px; color: var(--np-red); font-size: 12.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.np-lead-title { margin-top: 8px; font-family: var(--serif); font-size: clamp(2rem, 3.6vw, 3.2rem); font-weight: 600; letter-spacing: -0.015em; line-height: 1.08; text-wrap: balance; }
.np-lead-standfirst { margin-top: 12px; color: #3a3a3a; font-family: var(--serif); font-size: 20px; line-height: 1.45; }
.np-meta { margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.np-rail { padding-left: 32px; }
.np-rail[hidden] { display: none; }
.np-rail-title { padding-bottom: 10px; border-bottom: 2px solid var(--ink); font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.np-rail-item { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); }
.np-rail-item:last-child { border-bottom: 0; }
.np-rail-head { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; text-wrap: balance; }
.np-rail-text, .np-grid-text { display: -webkit-box; overflow: hidden; margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.5; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.np-empty { padding: 64px 0; color: var(--muted); font-family: var(--serif); font-size: 20px; text-align: center; }
.np-more { padding-top: 36px; padding-bottom: clamp(72px, 9vw, 112px); }
.np-more[hidden] { display: none; }
.np-more .np-rail-title, .np-related .np-rail-title { margin-bottom: 24px; }
.np-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 36px; }
.np-grid-item { display: block; padding: 0 20px; border-left: 1px solid var(--line); }
.np-grid-item:nth-child(4n + 1) { padding-left: 0; border-left: 0; }
.np-grid-item:nth-child(4n) { padding-right: 0; }
.np-grid-head { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.22; text-wrap: balance; }
.np-more-row { display: flex; justify-content: center; margin-top: 40px; }
.np-more-row .btn[hidden] { display: none; }

/* one story */
.np-article { padding-top: clamp(92px, 7vw, 104px); }
.np-article-wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.np-back { color: var(--muted); font-size: 14px; text-decoration: none; }
.np-back:hover { color: var(--ink); }
.np-article .np-kicker { margin-top: 28px; }
.np-article-title { margin-top: 10px; font-family: var(--serif); font-size: clamp(2.4rem, 5.4vw, 4.2rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.04; text-wrap: balance; overflow-wrap: anywhere; }
.np-standfirst { margin-top: 18px; color: #3a3a3a; font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.4; }
.np-byline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 24px; padding: 12px 0; color: var(--muted); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.np-copy { padding: 0; color: var(--ink); background: none; border: 0; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.np-hero { max-width: 1000px; margin: 32px auto 0; padding: 0 24px; }
.np-hero img { display: block; width: 100%; max-height: 70vh; object-fit: cover; background: #ececec; }
.np-body { margin-top: 32px; color: #1d1d1f; font-family: var(--serif); font-size: 20px; line-height: 1.62; overflow-wrap: anywhere; }
.np-body > * + * { margin-top: 1em; }
.np-body.has-dropcap > p:first-child::first-letter { float: left; padding: 0.07em 0.08em 0 0; font-size: 4.2em; font-weight: 600; line-height: 0.8; }
.np-body ul { padding-left: 1.3em; list-style: disc; }
.np-body li + li { margin-top: 0.4em; }
.np-body strong { font-weight: 650; }
.np-end { margin-top: 18px; font-size: 11px; }
.np-related { margin-top: 72px; padding-bottom: clamp(72px, 9vw, 112px); }
.np-related[hidden] { display: none; }

html[data-nr-nav]::view-transition-old(root) { animation: page-out 0.16s ease-out both; }
html[data-nr-nav]::view-transition-new(root) { animation: page-in 0.22s ease-out both; }

@media (max-width: 900px) {
  .np-front { grid-template-columns: 1fr; }
  .np-lead { padding-right: 0; border-right: 0; }
  .np-rail { margin-top: 36px; padding-left: 0; }
  .np-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .np-grid-item, .np-grid-item:nth-child(4n + 1), .np-grid-item:nth-child(4n) { padding: 0 0 0 20px; border-left: 1px solid var(--line); }
  .np-grid-item:nth-child(2n + 1) { padding: 0 20px 0 0; border-left: 0; }
}
@media (max-width: 820px) { .np-top, .np-article { padding-top: clamp(130px, 34vw, 150px); } }
@media (max-width: 600px) {
  .np-strip { justify-content: flex-start; gap: 6px 18px; }
  .np-grid { grid-template-columns: 1fr; row-gap: 0; }
  .np-grid-item, .np-grid-item:nth-child(n) { padding: 20px 0; border-left: 0; border-top: 1px solid var(--line); }
  .np-lead-standfirst { font-size: 18px; }
  .np-body { font-size: 18.5px; }
}

/* softer, the Apple way: rounded photos, hairline rules, the resources as quiet pills */
.page-news { --np-rule: rgba(0, 0, 0, 0.12); --np-red: #c2412d; }
.np-dateline { border-top-color: var(--np-rule); border-bottom-color: var(--np-rule); }
.np-strip { gap: 8px; padding: 14px 0 0; border: 0; }
.np-strip-label { margin-right: 6px; color: var(--muted); }
.np-strip a { padding: 8px 16px; background: #fff; border: 0.5px solid var(--pill-edge); border-radius: 999px; font-size: 14px; transition: background-color 0.2s ease; }
.np-strip a:hover { background: #f2f2f5; text-decoration: none; }
.np-front { margin-top: 36px; border-bottom-color: var(--np-rule); }
.np-lead { border-right-color: var(--np-rule); }
.np-lead-pic { border-radius: 22px; }
.np-rail-pic, .np-grid-pic { border-radius: 16px; }
.np-rail-title { border-bottom: 0.5px solid var(--np-rule); color: var(--muted); font-weight: 600; }
.np-rail-item { border-bottom-color: var(--np-rule); }
.np-grid-item { border-left-color: var(--np-rule); }
.np-hero img { border-radius: 24px; }
.np-byline { border-top-color: var(--np-rule); border-bottom-color: var(--np-rule); }
.np-back { display: inline-flex; gap: 6px; padding: 7px 14px; background: #f2f2f5; border-radius: 999px; color: var(--ink); }
.np-back:hover { background: #e8e8ed; }
@media (max-width: 600px) { .np-grid-item, .np-grid-item:nth-child(n) { border-top-color: var(--np-rule); } .np-strip { justify-content: flex-start; } }

/* headlines in the Apple face: heavier and set closer than the serif was */
.np-masthead { font-weight: 700; letter-spacing: -0.035em; }
.np-lead-title, .np-article-title { font-weight: 700; letter-spacing: -0.03em; }
.np-rail-head, .np-grid-head { font-weight: 600; letter-spacing: -0.02em; }
.np-lead-standfirst, .np-standfirst { letter-spacing: -0.015em; }
.np-body { font-size: 19px; line-height: 1.6; letter-spacing: -0.012em; }
@media (max-width: 600px) { .np-body { font-size: 17.5px; } }
/* the date is written in by the script: hold its line so nothing below moves when it appears */
.np-dateline time:empty::before { content: "\00a0"; }
@media (max-width: 600px) { .np-dateline { flex-direction: column; } }

/* ---------- the account bar (signed in): one frosted pill like the main nav ----------
   Admin · Messages · Inbox · you, the same on Join and on the other pages (auth.js). */
.nav-auth.is-signed { gap: 2px; margin-left: 0; padding: 4px; background: var(--glass); border: 0.5px solid var(--pill-edge); border-radius: 999px; box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.18); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); flex-wrap: nowrap; }
.nav-auth.is-signed .btn { min-height: 30px; gap: 6px; padding: 0 12px; color: var(--ink); background: transparent; border: 0; border-radius: 999px; font-size: 12.5px; font-weight: 500; text-decoration: none; }
.nav-auth.is-signed .btn:hover { background: rgba(0, 0, 0, 0.05); }
.nav-auth.is-signed .badge { min-width: 17px; height: 17px; padding: 0 5px; color: #fff; background: #ff3b30; font-size: 10px; }
.nav-auth.is-signed .nav-user { margin-left: 4px; padding: 0 12px 0 3px; background: #fff; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.nav-auth.is-signed .nav-user:hover { background: #f5f5f7; }
.nav-auth.is-signed .avatar { width: 24px; height: 24px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.18); }
.nav-auth.is-signed .nav-user-name { max-width: 110px; font-weight: 600; }
@media (max-width: 820px) {
  .nav-auth.is-signed .btn { padding: 0 9px; font-size: 12px; }
  .nav-auth.is-signed .nav-user { padding: 0 3px; }
}

/* ---------- the chat button in the corner, above the language switch ---------- */
.chat-fab { position: fixed; z-index: 36; right: var(--edge); bottom: calc(clamp(18px, 4.5vh, 42px) + 26px + 48px); display: grid; place-items: center; width: 52px; height: 52px; padding: 0; color: #fff; background: #1d1d1f; border: 0; border-radius: 50%; appearance: none; -webkit-appearance: none; box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.45); transition: transform 0.2s ease, opacity 0.2s ease; }
.chat-fab[hidden] { display: none; }
.chat-fab:hover { transform: scale(1.05); }
.chat-fab:active { transform: scale(0.96); }
.chat-fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.chat-fab.is-hidden-by-panel { opacity: 0; pointer-events: none; }
.chat-fab-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 6px; color: #fff; background: #ff3b30; box-shadow: 0 0 0 2px var(--bg); font-size: 11px; }
.chat-fab-badge[hidden] { display: none; }

/* account bubble: a round button just above the chat button; the account bar opens from it as a menu */
.acct-fab { position: fixed; z-index: 36; right: var(--edge); bottom: calc(clamp(18px, 4.5vh, 42px) + 26px + 48px + 52px + 12px); display: grid; place-items: center; width: 52px; height: 52px; padding: 0; color: var(--ink); background: var(--glass); border: 0.5px solid var(--pill-edge); border-radius: 50%; appearance: none; -webkit-appearance: none; box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.35); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); cursor: pointer; transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease; }
.acct-fab[hidden] { display: none; }
.acct-fab:hover { transform: scale(1.05); background: #fff; }
.acct-fab:active { transform: scale(0.96); }
.acct-fab.is-open { color: #fff; background: #1d1d1f; }
.acct-fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.acct-fab-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 6px; color: #fff; background: #ff3b30; box-shadow: 0 0 0 2px var(--bg); font-size: 11px; }
.acct-fab-badge[hidden] { display: none; }
.acct-pop { position: fixed; z-index: 37; right: calc(var(--edge) + 52px + 12px); bottom: calc(clamp(18px, 4.5vh, 42px) + 26px + 48px + 52px + 12px); min-width: 220px; padding: 6px; background: rgba(251, 251, 253, 0.86); border: 0.5px solid var(--pill-edge); border-radius: 20px 20px 6px 20px; box-shadow: 0 22px 48px -18px rgba(0, 0, 0, 0.4); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); transform-origin: 100% 100%; animation: acct-pop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.acct-pop[hidden] { display: none; }
@keyframes acct-pop { from { opacity: 0; transform: scale(0.9) translateY(6px); } }
.acct-pop .nav-auth.is-signed { position: static; flex-direction: column; align-items: stretch; gap: 2px; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.acct-pop .nav-auth.is-signed .btn { justify-content: space-between; min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 14px; }
.acct-pop .nav-auth.is-signed .nav-user { order: -1; justify-content: flex-start; gap: 10px; margin: 0 0 4px; padding: 6px 14px 6px 6px; min-height: 48px; border-radius: 14px; }
.acct-pop .nav-auth.is-signed .avatar { width: 34px; height: 34px; }
.acct-pop .nav-auth.is-signed .nav-user-name { display: inline; max-width: 150px; font-size: 14px; white-space: nowrap; }
html.is-chat-open .acct-fab, html.is-chat-open .acct-pop { opacity: 0; pointer-events: none; }
/* until the bubble picks it up, the signed-in bar never shows in the corner */
.corner-tr > .nav-auth.is-signed { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .acct-pop { animation: none; } }
.chat-search-wrap { padding: 10px 14px 4px; }
.chat-search { width: 100%; min-height: 38px; padding: 0 14px 0 36px; color: var(--ink); background: rgba(118, 118, 128, 0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; border: 0; border-radius: 11px; font: inherit; font-size: 15px; }
.chat-search:focus { outline: 2px solid rgba(0, 0, 0, 0.18); outline-offset: 0; }

/* ---------- the account bar lines up with the main nav ----------
   Wide screens: fixed at the same height as the nav, at the right edge. Narrower: it drops
   below the nav (with the rest of the corner) so the two never overlap. */
.nav-auth.is-signed .btn { min-height: 28px; }
@media (min-width: 1180px) {
  .nav-auth.is-signed { position: fixed; z-index: 31; top: 12px; right: var(--edge); }
}
/* admins on the News page: a "New post" button under the resources, and "Delete" in a story's byline */
.np-admin { display: flex; justify-content: center; margin-top: 14px; }
.np-admin[hidden] { display: none; }
.np-byline-actions { display: inline-flex; gap: 16px; }
.np-delete { color: #c2412d; }
.np-delete[hidden] { display: none; }
#news-compose .news-form { margin-top: 8px; }
/* editing a post: the photo it already has, which can be kept, replaced or removed */
.np-current-photo { display: flex; align-items: center; gap: 14px; padding: 10px; background: #f5f5f7; border-radius: 14px; }
.np-current-photo[hidden] { display: none; }
.np-current-photo img { width: 120px; height: 68px; object-fit: cover; border-radius: 10px; transition: opacity 0.2s ease; }
.np-current-photo div { display: grid; gap: 6px; justify-items: start; }
.np-current-label { color: var(--muted); font-size: 13px; }
.np-current-photo.is-removed img { opacity: 0.3; }
.btn-danger { color: #c2412d; }

/* ---------- chat + account bubbles tucked into the bottom right ---------- */
:root { --fab-bottom: clamp(24px, 4.5vh, 44px); }
/* same right edge as the page margin, so the corners line up */
.chat-fab { right: var(--edge); bottom: var(--fab-bottom); }
.acct-fab { right: var(--edge); bottom: calc(var(--fab-bottom) + 52px + 12px); }
.acct-pop { right: calc(var(--edge) + 52px + 12px); bottom: calc(var(--fab-bottom) + 52px + 12px); }
/* two lines beside the brand now: centre them on it */
.corner-tl { align-items: center; }
.corner-lines { line-height: 1.45; }

/* ---------- layout refresh (same look, calmer structure) ---------- */
/* one small label per page, at the top: a short rule, then the topic */
.label span:first-child { color: inherit; }
.label span:first-child::after { content: none; }
.label::before { content: ""; align-self: center; width: 28px; height: 1px; background: var(--line-strong); }

/* "why": one stacked message, headline over the story */
.why { display: grid; gap: clamp(28px, 4vw, 48px); }
.why .section-title { max-width: 14ch; }
.why-prose { max-width: 62ch; }

/* principles: a 2 x 2 of short rules, no numbering */
.principles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 72px); }
.principle { grid-row: span 2; padding: 30px 0 36px; }
.principle h3 { margin-top: 0; font-family: var(--display); font-size: clamp(1.35rem, 2.2vw, 1.75rem); font-weight: 700; letter-spacing: -0.02em; }
.principle p { max-width: 46ch; margin-top: 12px; font-size: 1.02rem; }

/* how it works: the step text carries the order, no big numerals */
.step { grid-row: span 2; }
.step h3 { margin-top: 0; }

/* team: one lead card on the brand gradient, the other two stacked beside it */
.team-grid { grid-template-columns: 1.25fr 1fr; grid-template-rows: auto auto; }
.team-card-lead { position: relative; grid-row: span 2; justify-content: flex-end; min-height: 320px; overflow: hidden; isolation: isolate; border: 0; }
.team-card-lead::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(251, 252, 250, 0.35), rgba(251, 252, 250, 0.82)), linear-gradient(120deg, #9775fa 0%, #b69cf7 38%, #9fdcb5 72%, #5fce78 100%); }
.team-card-lead p + p { max-width: 30ch; color: var(--ink); font-family: var(--display); font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }

@media (max-width: 820px) {
  .principles, .team-grid { grid-template-columns: 1fr; }
  .team-card-lead { grid-row: auto; min-height: 240px; }
}

/* account bubble menu: who you are (or Sign in), then the language switch */
.acct-area .acct-signin { display: flex; justify-content: center; width: 100%; min-height: 42px; color: #fff; background: #1d1d1f; border: 0; border-radius: 14px; font-size: 14px; font-weight: 500; text-decoration: none; }
.acct-area .acct-signin:hover { background: #3a3a3c; }
.acct-settings { display: grid; gap: 2px; margin-top: 6px; padding-top: 4px; border-top: 0.5px solid var(--hairline); }
.acct-lang { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 3px 6px 3px 14px; color: var(--muted); font-size: 13px; }
.acct-settings-actions { display: inline-flex; align-items: center; gap: 3px; }
.acct-lang .lang-switch { padding: 3px; background: rgba(0, 0, 0, 0.05); border-radius: 999px; }
.acct-lang .lang-switch button { height: 28px; min-width: 34px; font-size: 11px; }
.acct-theme-toggle { flex-basis: 30px; width: 30px; margin: 0; color: var(--ink); }
/* the home page has no corner for the account bar: empty until it moves into the bubble */
[data-auth-slot]:empty { display: none; }
/* the join page index on phones: no number column any more, title + arrow */
@media (max-width: 820px) {
  .page-index a, .page-index a + a { grid-template-columns: 1fr auto; }
}
/* home: the corner notes sit along the bottom edge, so the bubbles start above them */
.page-home { --fab-bottom: calc(clamp(18px, 4.5vh, 42px) + 16px + 18px); }

/* ---------- dialogs: Apple-checkout style forms (same pieces as the contact page) ---------- */
.app-dialog { width: min(560px, calc(100% - 24px)); background: #fff; border: 0; border-radius: 28px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 30px 80px -24px rgba(18, 16, 22, 0.38); }
.app-dialog-wide { width: min(720px, calc(100% - 24px)); }
.app-dialog::backdrop { background: rgba(18, 16, 22, 0.32); backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%); }
.dialog-form { padding: 40px 40px 32px; }
.dialog-form h3 { font-size: 28px; letter-spacing: -0.022em; line-height: 1.15; }
.dialog-note { margin-top: 0; color: #6e6e73; font-size: 15px; line-height: 1.45; }
.buy-form.dialog-form { gap: 0; }
.buy-form.dialog-form > .dialog-note { margin-top: 8px; }
.buy-form.dialog-form > .buy-step:first-of-type, .buy-form.dialog-form > .buy-fields, .buy-form.dialog-form > .profile-photo { margin-top: 28px; }
.dialog-form .buy-step + .buy-step { margin-top: 28px; }
.dialog-form .buy-q { margin-bottom: 12px; font-size: 19px; }
.dialog-form .buy-options { gap: 10px; }
.dialog-form .buy-option { display: flex; flex-direction: column; gap: 4px; min-height: 0; padding: 16px 18px; font-size: 14px; font-weight: 400; cursor: pointer; }
.dialog-form .buy-option-title { font-size: 16px; }
.dialog-form .buy-option-text { font-size: 13px; }
.dialog-form .float-field label { display: block; color: #6e6e73; font-size: 17px; font-weight: 400; }
.app-dialog .float-field :is(input, textarea) { min-height: 56px; padding: 24px 16px 8px; color: var(--ink); background: #fff; border: 1px solid #b6b6bb; border-radius: 12px; font-size: 17px; font-weight: 400; }
.app-dialog .float-field textarea { min-height: 120px; padding-top: 28px; }
.app-dialog .float-field :is(input, textarea):hover { border-color: #6e6e73; }
.app-dialog .float-field :is(input, textarea):focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.buy-form.dialog-form > .dialog-error { margin-top: 16px; }
.buy-form.dialog-form > .dialog-error:empty { display: none; }
.dialog-actions-buy { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; margin-top: 28px; }
.btn-buy { width: 100%; min-height: 52px; border-radius: 14px; font-size: 17px; font-weight: 500; }
.btn-buy:active { transform: scale(0.99); }
.btn-text { align-self: center; padding: 10px 14px; color: #6e6e73; background: none; border: 0; border-radius: 10px; font: inherit; font-size: 15px; cursor: pointer; }
.btn-text:hover { color: var(--ink); background: rgba(0, 0, 0, 0.04); }
.btn-text-danger:hover { color: var(--danger); }
.dialog-actions-row { display: flex; justify-content: center; gap: 8px; }
/* the news editor: title field, then the toolbar + text area as one framed block */
.news-form.buy-form { gap: 14px; }
.news-body-q { margin: 10px 0 -2px; }
.rich-editor { border-radius: 12px; }
/* phones: dialogs come up from the bottom edge, like a sheet */
@media (max-width: 640px) {
  .app-dialog, .app-dialog-wide { width: 100%; max-width: 100%; max-height: 92svh; margin: auto 0 0; border-radius: 26px 26px 0 0; }
  .dialog-form { padding: 30px 22px calc(22px + env(safe-area-inset-bottom)); }
  .dialog-form h3 { font-size: 24px; }
  .dialog-form .buy-options { grid-template-columns: 1fr; }
}

/* chat for visitors who aren't signed in */
.chat-intro-guest { margin-top: -4px; color: var(--ink); font-weight: 500; }
.chat-guest-note { display: grid; justify-items: center; gap: 16px; padding: 48px 28px; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.5; }
.chat-guest-note .chat-signin { min-height: 44px; padding: 0 26px; color: #fff; background: #1d1d1f; border-radius: 999px; text-decoration: none; }

/* FAQ (about page): plain rows that open in place */
.faq { display: grid; gap: clamp(28px, 4vw, 44px); }
.faq-list { max-width: 820px; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ""; flex: 0 0 auto; width: 10px; height: 10px; margin-right: 4px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: rotate(45deg) translateY(-3px); transition: transform 0.25s var(--ease); }
.faq-item[open] summary::after { transform: rotate(225deg) translateY(-3px); }
.faq-item h3 { font-family: var(--display); font-size: clamp(1.1rem, 1.8vw, 1.3rem); font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; }
.faq-item p { max-width: 62ch; padding: 0 0 24px; color: var(--muted); font-size: 1.02rem; line-height: 1.6; }

/* contact strip above the footer line (and at the end of the privacy page) */
.footer-contact { display: grid; gap: 14px; padding: 4px 0 26px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.footer-contact-lead { color: var(--ink); font-size: 15px; font-weight: 500; letter-spacing: -0.01em; text-transform: none; }
.footer-contact-links { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-contact-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; color: var(--ink); background: var(--surface); border: 0.5px solid var(--pill-edge); border-radius: 999px; font-size: 13.5px; text-decoration: none; letter-spacing: -0.01em; transition: background 0.2s ease, border-color 0.2s ease; }
.footer-contact-links a:hover { background: #fff; border-color: var(--ink); }
.footer-contact-k { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.legal-contact { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.legal-contact .footer-contact { border-bottom: 0; margin: 0; padding: 0; }
.legal .footer-contact-links a { color: var(--ink); text-decoration: none; }

/* ---------- three ways to learn (post + sign-up dialogs) ---------- */
.dialog-form .buy-options-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.buy-option:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.buy-option-note { margin-top: auto; padding-top: 6px; color: var(--ink); font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.buy-option-note::before { content: "★ "; }
.buy-option-note[hidden] { display: none; }
[data-give-options] + .float-field { margin-top: 12px; }
.buy-step[hidden], .buy-options[hidden], .float-field[hidden] { display: none; }
@media (max-width: 640px) {
  .dialog-form .buy-options-3 { grid-template-columns: 1fr; }
}

/* ---------- full list: filter by type, and when each post went up ---------- */
.all-meta { flex-wrap: wrap; }
.mode-filter { display: inline-flex; gap: 2px; padding: 3px; margin-right: auto; background: rgba(0, 0, 0, 0.05); border-radius: 999px; }
.all-count + .mode-filter { margin-left: 4px; }
.mode-filter button { height: 30px; padding: 0 14px; background: none; border: 0; border-radius: 999px; color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; }
.mode-filter button:hover { background: rgba(0, 0, 0, 0.06); }
.mode-filter button[aria-pressed="true"] { color: #fff; background: #1d1d1f; }
.mode-filter button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.market-when { margin-top: 8px; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  .mode-filter { order: 3; width: 100%; margin-right: 0; }
  .mode-filter button { flex: 1; padding: 0 8px; }
}
.app-dialog:focus, .app-dialog:focus-visible { outline: none; }

/* ---------- footer: brand + three columns, then one thin line ---------- */
.site-footer { padding-top: 56px; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 40px 32px; padding-bottom: 40px; }
.foot-mark { display: inline-block; margin-bottom: 14px; color: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: -0.04em; text-decoration: none; }
.foot-brand p { max-width: 34ch; color: var(--muted); font-size: 14px; line-height: 1.55; }
.foot-col h2 { margin: 6px 0 16px; color: var(--ink); font-size: 13px; font-weight: 700; letter-spacing: -0.005em; }
.foot-col ul { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.foot-col li { color: var(--muted); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.foot-col a { color: var(--muted); text-decoration: none; transition: color 0.2s ease; }
.foot-col a:hover, .foot-top:hover { color: var(--ink); }
.foot-connect li a[href^="mailto"] { color: var(--ink); }
.foot-social { display: flex; gap: 10px; margin-top: 18px; }
.foot-social a { display: grid; place-items: center; width: 40px; height: 40px; color: var(--ink); background: var(--surface); border: 0.5px solid var(--pill-edge); border-radius: 999px; transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease; }
.foot-social a:hover { color: #fff; background: var(--ink); transform: translateY(-2px); }
.foot-social svg { width: 18px; height: 18px; fill: currentColor; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.foot-top { color: inherit; text-decoration: none; }
@media (max-width: 900px) {
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .site-footer { padding-top: 40px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .foot-connect { grid-column: 1 / -1; }
  .foot-bottom { flex-direction: column; gap: 8px; }
}
/* the three round buttons: black with a white icon */
.foot-social a { color: #fff; background: #1d1d1f; border-color: #1d1d1f; }
.foot-social a:hover { color: #fff; background: #000; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18); }

/* ---------- photos inside a story: [[img:…|layout|size|caption]] ---------- */
.rt-figure { margin: 1.6em auto; }
.np-body > .rt-figure { margin-top: 1.6em; margin-bottom: 1.6em; }
.rt-figure-photos { display: grid; gap: 10px; }
.rt-figure img { display: block; width: 100%; height: auto; background: #ececec; border-radius: 16px; }
.rt-figure.is-row .rt-figure-photos { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.rt-figure.is-grid .rt-figure-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rt-figure.is-row.is-multi img, .rt-figure.is-grid.is-multi img { height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.rt-figure.is-row:has(img:nth-child(3)) img { aspect-ratio: 1; }
.rt-figure.is-small { width: min(62%, 420px); }
.rt-figure.is-medium { width: 100%; }
/* "Large" spills past the text column, up to the cover photo's width */
.rt-figure.is-wide { position: relative; left: 50%; width: min(1000px - 48px, 100vw - 48px); translate: -50% 0; }
.rt-figure figcaption { margin-top: 10px; color: var(--muted); font-family: var(--sans, inherit); font-size: 13.5px; line-height: 1.45; text-align: center; }
.rich-preview .rt-figure.is-wide { left: auto; width: 100%; translate: none; }
.rich-preview .rt-figure img { border-radius: 10px; }
@media (max-width: 600px) {
  .rt-figure.is-small { width: 78%; }
  .rt-figure.is-wide { width: calc(100vw - 32px); }
  .rt-figure img { border-radius: 12px; }
  .rt-figure-photos { gap: 6px; }
}

/* the editor: a "Photo" button in the toolbar and a panel per group of photos */
.rich-photo-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; color: var(--ink); border-radius: 8px; font-size: 14px; cursor: pointer; }
.rich-photo-btn:hover { background: var(--faint); }
.rich-photo-btn:focus-within { outline: 2px solid var(--ink); outline-offset: 1px; }
.rich-photo-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.rich-photo-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.media-status { color: var(--muted); font-size: 13px; }
.media-status[hidden], .media-panel[hidden] { display: none; }
.media-panel { display: grid; gap: 12px; }
.media-blocks { display: grid; gap: 12px; }
.media-block { display: grid; gap: 14px; padding: 16px; background: #fff; border: 1px solid #d2d2d7; border-radius: 14px; }
.media-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.media-remove { color: var(--danger, #c0392b); font-size: 13px; }
.media-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.media-thumb { position: relative; width: 92px; height: 92px; overflow: hidden; background: #f0f0f2; border-radius: 10px; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb-tools { position: absolute; inset: auto 4px 4px 4px; display: flex; justify-content: space-between; gap: 2px; }
.media-thumb-tools button { width: 26px; height: 24px; padding: 0; color: #fff; background: rgba(0, 0, 0, 0.62); border: 0; border-radius: 6px; font-size: 13px; line-height: 1; cursor: pointer; }
.media-thumb-tools button:disabled { opacity: 0.3; cursor: default; }
.media-thumb-add { display: grid; place-items: center; color: var(--muted); background: none; border: 1.5px dashed #b6b6bb; font-size: 28px; font-weight: 300; cursor: pointer; }
.media-thumb-add:hover { color: var(--ink); border-color: var(--ink); }
.media-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.media-control { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.media-seg { display: flex; gap: 2px; padding: 3px; background: rgba(0, 0, 0, 0.05); border-radius: 10px; }
.media-seg button { flex: 1; min-height: 32px; padding: 0 8px; color: var(--ink); background: none; border: 0; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.media-seg button[aria-pressed="true"] { color: #fff; background: #1d1d1f; }

/* ---------- dark appearance ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111113;
  --surface: #1b1b1f;
  --ink: #f2f2f4;
  --muted: #aaa9b2;
  --soft: #a2a0a9;
  --faint: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.29);
  --danger: #ff8179;
  --pill: #28282d;
  --pill-hover: #38383e;
  --glass: rgba(31, 31, 35, 0.82);
  --hairline: rgba(255, 255, 255, 0.14);
  --pill-edge: rgba(255, 255, 255, 0.2);
  --lime: #e8a85b;
  --accent: #e8a85b;
  --wave-line: rgba(255, 207, 157, 0.3);
  --cursor-dot: #ffffff;
  --cursor-dot-halo: rgba(0, 0, 0, 0.88);
  --cursor-ring: rgba(255, 255, 255, 0.92);
  --cursor-ring-halo: rgba(0, 0, 0, 0.78);
}

html[data-theme="dark"] .nav-pill > a { color: rgba(242, 242, 244, 0.78); }
html[data-theme="dark"] .nav-pill > a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .nav-pill > a[aria-current="page"] { color: #21160d; background: var(--accent); }
html[data-theme="dark"] .lang-switch button[aria-pressed="true"] { color: #21160d; background: var(--accent); }
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-accent,
html[data-theme="dark"] .hero-cta,
html[data-theme="dark"] .chip-more { color: #21160d; background: var(--accent); border-color: var(--accent); }
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-accent:hover,
html[data-theme="dark"] .hero-cta:hover,
html[data-theme="dark"] .chip-more:hover,
html[data-theme="dark"] .nav-pill > a[aria-current="page"]:hover,
html[data-theme="dark"] .lang-switch button[aria-pressed="true"]:hover { color: #21160d; background: #f2bd77; border-color: #f2bd77; }
html[data-theme="dark"] .chip em,
html[data-theme="dark"] .chip:hover em { color: var(--ink); background: rgba(255, 255, 255, 0.12); }
html[data-theme="dark"] .corner-lines { border-left-color: var(--line); }
html[data-theme="dark"] .step-num,
html[data-theme="dark"] .principle-num { color: rgba(255, 255, 255, 0.13); }
html[data-theme="dark"] .page-index a + a { border-color: var(--line); }
html[data-theme="dark"] .page-index a:hover { background: #242428; }
html[data-theme="dark"] .band,
html[data-theme="dark"] .band-still { background: linear-gradient(#111113 30%, rgba(17, 17, 19, 0.58) 62%, rgba(17, 17, 19, 0.3) 92%), linear-gradient(90deg, #71372b 0%, #91452f 20%, #ad5636 40%, #c36b3d 60%, #d58b4c 80%, #ad7144 100%); }
html[data-theme="dark"] .band { background: linear-gradient(#111113 45%, rgba(17, 17, 19, 0.58) 69%, rgba(17, 17, 19, 0.3) 91%), linear-gradient(90deg, #71372b 0%, #91452f 20%, #ad5636 40%, #c36b3d 60%, #d58b4c 80%, #ad7144 100%); }
html[data-theme="dark"] .team-card-lead::before { background: linear-gradient(rgba(17, 17, 19, 0.3), rgba(17, 17, 19, 0.86)), linear-gradient(120deg, #71372b 0%, #91452f 35%, #b35e3b 68%, #d18b4c 100%); }
html[data-theme="dark"] .lens-body { box-shadow: 0 0 0 1px rgba(240, 174, 104, 0.3), 0 20px 30px -6px rgba(184, 101, 47, 0.32), 0 3px 8px -2px rgba(184, 101, 47, 0.24); }
html[data-theme="dark"] .lens-light { mix-blend-mode: screen; }
html[data-theme="dark"] .lens-light:nth-child(1) { --c: 255, 183, 104 !important; --a: 0.52 !important; }
html[data-theme="dark"] .lens-light:nth-child(2) { --c: 234, 119, 75 !important; --a: 0.5 !important; }
html[data-theme="dark"] .lens-light:nth-child(3) { --c: 255, 211, 147 !important; --a: 0.38 !important; }
html[data-theme="dark"] .lens-surface { background: radial-gradient(circle at 32% 24%, rgba(255, 220, 174, 0.15), transparent 21%), radial-gradient(circle at 30% 21%, rgba(255, 255, 255, 0.6), transparent 6.5%), radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.12), transparent 46%), radial-gradient(circle at 50% 118%, rgba(120, 63, 31, 0.24), transparent 54%), radial-gradient(circle at 50% 50%, transparent 58%, rgba(120, 63, 31, 0.14) 80%, rgba(90, 45, 24, 0.32) 100%); }
html[data-theme="dark"] .lens-rim { box-shadow: inset 0 0 0 1px rgba(255, 238, 213, 0.6), inset 0 2px 1.5px -1px rgba(255, 255, 255, 0.7), inset 0 -2px 1.5px -1px rgba(255, 255, 255, 0.3), inset 0 0 10px -3px rgba(98, 52, 28, 0.5); }
html[data-theme="dark"] .lens-ring { background: conic-gradient(from calc(var(--rim) * 1deg), rgba(255, 255, 255, 0.92) 0deg, rgba(88, 49, 31, 0.28) 26deg, rgba(88, 49, 31, 0.28) 90deg, rgba(88, 49, 31, 0.46) 180deg, rgba(88, 49, 31, 0.28) 270deg, rgba(88, 49, 31, 0.28) 334deg, rgba(255, 255, 255, 0.92) 360deg); }

html[data-theme="dark"] .search-input {
  background-color: var(--surface);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23e3e3e7' stroke-width='1.8' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>");
  border-color: var(--line-strong);
}
html[data-theme="dark"] .search-input::placeholder { color: #a5a4ad; }
html[data-theme="dark"] .all-top { background: linear-gradient(to bottom, var(--bg) 68%, rgba(17, 17, 19, 0)); }

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .float-field input,
html[data-theme="dark"] .float-field textarea,
html[data-theme="dark"] .app-dialog input[type="text"],
html[data-theme="dark"] .app-dialog textarea,
html[data-theme="dark"] .app-dialog input[type="datetime-local"],
html[data-theme="dark"] .admin-add input,
html[data-theme="dark"] .news-photo input[type="file"] { color: var(--ink); background-color: var(--surface); border-color: var(--line-strong); }
html[data-theme="dark"] .field select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f2f2f4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); }
html[data-theme="dark"] .float-field label,
html[data-theme="dark"] .dialog-note,
html[data-theme="dark"] .btn-text { color: var(--muted); }
html[data-theme="dark"] .buy-option { background: var(--surface); border-color: var(--line-strong); }
html[data-theme="dark"] .buy-option:hover,
html[data-theme="dark"] .float-field :is(input, textarea):hover { border-color: #c6c5cd; }
html[data-theme="dark"] .buy-facts li + li { border-color: var(--line); }
html[data-theme="dark"] .buy-fact-icon { background: var(--surface); box-shadow: 0 0 0 0.5px var(--line-strong); }
html[data-theme="dark"] .buy-summary,
html[data-theme="dark"] .buy-done-icon,
html[data-theme="dark"] .np-current-photo { background: #242428; }
html[data-theme="dark"] .app-dialog { color: var(--ink); background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .app-dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
html[data-theme="dark"] .app-dialog .float-field :is(input, textarea) { color: var(--ink); background: #141416; border-color: var(--line-strong); }
html[data-theme="dark"] .app-dialog .float-field label { color: var(--muted); }
html[data-theme="dark"] .app-dialog .mode-option { background: #242428; border-color: var(--line); }
html[data-theme="dark"] .mode-filter { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .mode-filter button[aria-pressed="true"] { color: #21160d; background: var(--accent); }

html[data-theme="dark"] .nav-auth.is-signed .btn:hover { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .nav-auth.is-signed .nav-user { color: var(--ink); background: #29292e; box-shadow: 0 0 0 0.5px var(--line); }
html[data-theme="dark"] .nav-auth.is-signed .nav-user:hover { background: #38383e; }
html[data-theme="dark"] .chat-fab,
html[data-theme="dark"] .chat-send { color: #21160d; background: var(--accent); }
html[data-theme="dark"] .acct-fab:hover { background: #38383e; }
html[data-theme="dark"] .acct-fab.is-open { color: #21160d; background: var(--accent); }
html[data-theme="dark"] .acct-pop { background: rgba(31, 31, 35, 0.94); }
html[data-theme="dark"] .acct-lang .lang-switch { background: rgba(255, 255, 255, 0.1); }
html[data-theme="dark"] .chat { background: rgba(27, 27, 31, 0.96); }
html[data-theme="dark"] .chat-icon-btn { background: rgba(255, 255, 255, 0.09); }
html[data-theme="dark"] .chat-icon-btn:hover,
html[data-theme="dark"] .chat-row:hover { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .chat-tab[aria-selected="true"] { background: #38383e; box-shadow: 0 0 0 0.5px var(--line); }
html[data-theme="dark"] .chat-body { border-top-color: var(--line); }
html[data-theme="dark"] .chat-thread-head,
html[data-theme="dark"] .chat-composer { border-color: var(--line); }
html[data-theme="dark"] .chat-stack .avatar { box-shadow: 0 0 0 2px #1b1b1f; }
html[data-theme="dark"] .chat-bubble { background: #303035; }
html[data-theme="dark"] .chat-msg.is-mine .chat-bubble { color: #111113; background: #e8e8ec; }
html[data-theme="dark"] .chat-msg.is-team .chat-bubble { background: #414146; }
html[data-theme="dark"] .chat-input,
html[data-theme="dark"] .chat-search { color: var(--ink); background-color: #141416; border-color: var(--line-strong); }
html[data-theme="dark"] .chat-search { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23aaa9b2' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); }
html[data-theme="dark"] .chat-search:focus,
html[data-theme="dark"] .chat-input:focus { outline-color: rgba(255, 255, 255, 0.35); border-color: rgba(255, 255, 255, 0.45); }
html[data-theme="dark"] .chat { border-color: var(--line); }

html[data-theme="dark"] .np-strip a { background: var(--surface); }
html[data-theme="dark"] .np-strip a:hover { background: var(--pill-hover); }
html[data-theme="dark"] .np-back,
html[data-theme="dark"] .np-current-photo { color: var(--ink); background: #28282d; }
html[data-theme="dark"] .np-back:hover { background: #38383e; }
html[data-theme="dark"] .np-standfirst,
html[data-theme="dark"] .np-body { color: var(--ink); }
html[data-theme="dark"] .page-news { --np-rule: rgba(255, 255, 255, 0.14); --np-red: #ff9585; }
html[data-theme="dark"] .np-delete,
html[data-theme="dark"] .btn-danger { color: #ff9585; }
html[data-theme="dark"] .foot-social a { color: var(--ink); background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .foot-social a:hover { color: #21160d; background: var(--accent); }
html[data-theme="dark"] .footer-contact-links a:hover { background: var(--pill-hover); }
html[data-theme="dark"] .legal p,
html[data-theme="dark"] .legal li { color: var(--muted); }

@media (max-width: 640px) {
  .nav-pill { justify-content: flex-start; gap: 2px; }
  .nav-pill > a { min-height: 30px; gap: 5px; padding-inline: 8px; font-size: 11.5px; }
  .theme-toggle { flex-basis: 30px; width: 30px; height: 30px; margin-left: 0; }
}
@media (max-width: 560px) {
  .media-controls { grid-template-columns: 1fr; }
  .media-thumb { width: 78px; height: 78px; }
}
.rich-tools { flex-wrap: wrap; align-items: center; }
.rich-photo-btn { flex: 0 0 auto; white-space: nowrap; }
.rt-figure.is-grid.is-multi img:last-child:nth-child(odd) { grid-column: 1 / -1; aspect-ratio: 8 / 3; }

html[data-theme="dark"] .np-lead-standfirst { color: var(--ink); }
html[data-theme="dark"] .acct-area .acct-signin,
html[data-theme="dark"] .chat-guest-note .chat-signin { color: #21160d; background: var(--accent); }
html[data-theme="dark"] .pill-link:hover { background: var(--pill-hover); }
html[data-theme="dark"] .float-field [aria-invalid="true"] { background: #2b1918; }
html[data-theme="dark"] .media-block,
html[data-theme="dark"] .rich-editor { background: var(--surface); border-color: var(--line-strong); }
html[data-theme="dark"] .rich-preview { background: #141416; border-color: var(--line-strong); }
html[data-theme="dark"] .media-thumb { background: #242428; }
html[data-theme="dark"] .media-seg { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .media-seg button[aria-pressed="true"],
html[data-theme="dark"] .admin-tabs button[aria-selected="true"] { color: #21160d; background: var(--accent); }
