/* meet.rudi.company: rudi.'s own video calls. Same look as rudi.company and book.rudi.company. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("/assets/inter-latin.woff2") format("woff2"); }

:root {
    color-scheme: dark;
    --bg: #000; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #828287; --tile: #141415; --tile-2: #232325; --tile-3: #2f2f32;
    --hairline: rgba(255, 255, 255, .14); --accent: #d27474; --accent-rgb: 210, 116, 116; --on-accent: #0b0b0b; --danger: #e5484d;
    --nav: rgba(28, 28, 30, .62); --nav-edge: inset 0 0 0 .5px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 32px rgba(0, 0, 0, .36);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --ease: cubic-bezier(.28, .11, .32, 1); --pill: 980px; --r: 18px; --gutter: max(16px, 2.5vw);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100dvh; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px var(--gutter); min-height: 64px; flex: none; }
.logo { font-size: 1.5rem; font-weight: 900; letter-spacing: -.05em; line-height: 1; }
.logo span, .dot { color: var(--accent); }
.top-r { display: flex; align-items: center; gap: 8px; min-width: 0; }

main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.msg { margin: auto; padding: 24px var(--gutter); max-width: 34rem; text-align: center; color: var(--text-2); }
.msg h1 { color: var(--text); font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 900; letter-spacing: -.04em; line-height: 1.05; margin: 0 0 12px; }
.msg p { margin: 0 0 20px; }

/* Lobby */
.lobby { margin: auto; width: 100%; max-width: 980px; padding: 8px var(--gutter) 32px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; overflow-y: auto; }
.preview { position: relative; aspect-ratio: 16 / 10; background: var(--tile); border-radius: var(--r); overflow: hidden; }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.preview .off { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: .875rem; }
.preview .pbar { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 10px; }
.meter { position: absolute; left: 14px; top: 14px; display: flex; gap: 3px; align-items: flex-end; height: 18px; }
.meter i { width: 4px; border-radius: 2px; background: rgba(255, 255, 255, .85); height: 4px; transition: height .08s linear; }
.join h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 900; letter-spacing: -.045em; line-height: 1.02; margin: 0 0 8px; }
.join .when { color: var(--text-2); margin: 0 0 24px; }
.join label { display: block; font-size: .8125rem; color: var(--text-2); margin: 0 0 6px; }
.join input[type=text] { width: 100%; height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--tile); outline: none; }
.join input[type=text]:focus { border-color: var(--accent); }
.join .row { margin: 0 0 16px; }
.join .note { color: var(--text-3); font-size: .8125rem; margin: 14px 0 0; }
.join .err { color: var(--accent); font-size: .875rem; margin: 12px 0 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; border-radius: var(--pill); border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600; transition: filter .2s var(--ease), opacity .2s; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.ghost { background: var(--tile-2); color: var(--text); }
.btn.wide { width: 100%; }

.ico { width: 48px; height: 48px; border-radius: 50%; border: 0; display: inline-grid; place-items: center; background: var(--tile-2); color: var(--text); transition: background .2s var(--ease); flex: none; position: relative; }
.ico:hover { background: var(--tile-3); }
.ico.off { background: #f5f5f7; color: #111; }
.ico.red { background: var(--danger); color: #fff; }
.ico.rec { background: rgba(var(--accent-rgb), .18); color: var(--accent); }
.ico svg { width: 22px; height: 22px; }
.preview .ico { background: rgba(28, 28, 30, .7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.preview .ico.off { background: #f5f5f7; }

/* Call */
.call { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.stage { flex: 1; min-height: 0; padding: 0 var(--gutter); display: grid; gap: 10px; }
.grid { --cols: 1; display: grid; gap: 10px; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: 1fr; min-height: 0; height: 100%; }
.stage.share { grid-template-columns: minmax(0, 1fr) 240px; }
.stage.share .grid { --cols: 1 !important; grid-auto-rows: minmax(0, 150px); align-content: start; overflow-y: auto; }
.screen { min-height: 0; background: var(--tile); border-radius: var(--r); overflow: hidden; position: relative; }
.screen video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.tile { position: relative; background: var(--tile); border-radius: var(--r); overflow: hidden; min-height: 0; box-shadow: inset 0 0 0 0 var(--accent); transition: box-shadow .15s var(--ease); }
.tile.speaking { box-shadow: inset 0 0 0 3px var(--accent); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile.me video { transform: scaleX(-1); }
.tile .av { position: absolute; inset: 0; display: grid; place-items: center; }
.tile .av b { width: clamp(56px, 22%, 112px); aspect-ratio: 1; border-radius: 50%; background: var(--tile-3); display: grid; place-items: center; font-weight: 700; font-size: clamp(1.25rem, 3vw, 2rem); color: var(--text); }
.tag { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--pill); background: rgba(0, 0, 0, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #f5f5f7; }
.tag svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.alone { position: absolute; inset: auto 0 18% 0; text-align: center; color: var(--text-3); font-size: .875rem; pointer-events: none; }

.bar { flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px var(--gutter) max(14px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
.bar .sep { width: 1px; height: 28px; background: var(--hairline); margin: 0 4px; }

.pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: var(--pill); background: var(--nav); box-shadow: var(--nav-edge); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); font-size: .8125rem; color: var(--text-2); white-space: nowrap; }
.pill .live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.pill button { border: 0; background: none; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.pill.warn { color: var(--text); }
@keyframes pulse { 50% { opacity: .35; } }

/* Dialogs */
.veil { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; z-index: 10; }
.dlg { width: 100%; max-width: 440px; background: var(--tile); border-radius: 22px; padding: 28px; box-shadow: 0 0 0 .5px var(--hairline), 0 24px 64px rgba(0, 0, 0, .5); }
.dlg h2 { margin: 0 0 10px; font-size: 1.375rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.dlg p { margin: 0 0 22px; color: var(--text-2); }
.dlg .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.dlg .acts .btn { flex: 1; min-width: 140px; }
.dlg label { display: block; font-size: .8125rem; color: var(--text-2); margin: 0 0 6px; }
.dlg select { width: 100%; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--tile-2); margin: 0 0 16px; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); padding: 10px 16px; border-radius: var(--pill); background: var(--tile-2); box-shadow: 0 0 0 .5px var(--hairline), 0 10px 30px rgba(0, 0, 0, .4); font-size: .875rem; z-index: 20; max-width: calc(100% - 32px); text-align: center; }

@media (max-width: 760px) {
    .lobby { grid-template-columns: 1fr; align-items: start; margin-top: 0; }
    .stage.share { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 120px; }
    .stage.share .grid { --cols: 3 !important; grid-auto-rows: 120px; }
    .ico { width: 44px; height: 44px; }
    .bar { gap: 8px; }
    .bar .sep, .ico.wide-only { display: none; }
    .top-r .pill .long { display: none; }
}

@media (prefers-color-scheme: light) {
    :root { color-scheme: light; --bg: #fff; --text: #1d1d1f; --text-2: #6e6e73; --text-3: #737378; --tile: #f5f5f7; --tile-2: #e8e8ed; --tile-3: #dcdce1; --hairline: rgba(0, 0, 0, .12);
        --accent: #ad5050; --accent-rgb: 173, 80, 80; --on-accent: #fff; --nav: rgba(255, 255, 255, .62);
        --nav-edge: inset 0 0 0 .5px rgba(0, 0, 0, .07), inset 0 1px 0 rgba(255, 255, 255, .75), 0 10px 32px rgba(0, 0, 0, .12); }
    .ico.off { background: #1d1d1f; color: #fff; }
    .preview .ico { background: rgba(255, 255, 255, .75); }
    .preview .ico.off { background: #1d1d1f; }
    .veil { background: rgba(0, 0, 0, .35); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
