/* ============================================================================
   KINGINSEN — design system
   Royal emerald palace. Antique gold hairlines. Silver accents. Ivory text.
   Dynamic theming: --accent / --accent-soft are swapped per chosen material;
   the emerald base never changes.
   ========================================================================== */

:root {
  /* Single solid background — one deep emerald tone (per home reference) */
  --bg: #05160F;
  /* Emerald base — constant */
  --emerald-950: #051711;
  --emerald-900: #072018;
  --emerald-800: #0B3D2E;
  --emerald-700: #0E4A38;
  --emerald-glow: rgba(16, 92, 68, 0.55);

  /* Metals / text */
  --gold: #D4AF37;
  --gold-soft: #ECD594;
  --silver: #C7CED1;
  --silver-lt: #EAEEF0;
  --dim: #97A39A;
  --ivory: #F4EFE3;
  --ivory-dim: rgba(244, 239, 227, 0.66);
  --ivory-faint: rgba(244, 239, 227, 0.40);

  /* Dynamic accent (defaults to gold; JS overrides per material) */
  --accent: #D4AF37;
  --accent-soft: #ECD594;

  --hairline: rgba(212, 175, 55, 0.28);
  --hairline-strong: rgba(212, 175, 55, 0.55);

  --font-fa: 'Vazirmatn', 'Estedad', system-ui, sans-serif;
  --font-latin: 'Cormorant', 'Cormorant Garamond', serif;

  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --slow: 0.9s var(--ease);
}

/* ── reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-fa);
  color: var(--ivory);
  background: var(--bg);            /* single solid colour — no gradient */
  line-height: 1.85;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; color: inherit; background: none; border: none; }

/* Latin logotype — letter-spacing ONLY on Latin, never on Persian. */
.latin { font-family: var(--font-latin); letter-spacing: 0.16em; }
.jp { font-family: var(--font-latin); }

/* ── typography ─────────────────────────────────────────────────────────── */
h1, h2, h3, .display {
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0; /* Persian: no letter-spacing, ever */
}
.eyebrow {
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0; /* it is Persian */
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before, .eyebrow::after {
  content: ""; width: 34px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-strong), transparent);
}

/* ── layout helpers ─────────────────────────────────────────────────────── */
.container { width: min(var(--maxw), 92vw); margin-inline: auto; }
.section { padding: clamp(4rem, 9vw, 8rem) 0; position: relative; }
.center { text-align: center; }
.muted { color: var(--ivory-dim); }

/* ── ornaments ──────────────────────────────────────────────────────────── */
.hairline {
  height: 1px; border: 0;
  background: linear-gradient(90deg, transparent, var(--hairline-strong) 18%, var(--gold) 50%, var(--hairline-strong) 82%, transparent);
  opacity: 0.7;
}
.diamond-rule {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  color: var(--accent); margin: 1.4rem 0;
}
.diamond-rule::before, .diamond-rule::after {
  content: ""; height: 1px; width: clamp(40px, 14vw, 150px);
  background: linear-gradient(90deg, transparent, var(--hairline-strong));
}
.diamond-rule::after { background: linear-gradient(90deg, var(--hairline-strong), transparent); }

/* ── buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.85rem 2.1rem; border-radius: 999px;
  font-size: 0.98rem; font-weight: 500;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease), color 0.4s;
  position: relative; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #14110a;
  box-shadow: 0 10px 30px -12px var(--accent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px var(--accent); }
.btn-ghost {
  border: 1px solid var(--hairline-strong); color: var(--ivory);
  background: rgba(255,255,255,0.02);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-soft); transform: translateY(-2px); }
.btn-sm { padding: 0.55rem 1.3rem; font-size: 0.85rem; }

/* ── card surface ───────────────────────────────────────────────────────── */
.surface {
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012));
  border: 1px solid var(--hairline);
  border-radius: 18px;
  backdrop-filter: blur(6px);
}

/* ── particles canvas ───────────────────────────────────────────────────── */
#particles {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.55;
}
.app-shell { position: relative; z-index: 1; }

/* ── nav ────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(5,23,17,0.86), rgba(5,23,17,0.32));
  border-bottom: 1px solid var(--hairline);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.brand-logo { display: flex; flex-direction: column; line-height: 1; }
.brand-logo .latin { font-size: 1.35rem; color: var(--ivory); }
.brand-logo .jp { font-size: 0.85rem; color: var(--accent); margin-top: 2px; letter-spacing: 0.3em; }
.nav-links { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a { font-size: 0.96rem; color: var(--ivory-dim); position: relative; padding: 4px 0; transition: color 0.3s; }
.nav-links a::after {
  content: ""; position: absolute; bottom: -2px; right: 0; height: 1px; width: 0;
  background: var(--accent); transition: width 0.4s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--ivory); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* No hamburger at any breakpoint: the nav stacks and centres on small screens. */
@media (max-width: 860px) {
  .nav-inner { height: auto; flex-direction: column; gap: 0.55rem; padding-top: 0.85rem; padding-bottom: 0.85rem; }
  .brand-logo { align-items: center; }
  .nav-links { gap: 1.2rem 1.4rem; justify-content: center; }
  .nav-links a { font-size: 0.9rem; }
}

/* ── footer ─────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--hairline); margin-top: 2rem; padding: 3.4rem 0 2.4rem; position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.footer h4 { font-size: 0.95rem; color: var(--accent); margin-bottom: 1rem; }
.footer p, .footer a { color: var(--ivory-dim); font-size: 0.92rem; }
.footer a:hover { color: var(--accent-soft); }
.footer-bottom { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--hairline); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--ivory-faint); font-size: 0.82rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; } }

/* ── reveal on scroll ───────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

::selection { background: var(--accent); color: #14110a; }
