/* Löyly: Discord-native. Cool steam slate with an ember accent. Bricolage Grotesque display, Atkinson Hyperlegible text. */
:root {
  --page: #edf2f4;
  --panel: #ffffff;
  --panel-2: #f5f8f9;
  --rail: #dde6ea;
  --hover: #e4ecef;
  --ink: #12202a;
  --ink-2: #44555f;
  --ink-3: #4e5e68;
  --line: #d3dee3;
  --line-strong: #7f8f98;
  --ember: #c2461a;
  --ember-hover: #a83a13;
  --on-ember: #ffffff;
  --ember-text: #b13f15;
  --ember-soft: #fde6dc;
  --teal: #0d6b76;
  --teal-soft: #d8eef0;
  --chat: #ffffff;
  --chat-ink: #2e3338;
  --chat-muted: #5c6670;
  --embed: #f2f3f5;
  --mention: #e9ecfd;
  --mention-ink: #4752c4;
  --ok: #23824a;
  --danger: #c53030;
  --shadow: 0 1px 0 rgb(18 32 42 / .04), 0 16px 36px -18px rgb(18 32 42 / .25);
  --theme-color: #edf2f4;
  --r: 12px;
}
:root[data-theme="dark"] {
  --page: #0d161c;
  --panel: #14212a;
  --panel-2: #111c24;
  --rail: #0a1217;
  --hover: #1d2d37;
  --ink: #e4eef2;
  --ink-2: #a9bcc5;
  --ink-3: #8fa3ad;
  --line: #22333e;
  --line-strong: #5d7380;
  --ember: #ff8b5e;
  --ember-hover: #ffa47f;
  --on-ember: #2a0f04;
  --ember-text: #ff9a72;
  --ember-soft: #3a1c10;
  --teal: #74d2db;
  --teal-soft: #12323a;
  --chat: #313338;
  --chat-ink: #dbdee1;
  --chat-muted: #949ba4;
  --embed: #2b2d31;
  --mention: #3c4270;
  --mention-ink: #c9cdfb;
  --ok: #6fd39a;
  --danger: #ff8a8a;
  --shadow: 0 0 0 1px rgb(255 255 255 / .03), 0 24px 50px -24px rgb(0 0 0 / .8);
  --theme-color: #0d161c;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 17px/1.55 "Atkinson Hyperlegible", system-ui, sans-serif; }
h1, h2, h3, .display { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-optical-sizing: auto; line-height: 1.05; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 12px; border: 2px solid var(--ink); background: transparent; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform 100ms, background 100ms, box-shadow 100ms; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: none; box-shadow: none; }
.btn-ember { background: var(--ember); border-color: var(--ember); color: var(--on-ember); }
.btn-ember:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }

.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
.seg button { height: 34px; padding: 0 10px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.seg .i { width: 17px; height: 17px; }

/* ---------- Homepage ---------- */
.wrap { max-width: 1220px; margin: 0 auto; padding: 0 28px; }
.nav { display: flex; align-items: center; gap: 22px; height: 76px; }
.nav .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 24px "Bricolage Grotesque", sans-serif; letter-spacing: -.02em; }
.nav .logo img { width: 42px; height: 42px; }
.nav .links { display: flex; gap: 22px; font-weight: 700; font-size: 15px; }
.nav .links a { text-decoration: none; }
.nav .links a:hover { color: var(--ember-text); }
.nav .end { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; padding: 48px 0 72px; }
.hero h1 { font-size: clamp(48px, 6.4vw, 92px); font-weight: 800; letter-spacing: -.03em; margin: 0 0 22px; font-variation-settings: "wdth" 85; }
.hero p { font-size: 20px; color: var(--ink-2); max-width: 30em; margin: 0 0 30px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero small { display: block; margin-top: 16px; color: var(--ink-3); font-size: 15px; }

/* The memorable thing: a channel where Sauna works in real time */
.channel { border-radius: 18px; background: var(--chat); color: var(--chat-ink); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; font: 15px/1.4 "Atkinson Hyperlegible", sans-serif; }
:root[data-theme="dark"] .channel { border-color: #1e1f22; }
.channel-top { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-bottom: 1px solid rgb(127 127 127 / .2); font-weight: 700; }
.channel-top .i { width: 20px; height: 20px; color: var(--chat-muted); }
.channel-top span { font-weight: 400; color: var(--chat-muted); font-size: 13px; margin-left: 8px; }
.channel-top button { margin-left: auto; border: 0; background: none; color: var(--chat-muted); cursor: pointer; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.feed { height: 430px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 8px 0 14px; }
.m { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 6px 16px; }
.m.in { animation: msgIn 360ms cubic-bezier(.25, 1, .5, 1); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.m .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; overflow: hidden; }
.m .av img { width: 40px; height: 40px; object-fit: cover; }
.m .who { font-weight: 700; }
.m .bot { font-size: 10px; font-weight: 700; background: #5865f2; color: #fff; border-radius: 3px; padding: 1px 4px; margin-left: 4px; vertical-align: 2px; }
.m .ts { color: var(--chat-muted); font-size: 12px; margin-left: 6px; }
.m .body { margin-top: 2px; }
.m .gone { color: var(--chat-muted); font-style: italic; }
.m .ephem { color: var(--chat-muted); font-size: 12px; margin-top: 4px; }
.mention { background: var(--mention); color: var(--mention-ink); border-radius: 3px; padding: 0 2px; font-weight: 600; }
.emb { margin-top: 6px; max-width: 430px; border-left: 4px solid var(--ember); border-radius: 4px; background: var(--embed); padding: 10px 14px 12px; }
.emb b { display: block; margin-bottom: 2px; }
.emb .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dbtn { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 4px; background: #4e5058; color: #fff; font-weight: 600; font-size: 14px; }
.dbtn.blurple { background: #5865f2; }
.dbtn.green { background: #248046; }
.typing { height: 24px; padding: 0 16px; color: var(--chat-muted); font-size: 12px; }

.stripe { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: var(--ember); color: var(--on-ember); overflow: hidden; }
.stripe ul { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.stripe li { flex: 1; padding: 18px 20px; font: 800 20px "Bricolage Grotesque", sans-serif; text-align: center; border-left: 2px solid var(--ink); }
.stripe li:first-child { border-left: 0; }
.stripe small { display: block; font: 600 14px "Atkinson Hyperlegible", sans-serif; }

.section { padding: 100px 0; }
.section h2 { font-size: clamp(36px, 4.6vw, 64px); font-weight: 800; letter-spacing: -.04em; margin: 0 0 16px; max-width: 16ch; }
.section .sub { font-size: 19px; color: var(--ink-2); max-width: 34em; margin: 0 0 48px; }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.b { grid-column: span 2; position: relative; border: 2px solid var(--ink); border-radius: 20px; background: var(--panel); padding: 24px; overflow: hidden; }
.b.w3 { grid-column: span 3; }
.b.w4 { grid-column: span 4; }
.b h3 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 8px; }
.b p { margin: 0 0 18px; color: var(--ink-2); }
.b.ember { background: var(--ember); color: var(--on-ember); }
.b.ember p { color: inherit; }
.b.teal { background: var(--teal-soft); }
.b .mini { border-radius: 12px; background: var(--chat); color: var(--chat-ink); padding: 10px 0; }
.b .mini .m { padding: 4px 12px; font-size: 14px; }
.b .mascot { position: absolute; right: -10px; bottom: -14px; width: 170px; height: 170px; object-fit: contain; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rules li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.rules li span { margin-left: auto; font-weight: 400; color: var(--ink-3); font-size: 14px; }
.levels { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.levels i { flex: 1; border-radius: 6px 6px 2px 2px; background: var(--teal); opacity: .35; }
.levels i:nth-child(n+5) { opacity: .6; }
.levels i:last-child { opacity: 1; background: var(--ember); }

.final { display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: center; padding: 40px; border: 2px solid var(--ink); border-radius: 24px; background: var(--teal-soft); }
.final img { width: 140px; height: 140px; object-fit: contain; }
.final h2 { font-size: clamp(30px, 3.4vw, 46px); margin: 0 0 6px; font-weight: 800; letter-spacing: -.03em; }
.final p { margin: 0; color: var(--ink-2); }

.footer { padding: 48px 0 64px; color: var(--ink-3); font-size: 15px; }
.footer .wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.footer a { text-decoration: none; font-weight: 700; }
.footer a:hover { color: var(--ember-text); }

/* ---------- Dashboard: Discord-shaped ---------- */
.app { display: grid; grid-template-columns: 76px 248px minmax(0, 1fr) 380px; height: 100vh; }
.rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; overflow-y: auto; }
.rail a, .rail button { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font: 800 17px "Bricolage Grotesque", sans-serif; color: #fff; text-decoration: none; border: 0; cursor: pointer; transition: border-radius 150ms; }
.rail a:hover, .rail [aria-current="true"] { border-radius: 16px; }
.rail [aria-current="true"]::before { content: ""; position: absolute; left: -14px; width: 5px; height: 36px; border-radius: 0 4px 4px 0; background: var(--ink); }
.rail .home { background: var(--panel); }
.rail .home img { width: 36px; height: 36px; }
.rail hr { width: 32px; border: 0; border-top: 2px solid var(--line); margin: 2px 0; }
.rail .add { background: var(--panel); color: var(--ok); }
.cols { background: var(--panel-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cols header { padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.cols header strong { display: block; font: 800 19px "Bricolage Grotesque", sans-serif; letter-spacing: -.02em; }
.cols header small { color: var(--ink-3); font-size: 13px; }
.find { margin: 12px 12px 4px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 10px; background: var(--page); border: 1px solid var(--line); color: var(--ink-3); }
.find input { border: 0; background: none; outline: 0; min-width: 0; flex: 1; font-size: 14px; }
.mods { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.mods h4 { margin: 14px 8px 4px; font: 700 12px "Atkinson Hyperlegible", sans-serif; color: var(--ink-3); }
.mods a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 15px; color: var(--ink-2); }
.mods a:hover { background: var(--hover); color: var(--ink); }
.mods a[aria-current="page"] { background: var(--hover); color: var(--ink); }
.mods a .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.mods a .dot.off { background: var(--line-strong); }
.mods a .badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 0 7px; }
.me-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--rail); }
.me-bar .av { width: 34px; height: 34px; border-radius: 50%; background: #0d6b76; color: #fff; display: grid; place-items: center; font-weight: 800; }
.me-bar div { flex: 1; line-height: 1.2; font-size: 14px; }
.me-bar small { color: var(--ink-3); }

.work { overflow-y: auto; min-height: 0; position: relative; }
.work-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; background: var(--page); border-bottom: 1px solid var(--line); }
.work-head h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.work-head .seg { margin-left: auto; }
.menu-m { display: none; }
.work-body { padding: 28px 28px 40px; max-width: 860px; }
.view[hidden] { display: none; }
.card { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 22px; margin-bottom: 18px; }
.card > h2 { margin: 0 0 4px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.card > p { margin: 0 0 18px; color: var(--ink-2); font-size: 15px; }
.lbl { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 6px; }
.in, .ta, .sel { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--panel-2); font-size: 15px; }
.ta { min-height: 92px; resize: vertical; }
.btn-list { display: grid; gap: 8px; }
.btn-item { display: grid; grid-template-columns: 1fr 140px 36px; gap: 8px; align-items: center; }
.x { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); display: grid; place-items: center; cursor: pointer; }
.x:hover { color: var(--danger); }
.add-row { margin-top: 10px; }
.sw { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.sw:first-of-type { border-top: 0; }
.sw div { flex: 1; }
.sw b { display: block; font-size: 15px; }
.sw span { color: var(--ink-3); font-size: 14px; }
.tg { position: relative; width: 44px; height: 26px; flex: none; }
.tg input { position: absolute; inset: 0; opacity: 0; margin: 0; z-index: 1; cursor: pointer; }
.tg i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background 100ms; }
.tg i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 160ms cubic-bezier(.25, 1, .5, 1); }
.tg input:checked + i { background: var(--ok); }
:root[data-theme="dark"] .tg input:checked + i { background: #248046; }
.tg input:checked + i::after { transform: translateX(18px); }
.tg input:focus-visible + i { outline: 3px solid var(--teal); outline-offset: 2px; }
.sev { display: flex; gap: 6px; flex-wrap: wrap; }
.sev label { position: relative; }
.sev input { position: absolute; opacity: 0; }
.sev span { display: inline-flex; height: 34px; align-items: center; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line-strong); font-size: 14px; font-weight: 700; cursor: pointer; }
.sev input:checked + span { background: var(--ink); color: var(--page); border-color: var(--ink); }
.sev input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }

.feedlog { list-style: none; margin: 0; padding: 0; }
.feedlog li { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }
.feedlog li:first-child { border-top: 0; }
.feedlog .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.feedlog b { font-size: 15px; }
.feedlog span { display: block; color: var(--ink-3); font-size: 14px; }
.feedlog time { color: var(--ink-3); font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { border: 2px solid var(--ink); border-radius: 14px; padding: 16px; background: var(--panel); }
.kpi span { color: var(--ink-2); font-size: 14px; font-weight: 700; }
.kpi b { display: block; font: 800 34px "Bricolage Grotesque", sans-serif; letter-spacing: -.03em; }
.kpi.hot { background: var(--ember); color: var(--on-ember); }
.kpi.hot span { color: inherit; }

.preview { background: var(--page); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.preview header { height: 60px; display: flex; align-items: center; gap: 8px; padding: 0 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.preview header .live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); font-weight: 700; }
.preview header .live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.preview .channel { margin: 18px; border-radius: 14px; }
.preview .feed { height: auto; min-height: 260px; }
.preview .note { margin: 0 18px; color: var(--ink-3); font-size: 14px; }

.save { position: sticky; bottom: 18px; z-index: 5; display: flex; align-items: center; gap: 12px; max-width: 804px; margin: 0 28px 18px; padding: 10px 10px 10px 18px; border-radius: 12px; background: #111214; color: #fff; box-shadow: 0 10px 30px rgb(0 0 0 / .35); visibility: hidden; opacity: 0; transform: translateY(20px); transition: transform 220ms cubic-bezier(.25, 1, .5, 1), opacity 160ms, visibility 0s 220ms; }
.save.show { visibility: visible; opacity: 1; transform: none; transition: transform 220ms cubic-bezier(.25, 1, .5, 1), opacity 160ms; }
.save p { margin: 0; flex: 1; font-weight: 700; }
.save .reset { border: 0; background: none; color: #fff; font-weight: 700; cursor: pointer; padding: 0 10px; text-decoration: underline; }
.save .go { height: 36px; padding: 0 16px; border: 0; border-radius: 6px; background: #248046; color: #fff; font-weight: 700; cursor: pointer; }
.saved-msg { position: fixed; left: 50%; bottom: 22px; translate: -50% 0; z-index: 9; padding: 10px 16px; border-radius: 10px; background: #248046; color: #fff; font-weight: 700; opacity: 0; transition: opacity 180ms; pointer-events: none; }
.saved-msg.show { opacity: 1; }

@media (max-width: 1180px) {
  .app { grid-template-columns: 76px 240px minmax(0, 1fr); }
  .preview { display: none; }
  .work .inline-preview { display: block; }
}
.inline-preview { display: none; margin-bottom: 18px; }
.inline-preview .channel { border-radius: 14px; }
.inline-preview .feed { height: auto; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr 1fr; }
  .b, .b.w3, .b.w4 { grid-column: span 2; }
  .stripe ul { flex-wrap: wrap; }
  .stripe li { flex: 1 1 50%; }
  .stripe li:nth-child(3) { border-left: 0; }
  .stripe li:nth-child(n+3) { border-top: 2px solid var(--ink); }
  .final { grid-template-columns: 1fr; }
  .nav .links { display: none; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .rail { display: none; }
  .cols { position: fixed; inset: 0 auto 0 0; width: 290px; z-index: 20; transform: translateX(-100%); transition: transform 220ms cubic-bezier(.25, 1, .5, 1); }
  .app.open .cols { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .4); }
  .menu-m { display: inline-flex; }
  .work { overflow: visible; }
  .work-head { padding: 0 14px; }
  .work-body { padding: 20px 14px 120px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis .kpi:last-child { grid-column: span 2; }
  .btn-item { grid-template-columns: 1fr 36px; }
  .btn-item select { display: none; }
  .save { margin: 0 14px 14px; position: fixed; left: 0; right: 0; bottom: 0; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .nav .end .btn:not(.btn-ember) { display: none; }
  .nav .end .seg { display: none; }
  .nav .logo span { display: none; }
  .hero p { font-size: 18px; }
  .hero .cta .btn { width: 100%; }
  .feed { height: 380px; }
  .section { padding: 70px 0; }
  .final { padding: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .m.in { animation: none; }
  .btn:hover { transform: none; }
  .rail a, .tg i::after, .cols, .save { transition: none; }
}
