/* Theme: next-gen technical design with gold accents */

:root {
  color-scheme: light;

  --bg: #0a0a0a;
  --surface: #1a1a1a;
  --surface-2: #252525;
  --text: #f5f1ea;
  --muted: #b8b0a6;
  --border: rgba(181, 132, 42, 0.15);

  --brand: #d4af37;
  --brand-2: #f4d03f;
  --brand-contrast: #0a0a0a;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;

  --shadow-sm: 0 2px 12px rgba(212, 175, 55, 0.08);
  --shadow-md: 0 20px 60px rgba(212, 175, 55, 0.12);
  --shadow-lg: 0 30px 90px rgba(212, 175, 55, 0.15);

  --max: 1100px;
  
  /* Tech-focused transitions */
  --transition-fast: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 350ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
}

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

/* Modern reveal animation for content */
.reveal {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity var(--transition-slow) ease, transform var(--transition-slow) ease;
}

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

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

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes glow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.4)); }
  50% { filter: drop-shadow(0 0 40px rgba(212, 175, 55, 0.6)); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

@keyframes counterPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Keep dark mode forced */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light;
    --bg: #0a0a0a;
    --surface: #1a1a1a;
    --surface-2: #252525;
    --text: #f5f1ea;
    --muted: #b8b0a6;
    --border: rgba(181, 132, 42, 0.15);
    --brand: #d4af37;
    --brand-2: #f4d03f;
    --brand-contrast: #0a0a0a;
  }
}

/* Light theme */
html[data-theme="light"] {
  --bg: #f8f5f0;
  --surface: #f0ede8;
  --surface-2: #e8e3db;
  --text: #1a1510;
  --muted: #6b5f54;
  --border: rgba(181, 132, 42, 0.2);
  --brand: #c89a3a;
  --brand-2: #d4af37;
  --brand-contrast: #1a1510;
  
  --shadow-sm: 0 2px 12px rgba(181, 132, 42, 0.06);
  --shadow-md: 0 20px 60px rgba(181, 132, 42, 0.1);
  --shadow-lg: 0 30px 90px rgba(181, 132, 42, 0.12);
}

html[data-theme="light"] body {
  background: linear-gradient(135deg, #f8f5f0 0%, #f0ede8 50%, #f5f0ea 100%);
}

html[data-theme="light"] body::before {
  background: 
    radial-gradient(circle at 20% 50%, rgba(181, 132, 42, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.06) 0%, transparent 50%);
}

* {
  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.6;
  letter-spacing: 0.3px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  background: linear-gradient(135deg, #0a0a0a 0%, #121212 50%, #0f0f0f 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

/* Animated gradient background overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: 
    radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(244, 208, 63, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: gradientShift 15s ease infinite;
}

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

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

a {
  color: var(--brand);
  text-decoration: none;
  position: relative;
  transition: color var(--transition-fast) ease;
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width var(--transition-fast) ease;
}

a:hover {
  color: var(--brand-2);
}

a:hover::after {
  width: 100%;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 20px 70px;
}

@media (max-width: 720px) {
  .container {
    padding: 24px 16px 54px;
  }

  .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: 12px;
    width: 100%;
  }

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

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

  .lang-label {
    display: none;
  }

  .lang-select {
    width: 100%;
  }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, 
    rgba(26, 26, 26, 0.85), 
    rgba(37, 37, 37, 0.7));
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(244, 208, 63, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-base) ease;
}

.topbar:hover {
  background: linear-gradient(135deg, 
    rgba(26, 26, 26, 0.9), 
    rgba(37, 37, 37, 0.8));
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(244, 208, 63, 0.15);
}

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

.logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 32px rgba(212, 175, 55, 0.3), inset -1px -1px 2px rgba(0, 0, 0, 0.5);
  animation: float 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.logo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  animation: gradientShift 3s ease infinite;
}

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

.brand-title strong {
  font-size: 1rem;
  letter-spacing: 0.4px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-title span {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.2px;
}

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

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

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

.lang-select {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(26, 26, 26, 0.6);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition-fast) ease;
  backdrop-filter: blur(10px);
}

.lang-select:hover {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(26, 26, 26, 0.8);
}

.lang-select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-color: var(--brand);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(26, 26, 26, 0.6);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-fast) ease;
  backdrop-filter: blur(10px);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast) ease;
}

.chip:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(26, 26, 26, 0.8);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.15);
}

.chip:hover::before {
  opacity: 1;
}

.chip:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

#themeToggle {
  border: none;
  padding: 8px 12px;
  font-size: 1.1rem;
  transition: all var(--transition-fast) ease;
}

#themeToggle:hover {
  transform: translateY(-2px) rotate(-20deg);
}

#themeToggle:focus-visible {
  outline: 2px solid var(--brand);
}

.hero {
  margin-top: 28px;
  padding: 40px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.7),
    rgba(37, 37, 37, 0.5));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(244, 208, 63, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base) ease;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 0% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(244, 208, 63, 0.08) 0%, transparent 50%);
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
}

.hero:hover {
  border-color: rgba(212, 175, 55, 0.35);
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.8),
    rgba(37, 37, 37, 0.65));
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
  position: relative;
  z-index: 2;
}

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

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

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

.h-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
  font-weight: 800;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--text), var(--brand));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  animation: shimmer 3s linear infinite;
}

.h-subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  font-weight: 700;
  font-size: 0.98rem;
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.8),
    rgba(37, 37, 37, 0.6));
  transition: all var(--transition-fast) ease;
  backdrop-filter: blur(10px);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}

.button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast) ease;
}

.button.primary {
  border-color: var(--brand);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-contrast);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.3);
}

.button.primary:hover {
  box-shadow: 0 16px 40px rgba(212, 175, 55, 0.45), 0 0 20px rgba(212, 175, 55, 0.2);
  transform: translateY(-2px);
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.5);
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.95),
    rgba(37, 37, 37, 0.8));
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.2);
}

.button:hover::before {
  opacity: 1;
}

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

.kpi-card {
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.7),
    rgba(37, 37, 37, 0.5));
  padding: 20px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(244, 208, 63, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition-base) ease;
}

.kpi-card:hover {
  border-color: rgba(212, 175, 55, 0.35);
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.8),
    rgba(37, 37, 37, 0.65));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(244, 208, 63, 0.12);
}

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

.kpi {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg,
    rgba(37, 37, 37, 0.6),
    rgba(26, 26, 26, 0.4));
  border: 1px solid rgba(212, 175, 55, 0.15);
  transition: all var(--transition-fast) ease;
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast) ease;
  pointer-events: none;
}

.kpi:hover {
  border-color: rgba(212, 175, 55, 0.3);
  background: linear-gradient(135deg,
    rgba(37, 37, 37, 0.8),
    rgba(26, 26, 26, 0.6));
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.15);
}

.kpi:hover::before {
  opacity: 1;
}

.kpi strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: counterPulse 0.6s ease-out;
}

.kpi span {
  display: block;
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.section {
  margin-top: 28px;
}

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

.section-header h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.4px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

.card {
  grid-column: span 4;
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.65),
    rgba(37, 37, 37, 0.45));
  padding: 20px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(244, 208, 63, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition-base) ease;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast) ease;
  pointer-events: none;
}

.card:hover {
  border-color: rgba(212, 175, 55, 0.3);
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.8),
    rgba(37, 37, 37, 0.6));
  transform: translateY(-8px) rotateX(2deg) rotateY(-1deg);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(244, 208, 63, 0.12), 0 20px 60px rgba(212, 175, 55, 0.2);
}

.card:hover::before {
  opacity: 1;
}

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

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

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
  background: linear-gradient(135deg, var(--brand), var(--text));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

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

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

.bullet {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  flex: 0 0 auto;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
  animation: glow 3s ease-in-out infinite;
}

.footer {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(212, 175, 55, 0.15);
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.65),
    rgba(37, 37, 37, 0.45));
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(244, 208, 63, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition-base) ease;
}

.footer:hover {
  border-color: rgba(212, 175, 55, 0.25);
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.8),
    rgba(37, 37, 37, 0.6));
}

.small {
  font-size: 0.92rem;
  letter-spacing: 0.2px;
}

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

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

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

.label {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
  color: var(--text);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(26, 26, 26, 0.6);
  color: var(--text);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(244, 208, 63, 0.08);
  transition: all var(--transition-fast) ease;
  backdrop-filter: blur(10px);
  font-family: inherit;
  letter-spacing: 0.2px;
}

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

.input::placeholder,
.textarea::placeholder {
  color: rgba(184, 176, 166, 0.6);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-color: var(--brand);
  background: rgba(26, 26, 26, 0.8);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(244, 208, 63, 0.12), 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* Blur backdrop when forms are active */
body.form-active::before {
  backdrop-filter: blur(8px) brightness(0.9);
  -webkit-backdrop-filter: blur(8px) brightness(0.9);
}

/* Loading state animation */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
  animation: shimmer 1.5s infinite;
}

/* Success state */
.success {
  animation: slideInUp 0.6s ease-out;
}

.success::before {
  content: '✓';
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%) scale(0);
  color: var(--brand);
  font-weight: 700;
  animation: counterPulse 0.6s ease-out 0.3s forwards;
}

/* Button loading state */
.button.loading {
  opacity: 0.8;
  pointer-events: none;
}

.button.loading::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px solid transparent;
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Transition animations between states */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

.fade-out {
  animation: fadeOut 0.4s ease-out;
}

.hint {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.status {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: linear-gradient(135deg,
    rgba(37, 37, 37, 0.6),
    rgba(26, 26, 26, 0.4));
  backdrop-filter: blur(10px);
  font-size: 0.95rem;
  color: var(--text);
}

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

.wizard-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 14px;
}

.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: 32px 20px;
}

.apply-card {
  width: min(740px, 100%);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg,
    rgba(26, 26, 26, 0.8),
    rgba(37, 37, 37, 0.6));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(244, 208, 63, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 24px;
  transition: all var(--transition-base) ease;
}

.apply-card:hover {
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(244, 208, 63, 0.15);
}

.apply-stage {
  transform: translateY(0);
  opacity: 1;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1), opacity 450ms ease;
}

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

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

.apply-header {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.apply-title {
  margin: 0;
  font-size: 0.98rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.apply-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.apply-question {
  margin: 0 0 12px;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  letter-spacing: -0.015em;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--text));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}

.apply-done {
  display: grid;
  gap: 12px;
  padding: 8px 0;
}

.apply-done h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: -0.015em;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.apply-done p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

/* 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 20px;
}

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

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

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

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

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

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

.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 cubic-bezier(0.16, 1, 0.3, 1), opacity 520ms ease;
}

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

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

.story-title {
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  letter-spacing: -0.02em;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--text));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.story-text {
  margin-top: 20px;
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  line-height: 1.9;
  color: rgba(245, 241, 234, 0.95);
}

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

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

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

.story-button {
  appearance: none;
  border: 1px solid var(--brand);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-contrast);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.3);
  transition: all var(--transition-fast) ease;
  cursor: pointer;
  letter-spacing: 0.3px;
}

.story-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(212, 175, 55, 0.45), 0 0 20px rgba(212, 175, 55, 0.2);
}

.story-button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

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

.story-langbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.15);
  box-shadow: var(--shadow-md);
}

.story-langbtn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.98rem;
  line-height: 1;
  transition: all var(--transition-fast) ease;
  color: var(--muted);
  font-weight: 600;
}

.story-langbtn[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(244, 208, 63, 0.2));
  color: var(--brand);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.story-langbtn:hover {
  color: var(--brand);
}

.story-langbtn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
