/* 404 page: a design canvas with one frame you can move and resize.
   The frame's content is a "smart component": container queries switch it
   between Desktop, Tablet, Mobile and Tiny layouts as the frame changes size.
   Loaded by the 404 page only. */
.cv { --cv-bg: #191613; --panel: 248px; position: relative; height: 100dvh; min-height: 560px; display: grid; grid-template-columns: var(--panel) 1fr var(--panel); padding-top: 88px; background: var(--cv-bg); border-bottom: 1px solid var(--line); overflow: hidden; touch-action: none; }
html.cur .cv, html.cur .cv button, html.cur .cv input { cursor: default; }
html.cur .cv a { cursor: pointer; }
html.cv-on .cursor, html.cv-on .glow { opacity: 0 !important; }
.cv-mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* Side panels */
.cv-panel { background: var(--surface); border-color: var(--line); border-style: solid; border-width: 1px 0 0; font-size: 12px; overflow-y: auto; touch-action: pan-y; }
.cv-layers { border-right-width: 1px; }
.cv-inspect { border-left-width: 1px; }
.cv-h { padding: 16px 16px 8px; color: var(--unlit); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.cv-panel hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.cv-row { display: flex; align-items: center; gap: 10px; padding: 7px 16px; color: var(--mute); transition: background .2s, color .2s; }
.cv-row svg { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.2; }
a.cv-row:hover, a.cv-row:focus-visible, button.cv-row:hover { background: var(--surface-2); color: var(--fg); }
.cv-row.here { color: var(--acc); background: rgba(242,181,68,.08); }
.cv-row.here em { font-style: normal; margin-left: auto; color: var(--unlit); }
.cv-row.child { padding-left: 34px; }
.cv-row.off { opacity: .4; }
button.cv-row { width: 100%; text-align: left; font: inherit; border: 0; background: none; }
.cv-row.on { color: var(--fg); background: var(--surface-2); }

.cv-field { padding: 4px 16px 10px; }
.cv-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cv-input { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--unlit); transition: border-color .2s; }
.cv-input:focus-within { border-color: var(--acc); }
.cv-input input { width: 100%; min-width: 0; border: 0; background: none; color: var(--fg); font: inherit; font-size: 12px; outline: none; -moz-appearance: textfield; }
.cv-input input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-chip { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--mute); font: inherit; font-size: 12px; transition: border-color .2s, color .2s, background .2s; }
.cv-chip:hover { color: var(--fg); border-color: var(--unlit); }
.cv-chip[aria-pressed="true"] { border-color: var(--acc); color: var(--acc); background: rgba(242,181,68,.08); }
.cv-swatch { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--s); position: relative; }
.cv-swatch[aria-pressed="true"]::after { content: ""; position: absolute; inset: -5px; border: 1.5px solid var(--acc); border-radius: 50%; }
.cv-variant { display: flex; justify-content: space-between; align-items: center; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--fg); }
.cv-variant b { font-weight: 500; color: var(--acc); }
.cv-tip { padding: 8px 16px 16px; color: var(--unlit); line-height: 1.5; }

/* The stage and its dot grid */
.cv-stage { position: relative; border-top: 1px solid var(--line); background-image: radial-gradient(circle, #2f2a24 1px, transparent 1.2px); background-size: 24px 24px; }
.cv-frame:focus { outline: none; }
.cv-frame { position: absolute; left: 0; top: 0; --f-bg: var(--bg); --f-fg: var(--fg); --f-mute: var(--mute); --f-line: var(--line); --f-acc: var(--acc); }
.cv-frame[data-fill="bone"] { --f-bg: #ebe3d5; --f-fg: #15120f; --f-mute: #5c5348; --f-line: #d3c9b8; --f-acc: #9a6a12; }
.cv-frame[data-fill="marigold"] { --f-bg: #f2b544; --f-fg: #15120f; --f-mute: #4a3a1c; --f-line: #d89d33; --f-acc: #15120f; }
.cv-frame[data-fill="surface"] { --f-bg: #27211b; }
.cv-tag { position: absolute; left: 0; bottom: 100%; padding: 0 0 6px; font-size: 12px; color: var(--mute); white-space: nowrap; cursor: move !important; user-select: none; -webkit-user-select: none; }
.cv-tag:hover, .cv-frame.sel .cv-tag { color: var(--acc); }
.cv-body { position: absolute; inset: 0; overflow: hidden; background: var(--f-bg); color: var(--f-fg); container: f / size; font-family: "Archivo", system-ui, sans-serif; transition: background .3s, color .3s; box-shadow: 0 40px 80px -24px rgba(0,0,0,.6); }

/* Selection box, handles and the size badge */
.cv-sel { position: absolute; inset: -1px; border: 1.5px solid var(--acc); pointer-events: none; opacity: 0; transition: opacity .2s; }
.cv-frame.sel .cv-sel { opacity: 1; }
.cv-h8 { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; pointer-events: auto; touch-action: none; }
.cv-h8::after { content: ""; position: absolute; left: 7px; top: 7px; width: 8px; height: 8px; background: #fff; border: 1.5px solid var(--acc); border-radius: 1px; }
.cv-h8[data-h="n"], .cv-h8[data-h="s"], .cv-h8[data-h="e"], .cv-h8[data-h="w"] { opacity: .0; }
.cv-h8[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize !important; } .cv-h8[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize !important; }
.cv-h8[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize !important; } .cv-h8[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize !important; }
.cv-h8[data-h="n"] { left: 22px; right: 22px; width: auto; margin-left: 0; top: 0; cursor: ns-resize !important; } .cv-h8[data-h="s"] { left: 22px; right: 22px; width: auto; margin-left: 0; top: 100%; cursor: ns-resize !important; }
.cv-h8[data-h="w"] { top: 22px; bottom: 22px; height: auto; margin-top: 0; left: 0; cursor: ew-resize !important; } .cv-h8[data-h="e"] { top: 22px; bottom: 22px; height: auto; margin-top: 0; left: 100%; cursor: ew-resize !important; }
.cv-size { position: absolute; left: 50%; top: 100%; margin-top: 10px; transform: translateX(-50%); padding: 3px 6px; border-radius: 4px; background: var(--acc); color: var(--on-acc); font-size: 11px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s; }
.cv-frame.sel .cv-size { opacity: 1; }

/* ---------- The smart component inside the frame ---------- */
.f-in { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 4cqh; padding: 7cqmin; }
.f-art { font-family: "Archivo", system-ui, sans-serif; font-weight: 700; font-stretch: 125%; letter-spacing: -.05em; line-height: .8; font-size: clamp(40px, 34cqmin, 260px); color: transparent; -webkit-text-stroke: 1px var(--f-mute); user-select: none; -webkit-user-select: none; }
.f-art span { color: var(--f-acc); -webkit-text-stroke: 0; }
.f-copy { display: flex; flex-direction: column; align-items: inherit; max-width: 34em; }
.f-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--f-mute); }
.f-title { margin-top: 10px; font-size: clamp(18px, 6.4cqi, 60px); line-height: 1.04; letter-spacing: -.03em; font-weight: 600; font-stretch: 112%; text-wrap: balance; }
.f-text { margin-top: 12px; font-size: clamp(13px, 2cqi, 18px); line-height: 1.45; color: var(--f-mute); max-width: 34ch; text-wrap: pretty; }
.f-ctas { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: inherit; }
.f-btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: var(--radius-sm); background: var(--f-fg); color: var(--f-bg); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background-color .3s var(--ease), color .3s, border-color .3s; }
.f-btn:hover, .f-btn:focus-visible { background: var(--f-acc); color: var(--f-bg); }
.cv-frame[data-fill="marigold"] .f-btn:hover { background: var(--bg); color: var(--acc); }
.f-btn.ghost { background: transparent; color: var(--f-fg); border: 1px solid var(--f-line); }
.f-btn.ghost:hover, .f-btn.ghost:focus-visible { border-color: var(--f-fg); background: transparent; color: var(--f-fg); }
.f-mini { display: none; }
.f-in.left { align-items: flex-start; text-align: left; }
.f-in.left .f-ctas { justify-content: flex-start; }

/* Desktop: copy on the left, the big 404 on the right */
@container f (min-width: 720px) and (min-height: 340px) {
  .f-in { flex-direction: row-reverse; justify-content: space-between; align-items: center; text-align: left; padding: 6cqh 6cqi; gap: 4cqi; }
  .f-in .f-copy { align-items: flex-start; } .f-in .f-ctas { justify-content: flex-start; }
  .f-in.left { flex-direction: row-reverse; }
  .f-art { font-size: clamp(80px, min(44cqh, 26cqi), 340px); }
  .f-title { font-size: clamp(28px, 4.6cqi, 64px); }
  .f-text { font-size: clamp(14px, 1.5cqi, 19px); }
}
/* Mobile: drop the second button */
@container f (max-width: 479px) { .f-ctas .ghost { display: none; } .f-title { font-size: clamp(18px, 8.6cqi, 34px); } }
/* Short frames: no body text */
@container f (max-height: 360px) { .f-text { display: none; } .f-in { gap: 3cqh; } }
/* Tiny: just the number and a home button */
@container f (max-width: 259px) or (max-height: 219px) {
  .f-copy { display: none; } .f-mini { display: inline-flex; height: 34px; font-size: 13px; padding: 0 14px; }
  .f-art { font-size: clamp(32px, 30cqmin, 120px); }
}
@container f (max-width: 139px) or (max-height: 109px) { .f-mini { display: none; } }

/* Kurran's cursor and comment */
.cv-mp { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; transition: transform 1.6s var(--expo), opacity .4s; }
.cv-mp svg { width: 18px; display: block; }
.cv-mp span { display: inline-block; margin: 2px 0 0 14px; padding: 3px 7px; border-radius: 4px 99px 99px 99px; background: var(--acc); color: var(--on-acc); font-size: 11px; font-weight: 600; white-space: nowrap; }
.cv-note { font-family: "Archivo", system-ui, sans-serif; position: absolute; z-index: 2; max-width: 220px; padding: 10px 12px; border-radius: 16px 16px 16px 4px; background: var(--fg); color: var(--bg); font-size: 13px; line-height: 1.4; box-shadow: 0 20px 40px -16px rgba(0,0,0,.6); pointer-events: none; transition: opacity .3s; }
.cv-note b { display: block; font-size: 11px; margin-bottom: 2px; }
.cv-hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; background: rgba(21,18,15,.86); color: var(--mute); font-size: 12px; white-space: nowrap; pointer-events: none; transition: opacity .4s; }
.cv.used .cv-hint { opacity: 0; }

/* Small screens: a compact toolbar stands in for the settings panel */
.cv-bar { display: none; position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 99px; background: rgba(21,18,15,.9); }
.cv-bar .cv-swatch { width: 26px; height: 26px; }
.cv-bar .cv-chip { height: 28px; border-radius: 99px; }
@media (max-width: 1100px) { .cv { grid-template-columns: var(--panel) 1fr; } .cv-inspect { display: none; } .cv-bar { display: flex; } .cv-hint { bottom: 64px; } }
@media (max-width: 760px) {
  .cv { grid-template-columns: 1fr; padding-top: 72px; min-height: 520px; }
  .cv-layers { display: none; }
  .cv-note { display: none; }
  .cv-h8::after { left: 5px; top: 5px; width: 12px; height: 12px; }
}
@media (prefers-reduced-motion: reduce) { .cv-mp { transition: none; } }
