:root {
  --paper: #f3f1ec;
  --paper-2: #e8e6de;
  --ink: #202724;
  --muted: #66716b;
  --line: #d3d3ca;
  --accent: #a9543d;
  --dark: #202824;
  --dark-2: #151c19;
  --serif: "Iowan Old Style", "Baskerville", "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; }
body.call-active { background: var(--dark-2); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { color: white; background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.site-shell { width: min(1440px, 100%); min-height: 100dvh; margin: 0 auto; }
.site-header { height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(24px, 5vw, 76px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: baseline; gap: 14px; text-decoration: none; white-space: nowrap; }
.brand-mark { font-family: var(--serif); font-size: 32px; letter-spacing: -.09em; line-height: 1; }
.brand-dot { color: var(--accent); }
.brand-suffix { color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .18em; }
.header-aside { display: flex; align-items: center; gap: 10px; color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.site-footer { display: flex; justify-content: space-between; gap: 18px; padding: 22px clamp(24px, 5vw, 76px) 30px; border-top: 1px solid var(--line); color: #7b837c; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; }
.screen { min-height: calc(100dvh - 148px); }
.eyebrow, .field-label, .card-kicker, .panel-head, .call-eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; }

/* Entry */
.intro-screen { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(340px, .86fr); align-items: stretch; gap: 6%; padding: clamp(56px, 8.5vh, 112px) clamp(24px, 5vw, 76px) 90px; }
.intro-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.intro-copy .eyebrow { display: flex; justify-content: space-between; gap: 12px; max-width: 590px; margin-bottom: 64px; color: var(--accent); }
.intro-copy h1, .prejoin-copy h1 { margin: 0; font-family: var(--serif); font-size: clamp(64px, 6.9vw, 105px); font-weight: 500; line-height: 1.28; letter-spacing: -.075em; }
.intro-copy h1 em, .prejoin-copy h1 em { color: var(--accent); font-style: normal; }
.intro-lead { max-width: 500px; margin: 40px 0 0; color: #59645d; font-size: 16px; line-height: 2; }
.intro-facts { display: flex; flex-wrap: wrap; gap: 18px 29px; margin-top: 65px; padding-top: 19px; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .05em; }
.intro-facts span::before { display: inline-block; width: 4px; height: 4px; margin: 0 9px 2px 0; border-radius: 50%; background: var(--accent); content: ""; }
.entry-card { align-self: center; border: 1px solid #b9c0b8; background: #f9f8f4; box-shadow: 0 24px 60px #2631290c; }
.card-kicker { display: flex; justify-content: space-between; padding: 22px 29px; border-bottom: 1px solid var(--line); color: var(--accent); }
.entry-main { padding: 48px 40px 43px; }
.entry-main h2 { margin: 0 0 13px; font-family: var(--serif); font-size: clamp(33px, 3vw, 44px); font-weight: 500; letter-spacing: -.05em; }
.entry-main > p { margin: 0 0 37px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.primary-button { width: 100%; min-height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 0 23px; border: 1px solid var(--ink); border-radius: 2px; color: var(--paper); background: var(--ink); font-size: 14px; font-weight: 650; transition: background .2s, transform .2s; }
.primary-button:hover { transform: translateY(-2px); background: #38453d; }
.primary-button:disabled { opacity: .6; cursor: wait; transform: none; }
.separator { position: relative; margin: 33px 0 29px; border-top: 1px solid var(--line); text-align: center; }
.separator span { position: relative; top: -9px; padding: 0 13px; color: var(--muted); background: #f9f8f4; font-size: 11px; }
.join-form label, .field-label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.join-field { display: flex; border-bottom: 1px solid #aeb6ae; }
.join-field input { min-width: 0; flex: 1; padding: 12px 0 13px; border: 0; outline: 0; color: var(--ink); background: none; font-size: 12px; }
.join-field input::placeholder { color: #a0a9a0; }
.join-field button { width: 42px; display: grid; place-items: center; border: 0; color: var(--accent); background: none; }
.card-foot { display: flex; align-items: center; gap: 10px; padding: 17px 29px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
.card-foot svg { width: 14px; height: 14px; }

/* Prejoin */
.prejoin-screen { padding: 32px clamp(24px, 5vw, 76px) 90px; }
.prejoin-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 75px; }
.back-link { padding: 8px 0; border: 0; color: var(--muted); background: none; font-size: 12px; }
.back-link:hover { color: var(--accent); }
.prejoin-top .eyebrow { color: var(--accent); }
.prejoin-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .83fr); gap: 10%; }
.prejoin-copy h1 { margin-top: 22px; font-size: clamp(58px, 6.4vw, 89px); }
.prejoin-copy > p:not(.eyebrow) { max-width: 460px; margin: 30px 0 53px; color: var(--muted); font-size: 14px; line-height: 1.95; }
.prejoin-copy .eyebrow { color: var(--accent); }
.invite-panel { max-width: 560px; padding: 22px 0 16px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.invite-panel > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.room-code { color: var(--accent); font-family: var(--mono); font-size: 11px; letter-spacing: .05em; }
.invite-input-wrap { display: flex; align-items: center; margin-top: 7px; border-bottom: 1px solid var(--line); }
.invite-input-wrap input { min-width: 0; flex: 1; padding: 13px 0; border: 0; outline: 0; color: var(--ink); background: none; font-family: var(--mono); font-size: 12px; }
.invite-input-wrap button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; color: var(--accent); background: none; }
.share-link { display: inline-flex; align-items: center; gap: 8px; padding: 17px 0 0; border: 0; color: var(--ink); background: none; font-size: 12px; }
.share-link svg { width: 16px; height: 16px; }
.share-link:hover { color: var(--accent); }
.join-panel { padding: 0 0 25px; border-top: 1px solid var(--ink); }
.panel-head { display: flex; justify-content: space-between; padding: 18px 0 37px; color: var(--accent); }
.name-input { width: 100%; height: 52px; padding: 0 0 9px; border: 0; border-bottom: 1px solid #aeb6ae; outline: 0; color: var(--ink); background: none; font-size: 23px; }
.name-input::placeholder { color: #a4ada5; }
.mode-label { margin-top: 42px; }
.mode-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-option { min-height: 94px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); background: transparent; font-size: 12px; transition: border-color .2s, background .2s; }
.mode-option:hover { border-color: var(--ink); }
.mode-option[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); background: #e6e8df; }
.mode-option svg { width: 23px; height: 23px; }
.join-button { margin-top: 38px; }
.permission-note { margin: 17px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

/* Live room */
body.call-active .site-header { border-color: #3c4941; color: #eff0e9; background: var(--dark-2); }
body.call-active .brand-suffix, body.call-active .header-aside { color: #9fab9f; }
body.call-active .site-footer { display: none; }
.call-screen { min-height: calc(100dvh - 86px); padding: 25px clamp(20px, 3vw, 45px) 23px; color: #eef1e9; background: var(--dark-2); }
.call-heading { display: flex; justify-content: space-between; align-items: end; gap: 15px; padding-bottom: 21px; }
.call-eyebrow { color: #cf8e7c; }
.call-heading h1 { display: flex; align-items: center; gap: 11px; margin: 8px 0 0; font-family: var(--serif); font-size: 31px; font-weight: 500; }
.call-pulse { width: 7px; height: 7px; border-radius: 50%; background: #c28269; box-shadow: 0 0 0 5px #c2826924; }
.call-meta { display: flex; gap: 22px; padding-bottom: 5px; color: #aab7aa; font-family: var(--mono); font-size: 11px; }
.call-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; min-height: min(62vh, 690px); }
.stage { position: relative; min-width: 0; min-height: 430px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px; padding: 8px; border: 1px solid #3c4940; border-radius: 8px; background: #111714; }
.stage[data-remotes="1"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stage[data-remotes="2"], .stage[data-remotes="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.video-tile { position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 5px; background: #2a332c; }
.video-tile video { width: 100%; height: 100%; display: block; object-fit: cover; background: #2a332c; }
.video-tile.local-tile video { transform: scaleX(-1); }
.tile-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 13px; color: #aebbaf; background: #2a332c; font-size: 12px; }
.video-tile.has-video .tile-placeholder { display: none; }
.avatar { width: 90px; height: 90px; display: grid; place-items: center; border: 1px solid #697969; border-radius: 50%; color: #e5e9dd; font-family: var(--serif); font-size: 44px; }
.tile-label { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 22px 18px 14px; color: #fff; background: linear-gradient(transparent, #0b100ccd); font-size: 12px; }
.tile-state { color: #d4ded1; font-size: 10px; }
.play-remote { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 10px 16px; border: 1px solid #aab9a8; border-radius: 30px; color: #fff; background: #152019e8; font-size: 12px; }
.room-sidebar { display: flex; flex-direction: column; justify-content: space-between; padding: 24px 21px 19px; border: 1px solid #3c4940; border-radius: 8px; background: var(--dark); }
.room-sidebar .eyebrow { color: #d18c79; }
.room-sidebar h2 { margin: 32px 0 13px; font-family: var(--serif); font-size: 35px; font-weight: 500; line-height: 1.4; }
.room-sidebar p { margin: 0; color: #adbaad; font-size: 12px; line-height: 1.8; }
.sidebar-bottom .field-label { color: #9dac9d; }
.copy-room-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; border: 0; border-bottom: 1px solid #718073; color: #eef0e9; background: transparent; text-align: left; }
.copy-room-button span { overflow: hidden; font-family: var(--mono); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.copy-room-button svg { width: 17px; height: 17px; color: #d18c79; }
.privacy-line { display: flex; align-items: center; gap: 7px; margin-top: 19px; color: #9dac9d; font-size: 10px; }
.privacy-line svg { width: 13px; height: 13px; }
.call-controls { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 23px; }
.control-group { display: flex; align-items: center; gap: 12px; }
.control-button { min-width: 74px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; color: #c6d1c6; background: none; font-size: 10px; }
.control-icon { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid #576759; border-radius: 50%; color: #eff2e9; background: #2b382e; transition: background .2s; }
.control-button:hover .control-icon { background: #3b4b3e; }
.control-button.off .control-icon { color: #f3e1dd; border-color: #865b52; background: #634037; }
.control-button svg { width: 22px; height: 22px; }
.mobile-invite { display: none; }
.hangup-button { min-height: 51px; display: inline-flex; align-items: center; gap: 10px; padding: 0 20px; border: 0; border-radius: 28px; color: #fff; background: #aa5346; font-size: 12px; font-weight: 700; }
.hangup-button:hover { background: #c36354; }
.hangup-button svg { width: 19px; height: 19px; transform: rotate(135deg); }
.toast { position: fixed; z-index: 30; right: 22px; bottom: 24px; max-width: min(360px, calc(100vw - 36px)); padding: 13px 17px; border: 1px solid #5c6a5d; border-radius: 5px; color: white; background: #26322a; box-shadow: 0 10px 30px #111b1680; font-size: 12px; line-height: 1.5; }

@media (max-width: 1050px) {
  .intro-screen { grid-template-columns: 1fr .9fr; gap: 4%; }
  .intro-copy h1 { font-size: clamp(55px, 6.4vw, 82px); }
  .entry-main { padding-inline: 28px; }
  .prejoin-grid { gap: 5%; }
  .call-workspace { grid-template-columns: minmax(0, 1fr) 220px; }
}
@media (max-width: 760px) {
  .site-header { height: 68px; padding-inline: 20px; }
  .brand-mark { font-size: 29px; }
  .header-aside { font-size: 9px; }
  .site-footer { padding: 21px 20px 27px; }
  .site-footer span:nth-child(2) { display: none; }
  .screen { min-height: calc(100dvh - 116px); }
  .intro-screen { display: block; padding: 40px 20px 60px; }
  .intro-copy .eyebrow { margin-bottom: 41px; font-size: 9px; }
  .intro-copy h1 { font-size: clamp(51px, 12vw, 72px); }
  .intro-lead { margin-top: 25px; font-size: 13px; line-height: 1.85; }
  .intro-facts { margin-top: 37px; padding-top: 16px; font-size: 9px; }
  .entry-card { margin-top: 44px; }
  .card-kicker { padding: 17px 20px; }
  .entry-main { padding: 32px 24px 31px; }
  .entry-main h2 { font-size: 33px; }
  .entry-main > p { margin-bottom: 25px; }
  .card-foot { padding: 15px 20px; }
  .prejoin-screen { padding: 16px 20px 60px; }
  .prejoin-top { margin-bottom: 25px; }
  .prejoin-grid { display: block; }
  .prejoin-copy h1 { font-size: clamp(47px, 11.6vw, 67px); }
  .prejoin-copy > p:not(.eyebrow) { margin: 17px 0 24px; font-size: 12px; }
  .invite-panel { margin-bottom: 26px; padding-top: 16px; padding-bottom: 12px; }
  .panel-head { padding-bottom: 23px; }
  .mode-label { margin-top: 27px; }
  .mode-option { min-height: 82px; }
  .join-button { margin-top: 20px; }
  .call-screen { min-height: calc(100dvh - 68px); display: flex; flex-direction: column; padding: 13px 12px max(12px, env(safe-area-inset-bottom)); }
  .call-heading { padding: 4px 4px 14px; }
  .call-heading h1 { margin-top: 5px; font-size: 25px; }
  .call-meta { flex-direction: column; align-items: end; gap: 3px; font-size: 9px; }
  .call-workspace { display: block; flex: 1; min-height: 0; }
  .stage { height: 100%; min-height: min(430px, calc(100dvh - 250px)); max-height: calc(100dvh - 234px); grid-template-columns: 1fr; padding: 5px; }
  .stage[data-remotes="1"] { grid-template-columns: 1fr; }
  .stage[data-remotes="2"], .stage[data-remotes="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage:not([data-remotes="0"]) .local-tile { position: absolute; z-index: 3; top: 13px; right: 13px; width: min(28%, 122px); height: min(27%, 163px); min-height: 115px; border: 2px solid #c7d1c2; box-shadow: 0 8px 24px #0008; }
  .stage:not([data-remotes="0"]) .local-tile .avatar { width: 42px; height: 42px; font-size: 23px; }
  .stage:not([data-remotes="0"]) .local-tile .tile-placeholder { font-size: 9px; text-align: center; }
  .stage:not([data-remotes="0"]) .local-tile .tile-label { padding: 12px 7px 6px; font-size: 9px; }
  .stage:not([data-remotes="0"]) .local-tile .tile-state { display: none; }
  .avatar { width: 72px; height: 72px; font-size: 34px; }
  .room-sidebar { display: none; }
  .call-controls { padding: 14px 3px 4px; gap: 8px; }
  .control-group { gap: 4px; }
  .control-button { min-width: 54px; gap: 6px; font-size: 9px; }
  .control-icon { width: 48px; height: 48px; }
  .mobile-invite { display: flex; }
  .hangup-button { width: 50px; min-width: 50px; height: 50px; justify-content: center; padding: 0; }
  .hangup-button span { display: none; }
  .toast { right: 12px; bottom: 88px; }
}
@media (max-width: 390px) {
  .header-aside { display: none; }
  .intro-copy .eyebrow span:last-child { display: none; }
  .control-button { min-width: 49px; }
  .control-icon { width: 44px; height: 44px; }
  .control-button svg { width: 20px; height: 20px; }
  .hangup-button { width: 46px; min-width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; } }
