/* ─────────────────────────────────────────────────────
   K&N Elite — Unified Light Premium Design System
   Warm ivory · Soft black text · Champagne gold
   ───────────────────────────────────────────────────── */

:root {
  /* Palette */
  --ink:          #1A1714;
  --ink-soft:     #3B342D;
  --ink-60:       rgba(26,23,20,0.60);
  --ink-40:       rgba(26,23,20,0.40);
  --ink-20:       rgba(26,23,20,0.16);
  --ink-10:       rgba(26,23,20,0.08);
  --ink-5:        rgba(26,23,20,0.04);

  --ivory:        #FAF6EC;
  --ivory-2:      #F3EDDD;
  --bone:         #FFFDF7;
  --paper:        #FFFFFF;

  --gold:         #C9A961;
  --gold-deep:    #A8893F;
  --gold-soft:    #E2CC97;
  --gold-10:      rgba(201,169,97,0.10);
  --gold-20:      rgba(201,169,97,0.22);
  --gold-30:      rgba(201,169,97,0.35);

  --ok:           #6B7A4E;
  --warn:         #B08A3E;
  --err:          #8E3A2B;

  --serif:  "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:   "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 2px;
  --r-md: 4px;
  --r-lg: 8px;

  --sh-1: 0 1px 2px rgba(26,23,20,0.04), 0 4px 12px rgba(26,23,20,0.04);
  --sh-2: 0 2px 6px rgba(26,23,20,0.06), 0 16px 40px rgba(26,23,20,0.08);
  --sh-3: 0 12px 32px rgba(26,23,20,0.12), 0 32px 80px rgba(26,23,20,0.14);
  --sh-gold: 0 0 0 3px rgba(201,169,97,0.18), 0 8px 24px rgba(201,169,97,0.15);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv02";
}

/* ── Type ── */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono  { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 500;
}
.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(44px, 6vw, 92px);
  line-height: 1;
  letter-spacing: -0.025em;
}
.display em { font-style: italic; color: var(--gold-deep); font-weight: 400; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: clamp(36px, 4vw, 56px); line-height: 1.05; }
h2 { font-size: 36px; line-height: 1.1; }
h3 { font-size: 24px; line-height: 1.2; }
h4 { font-size: 17px; line-height: 1.2; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }

p { color: var(--ink-soft); }
.muted { color: var(--ink-60); }

/* ── Hairlines ── */
.hair      { height: 1px; background: var(--ink-10); width: 100%; }
.hair-gold { height: 1px; background: linear-gradient(90deg, transparent, var(--gold) 40%, var(--gold) 60%, transparent); }

/* ── Buttons ── */
.btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 16px 28px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--ivory);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .35s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  min-height: 52px;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
}
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(226,204,151,0.4), transparent);
  transform: translateX(-100%);
  transition: transform .6s var(--ease);
}
.btn:hover::after { transform: translateX(100%); }
.btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: var(--ivory); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(1px); }

.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink-20); }
.btn-ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--ivory); }

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}
.btn-gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: var(--ivory); }

.btn-lg { padding: 20px 36px; font-size: 13px; min-height: 60px; }
.btn-sm { padding: 10px 18px; font-size: 11px; min-height: 38px; letter-spacing: 0.12em; }

.btn .arrow { transition: transform .4s var(--ease); display: inline-flex; }
.btn:hover .arrow { transform: translateX(5px); }

/* ── Inputs ── */
.field { display: flex; flex-direction: column; gap: 8px; }
.label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-60);
  font-weight: 500;
}

.input, .select, .textarea {
  font-family: var(--sans);
  font-size: 16px;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--ink-10);
  border-radius: var(--r-sm);
  color: var(--ink);
  width: 100%;
  transition: all .3s var(--ease);
  min-height: 56px;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-20); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--sh-gold);
  background: var(--bone);
}
.input::placeholder { color: var(--ink-40); }

/* Hero-style huge input */
.input-hero {
  font-family: var(--serif);
  font-size: 22px;
  padding: 26px 28px;
  min-height: 80px;
  background: rgba(255,253,247,0.96);
  border: 1px solid rgba(201,169,97,0.4);
  backdrop-filter: blur(12px);
  color: var(--ink);
  letter-spacing: 0;
}
.input-hero:focus {
  background: var(--paper);
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,169,97,0.22), 0 20px 48px rgba(0,0,0,0.25);
}

/* Light hero input — big, on ivory */
.input-hero-light {
  font-family: var(--serif);
  font-size: 22px;
  padding: 22px 24px;
  min-height: 72px;
  background: var(--paper);
  border: 1px solid var(--ink-20);
  color: var(--ink);
  letter-spacing: 0;
  box-shadow: var(--sh-1);
}
.input-hero-light::placeholder { color: var(--ink-40); font-style: italic; }
.input-hero-light:focus {
  border-color: var(--gold);
  box-shadow: var(--sh-gold);
  background: var(--bone);
}

/* ── HERO FULL BG ── */
.hero-full {
  position: relative;
  min-height: calc(100vh - 82px);
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-full-bg {
  position: absolute; inset: 0;
  z-index: 0;
}
.hero-full-bg img {
  width: 100%; height: 100%; object-fit: cover;
  animation: ken-burns 24s ease-in-out infinite alternate;
}
.hero-full-overlay {
  position: absolute; inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(26,23,20,0.28) 0%, rgba(26,23,20,0.55) 60%, rgba(26,23,20,0.72) 100%),
    radial-gradient(ellipse at center, rgba(26,23,20,0.15) 0%, rgba(26,23,20,0.55) 100%);
}
.hero-full-content {
  position: relative; z-index: 2;
  max-width: 900px;
  padding: 120px 40px 80px;
  text-align: center;
  color: var(--ivory);
  width: 100%;
}
.hero-full-content .display { color: var(--ivory); }
.hero-full-content .display em { color: var(--gold-soft); }
.hero-photo-tag {
  position: absolute; bottom: 24px; right: 28px; z-index: 2;
  color: rgba(255,255,255,0.7);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
}
.hero-stat-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 48px;
  padding: 18px 28px;
  background: rgba(255,253,247,0.08);
  border: 1px solid rgba(226,204,151,0.35);
  backdrop-filter: blur(10px);
  color: var(--ivory);
}
.hero-stat-badge .num {
  font-family: var(--serif); font-size: 40px; font-weight: 300;
  color: var(--gold-soft); line-height: 1;
}
.hero-stat-badge .lbl {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: rgba(255,253,247,0.75);
}

/* ── Cards ── */
.card {
  background: var(--paper);
  border: 1px solid var(--ink-10);
  border-radius: var(--r-md);
  padding: 32px;
  transition: all .4s var(--ease);
}
.card-hover { cursor: pointer; position: relative; overflow: hidden; }
.card-hover::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease);
}
.card-hover:hover {
  border-color: var(--gold-30);
  transform: translateY(-4px);
  box-shadow: var(--sh-2);
}
.card-hover:hover::before { transform: scaleX(1); }

/* ── Chips ── */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--ink-20);
  border-radius: 100px;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-60);
  background: var(--paper);
}
.chip-gold {
  color: var(--gold-deep);
  border-color: var(--gold);
  background: var(--gold-10);
}

/* ── Layout ── */
.page { min-height: 100vh; display: flex; flex-direction: column; background: var(--ivory); }
.container { max-width: 1400px; margin: 0 auto; padding: 0 40px; width: 100%; }
.container-narrow { max-width: 980px; margin: 0 auto; padding: 0 40px; width: 100%; }

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 48px;
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 236, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink-10);
}
.topbar-floating {
  position: absolute; top: 0; left: 0; right: 0;
  background: transparent;
  backdrop-filter: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  color: var(--ivory);
}

.brand { display: flex; align-items: center; gap: 16px; cursor: pointer; user-select: none; }
.brand { position: relative; }

.brand-mark-img {
  transition: transform .8s cubic-bezier(0.34, 1.56, 0.64, 1), filter .6s var(--ease);
  filter: drop-shadow(0 2px 6px rgba(168,137,63,0.15));
  position: relative;
  z-index: 2;
}

.brand:hover .brand-mark-img {
  transform: rotate(25deg);
  filter: drop-shadow(0 4px 16px rgba(168,137,63,0.55));
}

.brand::after {
  content: "";
  position: absolute;
  left: -4px; top: 4px;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--gold);
  border-right-color: var(--gold-soft);
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
  pointer-events: none;
  transition: all .6s var(--ease);
}

.brand:hover::after {
  opacity: 0.6;
  transform: rotate(60deg) scale(1.1);
  animation: magic-trail 1s var(--ease) forwards;
}

@keyframes magic-trail {
  0%   { opacity: 0; transform: rotate(-90deg) scale(0.7); }
  50%  { opacity: 0.7; }
  100% { opacity: 0; transform: rotate(180deg) scale(1.4); }
}
.brand-text {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.18em;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  text-transform: uppercase;
  font-feature-settings: "lnum";
}
.brand-text .amp {
  color: var(--gold-deep);
  font-style: italic;
  font-weight: 500;
  margin: 0 0.03em;
}
.brand-sub {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.36em;
  color: var(--ink-60);
  margin-top: 5px;
  display: block;
  text-transform: uppercase;
  font-weight: 400;
}

.topbar-floating .brand-text { color: var(--ivory); }
.topbar-floating .brand-sub { color: rgba(255,255,255,0.75); }

.nav { display: flex; gap: 28px; align-items: center; }
.nav a {
  font-size: 13px;
  color: inherit;
  text-decoration: none;
  opacity: .7;
  transition: all .25s;
  cursor: pointer;
  position: relative;
  letter-spacing: 0.02em;
}
.nav a:hover, .nav a.active { opacity: 1; color: var(--gold-deep); }
.topbar-floating .nav a:hover, .topbar-floating .nav a.active { color: var(--gold-soft); }
.nav a.active::after {
  content: ""; position: absolute; bottom: -8px; left: 0; right: 0;
  height: 1px; background: var(--gold);
  animation: rule-grow .5s var(--ease) both;
}

.lang-switch {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  border: 1px solid var(--ink-20);
  border-radius: 100px;
  padding: 3px;
}
.topbar-floating .lang-switch { border-color: rgba(255,255,255,0.25); }
.lang-switch button {
  background: transparent; border: none; color: inherit;
  padding: 6px 12px; cursor: pointer; border-radius: 100px;
  font-family: inherit; font-size: inherit; letter-spacing: inherit;
  opacity: .55; transition: all .25s var(--ease);
}
.lang-switch button.active {
  background: var(--gold); color: var(--ink); opacity: 1;
}
.lang-switch button:hover:not(.active) { opacity: 1; }

/* ── PROGRESS BAR ── */
.progress-bar {
  position: sticky; top: 80px; z-index: 40;
  height: 2px;
  background: var(--ink-10);
  width: 100%;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-soft));
  background-size: 200% 100%;
  transition: width .8s var(--ease);
  animation: gold-shimmer 3s linear infinite;
}

/* ── BIG STEP INDICATOR ── */
.step-header {
  display: flex; align-items: baseline; gap: 24px;
  margin-bottom: 16px;
}
.step-big-num {
  font-family: var(--serif);
  font-size: 120px;
  font-weight: 300;
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1px var(--gold);
  letter-spacing: -0.04em;
  font-feature-settings: "lnum";
}
.step-big-num.active {
  color: var(--gold);
  -webkit-text-stroke: 0;
}
.step-meta { display: flex; flex-direction: column; gap: 6px; padding-bottom: 14px; }

/* Horizontal stepper */
.stepper-h {
  display: flex;
  gap: 0;
  width: 100%;
  padding: 28px 0;
  border-top: 1px solid var(--ink-10);
  border-bottom: 1px solid var(--ink-10);
}
.stepper-h .step {
  flex: 1;
  display: flex; flex-direction: column; gap: 6px;
  padding: 0 16px;
  border-left: 1px solid var(--ink-10);
  position: relative;
}
.stepper-h .step:first-child { border-left: none; padding-left: 0; }
.stepper-h .step-dot {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  color: var(--ink-40); text-transform: uppercase;
}
.stepper-h .step.active .step-dot,
.stepper-h .step.done .step-dot { color: var(--gold-deep); }
.stepper-h .step-lbl {
  font-family: var(--serif); font-size: 17px; color: var(--ink-40);
  transition: color .3s;
}
.stepper-h .step.active .step-lbl { color: var(--ink); }
.stepper-h .step.done .step-lbl { color: var(--ink-60); }
.stepper-h .step::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-20);
  margin-top: 6px;
  transition: all .3s;
}
.stepper-h .step.active::after {
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-20);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
.stepper-h .step.done::after { background: var(--gold-deep); }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(201,169,97,0.22); }
  50%      { box-shadow: 0 0 0 8px rgba(201,169,97,0.10); }
}

/* ── Animations ── */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rise-in-slow {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fade-in {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes rule-grow {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); }
}
@keyframes gold-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes ken-burns {
  0%   { transform: scale(1.05) translate(0, 0); }
  100% { transform: scale(1.15) translate(-2%, -1%); }
}
@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.rise { animation: rise-in .8s var(--ease-out) both; }
.rise-slow { animation: rise-in-slow 1s var(--ease-out) both; }
.fade { animation: fade-in .7s var(--ease-out) both; }
.scale-in { animation: scale-in .6s var(--ease-out) both; }
.slide-r { animation: slide-in-right .7s var(--ease-out) both; }
.slide-l { animation: slide-in-left .7s var(--ease-out) both; }

.stagger > * { animation: rise-in .8s var(--ease-out) both; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .12s; }
.stagger > *:nth-child(3) { animation-delay: .2s; }
.stagger > *:nth-child(4) { animation-delay: .28s; }
.stagger > *:nth-child(5) { animation-delay: .36s; }
.stagger > *:nth-child(6) { animation-delay: .44s; }
.stagger > *:nth-child(7) { animation-delay: .52s; }
.stagger > *:nth-child(8) { animation-delay: .6s; }

.shimmer-text {
  background: linear-gradient(90deg, var(--gold-deep) 0%, var(--gold-soft) 50%, var(--gold-deep) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gold-shimmer 4s linear infinite;
}

/* ── Numbers ── */
.num-xl {
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 84px);
  line-height: 1;
  font-weight: 300;
  letter-spacing: -0.025em;
  font-feature-settings: "lnum", "tnum";
}
.num-lg {
  font-family: var(--serif);
  font-size: 44px;
  line-height: 1;
  font-weight: 400;
  font-feature-settings: "lnum", "tnum";
}

/* ── Image placeholder with Unsplash integration ── */
.photo {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #E8DFC9, #CDC0A2);
}
.photo img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  transition: transform 1.2s var(--ease);
}
.photo-hover:hover img { transform: scale(1.06); }
.photo-kenburns img { animation: ken-burns 20s ease-in-out infinite alternate; }
.photo-tag {
  position: absolute; bottom: 14px; left: 14px;
  padding: 6px 12px;
  background: rgba(26,23,20,0.75);
  color: var(--ivory);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  backdrop-filter: blur(6px);
}

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-20); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }
::-webkit-scrollbar-track { background: transparent; }

/* ── Utilities ── */
.flex { display: flex; }
.grid { display: grid; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.gap-6 { gap: 24px; } .gap-8 { gap: 32px; } .gap-10 { gap: 40px; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.w-full { width: 100%; }
.block { display: block; }
.hidden { display: none !important; }
.relative { position: relative; }
.absolute { position: absolute; }

.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mt-10 { margin-top: 40px; } .mt-12 { margin-top: 48px; } .mt-16 { margin-top: 64px; }
.mt-20 { margin-top: 80px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.mb-10 { margin-bottom: 40px; } .mb-12 { margin-bottom: 48px; }
.py-16 { padding-top: 64px; padding-bottom: 64px; }
.py-24 { padding-top: 96px; padding-bottom: 96px; }

:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
img { max-width: 100%; display: block; }
button { font: inherit; }

/* Toast */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--ivory);
  padding: 16px 24px;
  border-radius: var(--r-sm);
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: var(--sh-3);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all .5s var(--ease);
  border-top: 1px solid var(--gold);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .ok { color: var(--gold); }

/* ── STAGE 3 horizontal timeline ── */
.stage-timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid var(--ink-10);
  border-bottom: 1px solid var(--ink-10);
  background: var(--paper);
  position: relative;
}
.stage-cell {
  padding: 40px 28px;
  border-right: 1px solid var(--ink-10);
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 260px;
  opacity: 0.35;
  transition: opacity .6s var(--ease), background .6s var(--ease);
}
.stage-cell:last-child { border-right: none; }
.stage-cell.active {
  opacity: 1;
  background: var(--gold-10);
}
.stage-cell.done { opacity: 0.85; }
.stage-cell .stage-num {
  font-family: var(--serif);
  font-size: 56px; font-weight: 300; line-height: 1;
  color: var(--gold);
  letter-spacing: -0.02em;
}
.stage-cell.done .stage-num { color: var(--gold-deep); }
.stage-cell .stage-title {
  font-family: var(--serif); font-size: 19px; line-height: 1.25;
  color: var(--ink);
  font-weight: 400;
}
.stage-cell .stage-sub {
  font-size: 12px; color: var(--ink-60); line-height: 1.5;
  margin-top: auto;
}
.stage-cell .stage-progress {
  position: absolute; left: 0; bottom: 0;
  height: 2px; background: var(--gold);
  width: 0;
  transition: width 0.2s linear;
}
.stage-cell.done .stage-progress { width: 100% !important; background: var(--gold-deep); }
.stage-check {
  position: absolute; top: 20px; right: 20px;
  color: var(--gold-deep); font-family: var(--mono); font-size: 12px;
  opacity: 0; transition: opacity .4s var(--ease);
}
.stage-cell.done .stage-check { opacity: 1; }

@media (max-width: 1100px) {
  .stage-timeline { grid-template-columns: 1fr; }
  .stage-cell { border-right: none; border-bottom: 1px solid var(--ink-10); min-height: auto; }
  .stage-cell:last-child { border-bottom: none; }
}

/* ── Property type big cards (4 options) ── */
.type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .type-grid { grid-template-columns: repeat(2, 1fr); } }
.type-card {
  padding: 28px 24px;
  background: var(--paper);
  border: 1px solid var(--ink-10);
  cursor: pointer;
  text-align: left;
  transition: all .35s var(--ease);
  display: flex; flex-direction: column; gap: 10px;
  min-height: 140px;
  border-radius: 2px;
}
.type-card:hover { border-color: var(--gold-30); transform: translateY(-3px); box-shadow: var(--sh-1); }
.type-card.active {
  background: var(--gold-10);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}
.type-card .t-icon {
  width: 36px; height: 36px;
  color: var(--gold-deep);
  display: flex; align-items: center;
}
.type-card .t-name {
  font-family: var(--serif); font-size: 20px; color: var(--ink);
  line-height: 1.2;
}
.type-card .t-hint {
  font-size: 12px; color: var(--ink-60);
  margin-top: auto;
}

/* ── Cabinet with vertical sidebar ── */
.cabinet-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 82px);
}
.cabinet-sidebar {
  background: var(--paper);
  border-right: 1px solid var(--ink-10);
  padding: 48px 0 48px 0;
  position: sticky; top: 82px;
  align-self: start;
  height: calc(100vh - 82px);
  display: flex; flex-direction: column;
}
.cab-user {
  padding: 0 28px 32px;
  border-bottom: 1px solid var(--ink-10);
  display: flex; align-items: center; gap: 14px;
}
.cab-user-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gold-10); border: 1px solid var(--gold-20);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 20px; color: var(--gold-deep);
  flex-shrink: 0;
}
.cab-user-name {
  font-family: var(--serif); font-size: 17px; color: var(--ink);
  line-height: 1.2;
}
.cab-user-sub {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--ink-60); text-transform: uppercase; margin-top: 4px;
}
.cab-nav { padding: 24px 16px; display: flex; flex-direction: column; gap: 2px; }
.cab-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: transparent; border: none;
  font-family: var(--sans); font-size: 14px;
  color: var(--ink-60);
  cursor: pointer;
  border-radius: 2px;
  text-align: left;
  transition: all .25s var(--ease);
  border-left: 2px solid transparent;
}
.cab-nav-item:hover { color: var(--ink); background: var(--ink-5); }
.cab-nav-item.active {
  color: var(--ink);
  background: var(--gold-10);
  border-left-color: var(--gold);
  font-weight: 500;
}
.cab-nav-item .n-num {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  color: var(--ink-40); width: 24px;
}
.cab-nav-item.active .n-num { color: var(--gold-deep); }
.cab-logout {
  margin-top: auto; padding: 0 28px 0;
  color: var(--ink-60); font-size: 12px; cursor: pointer;
}
.cab-logout:hover { color: var(--ink); }

@media (max-width: 900px) {
  .cabinet-layout { grid-template-columns: 1fr; }
  .cabinet-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--ink-10); }
}

/* ── Advantage cards (why K&N Elite) ── */
.adv-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
@media (max-width: 900px) { .adv-grid { grid-template-columns: 1fr; } }
.adv-card {
  padding: 36px;
  background: var(--paper);
  border: 1px solid var(--ink-10);
  position: relative;
  transition: all .4s var(--ease);
}
.adv-card:hover { border-color: var(--gold-30); transform: translateY(-3px); box-shadow: var(--sh-1); }
.adv-card .adv-num {
  font-family: var(--serif); font-size: 48px; font-weight: 300;
  color: var(--gold); line-height: 1; letter-spacing: -0.02em;
}
.adv-card .adv-title {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  color: var(--ink); margin-top: 18px; line-height: 1.3;
}
.adv-card .adv-body {
  margin-top: 12px; font-size: 14px; line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* Loader stages */
.loader-stage {
  opacity: 0.3;
  transition: all .5s var(--ease);
  padding: 18px 0;
  border-bottom: 1px solid var(--ink-10);
  display: flex; align-items: center; gap: 18px;
}
.loader-stage.active { opacity: 1; }
.loader-stage.done { opacity: 0.7; }
.loader-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-20);
  flex-shrink: 0;
  transition: all .4s var(--ease);
  position: relative;
}
.loader-stage.active .loader-dot {
  background: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-20);
  animation: pulse-dot 1.5s ease-in-out infinite;
}
.loader-stage.done .loader-dot {
  background: var(--gold-deep);
}
.loader-stage.done .loader-dot::after {
  content: ""; position: absolute;
  inset: 2px;
  background: var(--gold-deep);
  border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════
   MOBILE ADAPTATION — K&N Elite
   Breakpoints:
   - sm: до 767px  (phone portrait)
   - md: 768–1023px (tablet)
   - lg: 1024+     (desktop, default)
   ═══════════════════════════════════════════════════════ */

/* ── Safe areas для iPhone (notch, home indicator) ── */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ── База: минимум 375px, корректный zoom iOS ── */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Предотвращаем горизонтальный скролл из-за грид-блоков */
body {
  overflow-x: hidden;
}

/* iOS фикс: чтобы инпуты не зумили страницу при фокусе */
input, select, textarea {
  font-size: 16px;
}

/* ═══════════════════ PHONE (≤ 767px) ═══════════════════ */
@media (max-width: 767px) {

  /* ── Типографика: уменьшаем display-размеры ── */
  .display {
    font-size: clamp(36px, 11vw, 56px);
    letter-spacing: -0.02em;
  }
  h1 { font-size: 32px !important; line-height: 1.1; }
  h2 { font-size: 26px !important; line-height: 1.15; }
  h3 { font-size: 20px !important; line-height: 1.2; }

  /* ── Контейнеры: убираем большие paddings ── */
  .container,
  .container-narrow {
    padding: 0 20px;
  }

  /* ── Кнопки: тап-таргет минимум 44px (Apple HIG) ── */
  .btn {
    min-height: 48px;
    padding: 0 20px;
    font-size: 14px;
  }
  .btn-lg {
    min-height: 56px;
    font-size: 15px;
  }
  .btn-sm {
    min-height: 40px;
    font-size: 13px;
  }

  /* ── Topbar: компактная версия ── */
  .topbar {
    padding: 16px 20px !important;
  }
  .topbar .nav {
    gap: 12px !important;
  }
  /* Скрываем текстовые пункты nav, оставляем только бренд + бургер/lang */
  .topbar .nav a {
    display: none;
  }
  .topbar .nav .lang-switch,
  .topbar .nav .mobile-menu-btn {
    display: inline-flex;
  }

  /* ── Cards: меньше padding, не ломаем бордеры ── */
  .card {
    padding: 24px 20px;
    border-radius: var(--r-md);
  }

  /* ── Любые grid 2-колоночные в форме — в столбик ── */
  .card > div[style*="gridTemplateColumns"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* ── Inputs: крупнее для удобства ── */
  .input {
    font-size: 16px;
    padding: 14px 16px;
    min-height: 48px;
  }

  /* ── Скрываем десктопные-only элементы, показываем мобильные-only ── */
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }
  .mobile-only-flex { display: flex; }

  /* ── Footer: в столбик ── */
  footer {
    flex-direction: column !important;
    gap: 16px !important;
    padding: 28px 20px !important;
    text-align: center;
  }
}

/* ═══════════════════ TABLET (768–1023px) ═══════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {
  .container,
  .container-narrow {
    padding: 0 32px;
  }
}

/* ═══════════════════ DESKTOP-ONLY (≥ 1024px) ═══════════════════ */
@media (min-width: 1024px) {
  .mobile-only { display: none !important; }
  .mobile-only-flex { display: none !important; }
}

/* ═══════════════════ HELPERS ═══════════════════ */

/* Скрыть/показать по брейкпоинтам */
.desktop-only { display: block; }
.mobile-only { display: none; }
.mobile-only-flex { display: none; }

/* Класс для элементов, которые должны быть sticky к низу экрана на мобиле */
.mobile-sticky-bottom {
  position: sticky;
  bottom: 0;
  padding-bottom: var(--safe-bottom);
  background: var(--paper);
  border-top: 1px solid var(--ink-10);
  z-index: 10;
}

/* Мобильное меню-шторка (drawer) */
.mobile-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(320px, 85vw);
  background: var(--paper);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform .35s var(--ease);
  box-shadow: var(--sh-3);
  padding: 24px 24px calc(24px + var(--safe-bottom));
  padding-top: calc(24px + var(--safe-top));
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-drawer.open { transform: translateX(0); }

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,23,20,0.4);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.mobile-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
}
@media (max-width: 767px) {
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
  }
}

/* ═══════════════════ TOPBAR MOBILE ═══════════════════ */

/* Десктопный nav по умолчанию виден, на мобиле скрываем */
.desktop-only-flex {
  display: flex;
}
@media (max-width: 767px) {
  .desktop-only-flex {
    display: none !important;
  }
}

/* Шапка на мобиле — компактнее */
@media (max-width: 767px) {
  .topbar {
    padding: 14px 20px !important;
    min-height: 64px;
  }
  .topbar .brand {
    gap: 10px !important;
  }
  .topbar .brand-text {
    font-size: 13px !important;
    letter-spacing: 0.14em !important;
  }
  .topbar .brand-sub {
    display: none !important;
  }
}

/* ─── Drawer header ─── */
.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ink-10);
  margin-bottom: 28px;
}

.mobile-drawer-close {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ink);
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background .2s var(--ease);
}
.mobile-drawer-close:hover,
.mobile-drawer-close:active {
  background: var(--ink-5);
}

/* ─── Drawer nav links ─── */
.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 12px;
  font-family: var(--sans);
  font-size: 17px;
  color: var(--ink-soft);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all .25s var(--ease);
  text-decoration: none;
  font-weight: 400;
}

.mobile-drawer-link:hover,
.mobile-drawer-link:active {
  color: var(--ink);
  background: var(--ink-5);
}

.mobile-drawer-link.active {
  color: var(--ink);
  border-left-color: var(--gold);
  font-weight: 500;
  background: var(--gold-10);
}

.mobile-drawer-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold-deep);
  min-width: 24px;
}

.mobile-drawer-link.active .mobile-drawer-num {
  color: var(--gold-deep);
}

/* ─── Drawer footer (language switcher) ─── */
.mobile-drawer-footer {
  border-top: 1px solid var(--ink-10);
  padding-top: 20px;
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.mobile-drawer-footer .lang-switch {
  margin: 0;
}
