:root {
  --font-display: "Neue Metana Mono", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Neue Voxion", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@font-face {
  font-family: "Neue Metana Mono";
  src: url("assets/fonts/NeueMetanaMono-Light.otf") format("opentype");
  font-display: swap;
  font-style: normal;
  font-weight: 300;
}

@font-face {
  font-family: "Neue Metana Mono";
  src: url("assets/fonts/NeueMetanaMono-SemiBold.otf") format("opentype");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

@font-face {
  font-family: "Helvetica Neue Voxion";
  src: url("assets/fonts/HelveticaNeue.ttc") format("truetype-collection");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

:root {
  --brown: #31251f;
  --orange: #f18536;
  --sand: #d8c5b6;
  --ice: #f1f1f1;
  --paper: #fffaf6;
  --line: rgba(49, 37, 31, 0.18);
  --line-strong: rgba(49, 37, 31, 0.34);
  --muted: rgba(49, 37, 31, 0.68);
  --shadow: 0 22px 60px rgba(49, 37, 31, 0.12);
  --radius: 8px;
  --topbar-height: 72px;
  --page-gutter: clamp(18px, 5vw, 44px);
  color: var(--brown);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f3eee8;
  color: var(--brown);
  overflow-x: hidden;
}

button,
input,
textarea {
  font-family: var(--font-body);
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--topbar-height);
  padding: 10px var(--page-gutter);
  background: var(--brown);
  border-bottom: 2px solid var(--orange);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: 48px;
  min-height: 48px;
}

.brand img {
  display: block;
  width: 100%;
  height: 48px;
  object-fit: contain;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button,
.icon-button {
  min-height: 40px;
  border: 1px solid var(--orange);
  border-radius: var(--radius);
  background: var(--orange);
  color: var(--brown);
  font-weight: 700;
  padding: 0 14px;
  white-space: nowrap;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button--ghost {
  background: transparent;
  color: var(--sand);
  border-color: rgba(216, 197, 182, 0.46);
}

.button--ghost:hover {
  background: rgba(216, 197, 182, 0.16);
  border-color: rgba(216, 197, 182, 0.72);
  color: var(--ice);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  padding: 0;
  font-size: 18px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-height));
}

.workspace {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  background: #f3eee8;
  overflow-x: clip;
}

.hero {
  position: relative;
  --hero-progress: 0;
  overflow-x: clip;
  overflow-y: visible;
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: calc(100svh - var(--topbar-height));
  margin-bottom: 0;
  padding: 0;
  background: #f3eee8;
  color: var(--brown);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 -220px 0;
  background:
    radial-gradient(circle at 78% 78%, rgba(241, 133, 54, 0.22), rgba(241, 133, 54, 0) 42%),
    linear-gradient(180deg, rgba(243, 238, 232, 0) 0%, #f3eee8 76%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brown);
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: end;
  max-width: min(700px, 100%);
  font-size: clamp(3.35rem, 6.2vw, 7rem);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0;
  text-align: right;
  text-transform: uppercase;
  z-index: 2;
  opacity: calc(1 - var(--hero-progress) * 2);
  transform: translate3d(0, calc(var(--hero-progress) * -72px), 0)
    scale(calc(1 - var(--hero-progress) * 0.045));
  transform-origin: right center;
  transition: opacity 90ms linear, transform 90ms linear;
  will-change: opacity, transform;
}

.hero p {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  max-width: min(360px, 100%);
  margin: 0 0 clamp(78px, 9vw, 124px);
  color: rgba(49, 37, 31, 0.82);
  font-size: clamp(0.92rem, 1.12vw, 1.05rem);
  font-weight: 700;
  line-height: 1.08;
  text-align: left;
  z-index: 2;
  opacity: calc(1 - var(--hero-progress) * 0.36);
  transform: translate3d(calc(var(--hero-progress) * -24px), calc(var(--hero-progress) * 34px), 0);
  transition: opacity 90ms linear, transform 90ms linear;
  will-change: opacity, transform;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  grid-template-rows: auto 1fr auto;
  gap: clamp(20px, 4vw, 48px);
  width: 100%;
  min-height: calc(100svh - var(--topbar-height));
  padding: clamp(26px, 5vw, 60px) var(--page-gutter);
  overflow: visible;
  background: #f3eee8;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: translate3d(0, calc(var(--hero-progress) * -18px), 0);
  transition: transform 90ms linear;
  will-change: transform;
}

.hero__content::before {
  content: "";
  position: absolute;
  right: clamp(-120px, -6vw, -44px);
  bottom: clamp(-260px, -18vw, -150px);
  width: clamp(380px, 48vw, 700px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 42%, rgba(255, 231, 213, 0.7), rgba(241, 133, 54, 0.94) 34%, rgba(241, 133, 54, 0.7) 56%, rgba(241, 133, 54, 0) 72%);
  filter: blur(12px);
  pointer-events: none;
  opacity: calc(0.96 - var(--hero-progress) * 0.18);
  transform:
    translate3d(calc(var(--hero-progress) * -120px), calc(var(--hero-progress) * -46px), 0)
    scale(calc(1 + var(--hero-progress) * 0.22));
  transition: opacity 90ms linear, transform 90ms linear;
  will-change: opacity, transform;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label,
.question {
  display: grid;
  gap: 8px;
}

label span,
.question__label {
  color: var(--brown);
  font-size: 0.92rem;
  font-weight: 800;
}

.hero label span {
  color: var(--sand);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--brown);
  outline: none;
}

input {
  min-height: 44px;
  padding: 9px 12px;
}

textarea {
  min-height: 112px;
  padding: 12px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(241, 133, 54, 0.18);
}

.progress-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  width: min(1180px, calc(100% - clamp(36px, 10vw, 88px)));
  margin: clamp(-156px, -12vw, -96px) auto 18px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.progress-strip strong {
  font-size: 1.45rem;
  color: var(--orange);
}

.progress-strip span {
  color: var(--muted);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(216, 197, 182, 0.5);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange);
  transition: width 180ms ease;
}

.briefing-form {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 18px;
  width: min(1180px, calc(100% - clamp(36px, 10vw, 88px)));
  margin: 0 auto clamp(24px, 5vw, 56px);
}

.briefing-section {
  scroll-margin-top: 100px;
  padding: clamp(18px, 3vw, 30px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 42px rgba(49, 37, 31, 0.08);
}

.section-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brown);
  color: var(--orange);
  font-weight: 900;
  font-family: var(--font-display);
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0;
}

.section-header p {
  margin: 5px 0 0;
  color: var(--muted);
}

.questions {
  display: grid;
  gap: 16px;
}

.question__hint {
  margin-top: -3px;
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.option {
  display: flex;
  align-items: center;
  min-height: 46px;
  gap: 9px;
  padding: 10px 12px;
  background: rgba(216, 197, 182, 0.22);
  border: 1px solid rgba(49, 37, 31, 0.12);
  border-radius: var(--radius);
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  transform-origin: center;
}

.option:hover {
  background: rgba(241, 133, 54, 0.12);
  border-color: rgba(241, 133, 54, 0.45);
  box-shadow: 0 8px 22px rgba(49, 37, 31, 0.08);
  transform: scale(1.015);
}

.option input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--orange);
}

.scale {
  display: grid;
  gap: 8px;
}

.scale__row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) repeat(10, minmax(38px, 54px)) minmax(120px, 1.2fr);
  gap: 6px;
  align-items: center;
}

.scale__edge,
.scale__choice {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(216, 197, 182, 0.3);
  text-align: center;
}

.scale__edge {
  padding: 8px;
  font-size: 0.92rem;
}

.scale__choice {
  background: #fff;
  position: relative;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  transform-origin: center;
}

.scale__choice:hover {
  background: rgba(241, 133, 54, 0.12);
  border-color: rgba(241, 133, 54, 0.45);
  box-shadow: 0 8px 22px rgba(49, 37, 31, 0.08);
  transform: scale(1.06);
}

.scale__choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 18px;
  min-height: 18px;
  accent-color: var(--orange);
}

.scale__choice span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--brown);
  font-size: 0.88rem;
  font-weight: 800;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.scale__choice input:checked + span {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--brown);
}

dialog {
  width: min(900px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: var(--paper);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(49, 37, 31, 0.6);
}

.dialog__header,
.dialog__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: var(--brown);
  color: var(--ice);
}

.dialog__header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.dialog__header .icon-button {
  color: var(--brown);
}

#exportOutput {
  display: block;
  min-height: 52vh;
  border: 0;
  border-radius: 0;
  background: #fff;
}

@media (max-width: 1180px) {
  .hero h1 {
    font-size: clamp(3rem, 5.6vw, 5.8rem);
  }

  .hero__content {
    grid-template-columns: minmax(230px, 0.82fr) minmax(300px, 1.18fr);
  }

  .scale__row {
    grid-template-columns: minmax(110px, 1fr) repeat(10, minmax(34px, 1fr)) minmax(110px, 1fr);
  }
}

@media (max-width: 960px) {
  :root {
    --page-gutter: clamp(18px, 4vw, 34px);
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .hero__content {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto auto 1fr;
    min-height: calc(100svh - var(--topbar-height));
    gap: 18px;
  }

  .hero h1,
  .hero p {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    text-align: left;
  }

  .hero h1 {
    align-self: end;
    max-width: 780px;
    font-size: clamp(2.9rem, 8.3vw, 5.8rem);
    line-height: 1.02;
    transform-origin: left center;
  }

  .hero p {
    align-self: start;
    max-width: 520px;
    margin: 0;
    font-size: clamp(0.98rem, 2.4vw, 1.22rem);
  }

  .hero__content::before {
    right: clamp(-240px, -24vw, -120px);
    bottom: clamp(-280px, -30vw, -150px);
    width: clamp(420px, 68vw, 720px);
  }

  .progress-strip {
    margin-top: clamp(-128px, -11vw, -74px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .hero h1,
  .hero p,
  .hero__content,
  .hero__content::before,
  .hero::after {
    --hero-progress: 0 !important;
    transition: none;
  }

  .hero h1,
  .hero p,
  .hero__content,
  .hero__content::before,
  .hero::after {
    transform: none;
  }
}

@media (max-width: 760px) {
  :root {
    --page-gutter: 18px;
  }

  .topbar {
    gap: 14px;
    min-height: auto;
    padding-block: 10px;
  }

  .topbar__actions {
    gap: 6px;
  }

  .button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.88rem;
  }

  .brand {
    width: 42px;
    min-height: 42px;
  }

  .brand img {
    height: 42px;
  }

  .hero,
  .hero__content {
    min-height: 570px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 10.4vw, 4.25rem);
  }

  .hero p {
    max-width: 360px;
  }

  .field-grid,
  .option-grid {
    grid-template-columns: 1fr;
  }

  .progress-strip {
    grid-template-columns: 1fr;
    margin-top: -70px;
    gap: 8px;
  }

  .section-header {
    grid-template-columns: 1fr;
  }

  .scale__row {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
    gap: 4px;
  }

  .scale__edge {
    grid-column: span 5;
    font-size: 0.8rem;
  }
}

@media (max-width: 520px) {
  :root {
    --topbar-height: 68px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .topbar__actions {
    display: flex;
    width: auto;
    flex: 1;
    justify-content: flex-end;
    gap: 6px;
  }

  .topbar .button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.78rem;
  }

  .brand {
    width: 36px;
    min-height: 36px;
  }

  .brand img {
    height: 36px;
  }

  .hero,
  .hero__content {
    min-height: 430px;
  }

  .hero__content {
    grid-template-rows: 0.55fr auto auto 0.55fr;
    padding-top: 22px;
    padding-bottom: 58px;
  }

  .hero h1 {
    font-size: clamp(2.05rem, 10.8vw, 3.25rem);
    line-height: 1.04;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .progress-strip {
    margin-top: -50px;
  }

  .briefing-section {
    padding: 18px;
  }

  .section-number {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 380px) {
  .button {
    font-size: 0.82rem;
    padding: 0 8px;
  }

  .hero h1 {
    font-size: clamp(1.92rem, 10.4vw, 2.85rem);
  }

  .scale__row {
    grid-template-columns: repeat(5, minmax(36px, 1fr));
  }
}
