/* Arcwright: drafting-sheet system. One accent (redline orange) on warm off-black, bone type, hairline rules. */

@font-face { font-family: 'Big Shoulders Display'; src: url('/fonts/big-shoulders-display-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Big Shoulders Display'; src: url('/fonts/big-shoulders-display-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Big Shoulders Display'; src: url('/fonts/big-shoulders-display-latin-900-normal.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; src: url('/fonts/schibsted-grotesk-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; src: url('/fonts/schibsted-grotesk-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; src: url('/fonts/schibsted-grotesk-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; src: url('/fonts/schibsted-grotesk-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; src: url('/fonts/schibsted-grotesk-latin-700-normal.woff2') format('woff2'); font-weight: 700; 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-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; 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; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --ink: #14110d;
  --ink-2: #1b1812;
  --ink-3: #242018;
  --bone: #ece4d2;
  --bone-2: #bdb4a0;
  --bone-3: #948b78;
  --line: rgba(236, 228, 210, 0.16);
  --line-2: rgba(236, 228, 210, 0.34);
  --accent: #ff5b1f;
  --accent-dim: rgba(255, 91, 31, 0.14);
  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --sans: 'Schibsted Grotesk', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --head-h: 64px;
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--bone);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
main { flex: 1 0 auto; outline: none; }
img, svg { display: block; max-width: 100%; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--accent); }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--ink); padding: 10px 14px; font: 600 0.8rem var(--mono); text-transform: uppercase; }
.skip:focus { top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* drafting ruler on the left edge of the viewport */
@media (min-width: 1100px) {
  body::before {
    content: '';
    position: fixed; left: 0; top: 0; bottom: 0; width: 14px; z-index: 5; pointer-events: none;
    background:
      repeating-linear-gradient(to bottom, var(--line-2) 0 1px, transparent 1px 80px) left / 14px 100% no-repeat,
      repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 16px) left / 7px 100% no-repeat;
    border-right: 1px solid var(--line);
  }
}

/* ---------- type ---------- */
h1, h2, h3, h4 { margin: 0 0 0.5em; font-family: var(--display); font-weight: 800; text-transform: uppercase; line-height: 0.92; letter-spacing: 0.005em; }
h1 { font-size: clamp(3.4rem, 8.4vw, 8.2rem); font-weight: 900; }
h2 { font-size: clamp(2.4rem, 5.2vw, 4.6rem); }
h3 { font-size: clamp(1.6rem, 2.4vw, 2.2rem); line-height: 1; }
h4 { font-size: 1.25rem; }
.lead { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.55; color: var(--bone-2); max-width: 46ch; }
.mono, code, kbd, pre { font-family: var(--mono); }
.label { font: 500 0.72rem/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-3); }
.accent { color: var(--accent); }
kbd { font-size: 0.8em; padding: 0.1em 0.45em; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--ink-2); color: var(--bone); white-space: nowrap; }
code { font-size: 0.9em; color: var(--bone); background: var(--ink-3); padding: 0.1em 0.35em; }

.wrap { width: 100%; max-width: 1400px; margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(12px, 2vw, 28px); }

/* ---------- header ---------- */
.site-head { position: sticky; top: 0; z-index: 40; background: rgba(20, 17, 13, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 24px; height: var(--head-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand-word { font: 900 1.6rem/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.mark { color: var(--bone); flex: none; }
.mark-accent { stroke: var(--accent); }
.mark-accent-fill { fill: var(--accent); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { display: block; padding: 8px 12px; font: 500 0.78rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--bone-2); position: relative; }
.nav-links a:hover { color: var(--bone); }
.nav-links a[aria-current='page'] { color: var(--bone); }
.nav-links a[aria-current='page']::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-actions form { margin: 0; }
.nav-signin { font: 500 0.78rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--bone-2); }
.nav-signin:hover { color: var(--bone); }
.nav-who { font: 400 0.75rem var(--mono); color: var(--bone-3); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-btn { display: none; }

@media (max-width: 860px) {
  .nav-btn { display: inline-flex; align-items: center; gap: 10px; background: none; border: 1px solid var(--line-2); color: var(--bone); padding: 9px 12px; font: 500 0.75rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
  .nav-btn-bars, .nav-btn-bars::before { display: block; width: 16px; height: 2px; background: currentColor; position: relative; transition: transform 0.3s var(--ease); }
  .nav-btn-bars::before { content: ''; position: absolute; top: -5px; left: 0; }
  .nav-btn[aria-expanded='true'] .nav-btn-bars { transform: rotate(45deg); }
  .nav-btn[aria-expanded='true'] .nav-btn-bars::before { transform: translateY(5px) rotate(90deg); }
  .js .nav { position: fixed; inset: var(--head-h) 0 0 0; background: var(--ink); flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: 12px var(--gutter) 32px; overflow-y: auto; visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s 0.25s; }
  .js .nav.open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .nav-links { flex-direction: column; gap: 0; }
  .nav-links a { padding: 18px 0; font-size: 1.4rem; font-family: var(--display); font-weight: 800; letter-spacing: 0.03em; border-bottom: 1px solid var(--line); color: var(--bone); }
  .nav-links a[aria-current='page']::after { left: 0; right: auto; width: 32px; bottom: -1px; }
  .nav-actions { flex-wrap: wrap; padding-top: 24px; }
  .no-js .nav { flex-wrap: wrap; gap: 8px; }
  .no-js .head-row { height: auto; flex-wrap: wrap; padding-block: 10px; }
}

/* ---------- buttons ---------- */
.btn {
  --notch: 10px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 15px 22px; border: 1px solid var(--line-2); background: transparent; color: var(--bone);
  font: 600 0.8rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.35s var(--ease);
  will-change: transform;
}
.btn:hover { border-color: var(--bone); }
.btn .arr { display: inline-block; transition: transform 0.3s var(--ease); }
.btn:hover .arr { transform: translateX(2px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--ink); clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% 100%, 0 100%); }
.btn-primary:hover { background: var(--bone); border-color: var(--bone); }
.btn-ghost { border-color: transparent; padding-inline: 10px; color: var(--bone-2); }
.btn-ghost:hover { color: var(--bone); border-color: var(--line-2); }
.btn-sm { padding: 10px 14px; font-size: 0.72rem; --notch: 7px; }
.btn-danger { border-color: var(--accent); color: var(--accent); }
.btn-danger:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.4; pointer-events: none; }

/* ---------- section scaffolding ---------- */
.sec { padding-block: clamp(64px, 10vw, 140px); position: relative; }
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: clamp(32px, 5vw, 64px); font: 500 0.75rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-3); }
.sec-no { color: var(--accent); }
.sec-rule { flex: 1; height: 1px; background: var(--line); }
.crop { position: relative; }
.crop::before, .crop::after { content: ''; position: absolute; width: 14px; height: 14px; border: 0 solid var(--line-2); pointer-events: none; }
.crop::before { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.crop::after { right: -1px; bottom: -1px; border-right-width: 1px; border-bottom-width: 1px; }

/* ---------- notes ---------- */
.note { margin: 20px 0 0; padding: 12px 16px; border: 1px solid var(--line-2); border-left: 3px solid var(--bone); background: var(--ink-2); font-size: 0.95rem; }
.note-error { border-color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); }
.note-info { border-left-color: var(--bone); }

/* ---------- forms ---------- */
.field { display: grid; gap: 8px; margin-bottom: 22px; }
.field label, .field .label { font: 500 0.72rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-2); }
.field .hint { font-size: 0.85rem; color: var(--bone-3); }
input[type='text'], input[type='email'], input[type='password'], input[type='search'], input[type='number'], select, textarea {
  width: 100%; padding: 14px 14px; background: var(--ink-2); color: var(--bone); border: 1px solid var(--line-2); border-radius: 0;
  font: 400 1rem var(--sans); transition: border-color 0.2s, background 0.2s;
}
input.mono, textarea.mono { font-family: var(--mono); font-size: 0.95rem; }
input:hover, select:hover, textarea:hover { border-color: var(--bone-3); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); background: var(--ink-3); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--bone-2) 50%), linear-gradient(135deg, var(--bone-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; color: var(--bone-2); }
.check input { appearance: none; flex: none; width: 20px; height: 20px; margin: 2px 0 0; border: 1px solid var(--line-2); background: var(--ink-2); display: grid; place-content: center; cursor: pointer; }
.check input::after { content: ''; width: 10px; height: 10px; background: var(--accent); transform: scale(0); transition: transform 0.15s var(--ease); }
.check input:checked::after { transform: scale(1); }

/* ---------- account / form pages ---------- */
.auth { padding-block: clamp(40px, 7vw, 96px); align-items: start; row-gap: 40px; }
.auth-aside { grid-column: 1 / span 5; padding-top: 8px; }
.auth-aside h1 { font-size: clamp(3rem, 6vw, 5.6rem); }
.auth-aside .lead { margin-top: 20px; }
.auth-form { grid-column: 7 / span 6; padding: clamp(24px, 3.5vw, 48px); background: var(--ink-2); border: 1px solid var(--line); }
.auth-form h2 { font-size: 1.9rem; margin-bottom: 24px; }
.auth-form .btn { width: 100%; }
.alt { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.95rem; color: var(--bone-2); }
.spec-list { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--line); }
.spec-list li { display: grid; grid-template-columns: 9ch 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; color: var(--bone-2); }
.spec-list b { font: 500 0.72rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); padding-top: 3px; }
@media (max-width: 860px) {
  .auth-aside, .auth-form { grid-column: 1 / -1; }
}

.secret-box { display: block; margin: 12px 0 20px; padding: 14px; border: 1px dashed var(--line-2); font: 500 1.1rem var(--mono); letter-spacing: 0.12em; word-break: break-all; background: var(--ink); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; list-style: none; padding: 0; margin: 20px 0; }
.codes li { padding: 12px; border: 1px solid var(--line-2); font: 500 1rem var(--mono); letter-spacing: 0.08em; text-align: center; background: var(--ink); }

/* ---------- app pages: dashboard, devices ---------- */
.page-head { padding-block: clamp(36px, 6vw, 80px) clamp(24px, 3vw, 40px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.8rem, 6vw, 5.4rem); margin-bottom: 12px; }
.page-head .lead { margin: 0; }
.page-body { padding-block: clamp(28px, 4vw, 56px) clamp(56px, 8vw, 120px); }
.panel { background: var(--ink-2); border: 1px solid var(--line); padding: clamp(20px, 2.6vw, 36px); }
.panel > h2 { font-size: 1.7rem; margin-bottom: 18px; }
.panel .label { display: block; margin-bottom: 8px; }
.cols-7-5 > :first-child { grid-column: span 7; }
.cols-7-5 > :last-child { grid-column: span 5; }
.cols-5-7 > :first-child { grid-column: span 5; }
.cols-5-7 > :last-child { grid-column: span 7; }
.cols-7-5, .cols-5-7 { row-gap: 24px; align-items: start; }
@media (max-width: 960px) { .cols-7-5 > *, .cols-5-7 > * { grid-column: 1 / -1 !important; } }

.kv { margin: 0; border-top: 1px solid var(--line); }
.kv > div { display: grid; grid-template-columns: minmax(8ch, 14ch) 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.kv dt { font: 500 0.72rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-3); }
.kv dd { margin: 0; word-break: break-word; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--ink-3); border: 1px solid var(--line); margin-top: 8px; position: relative; overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.chip { display: inline-block; padding: 3px 8px; border: 1px solid var(--line-2); font: 500 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-2); }
.chip-accent { border-color: var(--accent); color: var(--accent); }
.chip-solid { background: var(--bone); color: var(--ink); border-color: var(--bone); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table.t { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 560px; }
.t th { text-align: left; padding: 12px 16px; font: 500 0.7rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-3); border-bottom: 1px solid var(--line-2); background: var(--ink-2); white-space: nowrap; }
.t td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: rgba(236, 228, 210, 0.03); }
.t .r { text-align: right; }
.empty { padding: 36px 20px; text-align: left; color: var(--bone-2); border: 1px dashed var(--line-2); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin-bottom: 32px; }
.stat { padding: 20px 22px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 800 3rem/1 var(--display); margin-top: 6px; }
@media (max-width: 760px) { .stat-row { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(2) { border-right: 0; } .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 20px; }
.toolbar .field { margin: 0; min-width: 160px; flex: 1; }
.toolbar .field:first-child { flex: 2; }
.inline-form { display: grid; gap: 12px; margin-top: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- legal ---------- */
.legal { padding-block: clamp(32px, 5vw, 72px) clamp(56px, 8vw, 120px); }
.legal-aside { grid-column: 1 / span 4; position: sticky; top: calc(var(--head-h) + 28px); align-self: start; }
.legal-aside h1 { font-size: clamp(2.6rem, 4.6vw, 4.2rem); }
.legal-aside ul { list-style: none; padding: 0; margin: 28px 0 0; border-top: 1px solid var(--line); }
.legal-aside li a { display: block; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; font: 500 0.78rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--bone-2); }
.legal-aside li a:hover, .legal-aside li a[aria-current='page'] { color: var(--accent); }
.legal-body { grid-column: 6 / span 7; max-width: 68ch; }
.legal-body > p:first-child { padding: 14px 16px; border: 1px solid var(--accent); background: var(--accent-dim); font-size: 0.95rem; }
.legal-body h2 { font-family: var(--sans); text-transform: none; font-weight: 700; font-size: 1.2rem; letter-spacing: 0; line-height: 1.3; margin: 2em 0 0.4em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.legal-body p, .legal-body li { color: var(--bone-2); }
@media (max-width: 960px) { .legal-aside, .legal-body { grid-column: 1 / -1; position: static; } }

/* ---------- error pages ---------- */
.err { padding-block: clamp(48px, 9vw, 120px); align-items: end; row-gap: 24px; }
.err-code { grid-column: 1 / span 5; font: 900 clamp(7rem, 22vw, 18rem)/0.8 var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--bone-3); }
.err-text { grid-column: 7 / span 6; }
.err-text h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); }
@media (max-width: 860px) { .err-code, .err-text { grid-column: 1 / -1; } }

/* ---------- footer title block ---------- */
.site-foot { margin-top: clamp(40px, 6vw, 80px); padding-block: 0 32px; }
.titleblock { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr; border: 1px solid var(--line-2); }
.tb-cell { padding: 22px; border-right: 1px solid var(--line); }
.tb-cell:last-child { border-right: 0; }
.tb-brand .mark { margin-bottom: 14px; }
.tb-name { font: 900 1.8rem/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 8px; }
.tb-line { font-size: 0.9rem; color: var(--bone-3); margin: 0; }
.tb-h { font: 500 0.7rem var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-3); margin: 0 0 12px; }
.tb-cell ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tb-cell a { text-decoration: none; font-size: 0.95rem; color: var(--bone-2); }
.tb-cell a:hover { color: var(--accent); }
.tb-big { font: 800 2.4rem/1 var(--display); letter-spacing: 0.04em; margin: 0 0 10px; color: var(--accent); }
@media (max-width: 960px) {
  .titleblock { grid-template-columns: 1fr 1fr; }
  .tb-brand { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .tb-cell:nth-child(n+2) { border-bottom: 1px solid var(--line); }
  .tb-sheet { grid-column: 1 / -1; border-bottom: 0 !important; }
}

/* ---------- reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
.break { word-break: break-all; }
.top-gap { margin-top: 24px; }
.w-0 { width: 0%; }
.w-1 { width: 1%; }
.w-2 { width: 2%; }
.w-3 { width: 3%; }
.w-4 { width: 4%; }
.w-5 { width: 5%; }
.w-6 { width: 6%; }
.w-7 { width: 7%; }
.w-8 { width: 8%; }
.w-9 { width: 9%; }
.w-10 { width: 10%; }
.w-11 { width: 11%; }
.w-12 { width: 12%; }
.w-13 { width: 13%; }
.w-14 { width: 14%; }
.w-15 { width: 15%; }
.w-16 { width: 16%; }
.w-17 { width: 17%; }
.w-18 { width: 18%; }
.w-19 { width: 19%; }
.w-20 { width: 20%; }
.w-21 { width: 21%; }
.w-22 { width: 22%; }
.w-23 { width: 23%; }
.w-24 { width: 24%; }
.w-25 { width: 25%; }
.w-26 { width: 26%; }
.w-27 { width: 27%; }
.w-28 { width: 28%; }
.w-29 { width: 29%; }
.w-30 { width: 30%; }
.w-31 { width: 31%; }
.w-32 { width: 32%; }
.w-33 { width: 33%; }
.w-34 { width: 34%; }
.w-35 { width: 35%; }
.w-36 { width: 36%; }
.w-37 { width: 37%; }
.w-38 { width: 38%; }
.w-39 { width: 39%; }
.w-40 { width: 40%; }
.w-41 { width: 41%; }
.w-42 { width: 42%; }
.w-43 { width: 43%; }
.w-44 { width: 44%; }
.w-45 { width: 45%; }
.w-46 { width: 46%; }
.w-47 { width: 47%; }
.w-48 { width: 48%; }
.w-49 { width: 49%; }
.w-50 { width: 50%; }
.w-51 { width: 51%; }
.w-52 { width: 52%; }
.w-53 { width: 53%; }
.w-54 { width: 54%; }
.w-55 { width: 55%; }
.w-56 { width: 56%; }
.w-57 { width: 57%; }
.w-58 { width: 58%; }
.w-59 { width: 59%; }
.w-60 { width: 60%; }
.w-61 { width: 61%; }
.w-62 { width: 62%; }
.w-63 { width: 63%; }
.w-64 { width: 64%; }
.w-65 { width: 65%; }
.w-66 { width: 66%; }
.w-67 { width: 67%; }
.w-68 { width: 68%; }
.w-69 { width: 69%; }
.w-70 { width: 70%; }
.w-71 { width: 71%; }
.w-72 { width: 72%; }
.w-73 { width: 73%; }
.w-74 { width: 74%; }
.w-75 { width: 75%; }
.w-76 { width: 76%; }
.w-77 { width: 77%; }
.w-78 { width: 78%; }
.w-79 { width: 79%; }
.w-80 { width: 80%; }
.w-81 { width: 81%; }
.w-82 { width: 82%; }
.w-83 { width: 83%; }
.w-84 { width: 84%; }
.w-85 { width: 85%; }
.w-86 { width: 86%; }
.w-87 { width: 87%; }
.w-88 { width: 88%; }
.w-89 { width: 89%; }
.w-90 { width: 90%; }
.w-91 { width: 91%; }
.w-92 { width: 92%; }
.w-93 { width: 93%; }
.w-94 { width: 94%; }
.w-95 { width: 95%; }
.w-96 { width: 96%; }
.w-97 { width: 97%; }
.w-98 { width: 98%; }
.w-99 { width: 99%; }
.w-100 { width: 100%; }

/* ---------- page head with side lead ---------- */
.page-head .grid { align-items: end; row-gap: 20px; }
.ph-main { grid-column: 1 / span 7; }
.ph-side { grid-column: 9 / span 4; margin: 0; }
@media (max-width: 960px) { .ph-main, .ph-side { grid-column: 1 / -1; } }

/* ---------- pricing ---------- */
.plans { align-items: stretch; row-gap: 24px; }
.plan { grid-column: span 5; background: var(--ink-2); border: 1px solid var(--line); padding: clamp(22px, 3vw, 44px); display: flex; flex-direction: column; gap: 6px; }
.plan-pro { grid-column: 7 / span 6; border-color: var(--line-2); background: var(--ink-3); }
.plan h2 { font-size: clamp(3rem, 5vw, 4.6rem); margin: 0; }
.price { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 20px; }
.price-n { font: 900 clamp(3.6rem, 7vw, 6rem)/0.9 var(--display); color: var(--accent); }
.price-u { font: 500 0.75rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bone-3); }
.plan .kv { margin-bottom: 28px; flex: 1; }
.plan .btn { align-self: flex-start; }
.plan .hint { margin: 14px 0 0; font-size: 0.88rem; color: var(--bone-3); }
.price-lower { margin-top: clamp(56px, 8vw, 110px); row-gap: 24px; align-items: start; }
.pl-a { grid-column: 1 / span 5; }
.pl-b { grid-column: 7 / span 6; }
.pl-b .hint { margin-top: 12px; color: var(--bone-3); font-size: 0.9rem; }
.faq { margin-top: clamp(56px, 8vw, 110px); row-gap: 24px; padding-top: 28px; border-top: 1px solid var(--line-2); }
.faq-h { grid-column: 1 / span 4; font-size: clamp(2rem, 3.4vw, 3rem); }
.faq-list { grid-column: 6 / span 7; margin: 0; }
.faq-list > div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.faq-list > div:first-child { padding-top: 0; }
.faq-list dt { font-weight: 600; margin-bottom: 6px; }
.faq-list dd { margin: 0; color: var(--bone-2); max-width: 60ch; }
@media (max-width: 960px) { .plan, .plan-pro, .pl-a, .pl-b, .faq-h, .faq-list { grid-column: 1 / -1; } }

/* ---------- line illustrations ---------- */
.ln { fill: none; stroke: var(--bone); stroke-width: 1.25; vector-effect: non-scaling-stroke; stroke-linecap: square; stroke-linejoin: miter; }
.ln.acc { stroke: var(--accent); }
.ln.faint { stroke: var(--bone-3); opacity: 0.75; }
.ln.dash { stroke-dasharray: 5 5; }
.fig-t { font: 500 11px var(--mono); letter-spacing: 0.06em; fill: var(--bone-2); }
.fig-t.acc { fill: var(--accent); }
.fig-t.dim { fill: var(--bone-3); }
.js svg.draw .ln:not(.dash) { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js svg.draw .ln.dash, .js svg.draw .fig-t { opacity: 0; }
.js svg.draw.in .ln:not(.dash) { animation: draw 1.3s var(--ease-io) forwards; animation-delay: calc(var(--i, 0) * 40ms); }
.js svg.draw.in .ln.dash, .js svg.draw.in .fig-t { opacity: 1; transition: opacity 0.7s ease 0.9s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.reduce svg.draw .ln:not(.dash) { stroke-dashoffset: 0 !important; animation: none !important; }
.reduce svg.draw .ln.dash, .reduce svg.draw .fig-t { opacity: 1 !important; }

/* ---------- features ---------- */
.mode-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(12px, 2vw, 28px); align-items: center; padding-block: clamp(48px, 8vw, 110px); border-bottom: 1px solid var(--line); row-gap: 32px; }
.mode-text { grid-column: 1 / span 5; }
.mode-fig { grid-column: 7 / span 6; margin: 0; }
.mode-row.flip .mode-text { grid-column: 8 / span 5; grid-row: 1; }
.mode-row.flip .mode-fig { grid-column: 1 / span 6; grid-row: 1; }
.mode-text h2 { font-size: clamp(4rem, 9vw, 8rem); margin-bottom: 18px; color: var(--bone); }
.mode-key { margin-bottom: 14px; color: var(--accent); }
.mode-fig svg { width: 100%; height: auto; background: var(--ink-2); border: 1px solid var(--line); padding: 10px; }
.mode-fig figcaption { margin-top: 12px; }
.scr { display: inline-block; min-width: var(--scr-w, 0); white-space: pre; }
.ticks { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--line); }
.ticks li { padding: 11px 0 11px 28px; border-bottom: 1px solid var(--line); position: relative; color: var(--bone-2); }
.ticks li::before { content: ''; position: absolute; left: 4px; top: 1.1em; width: 10px; height: 10px; border: 1px solid var(--accent); transform: rotate(45deg); }
@media (max-width: 960px) {
  .mode-text, .mode-fig, .mode-row.flip .mode-text, .mode-row.flip .mode-fig { grid-column: 1 / -1; grid-row: auto; }
}
.spec-block { padding-block: clamp(56px, 8vw, 110px); }
.sb-h { grid-column: 1 / span 5; font-size: clamp(2.2rem, 4vw, 3.6rem); }
.sb-list { grid-column: 7 / span 6; margin: 0; }
.sb-list > div { padding: 20px 0; border-top: 1px solid var(--line); }
.sb-list > div:last-child { border-bottom: 1px solid var(--line); }
.sb-list dt { font: 600 0.8rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.sb-list dd { margin: 0; color: var(--bone-2); max-width: 58ch; }
@media (max-width: 960px) { .sb-h, .sb-list { grid-column: 1 / -1; } .sb-h { margin-bottom: 8px; } }
.cta-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-block: clamp(40px, 6vw, 80px) 0; border-top: 1px solid var(--line-2); }
.cta-line h2 { margin: 0; font-size: clamp(2.6rem, 6vw, 5rem); }
.nav-locked { overflow: hidden; }

/* ---------- workspace pages: chat and editor ---------- */
.app-page .site-foot { display: none; }
.app-shell { padding-block: 16px 16px; height: calc(100dvh - var(--head-h)); min-height: 560px; display: flex; }
.app-empty { margin: auto; max-width: 640px; }
.app-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 0; width: 100%; border: 1px solid var(--line-2); min-height: 0; }
.app-rail { padding: 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; overflow-y: auto; background: var(--ink-2); }
.app-rail h1 { font-size: 4.4rem; margin: 0 0 18px; }
.rail-note { margin-top: auto; padding-top: 24px; font-size: 0.85rem; color: var(--bone-3); }
.app-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.log { flex: 1; overflow-y: auto; padding: 24px clamp(16px, 3vw, 40px); min-height: 0; }
.log-empty { max-width: 56ch; color: var(--bone-2); }
.log-empty .label { display: block; margin-top: 12px; color: var(--accent); }
.msg { padding: 18px 0; border-bottom: 1px solid var(--line); max-width: 78ch; }
.msg-role { margin: 0 0 8px; }
.msg-assistant .msg-role { color: var(--accent); }
.msg-body p { margin: 0 0 0.8em; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-user .msg-body { white-space: pre-wrap; word-break: break-word; }
.msg-error { border-left: 3px solid var(--accent); padding-left: 14px; background: var(--accent-dim); }
.streaming::after { content: ''; display: inline-block; width: 8px; height: 1.05em; margin-left: 3px; background: var(--accent); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.code { margin: 0.8em 0; border: 1px solid var(--line-2); background: var(--ink); }
.code figcaption { display: flex; gap: 6px; align-items: center; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line); font: 500 0.7rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-3); }
.code figcaption span { margin-right: auto; }
.code figcaption button, .ed-btn { background: none; border: 1px solid var(--line-2); color: var(--bone-2); font: 500 0.68rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 9px; cursor: pointer; }
.code figcaption button:hover, .ed-btn:hover:not([disabled]) { color: var(--bone); border-color: var(--bone); }
.ed-btn[disabled] { opacity: 0.35; cursor: default; }
.code pre { margin: 0; padding: 12px; overflow-x: auto; font-size: 0.85rem; line-height: 1.55; }
.code code { background: none; padding: 0; }
.composer { border-top: 1px solid var(--line-2); padding: 12px clamp(12px, 2vw, 24px) 14px; background: var(--ink-2); }
.composer textarea { resize: none; margin-bottom: 8px; }
.composer-row { display: flex; align-items: center; gap: 10px; }
.composer-row .label { margin-right: auto; min-height: 1em; }

.ed { display: grid; grid-template-columns: 200px minmax(0, 1fr) 380px; width: 100%; border: 1px solid var(--line-2); min-height: 0; }
.ed-tabs { display: none; }
.ed-files, .ed-ai { display: flex; flex-direction: column; min-height: 0; background: var(--ink-2); }
.ed-files { border-right: 1px solid var(--line); }
.ed-ai { border-left: 1px solid var(--line); }
.ed-code { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ed-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); min-height: 46px; flex-wrap: wrap; }
.ed-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-note { padding: 12px; margin: auto 0 0; font-size: 0.8rem; color: var(--bone-3); }
.file-list { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; }
.file-list button { width: 100%; text-align: left; background: none; border: 0; border-left: 2px solid transparent; color: var(--bone-2); padding: 9px 12px; font: 400 0.85rem var(--mono); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list button:hover { background: var(--ink-3); color: var(--bone); }
.file-list button[aria-current] { border-left-color: var(--accent); color: var(--bone); background: var(--ink-3); }
.ed-surface { position: relative; flex: 1; min-height: 160px; display: flex; background: var(--ink); }
.gutter { margin: 0; padding: 14px 10px 14px 12px; width: 52px; flex: none; overflow: hidden; text-align: right; font: 400 0.85rem/1.6 var(--mono); color: var(--bone-3); border-right: 1px solid var(--line); user-select: none; }
.code-area { flex: 1; border: 0 !important; background: transparent !important; padding: 14px 16px; resize: none; font: 400 0.85rem/1.6 var(--mono); tab-size: 2; white-space: pre; overflow: auto; color: var(--bone); }
.code-area:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.diffbox { border-top: 1px solid var(--line-2); max-height: 42%; display: flex; flex-direction: column; background: var(--ink-2); }
.diff { margin: 0; overflow: auto; font: 400 0.82rem/1.55 var(--mono); padding: 6px 0; }
.dl { padding: 0 14px; white-space: pre; }
.dl-add { background: rgba(236, 228, 210, 0.09); color: var(--bone); border-left: 2px solid var(--bone); }
.dl-del { color: var(--accent); background: var(--accent-dim); text-decoration: line-through; text-decoration-color: rgba(255, 91, 31, 0.5); border-left: 2px solid var(--accent); }
.dl-ctx { color: var(--bone-3); border-left: 2px solid transparent; }
.ed-accept { border-color: var(--accent); color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line-2); }
.seg button { background: none; border: 0; padding: 6px 12px; font: 600 0.72rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone-2); cursor: pointer; }
.seg .seg-on { background: var(--bone); color: var(--ink); }
.ed-select { width: auto; max-width: 150px; padding: 6px 28px 6px 8px; font: 400 0.78rem var(--mono); }
.ed-ai .log { padding: 14px; }

@media (max-width: 1100px) { .ed { grid-template-columns: 170px minmax(0, 1fr) 320px; } }
@media (max-width: 860px) {
  .app-shell { height: auto; min-height: calc(100dvh - var(--head-h)); padding-block: 0 0; }
  .app-grid { grid-template-columns: 1fr; border-left: 0; border-right: 0; }
  .app-rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .app-rail h1 { font-size: 2.6rem; margin-bottom: 8px; }
  .rail-note { display: none; }
  .log { min-height: 46dvh; }
  .ed { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - var(--head-h)); border-left: 0; border-right: 0; }
  .ed-tabs { display: flex; border-bottom: 1px solid var(--line-2); }
  .ed-tabs button { flex: 1; padding: 13px 0; background: none; border: 0; color: var(--bone-2); font: 600 0.75rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; border-bottom: 2px solid transparent; }
  .ed-tabs button[aria-selected='true'] { color: var(--bone); border-bottom-color: var(--accent); }
  .ed > .ed-files, .ed > .ed-code, .ed > .ed-ai { display: none; border: 0; }
  .ed[data-pane='files'] > .ed-files, .ed[data-pane='code'] > .ed-code, .ed[data-pane='ai'] > .ed-ai { display: flex; }
}

[hidden] { display: none !important; }
.ed-ai .log-empty p, .ed .log-empty p { font-size: 0.9rem; margin: 0 0 8px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* pricing billing toggle (no inline styles: the site CSP forbids them) */
#plans-container .yearly-price, #plans-container .yearly { display: none; }
#plans-container.show-yearly .yearly-price, #plans-container.show-yearly .yearly { display: inline; }
#plans-container.show-yearly .monthly-price, #plans-container.show-yearly .monthly { display: none; }

/* Turnstile human check */
.human-check { margin-bottom: 22px; }
.ts-box { min-height: 65px; display: grid; align-items: center; border: 1px solid var(--line); background: var(--ink); }
.ts-box .ts-wait { padding: 0 16px; }
.ts-box.ts-need { border-color: var(--accent); }
.ts-box iframe { width: 100% !important; }
