/* LOCKED IN fake browser. Sizes are in px at 1x; #screen is scaled by config.ui.scale. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --os-h: 24px;
  --toolbar-h: 43px;   /* 34px field flush under the menu bar + 9px below it */
  --tabbar-h: 34px;

  /* light chrome */
  --os-bg: rgba(236,236,238,.92);
  --os-fg: #1d1d1f;
  --chrome-bg: #e9e9ea;
  --chrome-bg2: #dcdcde;
  --chrome-fg: #3a3a3c;
  --chrome-dim: #a0a0a4;
  --field-bg: #d7d7d9;
  --tab-active: #f4f4f5;
  --border: rgba(0,0,0,.14);
}
.theme-wood {
  /* Lynch house chrome: dark mahogany, cream type. Not black, so the screen doesn't mirror the room. */
  --os-bg: rgba(58,34,20,.96);
  --os-fg: #f1e4c8;
  --chrome-bg: #4b2d1b;
  --chrome-bg2: #3f2516;
  --chrome-fg: #eadcc0;
  --chrome-dim: #a38568;
  --field-bg: #5e3a24;
  --tab-active: #6b4530;
  --border: rgba(0,0,0,.45);
}
.theme-dark {
  --os-bg: rgba(34,34,38,.92);
  --os-fg: #f5f5f7;
  --chrome-bg: #2b2b2e;
  --chrome-bg2: #222225;
  --chrome-fg: #d6d6d8;
  --chrome-dim: #6f6f74;
  --field-bg: #3a3a3e;
  --tab-active: #3c3c40;
  --border: rgba(0,0,0,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; overflow: hidden; }
body { font-family: var(--font); -webkit-font-smoothing: antialiased; color: var(--chrome-fg); }
button { background: none; border: 0; color: inherit; font: inherit; cursor: default; }
svg { display: block; }

#screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  transform-origin: top left;
  background: #000;
}
body.nocursor, body.nocursor * { cursor: none !important; }

/* ---------------- OS bar ---------------- */
#osbar {
  height: var(--os-h); flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 0 14px;
  background: var(--os-bg); color: var(--os-fg);
  font-size: 13px; font-weight: 500;
  backdrop-filter: blur(20px);
  user-select: none;
}
.os-left, .os-right { display: flex; align-items: center; gap: 0; height: 100%; }
.os-logo { display: flex; margin-right: 16px; }
.os-logo img { width: 15px; height: 15px; object-fit: contain; }
.os-app { font-weight: 700; margin-right: 18px; }
.os-menus { display: flex; gap: 18px; }
.os-item { display: flex; align-items: center; margin-left: 14px; }
.os-clock { gap: 7px; margin-left: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
#os-battery { display: flex; align-items: center; gap: 5px; font-size: 12px; }
/* macOS camera-in-use indicator: green dot beside Control Center while the scan runs */
.os-cam { width: 0; margin-left: 0; overflow: hidden; transition: width .15s, margin-left .15s; }
.os-cam::before { content: ""; display: block; width: 8px; height: 8px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
body.scanning .os-cam { width: 8px; margin-left: 14px; }
.batt { position: relative; width: 25px; height: 12px; border: 1.5px solid currentColor; border-radius: 3.5px; opacity: .95; }
.batt::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: currentColor; border-radius: 0 1px 1px 0; opacity: .6; }
.batt i { position: absolute; left: 1.5px; top: 1.5px; bottom: 1.5px; background: currentColor; border-radius: 1.5px; }

/* ---------------- Browser chrome ---------------- */
#browser { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--chrome-bg); }
#toolbar {
  height: var(--toolbar-h); flex: none;
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px 9px;   /* no gap above: the URL field butts against the menu bar */
  background: var(--chrome-bg);
  color: var(--chrome-fg);
}
.traffic { display: flex; gap: 8px; margin-right: 10px; }
.light { width: 12px; height: 12px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.2); }
.light.close { background: #ff5f57; } .light.min { background: #febc2e; } .light.max { background: #28c840; }
.tb-btn { width: 30px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--chrome-fg); }
.tb-btn.dim { color: var(--chrome-dim); }
.nav { display: flex; gap: 2px; margin-right: 6px; }
#urlbar {
  flex: 1; height: 34px; max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px;
  background: var(--field-bg); border-radius: 0;
  font-size: 16.2px; color: var(--chrome-fg);
  position: relative;
}
/* Field shoulders: the tab shoulder inverted. The field hangs from the menu bar, and each side
   rolls up from the flat bottom edge through the same S-curve to meet the bar above. */
#urlbar::before, #urlbar::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 30px;
  background: var(--field-bg);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
#urlbar::before {
  left: -29.5px;   /* half-pixel overlap so no seam shows against the field */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 34' preserveAspectRatio='none'%3E%3Cpath d='M0 0 C15 0 15 34 30 34 L30 0 Z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 34' preserveAspectRatio='none'%3E%3Cpath d='M0 0 C15 0 15 34 30 34 L30 0 Z'/%3E%3C/svg%3E");
}
#urlbar::after {
  right: -29.5px;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 34' preserveAspectRatio='none'%3E%3Cpath d='M30 0 C15 0 15 34 0 34 L0 0 Z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 34' preserveAspectRatio='none'%3E%3Cpath d='M30 0 C15 0 15 34 0 34 L0 0 Z'/%3E%3C/svg%3E");
}
.url-aa { font-size: 13.8px; letter-spacing: .5px; color: var(--chrome-fg); opacity: .9; }
.url-center { display: flex; align-items: center; gap: 7px; }
#url-lock { opacity: .8; width: 14.4px; height: 14.4px; }
.url-reload { opacity: .85; }
.url-reload svg { width: 17px; height: 17px; }

#tabbar {
  height: var(--tabbar-h); flex: none;
  display: flex; align-items: stretch;
  padding: 0 12px 4px;
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--border);
}
.tab {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  background: var(--tab-active); border-radius: 7px;
  font-size: 12.5px; color: var(--chrome-fg);
  min-width: 0;
}
/* Tinted mode: tab hugs its title, sits flush on the page, and takes the page colour. */
body.tab-tint #tabbar { padding-bottom: 0; padding-left: 0; border-bottom: 0; }
body.tab-tint .tab {
  flex: 0 1 auto; max-width: 400px; min-width: 120px;
  padding: 0 12px 0 12px;
  font-size: 17px; gap: 11px;
  margin: 0 30px 0 0;                  /* room for the right shoulder; the left edge is flush with the screen */
  border-radius: 0;
  position: relative;
  background: var(--page-bg, var(--tab-active)); color: var(--page-fg, var(--chrome-fg));
}
/* Tab shoulders: the top edge rolls down through an S-curve (tanh) into the bar on each side. */
body.tab-tint .tab::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 30px;
  background: var(--page-bg, var(--tab-active));
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
body.tab-tint .tab::after {
  right: -30px;
  /* Symmetric smoothstep: horizontal tangents at both ends, gentlest slope for the drop. */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 34' preserveAspectRatio='none'%3E%3Cpath d='M0 0 C15 0 15 34 30 34 L0 34 Z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 34' preserveAspectRatio='none'%3E%3Cpath d='M0 0 C15 0 15 34 30 34 L0 34 Z'/%3E%3C/svg%3E");
}
body.ready.tab-tint .tab::after { transition: background .3s; }
body.tab-tint .tab-title { flex: 0 1 auto; text-align: left; }
body.tab-tint .tab-favicon { width: 26px; height: 26px; border-radius: 7px; }
body.tab-tint .tab-favicon svg { width: 24px; height: 24px; }
body.tab-tint .tab-close svg { width: 12px; height: 12px; }
body.tab-tint .tab-close { display: none; }   /* Safari shows the close button on hover only; never on camera, so it's simply off */
body.tab-tint .tab { padding-right: 14px; min-width: 0; }
body.tab-tint #site-nav {
  background: var(--page-nav, rgba(0,0,0,.72)); color: var(--page-fg, #fff);
}
/* Colour cross-fades only after first paint, so load doesn't animate from the defaults. */
body.ready.tab-tint .tab, body.ready.tab-tint #site-nav { transition: background .3s, color .3s; }
body.tab-tint #site-nav .site-logo { color: inherit; }
.tab-favicon {
  width: 16px; height: 16px; flex: none; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; line-height: 1; overflow: hidden;
}
.tab-favicon img { width: 100%; height: 100%; object-fit: cover; }
.tab-title { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-close { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; opacity: .7; }

/* ---------------- Public mode (published site) ---------------- */
/* No fake OS bar, browser chrome, help card, or edit panel: the page is all there is. */
body.public #osbar, body.public #toolbar, body.public #tabbar, body.public #help, body.public #panel, body.public #site-footer { display: none !important; }
.public-note { position: absolute; left: 24px; right: 24px; bottom: 18px; text-align: center; font-size: 13px; line-height: 1.4; letter-spacing: 0; font-family: var(--font); }
.public-note a { color: #8e8e93; text-decoration: underline; text-underline-offset: 2px; }
.public-note a:hover { color: #6e6e73; }
/* Phones get the desktop layout at 1000 px wide, scaled to fit (see app.js), so type is enlarged to stay legible. */
body.phone .section .state { zoom: 1.3; }
body.phone .public-note { font-size: 27px; bottom: 44px; left: 60px; right: 60px; }
body.phone .section { padding-bottom: 210px; }

/* ---------------- Site ---------------- */
#viewport {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  background: var(--page-bg, #000); color: #f5f5f7;
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;   /* settle on a whole panel when close to one; proximity, not mandatory, so filmed scrolling still feels free */
  position: relative;
}
#viewport::-webkit-scrollbar { width: 0; }
/* Long headlines (sentences rather than product names) drop to a calmer scale. */
.section.long h1 { font-size: 54px; letter-spacing: -.02em; }
.section.long .sub { font-size: 31px; margin-top: 30px; }

/* Face-scan sections run through several screens in the same panel: sign-in (.state-a), then one
   .state.flow per entry in the section's flow. Only the .show one is laid out, so each is centred
   on its own; the swap is fade out, switch, fade in. */
.section .state { display: none; flex-direction: column; align-items: center; transition: opacity .45s ease; }
.section .state.show { display: flex; }
.section .state.flow.show { animation: state-in .7s ease both; }
.section.leaving .state { opacity: 0; }
@keyframes state-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* .state.flow: outrank the .section.long .sub scale */
.section .state.flow .sub { font-size: 28px; line-height: 1.32; max-width: 940px; text-wrap: balance; }
.section .state.flow .sub:first-child { margin-top: 0; }
.section .state.flow .picto { margin-top: 44px; }
.section .state.flow .ask { font-size: 28px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; margin-top: 44px; max-width: 940px; text-wrap: balance; }
.section .state.flow.q-only .ask { font-size: 40px; letter-spacing: -.02em; }   /* a question on its own screen carries it */
.section .state.flow > :first-child { margin-top: 0; }
/* Optional emoji between a screen's text and its question, in the system emoji font. */
.section .state.flow .emoji { font-size: 92px; line-height: 1; margin-top: 36px; }
.section .state.flow .emoji + .ask { margin-top: 32px; }
body.editing .section .state.flow .emoji:has(.ed:empty) { font-size: 22px; }
/* Monkey gaze (see GAZE_EYES in app.js). Each .eye is a fixed copy of the emoji's own eye (glossy
   black oval) laid exactly over it, hiding the glyph's painted highlight; the .glint inside is a
   new highlight that the pointer moves around, so the eye appears to look without changing shape. */
.section .state.flow .emoji { position: relative; }
.emoji .eye {
  position: absolute; top: .5625em; width: .106em; height: .174em; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none; overflow: hidden;
  background: radial-gradient(ellipse 46% 30% at 50% 84%, rgba(126,136,176,.6), rgba(126,136,176,0) 100%), #0c0a10;
}
.emoji .eye.l { left: calc(50% - .1625em); }   /* measured from the centre, not the left edge: Safari lays the glyph out in a box a little wider than 1em */
.emoji .eye.r { left: calc(50% + .1625em); }
.emoji .glint {
  position: absolute; left: 50%; top: 50%; width: .04em; height: .034em; border-radius: 50%;
  transform: translate(-50%, calc(-50% - .055em));   /* rest position, top of the eye like the glyph; JS takes over on pointer move */
  transition: transform .08s ease-out;
  background: radial-gradient(closest-side, #fff 0 55%, rgba(255,255,255,0) 100%);
}
/* Closing screen: green ring and tick that draw in when the screen shows; text may carry line breaks. */
.section .state.flow .sub { white-space: pre-line; }
.done-check { color: #30c759; }
.done-check svg { display: block; }
.done-check circle, .done-check path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.state.show .done-check circle { animation: draw-in .7s cubic-bezier(.4,0,.2,1) .25s forwards; }
.state.show .done-check path { animation: draw-in .45s cubic-bezier(.2,.8,.2,1) .8s forwards; }
@keyframes draw-in { to { stroke-dashoffset: 0; } }
.section .state.flow .done-check + h1 { margin-top: 34px; }
/* Pictogram at rest: no wire pulse, no mesh wave. */
.picto.rest .picto-pulse, .picto.rest .picto-wave { display: none; }
/* Pill buttons: Next and the Yes / No pairs, all outlined until clicked. Platform blue, like the links. */
.btn-row { display: flex; gap: 18px; margin-top: 56px; }
.picto + .btn-row { margin-top: 40px; }
.ask + .btn-row { margin-top: 26px; }
.q-only .ask + .btn-row { margin-top: 40px; }
.pill {
  font: inherit; font-size: 22px; font-weight: 500; letter-spacing: -.005em;
  min-width: 132px; padding: 13px 34px; border-radius: 980px; cursor: pointer;
  color: var(--pill, #0071e3); background: transparent; border: 2px solid var(--pill, #0071e3);
  transition: background .18s, color .18s, transform .12s;
}
.pill.solid, .pill.on { background: var(--pill, #0071e3); color: #fff; }
.pill:hover { background: color-mix(in srgb, var(--pill, #0071e3) 12%, transparent); }
.pill.solid:hover, .pill.on:hover { background: color-mix(in srgb, var(--pill, #0071e3) 86%, #000); }
.pill:active { transform: scale(.97); }
body.editing .pill { cursor: text; }

/* Signed-in pictogram: phone, wire, head wearing the device. Same line weights as the face glyph. */
.picto { margin-top: 70px; color: #1d1d1f; opacity: .9; --scan: #0a84ff; }
.picto svg { display: block; }
.picto .picto-wire { stroke: #8b8b8d; }   /* solid mid grey, not translucent: the wire crosses the head outline and must not show it through */
.picto .picto-pulse { stroke: var(--scan); stroke-dasharray: .07 .93; stroke-dashoffset: 1; filter: drop-shadow(0 0 2.5px var(--scan)); animation: wire-pulse 2.2s linear infinite; }
.picto .picto-device { fill: currentColor; }
.picto .picto-led { fill: var(--scan); filter: drop-shadow(0 0 2px var(--scan)); }
/* Mesh wave: each element flashes on at its delay (set inline from graph distance to the device) and decays. */
.picto .picto-wave { filter: drop-shadow(0 0 2.5px var(--scan)); }
.picto .picto-wave line { stroke: var(--scan); opacity: 0; animation: mesh-wave 2.2s linear infinite; }
.picto .picto-wave circle { fill: var(--scan); stroke: none; opacity: 0; animation: mesh-wave 2.2s linear infinite; }
@keyframes mesh-wave { 0% { opacity: 0; } 5% { opacity: 1; } 14% { opacity: .75; } 42% { opacity: 0; } 100% { opacity: 0; } }
@keyframes wire-pulse { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.section.black .picto, .section.mahogany .picto, .section.brick .picto, .section.olive .picto, .section.concrete032 .picto, .section.rawconcrete .picto { color: #f5f5f7; }

/* Phones flash a grey box over anything tappable; the glyph and the pill buttons have their own feedback. */
.glyph-btn, .pill { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* Face-scan sign-in glyph under a section's text. Click to scan. */
.glyph-btn {
  margin-top: 80px; display: inline-flex; align-items: center; justify-content: center;
  color: #1d1d1f; opacity: .9; cursor: pointer; outline: none;
  --scan: #0a84ff;                       /* the platform's system accent, not a Neuroticon colour */
  --ok: #30c759;                         /* system green for the success state */
  --hover: #ff3b30;                      /* hover glow: red, separate from the blue scan sweep */
}
.glyph-btn .face-mesh-hi { stroke: var(--scan); }
/* Hover glow layer (built in bindGlyphs): per-edge lines and per-vertex dots whose opacity is set
   from graph distance to the vertex nearest the pointer. Hidden while the scan or check is running. */
.glyph-btn .face-hover { filter: drop-shadow(0 0 2.5px var(--hover)); transition: opacity .25s ease; pointer-events: none; }
.glyph-btn .face-hover line { stroke: var(--hover); stroke-width: 1.5; opacity: 0; transition: opacity .28s ease-out; }
.glyph-btn .face-hover circle { fill: var(--hover); stroke: none; opacity: 0; transition: opacity .28s ease-out; }
.glyph-btn.scanning .face-hover, .glyph-btn.done .face-hover, .glyph-btn.resetting .face-hover { opacity: 0; }
.glyph-btn .face-scan { fill: var(--scan); opacity: 0; filter: drop-shadow(0 0 3px var(--scan)); }
.glyph-btn.scanning .face-scan { opacity: .95; }
.glyph-btn .face-check { stroke: var(--ok); stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }   /* opacity 0 too: a fully offset dash still shows its round end cap as a dot */
.glyph-btn.done .face-check { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset .5s cubic-bezier(.2,.8,.2,1) .55s, opacity 0s linear .55s; }
.glyph-btn.done .face-mesh, .glyph-btn.done .face-mesh-hi { transition: opacity .6s ease .1s; opacity: 0; }
.glyph-btn.done .face-dots { transition: fill-opacity .6s ease .1s; fill-opacity: 0; }
.glyph-btn.done .face-outline { stroke: var(--ok); transition: stroke .5s ease .55s; }
/* Fade back to idle: everything eases home together, check first. */
.glyph-btn.resetting .face-check { stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset .35s ease-in, opacity 0s linear .35s; }
.glyph-btn.resetting .face-mesh, .glyph-btn.resetting .face-mesh-hi { transition: opacity .8s ease .15s; }
.glyph-btn.resetting .face-mesh-hi { opacity: 0; }
.glyph-btn.resetting .face-dots { transition: fill-opacity .8s ease .15s; }
.glyph-btn.resetting .face-outline { transition: stroke .8s ease .15s; }
.section.black .glyph-btn, .section.mahogany .glyph-btn, .section.brick .glyph-btn, .section.olive .glyph-btn, .section.concrete032 .glyph-btn, .section.rawconcrete .glyph-btn { color: #f5f5f7; }
.section .glyph-btn svg { display: block; }

#site-footer { scroll-snap-align: end; }

#site-nav {
  position: sticky; top: 0; z-index: 10;
  height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 44px;
  background: rgba(0,0,0,.72); backdrop-filter: saturate(180%) blur(20px);
  font-size: 12px; color: rgba(255,255,255,.85);
}
.site-logo { font-weight: 600; font-size: 15px; letter-spacing: -.01em; color: #fff; }
#site-links { display: flex; gap: 44px; list-style: none; }

.section {
  min-height: calc(var(--vp-h, 100vh) - var(--nav-h, 48px));
  scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px 24px;
  font-family: var(--display-font);
}
.section .eyebrow { font-size: 21px; font-weight: 600; letter-spacing: .01em; opacity: .75; margin-bottom: 8px; }
.section h1 { font-size: 88px; font-weight: 700; letter-spacing: -.03em; line-height: 1.04; }
.section .sub { font-size: 28px; font-weight: 400; letter-spacing: -.01em; margin-top: 14px; opacity: .85; max-width: 760px; }
.section .cta { margin-top: 26px; display: flex; gap: 32px; font-size: 21px; }
.section .cta a { text-decoration: none; }
.section .cta a::after { content: " \203A"; }

/* Brutalist type treatment (themes with style: 'brutal'): cast-in, tracked caps. */
.section.brutal h1 { text-transform: uppercase; letter-spacing: .04em; font-weight: 800; text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 -1px 0 rgba(255,255,255,.12); }
.section.brutal .eyebrow { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; letter-spacing: .28em; text-transform: uppercase; opacity: .7; margin-bottom: 18px; }
.section.brutal .sub { font-weight: 300; opacity: .8; text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.section.brutal .cta a { text-transform: uppercase; letter-spacing: .14em; font-size: 14px; font-weight: 600; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.section.brutal .cta a::after { content: ""; }

/* Corner badge: riveted metal plate */
.badge {
  position: absolute; top: 34px; left: 40px;
  width: 168px; height: 168px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-radius: 7px;
  transform: rotate(-1.4deg);
  background-color: #454847;
  background-size: 300px 300px, 400px 400px, 400px 400px, auto;
  background-blend-mode: multiply, multiply, overlay, normal;   /* pits, rust/grime, brushed steel, base gradient */
  color: #c9ccc6;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22), inset 0 -2px 0 rgba(0,0,0,.55),
    inset 2px 0 0 rgba(255,255,255,.08), inset -2px 0 0 rgba(0,0,0,.35),
    0 6px 14px rgba(0,0,0,.55), 0 1px 0 rgba(0,0,0,.6);
  text-align: left;
}
/* rivets */
.badge::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  --rivet: radial-gradient(circle at 35% 30%, #9ea3a0 0 2px, #4a4e4d 2.5px, #232626 4.5px, transparent 5px);
  background: var(--rivet) 6px 6px / 12px 12px no-repeat, var(--rivet) calc(100% - 6px) 6px / 12px 12px no-repeat,
              var(--rivet) 6px calc(100% - 6px) / 12px 12px no-repeat, var(--rivet) calc(100% - 6px) calc(100% - 6px) / 12px 12px no-repeat;
}
.badge-mark {
  width: 104px; height: 104px;
  color: #d6d9d2;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.25)) drop-shadow(0 -1px 0 rgba(0,0,0,.7)) drop-shadow(0 0 6px rgba(0,0,0,.35));
  opacity: .92;
}
.badge-label {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: #b4b8b1; text-shadow: 0 -1px 0 rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.12);
  text-align: center;
}
.badge-label.empty, .badge-label:has(.ed:empty) { display: none; }
body.editing .badge-label { display: block; }

/* Corner badge, oscilloscope variant: CRT tube in a plastic bezel, green phosphor trace. */
.scope {
  position: absolute; top: 34px; left: 40px;
  width: 272px; height: 196px;
  padding: 11px 12px 13px;
  border-radius: 12px;
  background: linear-gradient(170deg, #34362f 0%, #1e201c 55%, #151713 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -1px 0 rgba(0,0,0,.6), 0 8px 18px rgba(0,0,0,.6), 0 1px 0 rgba(0,0,0,.7);
  transform: rotate(-1deg);
  text-align: left;
}
.scope-screen {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: 10px / 9px;
  --g: rgba(120,190,120,.16); --gc: rgba(150,220,150,.30);
  background:
    /* glass highlight */
    linear-gradient(115deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.03) 28%, rgba(255,255,255,0) 45%),
    /* scanlines */
    repeating-linear-gradient(180deg, rgba(0,0,0,.22) 0 1px, rgba(0,0,0,0) 1px 3px),
    /* centre crosshair */
    linear-gradient(90deg, transparent calc(50% - .5px), var(--gc) calc(50% - .5px), var(--gc) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(180deg, transparent calc(50% - .5px), var(--gc) calc(50% - .5px), var(--gc) calc(50% + .5px), transparent calc(50% + .5px)),
    /* graticule 10 x 8 */
    repeating-linear-gradient(90deg, var(--g) 0 1px, transparent 1px 10%),
    repeating-linear-gradient(180deg, var(--g) 0 1px, transparent 1px 12.5%),
    /* phosphor */
    radial-gradient(ellipse at 50% 45%, #1b2a1c 0%, #0f1a11 55%, #070d08 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.8), inset 0 0 28px rgba(0,0,0,.75), inset 0 0 6px rgba(90,255,120,.08);
}
.scope-trace { position: absolute; inset: 0; width: 100%; height: 100%; }
.scope-trace path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.trace-ghost { stroke: rgba(90,255,120,.22); stroke-width: 2.4; }
.trace-beam  { stroke: #6cff8a; stroke-width: 1.8; stroke-dasharray: 150 230; animation: scope-sweep 3.2s linear infinite; }
@keyframes scope-sweep { from { stroke-dashoffset: 380; } to { stroke-dashoffset: 0; } }
.scope-read {
  position: absolute; top: 7px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 9px; letter-spacing: .08em;
  color: rgba(130,255,150,.55); text-shadow: 0 0 4px rgba(90,255,120,.5);
}
.scope-read.tl { left: 10px; } .scope-read.tr { right: 10px; }
.scope-word {
  position: absolute; left: 0; right: 0; bottom: 9px; text-align: center;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
  color: #8dffa4; text-shadow: 0 0 2px rgba(140,255,160,.9), 0 0 10px rgba(90,255,120,.55), 0 0 22px rgba(90,255,120,.3);
  animation: scope-flicker 7s steps(1) infinite;
}
@keyframes scope-flicker { 0%, 92%, 100% { opacity: 1; } 93% { opacity: .78; } 94% { opacity: 1; } 97% { opacity: .9; } }
body.editing .scope-word { display: block; }

/* Corner badge, laser lockup: pulse mark, baseline runs on as a rule, wordmark sits on the rule. */
.laser {
  position: absolute; top: 44px; left: 50%;   /* left is overridden by layoutLasers() so the trace is centred tip to tip */
  width: 1560px; max-width: calc(100% - 96px); height: 192px;
  --laser: #1f6fff;        /* pulse + rule */
  --laser-text: #c4121f;   /* wordmark brand word: scarlet */
  --laser-text2: #4a4a4f;  /* wordmark descriptor: dark grey, quieter than the page headline */
  color: var(--laser);
  text-align: left;
}
.laser-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.laser-line path { fill: none; stroke: var(--laser); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.laser-line .laser-main { stroke-linecap: butt; }
.laser-word {
  position: absolute; left: 17.6%; bottom: 29%;   /* starts where the trough recovers, floats just above the rule */   /* starts where the trough recovers, baseline sits on the rule */
  font-family: var(--display-font); font-weight: 600; font-size: 50px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--laser-text);   /* no glow on the type: the pulse is the light source, the letters are ink */
  white-space: nowrap; line-height: 1;
}
body.editing .laser-word { display: block; }
.laser-word .w1 { color: var(--laser-text); }
.laser-word .w2 { color: var(--laser-text2); font-size: 32px; letter-spacing: .04em; margin-left: .3em; text-transform: lowercase; font-weight: 400; }

/* Long headlines (sentences rather than product names) drop to a calmer scale. */
.section.long h1 { font-size: 54px; letter-spacing: -.02em; }
.section.long .sub { font-size: 31px; margin-top: 30px; }
/* Laser lockup sits absolutely at the top; extra top padding pushes the centred text block down, clear of it. */
.section:has(.laser) { padding-top: 200px; }

.section.black .glyph-btn, .section.mahogany .glyph-btn, .section.brick .glyph-btn, .section.olive .glyph-btn, .section.concrete032 .glyph-btn, .section.rawconcrete .glyph-btn { color: #f5f5f7; }
.section .glyph-btn svg { display: block; }

#site-footer {
  padding: 24px 0 36px; text-align: center;
  font-size: 12px; opacity: .92;
  border-top: 1px solid transparent;
}

/* ---------------- Editing ---------------- */
.ed { outline: none; }
.ed:empty::before { content: attr(data-placeholder); }
body.editing .ed { outline: 1px dashed rgba(41,151,255,.6); outline-offset: 2px; border-radius: 2px; cursor: text; min-width: 8px; display: inline-block; }
body.editing .ed:hover { background: rgba(41,151,255,.12); }
body.editing .ed:focus { outline: 2px solid #2997ff; background: rgba(41,151,255,.1); }
body.editing .ed.optional:empty::after { content: "…"; opacity: .35; }
.ghost { display: none; opacity: .5; cursor: pointer; }
body.editing .ghost { display: inline-block; }
body.editing .ghost:hover { opacity: 1; }
.empty { display: none !important; }
body.editing #viewport { scroll-behavior: auto; }

.sec-tools {
  position: absolute; top: 14px; right: 18px;
  display: none; gap: 2px; align-items: center;
  background: rgba(20,20,22,.9); color: #eee;
  padding: 4px; border-radius: 8px; font-family: var(--font); font-size: 13px;
  backdrop-filter: blur(10px);
}
.section { position: relative; }
body.editing .section:hover .sec-tools { display: flex; }
.sec-tools button { width: 26px; height: 24px; border-radius: 5px; color: #eee; font-size: 13px; cursor: pointer; }
.sec-tools .swatch { width: 18px; height: 18px; border-radius: 50%; margin: 0 2px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.sec-tools .swatch.on { border-color: #fff; }
.sec-tools .swatch:hover { transform: scale(1.15); background-color: inherit; }
.sec-tools button:hover { background: rgba(255,255,255,.15); }
.sec-tools .sep { width: 1px; height: 16px; background: rgba(255,255,255,.2); margin: 0 4px; }

#panel {
  position: fixed; top: 60px; right: 20px; width: 290px; z-index: 1001;
  background: rgba(20,20,22,.94); color: #eee;
  border-radius: 12px; padding: 12px 14px 14px;
  font-family: var(--font); font-size: 13px; line-height: 1.5;
  backdrop-filter: blur(16px); box-shadow: 0 10px 40px rgba(0,0,0,.45);
}
#panel.hidden { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 14px; }
.panel-head button { color: #aaa; cursor: pointer; padding: 2px 6px; }
.panel-hint { color: #aaa; font-size: 12px; margin-bottom: 10px; }
#panel label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
#panel select, #panel input[type=number] { background: #2c2c2f; color: #eee; border: 1px solid #444; border-radius: 5px; padding: 3px 6px; font: inherit; width: 90px; }
#panel input[type=color] { width: 28px; height: 22px; border: 0; background: none; padding: 0; }
.panel-row { display: flex; gap: 6px; margin-top: 10px; }
.panel-row button { flex: 1; background: #2c2c2f; border: 1px solid #444; border-radius: 6px; padding: 6px 4px; color: #eee; cursor: pointer; font-size: 12px; }
.panel-row button:hover { background: #3a3a3e; }
.panel-row button.danger { color: #ff6b6b; }

/* ---------------- Help overlay ---------------- */
#help {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: rgba(20,20,22,.9); color: #eee;
  padding: 10px 16px; border-radius: 10px;
  font-size: 13px; line-height: 1.6; text-align: center;
  backdrop-filter: blur(10px);
  z-index: 1000; pointer-events: none;
  transition: opacity .25s;
}
#help.hidden { opacity: 0; }
#help kbd { background: #333; border-radius: 4px; padding: 1px 6px; font-family: inherit; }
#help code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
