/* Chief Tech Habibi - styles. Follows the Chief Tech Habibi design system (tokens, logo and applications). */

:root {
  --midnight: #09081C;
  --signal: #EEFF41;
  --glow-core: #F9FFC2;
  --ultraviolet: #8B5CFF;
  --violet-light: #B79BFF;
  --moon: #F1EEFF;
  --lavender: #D9D4F2;
  --dusk: #B8B2D9;

  /* Neutral surfaces and lines, taken from the Concept C boards */
  --surface: #1A1640;
  --line: #2E2A5A;
  --control-border: #7A73A8;

  --glow-button: 0 0 30px rgba(238, 255, 65, 0.4);
  --glow-panel: 0 0 60px rgba(139, 92, 255, 0.45);

  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;

  --column: 680px;
  --radius: 12px;        /* radius-md: buttons */
  --radius-input: 4px;   /* radius-sm: inputs and small tags */
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

/* 19px body on desktop, about 20% smaller on mobile */
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
@media (min-width: 768px) { html { font-size: 19px; } }

body {
  margin: 0;
  background: var(--midnight);
  color: var(--lavender);
  font-family: var(--body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

h1, h2, h3 { margin: 0 0 0.6em; color: var(--moon); }
h1 { font-family: var(--display); font-weight: 800; font-size: 3.05rem; line-height: 1.04; letter-spacing: -0.026em; }
h2 { font-family: var(--display); font-weight: 800; font-size: 1.895rem; line-height: 1.1; letter-spacing: -0.014em; }
h3 { font-family: var(--body); font-weight: 500; font-size: 1.158rem; line-height: 1.3; }
@media (max-width: 767px) { h1 { font-size: 2.6rem; } h2 { font-size: 1.75rem; } }
@media (max-width: 400px) { h1 { font-size: 2.25rem; } }
p { margin: 0 0 1em; max-width: 65ch; }
strong { font-weight: 500; color: var(--moon); }
.small { font-size: max(0.737rem, 13px); font-weight: 400; }
.quiet { color: var(--dusk); }

a { color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--moon); }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

img { max-width: 100%; height: auto; display: block; }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 768px) { .wrap { padding: 0 72px; } }
/* Left-aligned content column inside the wider frame */
.column > * { max-width: var(--column); }

.section { padding: 3.5rem 0; border-top: 1px solid var(--line); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--signal); color: var(--midnight); padding: 0.5rem 1rem; border-radius: var(--radius); z-index: 10; }
.skip-link:focus { top: 1rem; }

/* Pre-launch placeholder highlight. Remove every .todo before launch. */
.todo { background: var(--line); color: var(--glow-core); outline: 1px dashed var(--dusk); padding: 0 0.3em; border-radius: 3px; font-weight: 400; }

/* ---------- Header ---------- */

.site-header { padding: 1.5rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
/* Horizontal lockup: face left, wordmark right.
   Wordmark size = 0.24 x face height; gap = 0.14 x face height. */
.wordmark { display: inline-flex; align-items: center; gap: 17px; text-decoration: none; color: var(--moon); font-family: var(--display); }
.wordmark:hover { color: var(--moon); }
.wordmark-face { width: auto; height: 120px; flex-shrink: 0; }
.wordmark-full { font-weight: 800; font-size: 29px; line-height: 0.95; letter-spacing: -0.03em; }
.wordmark-full > span { display: block; }
.wordmark-accent { color: var(--signal); }
@media (max-width: 600px) {
  .wordmark { gap: 10px; }
  .wordmark-face { height: 72px; }
  .wordmark-full { font-size: 17px; }
}
/* The header button only makes sense before the quiz starts */
body[data-view]:not([data-view="landing"]) .header-cta { display: none; }
/* On small phones the hero button sits just below, so the header keeps only the name */
@media (max-width: 480px) { .site-header .btn-secondary { display: none; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 30px;
  font: 500 1rem/1.3 var(--body);
  background: var(--signal); color: var(--midnight);
  border: 0; border-radius: var(--radius);
  box-shadow: var(--glow-button);
  text-decoration: none; cursor: pointer;
}
.btn:hover { color: var(--midnight); text-decoration: underline; text-underline-offset: 0.18em; }
.btn:disabled { opacity: 0.7; cursor: progress; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px;
  font: 500 15px/1.3 var(--body);
  background: transparent; color: var(--signal);
  border: 2px solid var(--signal); border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
}
.btn-secondary:hover { color: var(--signal); text-decoration: underline; text-underline-offset: 0.18em; }

.btn-text {
  font: 400 1rem/1.4 var(--body);
  background: none; border: 0; padding: 0.4rem 0; min-height: 44px;
  color: var(--signal); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}

/* ---------- Hero: the signed note ---------- */

.hero { padding: 1.5rem 0 4rem; }
.hero-grid { display: grid; gap: 3rem; align-items: stretch; position: relative; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 64px; }
  .hero { padding-top: 2rem; }
}
.note { display: flex; flex-direction: column; justify-content: center; }
.note h1 { max-width: 660px; margin-bottom: 0.5em; }
.note p { max-width: 560px; margin-bottom: 0.75em; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.cta-row .small { color: var(--dusk); margin: 0; }

/* Sign-off: "Ayman" handwritten in flat signal yellow, no glow, flowing on from the
   last line of the note. That line grows to fit it, so nothing overlaps. */
.note .note-last { margin-bottom: 3.5rem; } /* breathing room above the button; scorecard.js adds more if the seal needs it */
.signoff {
  display: inline-block;
  margin: 0.5cm 0 0 0.4em; /* sits half a centimetre below the top of its line */
  vertical-align: top;
  font-family: "Mr Dafoe", "Snell Roundhand", "Brush Script MT", cursive;
  font-weight: 400; font-size: 68px; line-height: 1;
  color: var(--signal);
  transform: rotate(-3deg);
}
/* The header face switches on like a neon sign: two quick flickers, then steady, under 700ms */
/* No fill mode: if a browser pauses animations, the logo still shows at full strength */
.wordmark-face.lighting { animation: neon-on 650ms steps(1, end); }
@keyframes neon-on {
  0%   { opacity: 0.2; }
  12%  { opacity: 1; }
  22%  { opacity: 0.15; }
  34%  { opacity: 1; }
  44%  { opacity: 0.3; }
  56%  { opacity: 1; }
  100% { opacity: 1; }
}

/* Ultraviolet portrait panel */
.panel {
  background: var(--ultraviolet);
  color: var(--midnight);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--glow-panel);
  display: flex; flex-direction: column; gap: 16px;
  max-width: 420px;
}
/* Round seal (Badge lockup), on midnight after the sign-off. On wide screens scorecard.js
   centres it between the signature and the portrait panel. */
.seal { display: inline-block; width: 140px; height: 140px; margin: 2px 0 0 0.5em; vertical-align: top; }
.seal.seal-floating { position: absolute; margin: 0; }
@media (max-width: 899px) { .seal { width: 116px; height: 116px; margin-left: 1em; } }
.seal-text { font-family: var(--display); font-weight: 600; font-size: 11.5px; fill: var(--signal); }
.panel .portrait { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: var(--surface); aspect-ratio: 4 / 5; flex-grow: 1; }
.panel .portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.portrait-fallback { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--lavender); font-size: 15px; }
.portrait.no-photo img { display: none; }
.portrait.no-photo .portrait-fallback { display: flex; }
.panel-caption p { margin: 0; font-size: 14px; font-weight: 500; color: var(--midnight); }

/* ---------- Landing sections ---------- */

.learn-list { margin: 0; }
.learn-list > div { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.learn-list > div:last-child { border-bottom: 1px solid var(--line); }
.learn-list dt { font-weight: 500; font-size: 1.158rem; color: var(--moon); margin-bottom: 0.2rem; }
.learn-list dd { margin: 0; max-width: 60ch; }

/* Editorial split on desktop: heading left (stays in view), content right.
   Fills the width below the hero. Stacks as a single column on smaller screens. */
@media (min-width: 900px) {
  .split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 64px; }
  .split > h2 { grid-column: 1; grid-row: 1 / span 12; align-self: start; position: sticky; top: 2rem; margin: 0; }
  .split > :not(h2) { grid-column: 2; }
  .section .split { padding-top: 0.5rem; }
}

/* ---------- Quiz ---------- */

.progress-text { color: var(--dusk); font-size: max(0.737rem, 13px); font-weight: 400; margin-bottom: 0.4rem; }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 2rem; max-width: var(--column); }
.progress span { display: block; height: 100%; background: var(--moon); transition: width 0.2s ease; }
.q-cat { color: var(--dusk); font-weight: 400; margin-bottom: 0.5rem; }
.q-text { font-size: clamp(1.5rem, 4vw, 1.895rem); outline: none; max-width: 28ch; }
.q-text:focus-visible { outline: 3px solid var(--signal); }

.options { display: grid; gap: 0.6rem; max-width: 520px; margin: 1.75rem 0 1.25rem; }
.option {
  font: 400 1rem/1.4 var(--body);
  text-align: left;
  color: var(--moon);
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  min-height: 52px;
  cursor: pointer;
}
.option:hover { border-color: var(--moon); }
.option[aria-pressed="true"] { background: var(--moon); color: var(--midnight); border-color: var(--moon); font-weight: 500; }

/* ---------- Forms ---------- */

.form { max-width: var(--column); margin: 1.75rem 0 1rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 500; color: var(--moon); margin-bottom: 0.35rem; }
.optional { font-weight: 300; color: var(--dusk); }
.field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%;
  font: 400 1rem/1.4 var(--body);
  color: var(--moon);
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-input);
  padding: 0.75rem 0.85rem;
  min-height: 48px;
}
.field input::placeholder, .field textarea::placeholder { color: var(--dusk); opacity: 1; }
.field select option { background: var(--surface); color: var(--moon); }
.field textarea { resize: vertical; }
.field-pair { display: grid; gap: 0 1rem; }
@media (min-width: 620px) { .field-pair { grid-template-columns: 1fr 1fr; } }
.field.check { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start; }
.field.check input { width: 1.3rem; height: 1.3rem; margin: 0.2rem 0 0; accent-color: var(--signal); }
.field.check label { font-weight: 300; color: var(--lavender); margin: 0; }
.hp { position: absolute; left: -9999px; }

.alert { border: 1px solid var(--dusk); background: var(--surface); padding: 1rem 1.1rem; margin: 0 0 1.25rem; border-radius: var(--radius); }
.alert p { color: var(--moon); margin-bottom: 0.75rem; }

#gate-score { font-family: var(--display); font-weight: 800; }

/* ---------- Results ---------- */

.score-panel { padding: 2.5rem 0 3rem; }
.score-panel h2 { font-size: clamp(1.5rem, 4vw, 1.895rem); outline: none; }
.score-label { color: var(--dusk); margin-bottom: 0; }
.score-big { font-family: var(--display); font-weight: 800; line-height: 1; margin: 0.3rem 0 1.1rem; color: var(--moon); letter-spacing: -0.03em; }
#r-score { font-size: clamp(5rem, 16vw, 7.5rem); font-variant-numeric: tabular-nums; }
.score-of { color: var(--dusk); font-size: 2rem; letter-spacing: 0; }
.tier-msg { font-size: 1.158rem; color: var(--moon); }

.tier-chip { display: inline-block; font-weight: 500; color: var(--midnight); padding: 0.3rem 0.85rem; border-radius: var(--radius); }
.tier-exploring { background: var(--dusk); }
.tier-building { background: var(--ultraviolet); }
.tier-ready { background: var(--signal); }

.bars { max-width: var(--column); margin-bottom: 2.5rem; }
.bar-row { margin-bottom: 1.1rem; }
.bar-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.35rem; font-weight: 500; color: var(--moon); }
.bar-value { color: var(--dusk); font-weight: 400; white-space: nowrap; }
.bar-track { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--violet-light); }

.notes { list-style: none; padding: 0; margin: 0 0 2.5rem; max-width: var(--column); }
.notes li { border-top: 1px solid var(--line); padding: 1rem 0 0.25rem; }
.notes li:last-child { border-bottom: 1px solid var(--line); }
.note-q { color: var(--dusk); font-size: max(0.737rem, 13px); font-weight: 400; margin-bottom: 0.3rem; }

/* The page's one Ultraviolet block on the results view */
.next {
  background: var(--ultraviolet); color: var(--midnight);
  border-radius: 28px; padding: 1.75rem; margin-bottom: 2rem;
}
.next p { color: var(--midnight); font-weight: 400; }
.next p:last-child { margin-bottom: 0; }
.next a:not(.btn) { color: var(--midnight); }
.next .btn { margin: 0.25rem 0 1rem; }
.next :focus-visible { outline-color: var(--midnight); }

/* ---------- Footer ---------- */

.site-footer { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.site-footer p { margin-bottom: 0.6rem; }
.site-footer .small { color: var(--dusk); }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; padding: 0; margin: 0 0 1rem; }
.footer-links a { color: var(--lavender); }
.footer-links a:hover { color: var(--moon); }

/* ---------- Simple pages (privacy, 404, thanks) ---------- */

.page { padding: 2.5rem 0 4rem; }
.page h2 { font-size: 1.158rem; font-family: var(--body); font-weight: 500; letter-spacing: 0; margin-top: 2rem; }
.page ul { max-width: 65ch; padding-left: 1.2rem; }
.page li { margin-bottom: 0.4rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Social icons in the footer: drawn inline, coloured by the link */
.footer-links a { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }

/* Not-professional-advice line directly under the results notes */
.notes + p { margin-top: -1.75rem; margin-bottom: 2.5rem; }
