/* Theme: clean, modern information page */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #fcfaf5;
  --surface-2: #f6f1e6;
  --text: #0b0b0b;
  --muted: #3a3a3a;
  --border: rgba(11, 11, 11, 0.10);

  --brand: #b5842a;
  --brand-2: #e0c06a;
  --brand-contrast: #0b0b0b;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 30px rgba(16, 24, 40, 0.10);

  --max: 1100px;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Subtle reveal for homepage content */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Keep the site light (off-white + gold) even if OS is dark. */
    color-scheme: light;

    --bg: #fbf7ef;
    --surface: #f5f0e6;
    --surface-2: #efe7d6;
    --text: #0b0b0b;
    --muted: #3a3a3a;
    --border: rgba(11, 11, 11, 0.14);

    --brand: #b5842a;
    --brand-2: #e0c06a;
    --brand-contrast: #0b0b0b;

    --shadow-sm: 0 1px 2px rgba(11, 11, 11, 0.10);
    --shadow-md: 0 10px 30px rgba(11, 11, 11, 0.14);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

body > :not(.bg-canvas) {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 18px 56px;
}

@media (max-width: 720px) {
  .container {
    padding: 18px 14px 44px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    justify-content: center;
  }

  .brand-title {
    text-align: center;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
  }

  .chip {
    padding: 7px 10px;
    font-size: 0.9rem;
    text-align: center;
    flex: 1 1 calc(50% - 10px);
    max-width: calc(50% - 10px);
    justify-content: center;
  }

  .lang {
    flex: 1 1 calc(50% - 10px);
    max-width: calc(50% - 10px);
    justify-content: center;
  }

  .lang-label {
    display: none;
  }

  .lang-select {
    width: 100%;
  }

  .story-langbar {
    flex: 1 1 calc(50% - 10px);
    max-width: calc(50% - 10px);
    justify-content: center;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 25px rgba(181, 132, 42, 0.25);
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title strong {
  font-size: 0.98rem;
  letter-spacing: 0.2px;
}

.brand-title span {
  font-size: 0.82rem;
  color: var(--muted);
}

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

.lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--muted);
}

.lang-select {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.lang-select:focus {
  outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent);
  outline-offset: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  font-weight: 600;
  font-size: 0.92rem;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.chip:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand) 18%, var(--border));
}

.chip:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 2px;
}

.hero {
  margin-top: 22px;
  padding: 26px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--surface) 78%, transparent),
      color-mix(in srgb, var(--surface-2) 68%, transparent)
    );
  box-shadow: var(--shadow-md);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: center;
}

.hero-inner > div {
  text-align: center;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 22px 14px;
  }
}

.h-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
  letter-spacing: -0.02em;
}

.h-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
}

.cta-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.95rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button.primary {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-contrast);
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand) 22%, var(--border));
}

.button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 3px;
}

.kpi-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 16px;
}

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

.kpi {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
  border: 1px solid var(--border);
}

.kpi strong {
  display: block;
  font-size: 1.1rem;
}

.kpi span {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.section {
  margin-top: 22px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: 0.2px;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.card {
  grid-column: span 4;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 980px) {
  .card {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .card {
    grid-column: span 12;
  }
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.bullet {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  flex: 0 0 auto;
}

.footer {
  margin-top: 26px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.small {
  font-size: 0.9rem;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.label {
  font-weight: 700;
  font-size: 0.92rem;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent);
  outline-offset: 2px;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.status {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.wizard-step {
  display: grid;
  gap: 10px;
}

.wizard-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.wizard-actions .button {
  width: 100%;
}

@media (min-width: 520px) {
  .wizard-actions .button {
    width: auto;
  }
}

/* Full-screen application (one question per screen) */
.apply-body {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.apply-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
}

.apply-card {
  width: min(740px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--surface) 78%, transparent),
      color-mix(in srgb, var(--surface-2) 68%, transparent)
    );
  box-shadow: var(--shadow-md);
  padding: 20px;
}

.apply-stage {
  transform: translateY(0);
  opacity: 1;
  transition: transform 420ms ease, opacity 420ms ease;
}

.apply-stage.is-out {
  transform: translateY(-18px);
  opacity: 0;
}

.apply-stage.is-in {
  transform: translateY(18px);
  opacity: 0;
}

.apply-header {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.apply-title {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.apply-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.apply-question {
  margin: 0 0 10px;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  letter-spacing: -0.015em;
}

.apply-done {
  display: grid;
  gap: 10px;
  padding: 6px 0;
}

.apply-done h1 {
  margin: 0;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  letter-spacing: -0.015em;
}

.apply-done p {
  margin: 0;
  color: var(--muted);
}

/* Premium storytelling flow (one story per screen) */
.story-body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
}

.story-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 0 0;
  z-index: 20;
}

.story-header .container {
  padding: 0 18px;
}

.story-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 18px;
}

.story-shell.with-header {
  padding-top: 128px;
}

@media (max-width: 720px) {
  .story-header {
    position: sticky;
    padding: 12px 0 0;
  }

  .story-shell.with-header {
    padding-top: 56px;
  }

  .story-title {
    font-size: clamp(1.25rem, 5.2vw, 1.6rem);
  }

  .story-text {
    line-height: 1.75;
  }
}

.story-wrap {
  width: min(700px, 100%);
  text-align: center;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
}

.story-stage {
  transform: translateY(0);
  opacity: 1;
  transition: transform 520ms ease, opacity 520ms ease;
}

.story-stage.is-out {
  transform: translateY(-22px);
  opacity: 0;
}

.story-stage.is-in {
  transform: translateY(22px);
  opacity: 0;
}

.story-title {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  letter-spacing: -0.02em;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

.story-text {
  margin-top: 18px;
  font-size: clamp(0.98rem, 1.25vw, 1.06rem);
  line-height: 1.85;
  color: color-mix(in srgb, var(--text) 92%, transparent);
}

.story-text p {
  margin: 0 0 18px;
}

.story-text p:last-child {
  margin-bottom: 0;
}

.story-actions {
  margin-top: 26px;
  display: flex;
  justify-content: center;
}

.story-button {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border));
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-contrast);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, filter 180ms ease;
}

.story-button:hover {
  filter: brightness(1.02);
}

.story-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 3px;
}

.story-button:active {
  transform: translateY(1px);
}

.story-langbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(10px);
}

.story-langbtn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.98rem;
  line-height: 1;
}

.story-langbtn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
}

.story-langbtn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent);
  outline-offset: 3px;
}
