/* ──────────────────────────────────────────────
   KULI — Shared site layer (every page)
   Header · Footer · Brand · Motion · Story
────────────────────────────────────────────── */

/* ── BRAND (logo slot) ──────────────────────────
   Swap the <svg> inside .brand-mark with your own
   logo file; the slot keeps its size & alignment. */
.brand { display: inline-flex; align-items: center; gap: 0; }
.brand-mark {
  width: 44px; height: 44px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; overflow: hidden;
  transform: rotate(0deg) scale(1);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.06); }
.brand:not(:hover) .brand-mark { transform: rotate(0deg) scale(1); }
.brand-mark svg, .brand-mark img { width: 100%; height: 100%; display: block; }
.brand-word {
  font-family: 'Noto Sans Thaana', sans-serif; font-weight: 700;
  font-size: 27px; line-height: 1; color: var(--ink); padding-top: 3px;
  transition: color var(--trans-fast);
}
.dark-nav .brand-word, .site-footer .brand-word { color: var(--warm-bg); }

/* ── HEADER ─────────────────────────────────── */
.navbar {
  height: 72px;
  padding: 0 clamp(20px, 4vw, 40px);
  transition: background var(--trans-med), box-shadow var(--trans-med), height var(--trans-med);
}
.navbar.scrolled {
  height: 62px;
  background: rgba(255,255,255,0.82);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 1px 0 var(--border), 0 6px 24px rgba(0,0,0,0.05);
}
.nav-links { gap: 30px; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--muted);
  position: relative; padding: 6px 2px; transition: color var(--trans-fast);
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
  background: var(--gold); border-radius: 2px;
  transform: scaleX(0); transform-origin: center; transition: transform 0.3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--ink); }

.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-login { font-size: 14px; font-weight: 600; color: var(--text); padding: 9px 16px; border-radius: 100px; transition: background var(--trans-fast); }
.nav-login:hover { background: rgba(0,0,0,0.05); }
.dark-nav .nav-login { color: var(--warm-bg); }
.dark-nav .nav-login:hover { background: rgba(255,255,255,0.10); }

/* ── PAGE-ENTER ─────────────────────────────── */
body { opacity: 0; }
body.page-ready { opacity: 1; transition: opacity 0.5s ease; }

/* ── REVEAL / MOTION ────────────────────────── */
.aw { opacity: 0; transform: translateY(28px); }
.aw.in { opacity: 1; transform: none; transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }

.img-reveal { clip-path: inset(0 0 100% 0); transition: clip-path 0.95s var(--ease); will-change: clip-path; }
.img-reveal.in { clip-path: inset(0 0 0 0); }

.line-reveal { display: block; overflow: hidden; padding-bottom: 0.2em; margin-bottom: -0.2em; }
.line-reveal > span { display: inline-block; transform: translateY(116%); transition: transform 0.9s var(--ease); }
.line-reveal.in > span { transform: none; }

[data-tilt], .pcard, .listing-card, .rule-card, .acard { will-change: transform; }
.link-ul { position: relative; }
.link-ul::after { content:''; position:absolute; left:0; bottom:-2px; width:100%; height:1.5px; background:var(--gold); transform:scaleX(0); transform-origin:right; transition:transform .35s var(--ease); }
.link-ul:hover::after { transform:scaleX(1); transform-origin:left; }
.btn { will-change: transform; }
/* Satisfying press — every button gets a tactile scale-down */
.btn:active                   { transform: translateY(0) scale(0.965) !important; transition: transform 0.08s ease !important; }
.btn-primary:active, .btn-gold:active { box-shadow: none !important; }
.btn-ghost:active             { background: rgba(0,0,0,0.06) !important; }
[data-theme="dark"] .btn-ghost:active { background: rgba(255,255,255,0.07) !important; }

/* ── STORY RAIL (left scroll-progress with chapters) ── */
.story-rail {
  position: fixed; left: 26px; top: 50%; transform: translateY(-50%);
  z-index: 400; display: flex; flex-direction: column; align-items: center; gap: 14px;
  opacity: 0; transition: opacity 0.5s ease;
}
.story-rail.show { opacity: 1; }
.story-rail .sr-line { position: relative; width: 2px; height: 150px; background: rgba(0,0,0,0.12); border-radius: 2px; overflow: hidden; }
.story-rail .sr-fill { position: absolute; left: 0; top: 0; width: 100%; height: 0; background: var(--gold); border-radius: 2px; }
.story-rail .sr-dots { display: flex; flex-direction: column; gap: 13px; }
.story-rail .sr-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,0,0,0.18); cursor: pointer; transition: transform .25s var(--ease), background .25s; }
.story-rail .sr-dot:hover { transform: scale(1.4); }
.story-rail .sr-dot.on { background: var(--gold); transform: scale(1.4); }
@media (max-width: 1100px) { .story-rail { display: none; } }

/* ── SUB-PAGE HERO → editorial card ── */
.page-hero {
  max-width: 1240px; margin: 96px auto 0 !important;
  border-radius: 30px; overflow: hidden; position: relative;
  padding: clamp(48px, 6vw, 84px) clamp(28px, 5vw, 60px) !important;
}
.page-hero .page-title { font-family: 'Fraunces', serif !important; font-weight: 400 !important; letter-spacing: -0.02em !important; }
.page-hero .page-title em { font-style: italic; color: var(--gold-light); }

/* ── FOOTER ─────────────────────────────────── */
/* ── FOOTER — minimal, blended ── */
.site-footer {
  position: relative;
  background: transparent;
  color: var(--text);
  margin-top: 80px;
  padding-top: 0;
  overflow: hidden;
}

/* Soft fade-in line to separate from content */
.site-footer::before {
  content: '';
  display: block;
  height: 1px;
  margin: 0 auto;
  max-width: 1240px;
  background: var(--border);
  opacity: 0.7;
}

.site-footer .fwrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
  position: relative;
  z-index: 2;
}

/* CTA strip — hidden in minimal footer */
.footer-cta { display: none; }

/* Main grid */
.footer-main {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 24px 40px;
  padding: 48px 0 36px;
}

.footer-brand-col { max-width: 260px; }
.footer-brand-col .brand { margin-bottom: 10px; display: inline-flex; }
.footer-brand-col .ftag {
  font-size: 13px; line-height: 1.65;
  color: var(--muted);
  margin-bottom: 18px;
}

.footer-socials { display: flex; gap: 8px; }
.footer-socials a {
  width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--section-bg);
  border: 1px solid var(--border);
  transition: all var(--trans-fast);
}
.footer-socials a:hover { border-color: var(--gold); transform: translateY(-2px); }
.footer-socials svg { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 1.8; transition: stroke var(--trans-fast); }
.footer-socials a:hover svg { stroke: var(--gold); }

.footer-col h5 {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 14px; opacity: 0.6;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-size: 13px; color: var(--muted);
  transition: color var(--trans-fast);
  width: fit-content;
}
.footer-col a:hover { color: var(--gold); }

/* Watermark — fills footer area */
.footer-watermark {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Noto Sans Thaana', sans-serif; font-weight: 700;
  font-size: clamp(180px, 38vw, 480px);
  line-height: 1; color: var(--border);
  white-space: nowrap; pointer-events: none; z-index: 1;
  opacity: 0.35;
  user-select: none;
}

/* Bottom bar */
.footer-bottom {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  padding: 18px 0 32px;
  border-top: 1px solid var(--border);
}
.footer-copy { font-size: 12px; color: var(--muted); opacity: 0.6; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { font-size: 12px; color: var(--muted); opacity: 0.6; transition: opacity var(--trans-fast), color var(--trans-fast); }
.footer-links a:hover { color: var(--gold); opacity: 1; }

@media (max-width: 860px) {
  .footer-main { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-brand-col { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 480px) {
  .footer-main { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 520px) {
  .footer-main { grid-template-columns: 1fr; }
  .footer-cta { padding: 40px 0; flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-cta .fc-title { font-size: clamp(24px, 8vw, 34px); }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── Nav user avatar (auth state) ── */
.nav-user-menu { position: relative; }
.nav-user-btn {
  width: 36px; height: 36px; min-height: 0; border-radius: 50%; overflow: hidden;
  background: var(--gold-bg); border: 2px solid var(--gold-border);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border-color var(--trans-fast);
  flex-shrink: 0;
}
.nav-user-btn:hover { border-color: var(--gold); }
.nav-user-avatar { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-user-initials { font-size: 13px; font-weight: 700; color: var(--gold); }
.nav-user-drop {
  position: absolute; top: calc(100% + 10px); right: 0; left: auto;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 8px; min-width: 200px;
  max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity var(--trans-fast), transform var(--trans-fast);
  z-index: 500;
}
.nav-user-drop.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.nud-name { font-size: 14px; font-weight: 600; color: var(--text); padding: 10px 12px 2px; }
.nud-email { font-size: 12px; color: var(--muted); padding: 0 12px 10px; }
.nud-div { height: 1px; background: var(--border); margin: 4px 0; }
.nud-item {
  display: block; width: 100%; text-align: left; padding: 10px 12px;
  font-size: 14px; color: var(--text); border-radius: 8px;
  transition: background var(--trans-fast);
}
.nud-item:hover { background: var(--section-bg); color: var(--danger); }

/* ── AMBIENT BACKGROUND LAYERS ────────────────────────────────────────
   Two fixed pseudo-elements that slowly breathe — felt, not seen.
   Grain on html::before, warm gradient orbs on html::after.
────────────────────────────────────────────────────────────────────── */
html::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}
[data-theme="dark"] html::before,
html:has(body[data-theme="dark"])::before { opacity: 0.030; }

.ambient-layer {
  position: fixed; inset: -12%; z-index: 0; pointer-events: none;
  will-change: transform, opacity;
}
.ambient-layer-a {
  background: radial-gradient(ellipse 72% 60% at 15% 15%, var(--ambient-a) 0%, transparent 100%),
              radial-gradient(ellipse 55% 50% at 85% 80%, var(--ambient-b) 0%, transparent 100%);
  animation: ambientDrift 22s ease-in-out infinite alternate;
}
.ambient-layer-b {
  background: radial-gradient(ellipse 50% 44% at 78% 20%, var(--ambient-b) 0%, transparent 100%),
              radial-gradient(ellipse 40% 35% at 25% 75%, var(--ambient-a) 0%, transparent 100%);
  animation: ambientDrift2 28s ease-in-out infinite alternate;
  opacity: 0.8;
}

/* ── DARK MODE — global overrides ─────────────────────────────────── */
[data-theme="dark"] .navbar.scrolled {
  background: rgba(13,13,13,0.88);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 4px 20px rgba(0,0,0,0.28);
}
[data-theme="dark"] .nav-links a          { color: rgba(255,255,255,0.30); }
[data-theme="dark"] .nav-links a:hover    { color: rgba(255,255,255,0.72); }
[data-theme="dark"] .nav-login            { color: rgba(255,255,255,0.28); }
[data-theme="dark"] .nav-login:hover      { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.55); }
[data-theme="dark"] .hamburger-line       { background: var(--warm-bg); }
[data-theme="dark"] .nav-mobile-menu      { background: rgba(13,13,13,0.97); border-color: rgba(255,255,255,0.07); }
[data-theme="dark"] .nav-mobile-menu a    { color: rgba(255,255,255,0.72); }
[data-theme="dark"] .nav-mobile-menu a:hover { background: rgba(140,0,2,0.10); color: rgba(178,45,48,0.85); }
[data-theme="dark"] .nav-mobile-divider   { background: rgba(255,255,255,0.07); }

/* Dropdowns in dark mode */
[data-theme="dark"] .kd-list              { background: #171717; border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .kd-opt               { color: rgba(255,255,255,0.65); }
[data-theme="dark"] .kd-opt:hover         { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.88); }
[data-theme="dark"] .kd-opt.kd-selected   { background: rgba(140,0,2,0.14); color: rgba(178,45,48,0.85); }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  body { opacity: 1 !important; }
  .aw, .aw.in { opacity: 1 !important; transform: none !important; transition: none !important; }
  .img-reveal { clip-path: none !important; transition: none !important; }
  .line-reveal > span { transform: none !important; transition: none !important; }
  [data-tilt] { transform: none !important; }
  .story-rail { display: none !important; }
  .scrolly-step { opacity: 1 !important; }
}

/* inline check icon (replaces ✓) */
.ick{width:1em;height:1em;display:inline-block;vertical-align:-0.125em;flex-shrink:0;}

/* emoji-replacement icon */
.emi{width:1em;height:1em;display:inline-block;vertical-align:-0.15em;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}

/* ── Custom Dropdown (kd) ─────────────────────────
   Replaces native <select> on hero search & filter bar.
   The hidden <select> stays in DOM so JS reads .value normally. */
.kd-wrap { position: relative; display: inline-block; }

/* Shared chevron */
.kd-chev { display: inline-flex; align-items: center; flex-shrink: 0; opacity: 0.45; transition: opacity var(--trans-fast); }
.kd-chev svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; transition: transform 0.2s ease; }
.kd-wrap.open .kd-chev svg { transform: rotate(180deg); }
.kd-wrap.open .kd-chev { opacity: 0.8; }

/* Shared dropdown list */
.kd-list {
  position: absolute; top: calc(100% + 10px); left: 0;
  min-width: 190px; background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
  padding: 6px; z-index: 400; list-style: none; margin: 0;
  opacity: 0; pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top left;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.kd-wrap.open .kd-list { opacity: 1; pointer-events: all; transform: none; }
/* Right-aligned list for sort */
.kd-wrap.kd-right .kd-list { left: auto; right: 0; transform-origin: top right; }

.kd-opt {
  padding: 10px 14px; border-radius: 9px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text);
  transition: background 0.12s, color 0.12s; white-space: nowrap;
  line-height: 1.3;
}
.kd-opt:hover { background: var(--warm-bg); color: var(--ink); }
.kd-opt.kd-selected { background: var(--gold-bg); color: var(--gold-deep); font-weight: 600; }

/* ── Hero search variant ── */
.hs-field .kd-wrap { flex: 1; min-width: 0; display: flex; }
.hs-field .kd-trigger {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text); width: 100%; min-width: 0; padding: 0; text-align: left;
}
.hs-field .kd-trigger .kd-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-field .kd-list { top: calc(100% + 14px); min-width: 180px; }

/* ── Filter bar variant ── */
.filter-bar .kd-wrap { display: inline-block; }
.filter-bar .kd-trigger {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; cursor: pointer; white-space: nowrap;
  font-size: 14px; font-weight: 500; font-family: inherit;
  color: var(--text); background: var(--white);
  border: 1.5px solid var(--border); border-radius: var(--radius-pill);
  transition: border-color var(--trans-fast), color var(--trans-fast), background var(--trans-fast);
}
.filter-bar .kd-trigger:hover { border-color: var(--gold); color: var(--gold); }
.filter-bar .kd-trigger:hover .kd-chev { opacity: 0.8; }
.filter-bar .kd-wrap.open .kd-trigger { border-color: var(--gold); background: var(--gold-bg); color: var(--gold-deep); }

@media (max-width: 768px) {
  .kd-list { min-width: 160px; }
}
