/* ============================================================
   KAIYI NEPAL — Editorial Cinematic Luxury
   ============================================================ */

:root {
  --ink: #0A0A0B;
  --paper: #F1ECE3;
  --cream: #EFE9DD;
  --mist: #E8E2D6;
  --rust: #B23A1E;
  --ember: #8E2814;
  --bronze: #8C6F4A;
  --graphite: #2A2826;
  --stone: #6B655B;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { scroll-behavior: smooth; background: var(--paper); }
body { background: var(--paper); }

::selection { background: var(--rust); color: var(--paper); }

/* ===== Film grain overlay ===== */
.grain {
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
  animation: grainShift 8s steps(8) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-5%, -3%); }
  20%  { transform: translate(-9%, 2%); }
  30%  { transform: translate(3%, -7%); }
  40%  { transform: translate(-3%, 9%); }
  50%  { transform: translate(7%, -2%); }
  60%  { transform: translate(-9%, -5%); }
  70%  { transform: translate(2%, 7%); }
  80%  { transform: translate(-4%, 3%); }
  90%  { transform: translate(6%, -4%); }
  100% { transform: translate(0, 0); }
}

/* ===== Custom cursor dot ===== */
#cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rust);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease, width 0.2s ease, height 0.2s ease, background 0.2s ease;
  mix-blend-mode: difference;
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  #cursor-dot { display: block; }
}
#cursor-dot.is-link {
  width: 36px; height: 36px;
  background: var(--paper);
}

/* ============================================================
   HEADER
   ============================================================ */
.header-border-light {
  background: rgba(10, 10, 11, 0);
  color: #fff;
  border-color: rgba(255,255,255,0.12);
  transition: background 0.5s ease, color 0.4s ease, border-color 0.4s ease;
}
#site-header.scrolled .header-border-light {
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  color: var(--paper);
}

.brand-mark { color: inherit; }

/* ===== KAIYI nav logo color treatment =====
   Source PNG is black-on-white. CSS recolors it per context
   instead of pre-processing the image (cleaner, single asset). */

/* Default (dark bg, e.g. main site nav): invert to white, blend out the black bg */
.kaiyi-nav-logo {
  filter: invert(1);
  mix-blend-mode: screen;
}

/* Light bg variant (e.g. 404 page nav): keep logo black, blend out the white bg */
.kaiyi-nav-logo--light {
  filter: none;
  mix-blend-mode: multiply;
}

.nav-link {
  position: relative;
  color: inherit;
  opacity: 0.85;
  transition: opacity 0.25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(.7,0,.2,1);
}
.nav-link:hover { opacity: 1; }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-pill {
  border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 12px;
  border-radius: 999px;
}
#site-header.scrolled .nav-pill {
  border-color: rgba(255,255,255,0.18);
}

.cta-thin {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: inherit;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: color 0.25s ease;
}
.cta-thin:hover { color: var(--rust); border-color: var(--rust); }

/* ============================================================
   HERO
   ============================================================ */
.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s ease-in-out;
}
.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.ken-burns {
  transform: scale(1.05);
}
.hero-slide.active .ken-burns {
  animation: kenBurns 14s ease-out forwards;
}
@keyframes kenBurns {
  from { transform: scale(1.05) translate(0, 0); }
  to   { transform: scale(1.18) translate(-2%, -1.5%); }
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.35) 35%, rgba(0,0,0,0.05) 65%, rgba(0,0,0,0.45) 100%),
    radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.55) 100%);
}

.fade-in {
  opacity: 0;
  transform: translateY(28px);
}
.hero-slide.active .fade-in {
  animation: fadeUpHero 1s cubic-bezier(.18,.7,.2,1) forwards;
}
.hero-slide.active .fade-in:nth-child(1) { animation-delay: 0.15s; }
.hero-slide.active .fade-in:nth-child(2) { animation-delay: 0.35s; }
.hero-slide.active .fade-in:nth-child(3) { animation-delay: 0.55s; }
.hero-slide.active .fade-in:nth-child(4) { animation-delay: 0.75s; }
@keyframes fadeUpHero {
  to { opacity: 1; transform: translateY(0); }
}

.display-headline { color: var(--paper); }

.hero-arrow {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 14px;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.hero-arrow:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 26px;
  background: var(--paper);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.btn-primary:hover { background: var(--rust); color: var(--paper); transform: translateY(-1px); }

.btn-primary-light {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 26px;
  background: var(--rust);
  color: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: background 0.3s ease, transform 0.3s ease;
}
.btn-primary-light:hover { background: var(--ember); transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 0;
  color: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--paper);
  transition: color 0.25s ease, border-color 0.25s ease;
}
.btn-ghost:hover { color: var(--rust); border-color: var(--rust); }

.btn-ghost-dark {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 0;
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  transition: color 0.25s ease, border-color 0.25s ease;
}
.btn-ghost-dark:hover { color: var(--rust); border-color: var(--rust); }

/* ============================================================
   LINEUP CARDS
   ============================================================ */
.lineup-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card-meta {
  display: flex; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--stone);
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(10,10,11,0.18);
  margin-bottom: 22px;
}
.card-image {
  overflow: hidden;
  background: var(--mist);
  position: relative;
}
.card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.4s cubic-bezier(.18,.7,.2,1);
}
.lineup-card:hover .card-image img {
  transform: scale(1.06);
}
.card-body {
  padding-top: 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-body h3 { color: var(--ink); }
.card-foot { margin-top: auto; }
.card-spec-row {
  display: flex;
  gap: 24px;
  border-top: 1px solid rgba(10,10,11,0.15);
  border-bottom: 1px solid rgba(10,10,11,0.15);
  padding: 18px 0;
  margin: 22px 0;
  flex-wrap: wrap;
}
.card-spec-row > div {
  display: flex; flex-direction: column;
}
.spec-num {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.spec-unit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--stone);
  margin-top: 4px;
}
.spec-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--stone);
  opacity: 0.7;
  margin-top: 2px;
}
.card-foot {
  display: flex; align-items: end; justify-content: space-between;
  gap: 16px;
}
.card-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 4px;
}
.card-price {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--rust);
  font-variant-numeric: tabular-nums;
}
.card-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
}
.card-link:hover { color: var(--rust); border-color: var(--rust); }

/* ============================================================
   VEHICLE DETAIL ROWS
   ============================================================ */
.spec-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid rgba(10,10,11,0.15);
}
.spec-sheet > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(10,10,11,0.15);
  border-right: 1px solid rgba(10,10,11,0.15);
  padding-right: 16px;
  padding-left: 4px;
}
.spec-sheet > div:nth-child(2n) { border-right: none; padding-right: 4px; padding-left: 16px; }
.spec-sheet dt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--stone);
}
.spec-sheet dd {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.price-tag {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 2px solid var(--ink);
  display: inline-block;
}

/* ============================================================
   ADVANTAGE LIST
   ============================================================ */
.advantage-list {
  list-style: none;
  padding: 0; margin: 0;
}
.advantage-list li {
  display: grid;
  grid-template-columns: 80px 1fr 2fr;
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid rgba(10,10,11,0.15);
  align-items: baseline;
  transition: background 0.4s ease, padding 0.4s ease;
}
.advantage-list li:first-child { border-top: 1px solid rgba(10,10,11,0.15); }
.advantage-list li:hover {
  background: linear-gradient(to right, rgba(178,58,30,0.04), transparent 70%);
  padding-left: 12px;
}
.adv-num {
  font-family: 'Geist', sans-serif;
  font-weight: 700;
  font-size: 52px;
  letter-spacing: -0.04em;
  color: var(--rust);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.advantage-list h3 {
  font-family: 'Geist', sans-serif;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
}
.advantage-list h3 .adv-emph {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.advantage-list p {
  color: var(--graphite);
  opacity: 0.78;
  font-size: 15px;
  line-height: 1.65;
  max-width: 56ch;
}
@media (max-width: 768px) {
  .advantage-list li {
    grid-template-columns: 60px 1fr;
    gap: 18px;
  }
  .advantage-list p { grid-column: 1 / -1; padding-left: 78px; }
  .adv-num { font-size: 36px; }
  .advantage-list h3 { font-size: 20px; }
}

/* ============================================================
   FORM
   ============================================================ */
.field {
  display: flex; flex-direction: column;
}
.field label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(241, 236, 227, 0.55);
  margin-bottom: 10px;
}
.field input,
.field select,
.field textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(241, 236, 227, 0.25);
  color: var(--paper);
  font-family: 'Geist', sans-serif;
  font-size: 16px;
  padding: 10px 0;
  transition: border-color 0.3s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--rust);
}
.field select option { color: var(--ink); background: var(--paper); }
.field textarea { resize: vertical; }

/* Suppress browser autofill light-blue/yellow background on dark form */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.field input:-webkit-autofill:active,
.field select:-webkit-autofill,
.field textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--ink) inset !important;
  box-shadow: 0 0 0 1000px var(--ink) inset !important;
  -webkit-text-fill-color: var(--paper) !important;
  caret-color: var(--paper);
  border-bottom-color: rgba(241, 236, 227, 0.25) !important;
  transition: background-color 9999s ease-in-out 0s, color 9999s ease-in-out 0s;
}
/* Firefox autofill */
.field input:autofill,
.field select:autofill,
.field textarea:autofill {
  background: transparent !important;
  color: var(--paper) !important;
}

.contact-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  align-items: baseline;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.contact-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--rust);
}
.contact-val {
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--paper);
}

.hover-underline {
  position: relative;
  padding-bottom: 1px;
}
.hover-underline::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(.7,0,.2,1);
}
.hover-underline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-h {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 18px;
}

.social-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: var(--paper);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.social-icon:hover {
  background: var(--rust);
  border-color: var(--rust);
  color: var(--paper);
}

/* ============================================================
   REVEAL (scroll-triggered)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1s cubic-bezier(.18,.7,.2,1), transform 1s cubic-bezier(.18,.7,.2,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Tabular numerics utility ===== */
.font-mono-numeric { font-variant-numeric: tabular-nums; }

/* ===== Manifesto blockquote refinement ===== */
.manifesto {
  color: var(--paper);
}
.manifesto span.block {
  display: block;
}

/* ===== Scroll offset for sticky header ===== */
section[id] { scroll-margin-top: 84px; }

/* ===== Reduce motion ===== */
@media (prefers-reduced-motion: reduce) {
  .ken-burns, .marquee-track, .grain { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-slide.active .fade-in { opacity: 1; transform: none; animation: none; }
}
