/* ───────────────────────── MOX Skill Studio ─────────────────────────
   MOX brand system — Charcoal #121212 ground, Oxide #460400 atmosphere,
   Vermillion #B91800 accent, Linen type. Grotesque headlines, flared
   accent face for editorial moments.
---------------------------------------------------------------------- */

:root {
  --charcoal:   #121212;
  --surface:    #1b1815;
  --surface-2:  #221e1a;
  --line:       #332d27;
  --line-soft:  #2a2521;

  --linen:      #f1eade;
  --stone:      #a2988a;
  --stone-deep: #6f675c;

  --vermillion:        #b91800;
  --vermillion-bright: #de2c0f;
  --vermillion-soft:   rgba(185, 24, 0, .14);
  --oxide:      #460400;

  --font-head:   "Space Grotesk", "Arial Black", sans-serif;
  --font-body:   "Hanken Grotesk", -apple-system, system-ui, sans-serif;
  --font-accent: "Fraunces", Georgia, serif;

  --ease-out:  cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--charcoal);
  color: var(--linen);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection { background: var(--vermillion); color: var(--linen); }

/* film grain, very quiet */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 50;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ───────────── chrome ───────────── */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 44px;
}

.wordmark { display: flex; align-items: center; gap: 14px; }
.wordmark-logo { height: 20px; width: auto; display: block; }
.wordmark-divider { width: 1px; height: 18px; background: var(--line); }
.wordmark-text {
  font-family: var(--font-head);
  font-weight: 500; font-size: 13px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--stone);
}

.topbar-right { display: flex; align-items: center; gap: 20px; }

.autosave {
  font-size: 12.5px; color: var(--stone-deep);
  opacity: 0; transition: opacity .5s var(--ease-soft);
}
.autosave.show { opacity: 1; }

.progress-rail {
  position: fixed; top: 0; left: 0; right: 0; z-index: 45;
  height: 3px; background: transparent;
}
.progress-fill {
  height: 100%; width: 0%;
  background: var(--vermillion);
  transition: width .7s var(--ease-out);
}

/* ───────────── stage & steps ───────────── */

#stage { position: relative; height: 100vh; }

.step {
  position: absolute; inset: 0;
  display: flex;
  padding: 100px 48px 130px;
  overflow-y: auto;
  visibility: hidden; opacity: 0;
  transition: opacity .45s var(--ease-soft), visibility 0s linear .45s;
}
.step.is-active {
  visibility: visible; opacity: 1;
  transition: opacity .55s var(--ease-soft) .12s, visibility 0s;
}

/* question entrance choreography
   (margin:auto centres safely even when content is taller than the viewport) */
.q { width: min(640px, 100%); margin: auto; }
.q-wide { width: min(780px, 100%); }
.q-xwide { width: min(960px, 100%); }
.welcome-inner, .done-inner { margin: auto; }

.step .q > *,
.welcome-inner > *,
.done-inner > * {
  opacity: 0; transform: translateY(22px);
}
.step.is-active .q > *,
.step.is-active .welcome-inner > *,
.step.is-active .done-inner > * {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.step.is-active .q > *:nth-child(1), .step.is-active .welcome-inner > *:nth-child(1), .step.is-active .done-inner > *:nth-child(1) { transition-delay: .10s; }
.step.is-active .q > *:nth-child(2), .step.is-active .welcome-inner > *:nth-child(2), .step.is-active .done-inner > *:nth-child(2) { transition-delay: .18s; }
.step.is-active .q > *:nth-child(3), .step.is-active .welcome-inner > *:nth-child(3), .step.is-active .done-inner > *:nth-child(3) { transition-delay: .26s; }
.step.is-active .q > *:nth-child(4), .step.is-active .welcome-inner > *:nth-child(4), .step.is-active .done-inner > *:nth-child(4) { transition-delay: .34s; }
.step.is-active .q > *:nth-child(5), .step.is-active .welcome-inner > *:nth-child(5), .step.is-active .done-inner > *:nth-child(5) { transition-delay: .42s; }
.step.is-active .q > *:nth-child(6), .step.is-active .welcome-inner > *:nth-child(6), .step.is-active .done-inner > *:nth-child(6) { transition-delay: .50s; }
.step.is-active .q > *:nth-child(7), .step.is-active .done-inner > *:nth-child(7) { transition-delay: .58s; }

/* ───────────── typography ───────────── */

.eyebrow {
  font-family: var(--font-head);
  font-size: 12px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--stone); margin-bottom: 22px;
}
.qnum {
  color: var(--vermillion-bright);
  font-feature-settings: "tnum";
  margin-right: 10px;
}

.question {
  font-family: var(--font-head);
  font-weight: 700; font-size: clamp(32px, 4.2vw, 50px);
  line-height: 1.04; letter-spacing: -.02em;
  margin-bottom: 18px;
  text-wrap: balance;
}
.question em {
  font-family: var(--font-accent);
  font-style: italic; font-weight: 480;
  font-variation-settings: "opsz" 100;
  letter-spacing: 0;
  color: var(--vermillion-bright);
}

.hint {
  font-size: 16.5px; color: var(--stone);
  max-width: 58ch; margin-bottom: 38px;
}
.hint em { font-style: italic; }

.brand-echo, .brand-echo-mission, .brand-echo-weare { color: var(--vermillion-bright); }

.optional-tag {
  display: inline-block; vertical-align: middle;
  font-family: var(--font-body);
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--stone-deep);
  border: 1px solid var(--line); border-radius: 99px;
  padding: 3px 10px; margin-left: 10px;
}

.sublabel {
  display: block;
  font-size: 15px; font-weight: 500; color: var(--stone);
  margin: 40px 0 12px;
}
.sublabel em { font-style: italic; color: var(--linen); }

/* ───────────── fields ───────────── */

.field {
  display: block; width: 100%;
  font-family: var(--font-body);
  font-size: 18px; color: var(--linen);
  background: transparent;
  border: none; border-bottom: 2px solid var(--line);
  padding: 12px 2px 14px;
  outline: none;
  transition: border-color .3s var(--ease-soft);
}
.field::placeholder { color: var(--stone-deep); }
.field:hover { border-color: #483f37; }
.field:focus { border-color: var(--vermillion-bright); }

.field-xl {
  font-family: var(--font-head);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 600; letter-spacing: -.01em;
  padding-bottom: 18px;
}

.field-area { resize: none; line-height: 1.6; }

.field-error {
  margin-top: 14px; font-size: 14.5px; color: var(--vermillion-bright);
}

.field.shake { animation: shake .4s var(--ease-soft); }
@keyframes shake {
  20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(2px); }
}

/* ───────────── chips ───────────── */

.chip-grid { display: flex; flex-wrap: wrap; gap: 12px; }

.chip {
  font-family: var(--font-body); font-size: 15.5px; font-weight: 500;
  color: var(--stone); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 99px;
  padding: 11px 22px; cursor: pointer;
  transition: transform .25s var(--ease-out), background .25s var(--ease-soft),
              border-color .25s var(--ease-soft), color .25s var(--ease-soft),
              opacity .25s var(--ease-soft);
}
.chip:hover { border-color: var(--vermillion-bright); color: var(--linen); transform: translateY(-2px); }
.chip.is-on {
  background: var(--linen); border-color: var(--linen); color: var(--charcoal);
  transform: translateY(-2px);
}
.chip:active { transform: scale(.96); }
.chip:focus-visible, .task-card:focus-visible { outline: 2px solid var(--vermillion-bright); outline-offset: 3px; }

.chip-grid-dense { gap: 9px; max-height: 42vh; overflow-y: auto; padding: 4px; }
.chip-sm { font-size: 13.5px; padding: 8px 16px; }
.chip.is-elsewhere { opacity: .3; }
.chip.is-elsewhere:hover { opacity: 1; }

.custom-add { display: flex; align-items: flex-end; gap: 14px; }
.custom-add .field { flex: 1; }
.btn-sm { padding: 11px 20px; font-size: 14px; }

/* ───────────── personas ───────────── */

.persona-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 980px) { .persona-grid { grid-template-columns: 1fr; } }

.persona-card {
  background: var(--surface); border: 1.5px solid var(--line-soft); border-radius: 16px;
  padding: 22px 20px 20px;
  display: flex; flex-direction: column; gap: 16px;
  transition: border-color .3s var(--ease-soft), box-shadow .3s var(--ease-soft);
}
.persona-card:focus-within {
  border-color: var(--vermillion);
  box-shadow: 0 18px 44px -22px rgba(185, 24, 0, .35);
}

.persona-head {
  font-family: var(--font-head); font-weight: 600; font-size: 16px;
  letter-spacing: .01em;
  display: flex; align-items: center; gap: 10px;
}
.persona-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--vermillion-soft); color: var(--vermillion-bright);
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  display: grid; place-items: center;
}

.persona-label {
  display: block;
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--stone-deep);
}
.persona-label .field { margin-top: 6px; }

.field-sm { font-size: 14.5px; padding: 8px 2px 10px; }

/* ───────────── tone scales ───────────── */

.scale-list { display: grid; gap: 22px; }

.scale-row {
  background: var(--surface); border: 1.5px solid var(--line-soft); border-radius: 14px;
  padding: 16px 22px 20px;
  transition: border-color .3s var(--ease-soft), background .3s var(--ease-soft);
}
.scale-row.is-set { border-color: #5e1206; background: #201614; }

.scale-labels {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px; gap: 12px;
}
.scale-left, .scale-right {
  font-family: var(--font-head);
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
}
.scale-readout {
  font-family: var(--font-accent);
  font-size: 12.5px; color: var(--stone-deep); font-style: italic;
  text-align: center; flex: 1;
}
.scale-row.is-set .scale-readout { color: var(--vermillion-bright); }

.scale-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px; border-radius: 99px;
  background: var(--line); outline: none; cursor: pointer;
}
.scale-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--charcoal); border: 2px solid var(--linen);
  cursor: grab;
  transition: transform .2s var(--ease-out), border-color .2s, background .2s;
}
.scale-slider::-webkit-slider-thumb:hover { transform: scale(1.15); border-color: var(--vermillion-bright); }
.scale-slider:active::-webkit-slider-thumb { cursor: grabbing; background: var(--vermillion); border-color: var(--vermillion); }
.scale-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--charcoal); border: 2px solid var(--linen); cursor: grab;
}
.scale-slider:focus-visible { outline: 2px solid var(--vermillion-bright); outline-offset: 6px; }
.scale-row.is-set .scale-slider::-webkit-slider-thumb { background: var(--vermillion); border-color: var(--vermillion); }
.scale-row.is-set .scale-slider::-moz-range-thumb { background: var(--vermillion); border-color: var(--vermillion); }

/* ───────────── positioning mad-lib ───────────── */

.madlib {
  font-family: var(--font-accent);
  font-size: clamp(21px, 2.6vw, 27px);
  font-weight: 440; line-height: 2.1;
  font-variation-settings: "opsz" 60;
  color: var(--linen);
  margin-bottom: 8px;
}
.madlib-brand { color: var(--vermillion-bright); font-style: italic; }

.blank {
  font-family: var(--font-accent);
  font-size: inherit; font-weight: 440; color: var(--vermillion-bright);
  background: transparent;
  border: none; border-bottom: 2px dashed #59281c;
  padding: 0 6px 2px; margin: 0 2px;
  outline: none;
  min-width: 130px; max-width: 100%;
  field-sizing: content;
  transition: border-color .3s var(--ease-soft);
}
.blank::placeholder { color: var(--stone-deep); font-style: italic; }
.blank:focus { border-bottom-style: solid; border-color: var(--vermillion-bright); }

.usp-list { display: grid; gap: 14px; }
.usp-row { display: flex; align-items: baseline; gap: 16px; }
.usp-num {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); color: var(--stone);
  font-size: 12.5px; font-weight: 600;
  display: grid; place-items: center; align-self: center;
}

/* ───────────── file buckets ───────────── */

.drop-group { margin-bottom: 26px; }
.drop-group:last-child { margin-bottom: 0; }

.drop-group-head { margin-bottom: 10px; }
.drop-group-title {
  font-family: var(--font-head); font-weight: 600; font-size: 18px;
  letter-spacing: .005em;
}
.drop-group-sub { font-size: 13.5px; color: var(--stone-deep); margin-top: 2px; }
.drop-group-sub em { font-style: italic; color: var(--stone); }

.dropzone.dropzone-row {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 24px; border-radius: 14px;
  text-align: left;
}
.dz-glyph-sm { font-size: 17px; color: var(--vermillion-bright); }
.dz-row-text { font-size: 14.5px; color: var(--stone); }

.drop-group .file-list { margin-top: 12px; }

/* ───────────── task cards ───────────── */

.card-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }

.task-card {
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  color: var(--stone); text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--line-soft); border-radius: 14px;
  padding: 20px 18px 18px; cursor: pointer;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-soft),
              border-color .3s var(--ease-soft), background .3s var(--ease-soft),
              color .3s var(--ease-soft);
}
.task-card:hover {
  transform: translateY(-3px);
  border-color: #6b1a0a;
  box-shadow: 0 16px 36px -20px rgba(185, 24, 0, .4);
  color: var(--linen);
}
.task-card.is-on {
  background: var(--vermillion-soft); border-color: var(--vermillion); color: var(--linen);
}
.task-card.is-on .task-ico { background: var(--vermillion); color: var(--linen); }
.task-card:active { transform: scale(.97); }

.task-ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 16px; color: var(--stone);
  background: var(--surface-2);
  transition: background .3s var(--ease-soft), color .3s var(--ease-soft);
}

/* ───────────── dropzone ───────────── */

.dropzone {
  position: relative;
  border: 2px dashed var(--line); border-radius: 20px;
  background: var(--surface);
  padding: 52px 30px;
  text-align: center; cursor: pointer;
  transition: border-color .3s var(--ease-soft), background .3s var(--ease-soft),
              transform .3s var(--ease-out);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--vermillion-bright); outline: none; }
.dropzone.is-over {
  border-color: var(--vermillion-bright); border-style: solid;
  background: var(--vermillion-soft);
  transform: scale(1.012);
}

.dz-browse { color: var(--vermillion-bright); text-decoration: underline; text-underline-offset: 3px; }

.file-list { list-style: none; margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }

.file-pill {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--linen); color: var(--charcoal);
  border-radius: 99px; padding: 9px 10px 9px 16px;
  font-size: 13.5px; font-weight: 600;
  animation: pill-in .45s var(--ease-out);
}
@keyframes pill-in { from { opacity: 0; transform: translateY(10px) scale(.95); } }
.file-pill .size { color: #847b6d; font-weight: 400; }
.file-pill button {
  width: 22px; height: 22px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(18,18,18,.12); color: var(--charcoal);
  font-size: 12px; line-height: 1;
  display: grid; place-items: center;
  transition: background .2s, color .2s;
}
.file-pill button:hover { background: var(--vermillion); color: var(--linen); }

/* ───────────── review ───────────── */

.review-list { border-top: 1px solid var(--line-soft); margin-bottom: 8px; }

.review-row {
  display: grid; grid-template-columns: 180px 1fr auto;
  gap: 20px; align-items: baseline;
  padding: 18px 4px; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; border-radius: 6px;
  transition: background .25s var(--ease-soft);
}
.review-row:hover { background: rgba(185, 24, 0, .08); }
.review-row dt {
  font-family: var(--font-head);
  font-size: 11.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--stone-deep);
}
.review-row dd { font-size: 15.5px; color: var(--linen); }
.review-row dd.empty { color: var(--stone-deep); font-style: italic; }
.review-row .edit-tag {
  font-size: 13px; color: var(--vermillion-bright);
  opacity: 0; transition: opacity .25s;
}
.review-row:hover .edit-tag { opacity: 1; }

/* ───────────── AI polish ───────────── */

.polish-card {
  background: var(--surface); border: 1.5px solid var(--line-soft); border-radius: 18px;
  padding: 26px 28px; margin: 34px 0 6px;
  box-shadow: inset 0 1px 0 rgba(241, 234, 222, .045);
}

.polish-title {
  font-family: var(--font-head); font-weight: 600; font-size: 18px;
  margin-bottom: 6px;
}
.polish-sub { font-size: 14px; color: var(--stone); max-width: 58ch; }

.polish-key { margin-top: 18px; }
.polish-keynote { margin-top: 10px; font-size: 12.5px; color: var(--stone-deep); }
.polish-keynote strong { color: var(--stone); font-weight: 600; }

.polish-actions { display: flex; align-items: center; gap: 18px; margin-top: 20px; }
.polish-status { font-size: 13.5px; color: var(--stone); }
.polish-status.is-error { color: var(--vermillion-bright); }
.polish-status.is-working::after {
  content: "…"; display: inline-block; width: 1.2em; text-align: left;
  animation: working 1.2s steps(4) infinite;
}
@keyframes working { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.polish-results { margin-top: 22px; display: grid; gap: 14px; }

.diff-row {
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 18px 20px;
}
.diff-head {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  margin-bottom: 12px;
}
.diff-label {
  font-family: var(--font-head);
  font-size: 11.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--stone);
}

.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 99px; overflow: hidden; }
.seg button {
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  background: transparent; color: var(--stone); border: none; cursor: pointer;
  padding: 7px 16px;
  transition: background .25s var(--ease-soft), color .25s var(--ease-soft);
}
.seg button.is-on { background: var(--linen); color: var(--charcoal); }
.seg button:not(.is-on):hover { color: var(--linen); }

.diff-new {
  font-size: 14.5px; color: var(--linen); line-height: 1.6;
  white-space: pre-wrap;
}
.diff-orig {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-soft);
  font-size: 13px; color: var(--stone-deep); line-height: 1.55;
  white-space: pre-wrap;
}
.diff-orig::before {
  content: "Yours: "; font-weight: 600; color: var(--stone);
}

.polish-apply-row { display: flex; align-items: center; gap: 20px; margin-top: 4px; }

/* ───────────── buttons ───────────── */

.btn {
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  letter-spacing: .01em;
  border: none; border-radius: 99px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-soft),
              background .3s var(--ease-soft), color .3s var(--ease-soft);
}
.btn:active { transform: scale(.96); }

.btn-primary {
  background: var(--vermillion); color: var(--linen);
  padding: 15px 30px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14),
              0 8px 24px -10px rgba(185, 24, 0, .5);
}
.btn-primary:hover { background: var(--vermillion-bright); transform: translateY(-2px); }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }
.btn-lg { padding: 19px 38px; font-size: 16.5px; }

.btn-arrow { display: inline-block; transition: transform .3s var(--ease-out); }

.btn-ghost {
  background: transparent; color: var(--stone);
  padding: 14px 22px; border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--linen); color: var(--linen); }

.link-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--stone);
  text-decoration: underline; text-underline-offset: 4px;
  transition: color .25s;
}
.link-btn:hover { color: var(--vermillion-bright); }

.btn:focus-visible, .link-btn:focus-visible {
  outline: 2px solid var(--vermillion-bright); outline-offset: 3px;
}
.field:focus-visible { outline: none; } /* the vermillion underline is the focus indicator */

/* ───────────── nav bar ───────────── */

.navbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 44px 24px;
  background: rgba(18, 18, 18, .55);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  border-top: 1px solid rgba(241, 234, 222, .06);
}
.nav-right { display: flex; align-items: center; gap: 22px; }

.step-count {
  font-family: var(--font-head);
  font-size: 12px; color: var(--stone-deep);
  font-feature-settings: "tnum";
  letter-spacing: .12em;
}

.kbd-hint {
  position: fixed; bottom: 9px; left: 50%; transform: translateX(-50%);
  z-index: 41; font-size: 11.5px; color: var(--stone-deep);
}
.kbd-hint kbd {
  font-family: var(--font-body);
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; font-size: 10.5px;
  background: var(--surface);
}

/* ───────────── welcome ───────────── */

.welcome-inner {
  position: relative; z-index: 3;
  text-align: center; max-width: 780px;
}

.welcome-eyebrow { margin-bottom: 30px; color: var(--stone); }

.welcome-title {
  font-family: var(--font-head);
  font-weight: 700; font-size: clamp(50px, 7.2vw, 88px);
  line-height: .98; letter-spacing: -.025em;
  margin-bottom: 34px;
}
.welcome-title .line { display: block; }
.welcome-title em {
  font-family: var(--font-accent);
  font-style: italic; font-weight: 420;
  font-variation-settings: "opsz" 144;
  letter-spacing: -.01em;
  color: var(--vermillion-bright);
}

.welcome-sub {
  font-size: 19px; color: var(--stone);
  max-width: 52ch; margin: 0 auto 44px;
}
.welcome-sub strong { color: var(--linen); }

.welcome-footnote { margin-top: 26px; font-size: 13px; color: var(--stone-deep); }

/* oxide atmosphere — the poster treatment */
.welcome-orbs { position: absolute; inset: 0; overflow: hidden; z-index: 1; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%;
  opacity: .55;
  animation: drift 28s var(--ease-soft) infinite alternate;
  will-change: transform;
}
.orb-a { width: 900px; height: 900px; background: radial-gradient(closest-side, var(--oxide), transparent 70%); top: -340px; left: -320px; }
.orb-b { width: 840px; height: 840px; background: radial-gradient(closest-side, #3a0500, transparent 70%); bottom: -360px; right: -280px; animation-delay: -6s; }
.orb-c { width: 560px; height: 560px; background: radial-gradient(closest-side, #2c0300, transparent 70%); bottom: -4%; left: 6%; animation-delay: -10s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(50px, -36px) scale(1.14); }
}

/* the interactive MOX mark — tilts toward the cursor, spins when clicked */
.hero-mark {
  background: none; border: none; cursor: pointer;
  width: 58px; height: 58px;
  margin: 0 auto 34px;
  display: block;
  perspective: 600px;
  -webkit-tap-highlight-color: transparent;
}
.hero-mark img {
  width: 100%; height: 100%; object-fit: contain;
  display: block;
  will-change: transform;
  transition: filter .4s var(--ease-soft);
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, .45));
}
.hero-mark.is-spinning img { animation: mark-spin .9s var(--ease-out); }
@keyframes mark-spin {
  0%   { transform: rotateY(0) scale(1); }
  45%  { transform: rotateY(380deg) scale(1.18); }
  100% { transform: rotateY(720deg) scale(1); }
}
.hero-mark:focus-visible { outline: 2px solid var(--vermillion-bright); outline-offset: 6px; border-radius: 12px; }

/* ───────────── done ───────────── */

.done-inner { position: relative; z-index: 2; text-align: center; max-width: 680px; }

.done-mark { margin-bottom: 28px; }
.done-svg { width: 76px; height: 76px; }
.done-circle {
  fill: none; stroke: var(--vermillion-bright); stroke-width: 2.5;
  stroke-dasharray: 183; stroke-dashoffset: 183;
  transform: rotate(-90deg); transform-origin: center;
}
.done-check {
  fill: none; stroke: var(--linen); stroke-width: 3.5;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40;
}
.step.is-active .done-circle { animation: draw 1s var(--ease-out) .3s forwards; }
.step.is-active .done-check  { animation: draw .5s var(--ease-out) 1.1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.done-title {
  font-family: var(--font-head);
  font-weight: 700; font-size: clamp(38px, 5.2vw, 60px);
  letter-spacing: -.02em; line-height: 1.02;
  margin-bottom: 16px;
}
.done-sub { font-size: 17.5px; color: var(--stone); margin-bottom: 36px; }

.install-card {
  text-align: left;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 18px;
  padding: 30px 34px; margin-top: 44px;
}
.install-title {
  font-family: var(--font-head); font-weight: 600; font-size: 19px;
  margin-bottom: 16px;
}
.install-steps { padding-left: 20px; display: grid; gap: 10px; font-size: 15px; color: var(--stone); }
.install-steps strong { color: var(--linen); }
.install-steps code, .install-note code {
  font-size: 13px; background: var(--surface-2); color: var(--linen);
  border-radius: 6px; padding: 2px 7px;
}
.install-note {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft);
  font-size: 13.5px; color: var(--stone-deep);
}

.done-restart { margin-top: 30px; }

/* ───────────── surface refinement ─────────────
   hairline top-light on raised surfaces — the "machined edge" */

.persona-card, .scale-row, .task-card, .install-card, .dropzone {
  box-shadow: inset 0 1px 0 rgba(241, 234, 222, .045);
}
.persona-card:focus-within {
  box-shadow: inset 0 1px 0 rgba(241, 234, 222, .045),
              0 18px 44px -22px rgba(185, 24, 0, .35);
}

/* ───────────── custom cursor ─────────────
   active only on fine pointers; body.has-cursor is set by JS */

body.has-cursor, body.has-cursor * { cursor: none !important; }

.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 200;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: opacity .25s var(--ease-soft);
}
.cursor-dot {
  width: 7px; height: 7px;
  background: var(--vermillion-bright);
  transition: opacity .25s var(--ease-soft),
              width .2s var(--ease-out), height .2s var(--ease-out),
              border-radius .2s var(--ease-out), background .2s var(--ease-soft);
}
.cursor-ring {
  width: 30px; height: 30px;
  border: 1.5px solid rgba(241, 234, 222, .35);
  transition: opacity .25s var(--ease-soft),
              width .25s var(--ease-out), height .25s var(--ease-out),
              border-color .25s var(--ease-soft);
}

/* hovering anything interactive: ring opens up and warms */
body.cursor-hover .cursor-ring {
  width: 48px; height: 48px;
  border-color: rgba(222, 44, 15, .8);
}
body.cursor-hover .cursor-dot { background: var(--linen); }

/* over text fields: dot becomes a caret bar, ring retires */
body.cursor-text .cursor-ring { opacity: 0; }
body.cursor-text .cursor-dot {
  width: 2.5px; height: 22px; border-radius: 2px;
  background: var(--vermillion-bright);
}

/* pressed */
body.cursor-down .cursor-ring { width: 22px; height: 22px; }

/* parked outside the window */
body.cursor-gone .cursor-dot, body.cursor-gone .cursor-ring { opacity: 0; }

/* ───────────── confetti (download celebration) ───────────── */

.confetti {
  position: fixed; z-index: 150;
  pointer-events: none;
  top: 0; left: 0;
  will-change: transform, opacity;
}

/* ───────────── reduced motion ───────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
