:root {
  --bg: #000;
  --fg: #dcdcdc;
  --dim: rgba(220,220,220,.5);
  --line: rgba(220,220,220,.18);
  --font: "Helvetica Neue", Helvetica, -apple-system, Arial, sans-serif;
}
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 700 12px/1.4 var(--font); overflow: hidden; }
body { text-transform: uppercase; letter-spacing: -.03em; }
canvas#eye { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.dim { color: var(--dim); }

.pill {
  display: inline-block; border: 1px solid var(--fg); border-radius: 999px; padding: 4px 11px 3px;
  font: 700 11px/1.3 var(--font); letter-spacing: -.02em; text-transform: uppercase; background: transparent; color: var(--fg);
  cursor: pointer; user-select: none; white-space: nowrap; transition: background .12s, color .12s;
}
.pill:hover, .pill.active { background: var(--fg); color: var(--bg); }

.head { position: fixed; left: 20px; top: 18px; right: 20px; pointer-events: none; z-index: 3; }
.head-title { font-size: 20px; line-height: 1.1; letter-spacing: -.04em; margin-bottom: 12px; }
.head-title .dim { font-size: 12px; margin-left: 8px; }
.brands { display: flex; flex-wrap: wrap; gap: 6px; max-width: 60vw; pointer-events: auto; }

.hint { position: fixed; right: 20px; top: 24px; text-align: right; max-width: 34vw; font-size: 10px; color: var(--dim); pointer-events: none; transition: opacity .6s; }
body.quiet .hint { opacity: 0; }

.tip {
  position: fixed; z-index: 5; pointer-events: none; padding: 5px 10px 4px; background: var(--bg);
  border: 1px solid var(--fg); font-size: 11px; white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis;
}
.tip .dim { margin-left: 8px; }

/* detail panel */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 46vw); z-index: 8; overflow-y: auto;
  background: var(--bg); border-left: 1px solid var(--fg); padding: 18px 22px 40px; box-sizing: border-box;
  animation: panelIn .28s cubic-bezier(.2,.7,.2,1);
}
@keyframes panelIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.panel-brands { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.panel-title { font-size: 26px; line-height: 1.02; letter-spacing: -.045em; margin: 0 0 10px; }
.panel-meta { font-size: 11px; margin-bottom: 22px; }
.panel-media { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.panel-media img, .panel-media video { width: 100%; display: block; background: #cfcfcf; }
.panel-caption { text-transform: none; font-weight: 400; font-size: 14px; line-height: 1.45; letter-spacing: -.01em; white-space: pre-line; margin: 0 0 18px; }
.panel-tags { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--dim); margin-bottom: 26px; }
.panel-tags span { cursor: pointer; }
.panel-tags span:hover { color: var(--fg); }
.panel-foot { border-top: 1px solid var(--line); padding-top: 12px; font-size: 11px; }
.panel-foot a { color: inherit; text-decoration: none; }
.panel-foot a:hover { color: var(--fg); }

/* prompt */
.prompt {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(12px); width: min(560px, calc(100vw - 48px));
  opacity: 0; transition: opacity .3s ease, transform .3s ease; z-index: 6;
}
.prompt.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.prompt input {
  width: 100%; box-sizing: border-box; background: var(--bg); color: var(--fg); border: 1px solid var(--fg);
  border-radius: 999px; padding: 12px 20px 11px; font: 700 14px var(--font); letter-spacing: -.03em; text-transform: uppercase; outline: none;
}
.prompt input::placeholder { color: var(--dim); }
.answer { text-align: center; font-size: 11px; margin-top: 10px; min-height: 1.4em; }
.answer b { color: var(--fg); }

body.has-panel .prompt { left: calc((100vw - min(520px, 46vw)) / 2); }
body.has-panel .hint { display: none; }

@media (max-width: 1000px) { .hint { display: none; } }

/* tune panel */
.tune-btn { position: fixed; right: 20px; top: 52px; z-index: 9; }
body.has-panel .tune-btn { display: none; }
.tune {
  position: fixed; right: 20px; top: 90px; z-index: 9; width: 300px; max-height: calc(100vh - 120px); overflow-y: auto;
  background: var(--bg); border: 1px solid var(--fg); padding: 12px 14px 14px; box-sizing: border-box; font-size: 10.5px;
}
.tune-top { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 12px; }
.tune-top span { flex: 1; }
.tune label { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 8px; margin: 3px 0; }
.tune output { text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }
.tune input[type=range] { width: 100%; accent-color: #dcdcdc; height: 14px; }

/* ask */
.answer { max-width: 100%; line-height: 1.5; }
.answer .ai { color: var(--fg); font-weight: 700; }
.answer .thinking::after { content: '…'; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.keyform { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.keyform input { flex: 1; max-width: 380px; background: var(--bg); border: 1px solid var(--fg); border-radius: 999px; padding: 6px 12px; font: 700 11px var(--font); color: var(--fg); outline: none; }

/* stage — ARCH Cam post-open look */
.stage { position: fixed; inset: 0; z-index: 4; transform-origin: 50% 50%; overflow: hidden; }
.stage-frost { position: absolute; inset: 0; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); }
.stage-glow { position: absolute; pointer-events: none; image-rendering: auto; will-change: transform, opacity; }
.stage-card { position: absolute; overflow: hidden; background: #000; box-shadow: 0 30px 80px rgba(0,0,0,.6); cursor: pointer; will-change: left, top, width, height; border-radius: 0 !important; }
.stage-card img, .stage-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.panel { z-index: 8; }
.panel-media .slide { position: relative; }
.panel-media .slide .pill { position: absolute; left: 10px; bottom: 10px; background: var(--bg); }
.panel-media .slide { cursor: pointer; }

/* minimal mode: only the prompt, centred on the pupil, Apple-style frosted glass */
.head, .hint, .tune-btn { display: none !important; }
.prompt {
  bottom: auto !important; top: 50% !important; left: 50% !important;
  opacity: 1 !important; transform: translate(-50%, -50%) !important;
  width: min(520px, calc(100vw - 48px));
  transition: opacity .3s ease, left .3s ease;
}
.prompt input {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.10);
  -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 12px 40px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 15px 22px 14px; font-size: 14px; text-align: center;
}
.prompt input:focus { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.1); }
.prompt input::placeholder { color: rgba(220,220,220,.6); }
.answer { margin-top: 12px; }
.answer:not(:empty) {
  display: inline-block; left: 50%; position: relative; transform: translateX(-50%);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 10px 16px;
  -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  max-width: min(560px, calc(100vw - 48px)); text-align: center;
}
body.has-panel .prompt { left: calc((100vw - min(520px, 46vw)) / 2) !important; opacity: 0 !important; pointer-events: none; }

/* edgeless prompt + cascading example sentences */
.prompt form { position: relative; }
.prompt input { border: none !important; box-shadow: 0 14px 44px rgba(0,0,0,.35); background: rgba(255,255,255,.08); }
.prompt input:focus { background: rgba(255,255,255,.12); }
.ghost { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; font: 700 14px var(--font); letter-spacing: -.03em; text-transform: uppercase; color: rgba(220,220,220,.5); white-space: nowrap; overflow: hidden; }
.ghost span { display: inline-block; opacity: 0; transform: translateX(-10px); transition: opacity .32s cubic-bezier(.32,.72,0,1), transform .38s cubic-bezier(.32,.72,0,1); }
.ghost.in span { opacity: 1; transform: none; }
.ghost.out span { opacity: 0; transform: translateX(12px); }
/* slide navigation */
.stage-nav { position: absolute; z-index: 5; width: 44px; height: 32px; padding: 0; text-align: center; line-height: 32px; font-size: 14px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); display: none; }
.stage-nav:hover { background: var(--fg); color: var(--bg); }
.panel-media .slide.active img { outline: 2px solid var(--fg); outline-offset: -2px; }

/* panel: first image, then the post's info, then the rest */
.panel-first { margin-bottom: 14px; }
.panel-info { margin-bottom: 26px; }
.panel-info .panel-meta { margin: 0 0 10px; }
.panel-info .panel-caption { margin: 0 0 14px; font-size: 15px; }
.panel-info .panel-brands { margin-bottom: 10px; }
.panel-info .panel-tags { margin-bottom: 0; }

/* no hover label */
.tip { display: none !important; }

/* readable answers: sentence case, no caps */
.prompt, .prompt input, .ghost, .answer { text-transform: none !important; }
.prompt input { font-weight: 500; letter-spacing: -.01em; font-size: 15px; }
.ghost { font-weight: 500; letter-spacing: -.01em; font-size: 15px; }
.answer { font-weight: 400; letter-spacing: -.01em; font-size: 15px; line-height: 1.5; color: var(--fg); padding: 14px 20px !important; }
.answer .ai { font-weight: 400; }
.answer .count { display: block; margin-top: 8px; font-size: 12px; color: var(--dim); font-weight: 600; }
.answer b { font-weight: 600; }

/* slide navigation: small type under the card, no arrows */
.stage-nav { width: auto; height: auto; padding: 0; line-height: 1; border: none; border-radius: 0; background: none !important;
  -webkit-backdrop-filter: none; backdrop-filter: none; font: 500 12px var(--font); letter-spacing: -.01em; text-transform: none; color: var(--dim); cursor: pointer; }
.stage-nav:hover { color: var(--fg); background: none !important; }
.stage-nav, .stage-nav:focus, .stage-nav:focus-visible { outline: none !important; box-shadow: none !important; }

/* contact details: clickable, roomy, left aligned */
.answer a { color: var(--fg); text-decoration: underline; text-decoration-color: rgba(220,220,220,.25); text-underline-offset: 3px; }
.answer a:hover { text-decoration-color: var(--fg); }
.answer.has-links { text-align: left; padding: 18px 22px !important; }
.answer .links { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.10); }
.answer .links a { display: block; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -.02em; padding: 2px 0; }
.answer .links a:hover { text-decoration: underline; }

/* links: never underlined; hovering one item fades the others */
.answer a, .answer a:hover, .answer .links a, .answer .links a:hover { text-decoration: none !important; }
.answer .links a { transition: opacity .25s ease; }
.answer .links:hover a { opacity: .3; }
.answer .links:hover a:hover { opacity: 1; }
.answer .ai a { font-weight: 600; }

/* consistent graphic language: rectangles, no strokes */
.panel { border-left: none !important; }
.panel-media .slide.active img { outline: none !important; }
.prompt { width: min(600px, calc(100vw - 48px)); }
.prompt input { border-radius: 0 !important; padding: 18px 24px 17px; background: rgba(255,255,255,.17); box-shadow: 0 18px 60px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.14); }
.prompt input:focus { background: rgba(255,255,255,.22); }
.answer:not(:empty) {
  display: block; left: 0; transform: none; width: 100%; box-sizing: border-box; max-width: none;
  margin-top: 0; border-radius: 0; border: none; border-top: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.15); box-shadow: 0 18px 60px rgba(0,0,0,.4);
  transform-origin: top center; animation: fold .32s cubic-bezier(.32,.72,0,1) both;
}
.answer.has-links { padding: 20px 24px !important; }
@keyframes fold { from { transform: scaleY(0); opacity: 0; } to { transform: none; opacity: 1; } }

.prompt { width: min(440px, calc(100vw - 48px)); }

/* long answers (full job descriptions): keep paragraphs, scroll inside the panel */
.answer .ai { white-space: pre-line; }
.answer:not(:empty) { max-height: 58vh; overflow-y: auto; }
.answer.has-links { text-align: left; }

/* dropdown sections (job openings) */
.answer .sec { margin: 12px 0 0; border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; }
.answer .sec summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.answer .sec summary::-webkit-details-marker { display: none; }
.answer .sec-title { font-weight: 600; letter-spacing: -.02em; }
.answer .sec-title::after { content: ' +'; color: var(--dim); font-weight: 400; }
.answer .sec[open] .sec-title::after { content: ' \2013'; }
.answer .sec-meta { color: var(--dim); font-size: 12px; white-space: nowrap; }
.answer .sec-body { margin-top: 10px; white-space: pre-line; font-weight: 400; color: rgba(220,220,220,.85); }
.answer .sec-body a { font-weight: 600; }
.answer .copied { margin-left: 8px; font-size: 11px; color: var(--dim); font-weight: 400; }

.answer .sec-body { overflow: hidden; }
.answer .sec summary { transition: color .2s; }
.answer .sec:hover summary { color: var(--fg); }

.panel-download { margin-left: 8px; text-decoration: none; text-transform: none; font-weight: 600; letter-spacing: -.01em; }
.panel-top { justify-content: flex-start; }
.panel-top .panel-idx { margin-left: auto; }


/* ---------- mobile: fluid, touch first */
canvas#eye { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
body.mobile .prompt { width: calc(100vw - 32px); top: auto !important; bottom: calc(12px + env(safe-area-inset-bottom)) !important; transform: translateX(-50%) !important; }
body.mobile .answer:not(:empty) { max-height: 52vh; }
body.mobile .prompt input { font-size: 16px; padding: 15px 18px 14px; }         /* 16px stops iOS zooming the field */
body.mobile .ghost { font-size: 16px; }
body.mobile .answer:not(:empty) { max-height: 46vh; font-size: 15px; }
body.mobile .panel {
  top: 0; right: 0; left: 0; bottom: 0; width: 100%; height: 100%; border-left: none;
  padding: 14px 18px 40px; animation: sheetIn .32s cubic-bezier(.32,.72,0,1);
  background: var(--bg);
}
body.mobile .panel-media video { width: 100%; display: block; background: #000; }
body.mobile .panel-media .slide .pill { display: none; }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
body.mobile.has-panel .prompt { opacity: 0 !important; pointer-events: none; }
body.mobile .panel-top { margin-bottom: 14px; }
body.mobile .panel-info .panel-caption { font-size: 14px; }
body.mobile .tune { width: calc(100vw - 32px); right: 16px; top: 60px; }
body.mobile .stage-card { box-shadow: 0 20px 50px rgba(0,0,0,.6); }
@media (max-width: 700px) { .pill { padding: 6px 12px 5px; font-size: 12px; } }

/* the hidden attribute must win over display rules (e.g. the Download PDF pill on non-report posts) */
[hidden] { display: none !important; }

/* answer folds away when tapping back to the sphere */
.answer.folding { animation: foldOut .26s cubic-bezier(.32,.72,0,1) both; pointer-events: none; }
@keyframes foldOut { from { transform: none; opacity: 1; } to { transform: scaleY(0); opacity: 0; } }
