/* The next dashboard, version 2: glass over the client's photograph, one page, a floor plan.
   Decisions and the rules the user overrode: dashboard/next/DECISIONS.md. */

@font-face { font-family: "Fraunces"; src: url("fonts/fraunces-latin-opsz-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Karla"; src: url("fonts/karla-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  /* ink on glass */
  --ink: #f6f1e7;
  --ink-2: rgb(246 241 231 / 0.78);
  --ink-3: rgb(246 241 231 / 0.62);
  --navy: #162540;
  --cream: #f4f0e8;
  /* glass */
  --window: rgb(26 30 40 / 0.42);
  --pane: rgb(255 255 255 / 0.075);
  --pane-hi: rgb(255 255 255 / 0.13);
  --pane-press: rgb(255 255 255 / 0.18);
  --edge: rgb(255 255 255 / 0.16);
  --edge-hi: rgb(255 255 255 / 0.32);
  --blur: blur(30px) saturate(150%);
  --lift: 0 24px 60px rgb(0 0 0 / 0.28);
  --sheen: inset 0 1px 0 rgb(255 255 255 / 0.16);
  /* departments, from Peregrine Office (--pp-dept-*) */
  --dept-finance: #d9bd82;
  --dept-marketing: #a3b8d2;
  --dept-suppliers: #9fb090;
  --dept-roster: #d0a8a1;
  --dept-admin: #94c0b6;
  --dept-owner: #f4f0e8;
  --ok: #a9d18e;
  --warn: #f0b47a;
  --bad: #f19a8c;
  /* type */
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Karla", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --t12: 12px; --t14: 14px; --t16: 16px; --t20: 20px; --t25: 25px; --t31: 31px; --t39: 39px;
  /* space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* shape */
  --r-window: 28px;
  --r-card: 20px;
  --r-inner: 12px;
  --r-control: 12px;
  --r-pill: 999px;
  --h-control: 44px;
  /* motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-hover: ease;
}

*, *::before, *::after { box-sizing: border-box; }
*, *::before, *::after { font-variant-numeric: tabular-nums !important; }
html { height: 100%; scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100%; color: var(--ink); font: 400 var(--t16)/1.55 var(--sans); -webkit-font-smoothing: antialiased; background: #1c1f26; overflow: hidden; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--ink); text-wrap: balance; }
p { text-wrap: pretty; }
button, input { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; transition: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.label { font: 500 var(--t12)/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-2); font-size: var(--t14); line-height: 1.5; }

/* ------------------------------- backdrop ------------------------------- */

.backdrop { position: fixed; inset: 0; z-index: 0; background: #1c1f26 center / cover no-repeat; }
.backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(14 17 24 / 0.42), rgb(14 17 24 / 0.62)); }
.backdrop svg { width: 100%; height: 100%; }
.backdrop--art::after { background: rgb(14 17 24 / 0.12); }

/* ------------------------------ glass bits ------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--h-control); padding: 0 var(--s4); border-radius: var(--r-pill);
  border: 1px solid transparent; background: var(--cream); color: var(--navy);
  font: 500 var(--t14)/1 var(--sans); letter-spacing: 0.01em; text-decoration: none; white-space: nowrap;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms var(--ease-hover), border-color 150ms var(--ease-hover), transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn--glass { background: var(--pane-hi); color: var(--ink); border-color: var(--edge); }
.btn[aria-disabled="true"] { background: transparent; color: var(--ink-3); border: 1px dashed var(--edge-hi); cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: #fff; }
  .btn--glass:hover { background: var(--pane-press); border-color: var(--edge-hi); }
  .btn[aria-disabled="true"]:hover { background: transparent; }
}
.round { width: var(--h-control); height: var(--h-control); border-radius: 50%; display: grid; place-items: center; position: relative; background: var(--pane-hi); border: 1px solid var(--edge); color: var(--ink); cursor: pointer; padding: 0; transition: background-color 150ms var(--ease-hover), transform 120ms var(--ease-out); }
.round:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .round:hover { background: var(--pane-press); } }
.badge { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--warn); color: var(--navy); font: 500 12px/18px var(--mono); text-align: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--pane-hi); border: 1px solid var(--edge); color: var(--ink-2); font: 500 var(--t12)/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.chip--live { color: var(--ok); border-color: rgb(169 209 142 / 0.4); }
.chip--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip--example { border-style: dashed; }
.chip--wait { color: var(--warn); border-color: rgb(240 180 122 / 0.45); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); font: 500 var(--t12)/1.5 var(--mono); }
.pill--up { background: rgb(169 209 142 / 0.16); color: var(--ok); }
.pill--down { background: rgb(241 154 140 / 0.16); color: var(--bad); }
.pill--flat { background: var(--pane-hi); color: var(--ink-2); }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 600 var(--t16)/1 var(--serif); color: var(--navy); box-shadow: 0 0 0 2px rgb(255 255 255 / 0.25); }
.input { min-height: 52px; width: 100%; padding: 0 var(--s4); border-radius: var(--r-control); background: rgb(255 255 255 / 0.08); border: 1px solid var(--edge-hi); color: var(--ink); font-size: var(--t16); transition: border-color 150ms var(--ease-hover), background-color 150ms var(--ease-hover); }
.input::placeholder { color: var(--ink-3); }
.input:focus-visible { outline: 2px solid var(--cream); outline-offset: 1px; background: rgb(255 255 255 / 0.12); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.error { color: var(--bad); font-size: var(--t14); line-height: 1.5; display: flex; gap: 6px; }
.error::before { content: "!"; flex: none; width: 18px; height: 18px; margin-top: 1px; border: 1px solid currentColor; border-radius: 50%; font: 500 var(--t12)/16px var(--mono); text-align: center; }

/* ================================== INTRO ================================== */

.intro { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--cream); padding: 16px; cursor: pointer; }
.intro__frame { position: relative; height: min(86svh, 150vw); aspect-ratio: 2 / 3; max-width: 100%; }
.intro__poster { width: 100%; height: 100%; border-radius: 14px; overflow: hidden; border: 1px solid #e2d9c8; }
.intro__poster svg { width: 100%; height: 100%; }
.intro__status { position: absolute; left: 0; right: 0; top: calc(100% + 12px); text-align: center; color: #6b675b; }
.intro.is-leaving { pointer-events: none; }
@media (max-width: 599px) { .intro__frame { height: auto; width: 100%; } }
.falcon { position: fixed; left: 0; top: 0; width: 120px; z-index: 60; pointer-events: none; opacity: 0; }
.falcon svg { width: 100%; height: auto; overflow: visible; }
.falcon__wings { transform-box: view-box; transform-origin: 100px 48px; }

/* ================================= SIGN IN ================================= */

.signin { position: fixed; inset: 0; z-index: 2; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.vcard {
  position: relative; width: min(100%, 440px); padding: var(--s6) var(--s6) var(--s5);
  border-radius: var(--r-window); background: rgb(20 23 31 / 0.55); border: 1px solid var(--edge);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--lift), var(--sheen);
  display: grid; gap: var(--s5); transition: box-shadow 400ms var(--ease-out), border-color 400ms var(--ease-out), transform 300ms var(--ease-out), opacity 300ms var(--ease-out);
}
.vcard::before { content: ""; position: absolute; top: 10px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgb(255 255 255 / 0.22); }
.vcard__brand { font: 500 var(--t20)/0.95 var(--serif); color: var(--ink); text-align: center; letter-spacing: -0.01em; }
.vcard__step { display: grid; gap: var(--s5); transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
.vcard__step.is-entering { opacity: 0; transform: scale(0.97); }
.vcard h1 { font-size: var(--t31); line-height: 1.15; text-align: center; }
.vcard .sub { color: var(--ink-2); text-align: center; font-size: var(--t16); max-width: 34ch; margin: var(--s2) auto 0; }
.vcard form { display: grid; gap: var(--s4); }
.vcard .btn { min-height: 52px; width: 100%; font-size: var(--t16); }
.field { display: grid; gap: var(--s2); }
.field label { font: 500 var(--t12)/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.vcard__foot { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: var(--s2); color: var(--ink-2); font-size: var(--t16); }
.textbtn { background: none; border: 0; padding: 0 4px; min-height: var(--h-control); color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--edge-hi); }

.code { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2); }
.code__box { height: 60px; border-radius: var(--r-control); display: grid; place-items: center; background: rgb(255 255 255 / 0.06); border: 1px solid var(--edge-hi); font: 600 var(--t25)/1 var(--sans); color: var(--ink); transition: border-color 150ms var(--ease-hover), box-shadow 150ms var(--ease-hover), background-color 150ms var(--ease-hover); }
.code__box.is-filled { background: rgb(255 255 255 / 0.1); }
.code__box.is-current { border-color: var(--warn); box-shadow: 0 0 0 3px rgb(240 180 122 / 0.22); }
.code__box.is-current:empty::after { content: ""; width: 2px; height: 24px; background: var(--ink); animation: caret 1s steps(1) infinite; }
.code__box.pop { animation: pop 180ms var(--ease-out); }
.code[aria-invalid="true"] .code__box { border-color: var(--bad); }
.code__input { position: absolute; inset: 0; width: 100%; opacity: 0; border: 0; font-size: 16px; color: transparent; caret-color: transparent; background: transparent; }
.code__input:focus-visible { outline: none; }
@keyframes caret { 50% { opacity: 0; } }
@keyframes pop { from { transform: scale(0.94); } to { transform: scale(1); } }
.vcard.is-verified { border-color: rgb(169 209 142 / 0.55); box-shadow: var(--lift), var(--sheen), 0 0 80px rgb(120 200 110 / 0.28), inset 0 0 60px rgb(120 200 110 / 0.12); }
.vcard.is-verified .code__box { border-color: rgb(169 209 142 / 0.7); }
.verified { display: grid; justify-items: center; gap: var(--s3); text-align: center; }
.verified__tick { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; border: 2px solid var(--ok); color: var(--ok); background: rgb(169 209 142 / 0.1); }
.verified__tick path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 360ms 120ms var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ================================== APP ================================== */

.window {
  position: fixed; inset: 20px; z-index: 2; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: var(--s4); padding: var(--s4);
  border-radius: var(--r-window); background: var(--window); border: 1px solid var(--edge);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--lift), var(--sheen);
  transition: opacity 400ms var(--ease-out), transform 500ms var(--ease-out);
}
.window.is-entering { opacity: 0; transform: scale(0.97); }

/* rail */
.rail { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s3) 0; border-radius: var(--r-card); background: var(--pane); border: 1px solid var(--edge); box-shadow: var(--sheen); }
.rail__mark { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: var(--s3); font: 600 var(--t20)/1 var(--serif); color: var(--navy); background: var(--cream); border-radius: 14px; text-decoration: none; }
.rail__spacer { flex: 1; }
.rail__btn { position: relative; z-index: 1; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: none; border: 0; color: var(--ink-2); cursor: pointer; text-decoration: none; transition: color 150ms var(--ease-hover), background-color 150ms var(--ease-hover); }
.rail__btn[aria-current="page"] { color: var(--ink); }
.rail__btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px rgb(26 30 40 / 0.8); }
@media (hover: hover) and (pointer: fine) { .rail__btn:hover { color: var(--ink); background: rgb(255 255 255 / 0.06); } }
.rail__btn:active { background: var(--pane-press); }
.rail__glow { position: absolute; left: 50%; top: 0; width: 48px; height: 48px; margin-left: -24px; border-radius: 14px; background: var(--pane-hi); border: 1px solid var(--edge); box-shadow: var(--sheen); transition: transform 280ms var(--ease-in-out); pointer-events: none; }
.tip { position: absolute; left: calc(100% + 10px); top: 50%; translate: 0 -50%; padding: 4px 10px; border-radius: 8px; background: rgb(20 23 31 / 0.85); border: 1px solid var(--edge); color: var(--ink); font: 500 var(--t12)/1.5 var(--sans); white-space: nowrap; pointer-events: none; opacity: 0; transform: translateX(-4px); transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out); z-index: 5; }
@media (hover: hover) and (pointer: fine) { .rail__btn:hover .tip { opacity: 1; transform: none; } }
.rail__btn:focus-visible .tip { opacity: 1; transform: none; }

/* main */
.main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--s4); }
.top { display: flex; align-items: center; gap: var(--s4); min-height: 56px; padding: 0 var(--s2); }
.top__title { min-width: 0; }
.top__title h1 { font-size: var(--t31); line-height: 1.1; }
.top__title p { color: var(--ink-2); font-size: var(--t14); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__spacer { flex: 1; }
.top__actions { display: flex; gap: var(--s2); align-items: center; }
.top__sep { width: 1px; height: 28px; background: var(--edge); margin: 0 var(--s1); }
.me { width: var(--h-control); height: var(--h-control); border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--cream); color: var(--navy); font: 600 var(--t16)/1 var(--serif); position: relative; }
.me::after { content: ""; position: absolute; right: 1px; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px rgb(26 30 40 / 0.9); }
.menu { position: fixed; top: 92px; right: 44px; z-index: 20; min-width: 240px; padding: var(--s2); border-radius: 16px; background: rgb(24 27 36 / 0.82); border: 1px solid var(--edge); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--lift); display: grid; gap: 2px; transform-origin: top right; transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 0s; }
.menu.is-closed { opacity: 0; transform: scale(0.96) translateY(-6px); pointer-events: none; visibility: hidden; transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out), visibility 0s 150ms; }
.menu__who { padding: var(--s3); border-bottom: 1px solid var(--edge); margin-bottom: var(--s1); }
.menu__who strong { display: block; font-weight: 500; }
.menu a, .menu button { display: flex; align-items: center; gap: var(--s3); min-height: var(--h-control); padding: 0 var(--s3); border-radius: 10px; border: 0; background: none; color: var(--ink); text-decoration: none; cursor: pointer; text-align: left; font-size: var(--t16); }
@media (hover: hover) and (pointer: fine) { .menu a:hover, .menu button:hover { background: var(--pane-hi); } }

/* views */
.view { position: relative; min-height: 0; min-width: 0; height: 100%; }
.enter { animation: rise 420ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card { position: relative; overflow: hidden; min-width: 0; min-height: 0; padding: var(--s5); border-radius: var(--r-card); background: var(--pane); border: 1px solid var(--edge); box-shadow: var(--sheen); transition: transform 200ms var(--ease-out), background-color 200ms var(--ease-hover), border-color 200ms var(--ease-hover); }
.card--lift { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .card--lift:hover { transform: translateY(-3px); background: var(--pane-hi); border-color: var(--edge-hi); } }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.card__head h2 { font-size: var(--t20); line-height: 1.25; }
.glow { position: absolute; width: 180px; height: 180px; right: -60px; top: -70px; border-radius: 50%; background: radial-gradient(closest-side, var(--g, rgb(163 184 210 / 0.55)), transparent); pointer-events: none; }
.scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 0.2) transparent; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.kpi { display: grid; grid-template-rows: auto auto auto; gap: var(--s2); padding: var(--s4) var(--s5); }
.kpi__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--pane-hi); border: 1px solid var(--edge); color: var(--ink); }
.kpi__row { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.kpi__figure { font: 500 var(--t31)/1.05 var(--serif); color: var(--ink); white-space: nowrap; }
.kpi__figure--text { font-size: var(--t20); line-height: 1.3; white-space: normal; }
.kpi__note { color: var(--ink-2); font-size: var(--t14); line-height: 1.4; }

/* overview */
.overview { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--s4); height: 100%; }
.overview__main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s4); min-height: 0; }
.plan-card { display: grid; grid-template-rows: auto minmax(0, 1fr); padding: var(--s4) var(--s5) var(--s4); }
.plan-card .card__head { margin-bottom: var(--s2); }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; color: var(--ink-2); font-size: var(--t14); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; }
.plan { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; border-radius: var(--r-inner); }
.plan > svg { width: 100%; height: 100%; max-height: 100%; transition: transform 300ms var(--ease-in-out), opacity 300ms var(--ease-out); }
.room { cursor: pointer; }
.room:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.room .floor { transition: fill-opacity 150ms var(--ease-hover); }
.room .walls { transition: stroke-opacity 150ms var(--ease-hover); }
@media (hover: hover) and (pointer: fine) { .room:hover .floor { fill-opacity: 0.3; } .room:hover .walls { stroke-opacity: 1; } }
.room .focus { fill: none; stroke: transparent; }
.room:focus-visible .focus { stroke: var(--cream); stroke-width: 3; }
.room--locked .walls { stroke-dasharray: 8 7; }
.room .wait-ring { transform-box: fill-box; transform-origin: center; animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.25; transform: scale(1); } 50% { opacity: 0.7; transform: scale(1.18); } }
.plan text { font-family: var(--sans); fill: var(--ink); }
.plan .t-room { font: 500 12px var(--mono); letter-spacing: 0.12em; fill: var(--ink-3); text-transform: uppercase; }
.plan .t-name { font: 500 25px var(--serif); }
.plan .t-status { font: 400 16px var(--sans); fill: var(--ink-2); }

.needs { display: grid; grid-template-rows: auto minmax(0, 1fr); padding: var(--s4) var(--s3) var(--s3) var(--s5); }
.needs .card__head { padding-right: var(--s2); }
.needs__list { list-style: none; margin: 0; padding: 0 var(--s2) 88px 0; display: grid; gap: var(--s2); align-content: start; }
.need { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--s3); padding: var(--s3); border-radius: var(--r-inner); background: rgb(255 255 255 / 0.05); border: 1px solid rgb(255 255 255 / 0.08); }
.need p { font-size: var(--t16); line-height: 1.4; }
.need .muted { margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.need .btn { margin-top: var(--s3); }
.empty { display: grid; place-items: center; align-content: center; text-align: center; gap: var(--s2); color: var(--ink-2); padding: var(--s6) var(--s4); }

/* takings */
.takings { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--s4); height: 100%; }
.takings__main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s4); min-height: 0; }
.takings__side { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); min-height: 0; }
.chart-card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.chart { position: relative; min-height: 0; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .tick { font: 400 var(--t12) var(--mono); fill: var(--ink-3); }
.chart .grid { stroke: rgb(255 255 255 / 0.1); }
.chart .bar-today { fill: var(--dept-finance); }
.chart .bar-before { fill: rgb(255 255 255 / 0.3); }
.chart .hl { fill: rgb(255 255 255 / 0.06); opacity: 0; }
.chart .hl.is-on { opacity: 1; }
.chart .hit { fill: transparent; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; padding: var(--s2) var(--s3); border-radius: 10px; background: rgb(20 23 31 / 0.9); border: 1px solid var(--edge); font-size: var(--t14); line-height: 1.4; white-space: nowrap; }
.key { display: flex; gap: var(--s4); flex-wrap: wrap; align-items: center; color: var(--ink-2); font-size: var(--t14); margin-top: var(--s3); }
.key span { display: inline-flex; gap: 6px; align-items: center; }
.key i { width: 10px; height: 10px; border-radius: 3px; }
.key .btn { margin-left: auto; min-height: 36px; position: relative; }
.key .btn::after { content: ""; position: absolute; inset: -4px 0; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s2); align-items: end; height: calc(100% - 44px); min-height: 80px; }
.week div { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 6px; }
.week b { align-self: end; width: 100%; max-width: 30px; border-radius: 8px 8px 3px 3px; background: rgb(255 255 255 / 0.3); }
.week div:last-child b { background: var(--dept-finance); }
.week span { font: 400 var(--t12) var(--mono); color: var(--ink-3); }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); padding: 10px 0; border-top: 1px solid rgb(255 255 255 / 0.08); align-items: baseline; }
.list li:first-child { border-top: 0; }
.list .v { color: var(--ink); white-space: nowrap; }
.list .s { display: block; color: var(--ink-3); font-size: var(--t14); }
.tablewrap table { width: 100%; border-collapse: collapse; font-size: var(--t14); }
.tablewrap th, .tablewrap td { padding: 6px 0; text-align: right; border-bottom: 1px solid rgb(255 255 255 / 0.08); }
.tablewrap th:first-child, .tablewrap td:first-child { text-align: left; }
.tablewrap th { color: var(--ink-3); font-weight: 500; }

/* desks */
.desk { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: var(--s4); height: 100%; }
.hero { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s5); align-items: center; padding: var(--s5) var(--s6); }
.hero .avatar { width: 72px; height: 72px; font-size: var(--t31); box-shadow: 0 0 0 3px rgb(255 255 255 / 0.25), 0 0 40px var(--g, transparent); }
.hero h2 { font-size: var(--t39); line-height: 1.05; }
.hero p { color: var(--ink-2); max-width: 60ch; margin-top: var(--s2); }
.hero .meta { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); align-items: center; }
.hero__actions { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.timeline { list-style: none; margin: 0; padding: 0 var(--s2) 0 0; display: grid; align-content: start; }
.timeline li { display: grid; grid-template-columns: 52px 14px minmax(0, 1fr) auto; gap: var(--s3); align-items: start; padding: 10px 0; }
.timeline time { font: 400 var(--t14)/1.5 var(--mono); color: var(--ink-3); }
.timeline .node { width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: var(--g, var(--ink-3)); position: relative; }
.timeline li:not(:last-child) .node::after { content: ""; position: absolute; left: 5px; top: 16px; width: 2px; height: 30px; background: rgb(255 255 255 / 0.12); }
.timeline .node--wait { background: transparent; border: 2px dashed var(--warn); }
.timeline .state { font: 500 var(--t12)/1.9 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.timeline .state--wait { color: var(--warn); }
.locked { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; }
.locked__card { width: min(680px, 100%); display: grid; gap: var(--s4); justify-items: start; padding: var(--s6); }
.locked__lock { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; border: 1px dashed var(--edge-hi); color: var(--ink-2); }
.locked__card h2 { font-size: var(--t39); line-height: 1.05; }
.locked__card p { color: var(--ink-2); max-width: 56ch; }
.gauge { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s5); align-items: center; }
.gauge svg { width: 132px; height: 132px; }
.gauge .ring { stroke: rgb(255 255 255 / 0.1); }
.gauge .fill { stroke: var(--dept-marketing); }
.gauge text { font: 500 28px var(--serif); fill: var(--ink); }
.gauge text.small { font: 500 11px var(--mono); fill: var(--ink-3); letter-spacing: 0.1em; }

/* The card in the bottom-right corner leaves Peri a place to stand. */
.desk__col > .card:last-child, .takings__side > .card:last-child, .desk > .card:last-child, .team > .card:last-child { padding-bottom: 84px; }
@media (max-width: 899px) { .desk__col > .card:last-child, .takings__side > .card:last-child, .desk > .card:last-child, .team > .card:last-child { padding-bottom: var(--s5); } }

/* the live website, scaled down */
.site-card { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.desk__col { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--s4); min-height: 0; }
.site { position: relative; display: block; min-height: 0; border-radius: var(--r-inner); overflow: hidden; border: 1px solid var(--edge); background: #fff; }
.site iframe { position: absolute; top: 0; left: 0; width: 250%; height: 250%; border: 0; transform: scale(0.4); transform-origin: 0 0; pointer-events: none; }
.site__veil { position: absolute; inset: 0; transition: background-color 150ms var(--ease-hover); }
@media (hover: hover) and (pointer: fine) { .site:hover .site__veil { background: rgb(255 255 255 / 0.06); } }

/* team */
.team { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); height: 100%; align-content: start; }
.people li { grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; }

/* Peri */
.peri-dock { position: fixed; right: 40px; bottom: 36px; z-index: 30; width: 84px; }
.peri-dock peri-mascot { display: block; --peri-size: 84px; --peri-font: var(--sans); }
.peri-dock peri-mascot::part(bubble) { min-width: 0; width: max-content; max-width: min(260px, calc(100vw - 120px)); background: rgb(24 27 36 / 0.88); color: var(--ink); border: 1px solid var(--edge); box-shadow: var(--lift); font: 400 var(--t14)/1.45 var(--sans); }
.chat { position: fixed; right: 40px; bottom: 140px; z-index: 31; width: min(400px, calc(100vw - 32px)); height: min(540px, calc(100svh - 200px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-radius: var(--r-card); background: rgb(22 25 33 / 0.74); border: 1px solid var(--edge); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--lift), var(--sheen); transform-origin: 100% 100%; transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s; }
.chat.is-closed { opacity: 0; transform: scale(0.96); pointer-events: none; visibility: hidden; transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out), visibility 0s 150ms; }
.chat__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s3) var(--s3) var(--s5); border-bottom: 1px solid var(--edge); }
.chat__head h2 { font-size: var(--t20); }
.chat__log { padding: var(--s4); display: grid; gap: var(--s3); align-content: start; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: var(--t16); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg--peri { justify-self: start; background: rgb(255 255 255 / 0.09); border: 1px solid rgb(255 255 255 / 0.08); border-bottom-left-radius: 4px; }
.msg--me { justify-self: end; background: var(--cream); color: var(--navy); border-bottom-right-radius: 4px; }
.msg .btn { margin-top: var(--s2); }
.chat__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); padding: var(--s3); border-top: 1px solid var(--edge); }
.chat__form .input { min-height: var(--h-control); border-radius: var(--r-pill); }
.thinking { display: inline-flex; gap: 4px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); animation: blink 1s linear infinite; }
.thinking i:nth-child(2) { animation-delay: 0.15s; }
.thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------------------------- Peri, full screen ---------------------------- */

.takeover {
  position: fixed; inset: 20px; z-index: 40; overflow: hidden;
  display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: var(--s5) var(--s6);
  padding: var(--s7) var(--s7) var(--s6);
  border-radius: var(--r-window); background: rgb(16 19 27 / 0.62); border: 1px solid var(--edge-hi);
  backdrop-filter: blur(44px) saturate(160%); -webkit-backdrop-filter: blur(44px) saturate(160%); box-shadow: var(--lift), var(--sheen);
  transform-origin: calc(100% - 60px) calc(100% - 60px);
  transition: opacity 280ms var(--ease-out), transform 320ms var(--ease-out), visibility 0s;
}
.takeover.is-closed { opacity: 0; transform: scale(0.92); visibility: hidden; pointer-events: none; transition: opacity 180ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s 200ms; }
.takeover::before { content: ""; position: absolute; width: 520px; height: 520px; left: -160px; top: -200px; border-radius: 50%; background: radial-gradient(closest-side, rgb(163 184 210 / 0.35), transparent); pointer-events: none; }
.takeover__close { position: absolute; top: var(--s5); right: var(--s5); z-index: 2; }
.takeover__peri { position: relative; display: grid; align-content: center; gap: var(--s5); grid-row: 1 / -1; }
.takeover__peri peri-mascot { display: block; --peri-size: 190px; --peri-font: var(--sans); }
.takeover__peri peri-mascot::part(bubble) { min-width: 0; width: max-content; max-width: 220px; background: rgb(24 27 36 / 0.92); color: var(--ink); border: 1px solid var(--edge); box-shadow: var(--lift); font: 400 var(--t16)/1.45 var(--sans); }
.takeover__peri h2 { font-size: var(--t39); line-height: 1.08; margin-top: var(--s2); }
.takeover__peri .muted { font-size: var(--t16); margin-top: var(--s3); max-width: 34ch; }
.tools { list-style: none; margin: 0; padding: var(--s2) var(--s2) 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: 1fr; gap: var(--s4); align-content: center; min-height: 0; overflow-y: auto; }
.tools li { display: grid; }
@media (min-width: 1200px) { .tools { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tools li:first-child { grid-row: span 2; } }
@media (min-width: 900px) and (max-width: 1199px) { .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tools li:first-child { grid-column: 1 / -1; } .tools li:first-child .tool__preview { display: none; } }
.tool__preview { position: relative; width: 100%; min-height: 0; height: 100%; margin-top: var(--s2); border-radius: var(--r-inner); overflow: hidden; border: 1px solid var(--edge); background: #fff; align-self: stretch; }
.tool__preview iframe { position: absolute; top: 0; left: 0; width: 333%; height: 333%; border: 0; transform: scale(0.3); transform-origin: 0 0; pointer-events: none; }
@media (min-width: 1200px) { .tools li:first-child .tool { grid-template-rows: auto auto auto minmax(80px, 1fr) auto; } }
.tool {
  position: relative; overflow: hidden; display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--s2); justify-items: start; text-align: left;
  min-height: 176px; padding: var(--s5); border-radius: var(--r-card); cursor: pointer; color: var(--ink);
  background: var(--pane); border: 1px solid var(--edge); box-shadow: var(--sheen);
  transition: transform 200ms var(--ease-out), background-color 200ms var(--ease-hover), border-color 200ms var(--ease-hover);
}
.tool:active { transform: scale(0.98); }
.tool[aria-pressed="true"] { background: var(--pane-press); border-color: var(--cream); }
@media (hover: hover) and (pointer: fine) { .tool:hover { transform: translateY(-3px); background: var(--pane-hi); border-color: var(--edge-hi); } }
.tool__icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--g) 30%, transparent); border: 1px solid color-mix(in srgb, var(--g) 55%, transparent); color: var(--ink); margin-bottom: var(--s2); }
.tool__name { font: 500 var(--t20)/1.25 var(--serif); }
.tool__line { color: var(--ink-2); font-size: var(--t14); line-height: 1.45; }
.tool__chip { margin-top: var(--s2); }
.tool--peri { border-color: rgb(169 209 142 / 0.45); background: rgb(169 209 142 / 0.09); }
.tool--locked { border-style: dashed; background: transparent; }
.tool--locked .tool__name, .tool--locked .tool__line { color: var(--ink-3); }
.takeover__ask { grid-column: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); }
.takeover__ask .input { min-height: 52px; border-radius: var(--r-pill); padding: 0 var(--s5); }
.takeover__ask .btn { min-height: 52px; padding: 0 var(--s5); }
.peri-dock { transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
.peri-dock.is-away { opacity: 0; transform: scale(0.8); pointer-events: none; }

@media (max-height: 820px) and (min-width: 900px) {
  .takeover { inset: 12px; padding: var(--s6) var(--s6) var(--s5); }
  .tool { min-height: 150px; padding: var(--s4); }
  .takeover__peri peri-mascot { --peri-size: 150px; }
  .takeover__peri h2 { font-size: var(--t31); }
}
@media (max-width: 899px) {
  .takeover { inset: 0; border-radius: 0; border: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; padding: max(var(--s6), env(safe-area-inset-top)) var(--s4) max(var(--s4), env(safe-area-inset-bottom)); gap: var(--s4); }
  .takeover__peri { grid-row: auto; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: var(--s4); padding-right: 48px; }
  .takeover__peri peri-mascot { --peri-size: 88px; }
  .takeover__peri h2 { font-size: var(--t25); }
  .takeover__peri .muted { display: none; }
  .tools { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; align-content: start; padding: 0; }
  .tool { min-height: 0; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: var(--s3); padding: var(--s4); }
  .tool__icon { grid-row: 1 / span 3; margin: 0; }
  .tool__preview { display: none; }
  .takeover__ask { grid-column: 1; }
}

/* --------------------------- smaller screens --------------------------- */

/* Shorter laptop screens: tighter, still one page. */
@media (max-height: 820px) and (min-width: 900px) {
  .window { inset: 12px; padding: var(--s3); gap: var(--s3); }
  .main, .overview, .takings, .desk, .overview__main, .takings__main, .takings__side, .kpis { gap: var(--s3); }
  .kpi { padding: var(--s3) var(--s4); gap: 6px; }
  .kpi__icon { display: none; }
  .kpi__figure { font-size: var(--t25); }
  .top { min-height: 48px; }
  .top__title h1 { font-size: var(--t25); }
  .card { padding: var(--s4); }
  .hero { padding: var(--s4) var(--s5); }
  .hero .avatar { width: 56px; height: 56px; font-size: var(--t25); }
  .hero h2 { font-size: var(--t31); }
  .peri-dock { right: 28px; bottom: 24px; width: 72px; }
  .peri-dock peri-mascot { --peri-size: 72px; }
  .menu { top: 76px; right: 28px; }
}

/* Tablets and phones: the rail becomes a bar along the bottom and the view scrolls inside the window. */
@media (max-width: 899px) {
  .window { inset: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; padding: max(var(--s3), env(safe-area-inset-top)) var(--s3) 0; border: 0; gap: var(--s3); }
  .rail { order: 2; flex-direction: row; justify-content: space-around; padding: var(--s2) var(--s2) max(var(--s2), env(safe-area-inset-bottom)); border-radius: var(--r-card) var(--r-card) 0 0; margin: 0 calc(-1 * var(--s3)); }
  .rail__mark, .rail__spacer, .rail__out { display: none; }
  .rail__glow { top: 0; left: 0; margin-left: 0; }
  .tip { display: none; }
  .view { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 96px; }
  .overview, .takings, .desk, .team { height: auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
  .overview__main, .takings__main, .desk, .team { grid-template-columns: minmax(0, 1fr); }
  .site { height: 360px; }
  .takings__side { grid-template-rows: auto auto; }
  .plan { aspect-ratio: 1000 / 560; }
}
@media (max-width: 599px) {
  .plan { aspect-ratio: 608 / 956; }
  .chart { height: 220px; }
  .week { height: 140px; }
  .hero { grid-template-columns: auto minmax(0, 1fr); }
  .hero__actions { grid-column: 1 / -1; justify-content: stretch; }
  .hero__actions .btn { flex: 1 1 160px; }
  .top__title h1 { font-size: var(--t25); }
  .top__title p { display: none; }
  .top__sep, .top__ask { display: none; }
  .peri-dock { right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 60px; }
  .peri-dock peri-mascot { --peri-size: 60px; }
  .chat { right: 12px; bottom: calc(150px + env(safe-area-inset-bottom)); }
  .menu { right: 12px; top: 64px; }
}
@media (max-width: 599px) {
  .card { padding: var(--s4); }
  .hero { padding: var(--s4); gap: var(--s4); }
  .hero h2 { font-size: var(--t31); }
  .hero .avatar { width: 56px; height: 56px; }
  .kpi__figure { font-size: var(--t25); }
  .need { grid-template-columns: minmax(0, 1fr); }
  .need .avatar { display: none; }
  .vcard { padding: var(--s6) var(--s4) var(--s4); }
}

/* ------------------------------ reduced motion ----------------------------- */

@media (prefers-reduced-motion: reduce) {
  .enter { animation: fade 180ms ease both; animation-delay: 0ms; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
  .btn:active, .round:active { transform: none; }
  .card--lift:hover { transform: none !important; }
  .plan > svg, .rail__glow { transition: none; }
  .room .wait-ring, .code__box.pop, .code__box.is-current:empty::after { animation: none; }
  .vcard__step.is-entering, .window.is-entering { transform: none; }
  .chat, .chat.is-closed, .menu, .menu.is-closed { transform: none; }
  .takeover, .takeover.is-closed, .peri-dock, .peri-dock.is-away, .tool:hover, .tool:active { transform: none; }
  .verified__tick path { animation: none; stroke-dashoffset: 0; }
}

/* C1: round and rounded controls keep a square 44px+ hit area at their corners. */
.round::before, .me::before, .rail__btn::before, .rail__mark::before { content: ""; position: absolute; inset: -4px; }
.rail__mark { position: relative; }
