/* ═══════════════════════════════════════════════════════════════
   KAGO ATELIER — Shared Design System
   kagoatelier.com
═══════════════════════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --b:   #4A1220;
  --bm:  #6B1E2E;
  --ba:  #8C2A3E;
  --r:   #C4788A;
  --rl:  #D9A0AC;
  --rp:  #EDD5D9;
  --bg:  #F2E8DA;
  --bgd: #E0CEBC;
  --bgw: #F7F0E6;
  --ink: #2C1008;
  --tx:  #5A3020;
  --mu:  #9C7860;

  --nav-h: 64px;
  --ease:  cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 19px;
  color: var(--ink);
  background: var(--bgw);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; object-fit: cover; }
a { text-decoration: none; color: inherit; }
button, input, textarea, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }

/* ── PAGE TRANSITION ── */
.page-wrap {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.page-wrap.visible { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════
   NAVIGATION
══════════════════════════════════ */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 800;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s;
}
.site-nav.transparent {
  background: transparent;
  border-bottom: 1px solid transparent;
}
.site-nav.dark {
  background: rgba(74, 18, 32, 0.96);
  border-bottom: 1px solid rgba(196, 120, 138, 0.1);
  backdrop-filter: blur(12px);
}
.site-nav.light {
  background: rgba(247, 240, 230, 0.96);
  border-bottom: 1px solid rgba(224, 206, 188, 0.5);
  backdrop-filter: blur(12px);
}

.nav-brand {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-style: italic;
  font-size: 22px;
  letter-spacing: 0.18em;
  transition: color 0.3s;
  flex-shrink: 0;
}
.site-nav.dark .nav-brand,
.site-nav.transparent .nav-brand { color: rgba(242, 232, 218, 0.92); }
.site-nav.light .nav-brand { color: var(--tx); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: color 0.3s;
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 100%;
  height: 1px;
  transition: right 0.35s var(--ease);
}
.nav-links a:hover::after,
.nav-links a.active::after { right: 0; }

.site-nav.dark .nav-links a,
.site-nav.transparent .nav-links a { color: rgba(196, 120, 138, 0.55); }
.site-nav.dark .nav-links a::after,
.site-nav.transparent .nav-links a::after { background: var(--r); }
.site-nav.dark .nav-links a:hover,
.site-nav.transparent .nav-links a:hover,
.site-nav.dark .nav-links a.active,
.site-nav.transparent .nav-links a.active { color: rgba(217, 160, 172, 0.9); }

.site-nav.light .nav-links a { color: var(--mu); }
.site-nav.light .nav-links a::after { background: var(--tx); }
.site-nav.light .nav-links a:hover,
.site-nav.light .nav-links a.active { color: var(--tx); }

.nav-cta {
  padding: 9px 22px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: all 0.3s;
  border: 1px solid;
}
.site-nav.dark .nav-cta,
.site-nav.transparent .nav-cta {
  background: rgba(196, 120, 138, 0.14);
  color: rgba(217, 160, 172, 0.82);
  border-color: rgba(196, 120, 138, 0.28);
}
.site-nav.dark .nav-cta:hover,
.site-nav.transparent .nav-cta:hover {
  background: var(--r);
  color: var(--bgw);
  border-color: var(--r);
}
.site-nav.light .nav-cta {
  background: var(--tx);
  color: var(--bgw);
  border-color: var(--tx);
}
.site-nav.light .nav-cta:hover {
  background: var(--ink);
  border-color: var(--ink);
}

/* Mobile hamburger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  width: 36px;
  cursor: pointer;
}
.nav-burger span {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform 0.35s var(--ease), opacity 0.25s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 799;
  background: var(--b);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}
.mobile-menu a {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.06em;
  color: rgba(242, 232, 218, 0.7);
  transition: color 0.3s;
}
.mobile-menu a:hover { color: rgba(242, 232, 218, 0.95); }
.mobile-menu .m-cta {
  margin-top: 16px;
  padding: 12px 36px;
  border: 1px solid rgba(196, 120, 138, 0.38);
  color: rgba(196, 120, 138, 0.75);
  font-family: "EB Garamond", serif;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  transition: all 0.3s;
}
.mobile-menu .m-cta:hover { background: var(--r); color: var(--bgw); border-color: var(--r); }

/* ══════════════════════════════════
   FOOTER
══════════════════════════════════ */
.site-footer {
  background: var(--b);
  border-top: 1px solid rgba(196, 120, 138, 0.1);
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-brand {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0.16em;
  color: rgba(242, 232, 218, 0.5);
}
.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(196, 120, 138, 0.35);
  transition: color 0.3s;
}
.footer-links a:hover { color: var(--rl); }
.footer-copy {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(242, 232, 218, 0.55);
  width: 100%;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(196, 120, 138, 0.12);
  margin-top: 8px;
}

/* ══════════════════════════════════
   SHARED TYPOGRAPHY
══════════════════════════════════ */
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: var(--r);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  background: var(--rl);
  opacity: 0.6;
  flex-shrink: 0;
}
.eyebrow.light {
  color: rgba(196, 120, 138, 0.55);
}
.eyebrow.light::before { background: rgba(196, 120, 138, 0.3); opacity: 1; }

.section-title {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
}
.section-title em { color: var(--r); font-style: normal; }

.section-body {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 19px;
  line-height: 1.85;
  color: var(--mu);
}

/* ══════════════════════════════════
   BUTTONS
══════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: var(--r);
  color: var(--bgw);
  border: 1px solid var(--r);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  transition: all 0.35s;
}
.btn-primary:hover {
  background: var(--rl);
  border-color: var(--rl);
  color: var(--b);
}

.btn-ghost-light {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: transparent;
  color: rgba(242, 232, 218, 0.75);
  border: 1px solid rgba(196, 120, 138, 0.28);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  transition: all 0.35s;
}
.btn-ghost-light:hover {
  background: rgba(196, 120, 138, 0.1);
  border-color: rgba(196, 120, 138, 0.5);
  color: rgba(217, 160, 172, 0.92);
}

.btn-ghost-dark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: transparent;
  color: var(--tx);
  border: 1px solid var(--bgd);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  transition: all 0.35s;
}
.btn-ghost-dark:hover {
  background: var(--tx);
  border-color: var(--tx);
  color: var(--bgw);
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tx);
  transition: gap 0.3s, color 0.3s;
  background: none;
  border: none;
  padding: 0;
}
.btn-text:hover { gap: 14px; color: var(--r); }
.btn-text.light { color: rgba(217, 160, 172, 0.7); }
.btn-text.light:hover { color: var(--rl); }

/* ══════════════════════════════════
   SPINNER / LOADING
══════════════════════════════════ */
.spinner {
  display: inline-block;
  width: 24px; height: 24px;
  border: 2px solid rgba(196, 120, 138, 0.2);
  border-top-color: var(--r);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.spinner.dark { border-color: rgba(90, 48, 32, 0.15); border-top-color: var(--tx); }
@keyframes spin { to { transform: rotate(360deg); } }

.load-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 40px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 16px;
  color: var(--mu);
}

/* ══════════════════════════════════
   TOAST
══════════════════════════════════ */
#toastArea {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  min-width: 240px;
}
.toast {
  padding: 12px 22px;
  font-size: 16px;
  text-align: center;
  animation: toastIn 0.3s var(--ease);
}
.toast-ok   { background: var(--tx); color: var(--bgw); }
.toast-err  { background: #8B2020; color: #fff; }
.toast-info { background: var(--r); color: var(--bgw); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ══════════════════════════════════
   MODAL (shared)
══════════════════════════════════ */
.modal-overlay.open ~ #kago-chat-toggle,
.modal-overlay.open ~ #kago-chat-panel,
body:has(.modal-overlay.open) #kago-chat-toggle,
body:has(.modal-overlay.open) #kago-chat-panel {
  pointer-events: none !important;
  opacity: 0 !important;
}
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(44, 16, 8, 0.88);
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-panel {
  background: var(--bgw);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-hd {
  padding: 18px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--bgd);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-hd-title {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 23px;
  color: var(--tx);
}
.modal-close {
  font-size: 25px;
  color: var(--mu);
  line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--tx); }
.modal-bd { padding: 24px; }
.modal-ft {
  padding: 16px 24px;
  border-top: 1px solid var(--bgd);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--bg);
}

/* ══════════════════════════════════
   FORM ELEMENTS (shared)
══════════════════════════════════ */
.form-field { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mu);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--bgd);
  background: var(--bg);
  font-size: 18px;
  color: var(--ink);
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  transition: border-color 0.25s;
  font-family: "EB Garamond", Georgia, serif;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--r); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--mu); opacity: 0.6; }
.form-textarea { min-height: 100px; resize: vertical; }

/* dark form (for contact page) */
.form-input.on-dark, .form-select.on-dark, .form-textarea.on-dark {
  background: rgba(242, 232, 218, 0.07);
  border-color: rgba(196, 120, 138, 0.18);
  color: rgba(242, 232, 218, 0.9);
}
.form-input.on-dark::placeholder, .form-textarea.on-dark::placeholder { color: rgba(242, 232, 218, 0.3); }
.form-input.on-dark:focus, .form-select.on-dark:focus, .form-textarea.on-dark:focus { border-color: rgba(196, 120, 138, 0.5); }

/* ══════════════════════════════════
   BOOKING MODAL
══════════════════════════════════ */
#bookingModal .modal-hd-title { font-size: 21px; }
#bookingFormOk {
  display: none;
  text-align: center;
  padding: 32px;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 20px;
  color: var(--tx);
  line-height: 1.7;
}

/* ══════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════ */
@media (max-width: 900px) {
  .site-nav { padding: 0 28px; }
  .site-footer { padding: 36px 28px; }
}

@media (max-width: 700px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .site-nav { padding: 0 20px; }
  .site-footer { padding: 28px 20px; text-align: center; justify-content: center; }
}

/* ══════════════════════════════════
   TASK 1 — GLOBAL CARD TYPE SIZES
══════════════════════════════════ */
[class*="card-brand"], [class*="look-brand"], [class*="item-brand"] {
  font-size: 13px;
  letter-spacing: 0.2em;
}
[class*="item-piece"], [class*="card-title"], [class*="look-title"] {
  font-size: 22px;
}
[class*="item-num"], [class*="card-num"], [class*="look-num"] {
  font-size: 28px;
}

/* ══════════════════════════════════
   TASK 2 — HERO LETTER ENTRANCE ANIMATION
══════════════════════════════════ */
.kago-word { display: inline-block; }
.kago-letter { display: inline-block; opacity: 0; animation: kagoLetterIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards, kagoLetterFloat 3.8s ease-in-out 1.6s infinite; }
@keyframes kagoLetterIn {
  0%   { opacity: 0; transform: translateY(40px) scale(0.88); filter: blur(5px); }
  55%  { opacity: 1; filter: blur(0); }
  78%  { transform: translateY(-8px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes kagoLetterFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.kago-letter:nth-child(odd)  { animation-duration: 0.65s, 3.6s; }
.kago-letter:nth-child(even) { animation-duration: 0.65s, 4.1s; }
.hero-est, .hero-subtitle, .hero-tagline, [class*="est-"], [class*="hero-sub"] { opacity: 0; animation: kagoFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 1.4s forwards; }
.hero-cta, .hero-actions, [class*="hero-btn"], [class*="hero-cta"] { opacity: 0; animation: kagoFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 1.8s forwards; }
@keyframes kagoFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════
   TASK 3 — 3D CARD HOVER
══════════════════════════════════ */
.kago-card, .featured-item, .look-card, .kago-look-card, .kago-collection-card,
[class*="look-item"], [class*="collection-card"] {
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.45s ease;
  will-change: transform;
}
.kago-card:hover, .featured-item:hover, .look-card:hover, .kago-look-card:hover,
.kago-collection-card:hover {
  box-shadow: 18px 18px 55px rgba(74, 18, 32, 0.32), -3px -3px 18px rgba(201, 169, 110, 0.07);
}
.kago-card img, .featured-item img, .look-card img, .kago-look-card img,
.kago-collection-card img {
  transform: translateZ(20px);
  transition: transform 0.45s ease;
}

/* ══════════════════════════════════
   TASK 4 — FLOATING BRAND LABELS
══════════════════════════════════ */
.kago-brand, .kago-brands-wrap span, [class*="look-brand"], [class*="card-brand"] {
  display: inline-block;
  animation: brandDrift 5s ease-in-out infinite;
}
.kago-brands-wrap { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
@keyframes brandDrift {
  0%   { transform: translateX(0); }
  35%  { transform: translateX(-7px); }
  65%  { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}
.kago-brand:nth-child(1) { animation-delay: 0s; }
.kago-brand:nth-child(2) { animation-delay: 0.5s; }
.kago-brand:nth-child(3) { animation-delay: 1s; }

/* ══════════════════════════════════
   TASK 6 — COLLECTION LOADING & CARD STATES
══════════════════════════════════ */
.kago-collection-grid { min-height: 400px; width: 100%; }
.kago-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 20px;
  color: rgba(201, 169, 110, 0.5);
  letter-spacing: 0.08em;
}
.kago-empty-collection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
  text-align: center;
  padding: 60px 40px;
}
.kago-empty-collection p {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 20px;
  color: rgba(201, 169, 110, 0.45);
  line-height: 1.7;
}
.kago-collection-card {
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.45s ease;
  will-change: transform;
  cursor: pointer;
}
.kago-card-visual {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.kago-card-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kago-card-num {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 52px;
  color: rgba(245, 238, 224, 0.25);
}
.kago-card-meta { padding: 14px 4px 4px; }
.kago-card-name {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 22px;
  color: #F5EEE0;
  margin-top: 6px;
  line-height: 1.3;
}

/* ══════════════════════════════════
   HERO HEADING — SIZE CORRECTION
══════════════════════════════════ */
.home-hero-title,
.lbd-title,
.we-hero-title {
  font-size: clamp(22px, 4vw, 64px) !important;
  line-height: 1.05 !important;
  letter-spacing: 0.06em !important;
  white-space: nowrap !important;
}

/* ══════════════════════════════════
   ATELIER PILLARS — shared (index + services)
══════════════════════════════════ */
.pillars-section { background: var(--b); padding: 96px 48px; }
.pillars-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; margin-top: 56px;
}
.pillar {
  background: rgba(242,232,218,.04); padding: 40px 32px;
  border: 1px solid rgba(196,120,138,.07); transition: background .35s;
}
.pillar:hover { background: rgba(196,120,138,.06); }
.pillar-num {
  font-family: "Playfair Display", serif; font-style: italic;
  font-size: 32px; color: rgba(245,238,224,.35); margin-bottom: 20px;
}
.pillar-name {
  font-family: "Playfair Display", serif; font-weight: 700;
  font-size: clamp(16px,1.5vw,20px); color: rgba(245,238,224,.90); margin-bottom: 12px;
}
.pillar-desc { font-size: 13px; color: rgba(245,238,224,.65); line-height: 1.75; }
@media (max-width: 1000px) { .pillars-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .pillars-section { padding: 48px 20px; }
  .pillars-grid { grid-template-columns: 1fr 1fr; gap: 1px; }
  .pillar { padding: 28px 20px; }
}
