/* ============================================================
   Tapacir B.E.S.A. — Design System v2
   Fraunces + Inter · Navy #0B1B30 · Gold #C9A25E · Cream #F7F3EC
   ============================================================ */

:root {
  --navy: #0B1B30;
  --navy-2: #0E2238;
  --navy-3: #122A44;
  --gold: #C9A25E;
  --gold-2: #E4C88A;
  --cream: #F7F3EC;
  --paper: #FFFCF7;
  --ink: #1B2530;
  --muted: #6E7A86;
  --hairline: rgba(11,27,48,.12);
  --hairline-gold: rgba(201,162,94,.45);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 200ms;
  --dur-med: 400ms;
  --dur-slow: 700ms;
  --shadow: 0 20px 60px rgba(11,27,48,.14);
  --shadow-lg: 0 32px 90px rgba(11,27,48,.22);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans); color: var(--ink); background: var(--paper);
  line-height: 1.65; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--gold); color: var(--navy); padding: 10px 18px; font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

/* ===== Micro-labels ===== */
.sec-label {
  font-size: 11.5px; font-weight: 600; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 14px; display: flex; align-items: center; gap: 12px;
}
.sec-label::before { content: ""; width: 34px; height: 1px; background: var(--gold); display: inline-block; }
.sec-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.08;
  color: var(--navy); letter-spacing: -0.01em;
}

/* ===== Header ===== */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background .4s var(--ease-out), box-shadow .4s var(--ease-out);
  background: transparent;
}
.header.scrolled {
  background: rgba(11,27,48,.92); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 84px; transition: height .4s var(--ease-out);
}
.header.scrolled .header-inner { height: 66px; }
.logo img { height: 44px; width: auto; transition: height .4s var(--ease-out); }
.header.scrolled .logo img { height: 36px; }
.nav { display: flex; gap: 34px; }
.nav-link {
  position: relative; font-size: 13px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.85);
  padding: 6px 0; transition: color .3s;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease-out);
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 18px; }

/* Lang switcher */
.lang-switch { display: flex; gap: 2px; background: rgba(255,255,255,.08); border-radius: 4px; padding: 3px; }
.lang-btn {
  background: transparent; border: none; color: rgba(255,255,255,.7);
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  padding: 5px 9px; border-radius: 3px; transition: all .25s;
}
.lang-btn.active { background: var(--gold); color: var(--navy); }
.lang-btn:hover:not(.active) { color: #fff; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 14px 30px; border-radius: 2px; border: 1px solid transparent;
  transition: all .35s var(--ease-out); position: relative; overflow: hidden;
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-2); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(201,162,94,.35); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); background: rgba(201,162,94,.08); }
.btn-lg { padding: 17px 38px; font-size: 13.5px; }
.header-cta { padding: 10px 20px; font-size: 12px; }
.menu-btn { display: none; background: none; border: none; color: #fff; font-size: 26px; line-height: 1; }

/* ===== HERO (signature) ===== */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); will-change: transform; }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,27,48,.42) 0%, rgba(11,27,48,.18) 42%, rgba(11,27,48,.72) 100%);
}
.hero-lockup {
  position: relative; z-index: 2; padding-bottom: 15vh; width: 100%;
  max-width: 1240px; margin: 0 auto; padding-left: 28px; padding-right: 28px;
  color: #fff;
}
.hero-label {
  font-size: 12px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold-2); margin-bottom: 20px; display: flex; align-items: center; gap: 14px;
}
.hero-label::before { content: ""; width: 44px; height: 1px; background: var(--gold-2); display: inline-block; }
.hero-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: 1.02;
  letter-spacing: -0.015em; max-width: 13ch; text-shadow: 0 4px 40px rgba(0,0,0,.25);
}
.hero-sub {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem); color: var(--gold-2);
  margin-top: 14px;
}
.hero-ctas { display: flex; gap: 16px; margin-top: 38px; flex-wrap: wrap; }
.hero-scroll {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  width: 1px; height: 64px; z-index: 3; opacity: .8;
}
.hero-scroll span {
  display: block; width: 1px; height: 100%; background: rgba(255,255,255,.7);
  position: relative; overflow: hidden;
}
.hero-scroll span::after {
  content: ""; position: absolute; top: -50%; left: 0; width: 1px; height: 50%;
  background: var(--gold); animation: scrollCue 2.2s var(--ease-inout) infinite;
}
@keyframes scrollCue { 0% { top: -50%; } 100% { top: 110%; } }

/* Hero entrance (JS adds .loaded) */
.hero .hero-label, .hero .hero-title, .hero .hero-sub, .hero .hero-ctas { opacity: 0; transform: translateY(26px); }
.hero.loaded .hero-label, .hero.loaded .hero-title, .hero.loaded .hero-sub, .hero.loaded .hero-ctas {
  animation: riseIn .9s var(--ease-out) forwards;
}
.hero.loaded .hero-label { animation-delay: .1s; }
.hero.loaded .hero-title { animation-delay: .18s; }
.hero.loaded .hero-sub { animation-delay: .3s; }
.hero.loaded .hero-ctas { animation-delay: .42s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Sections base ===== */
section { position: relative; }
.collections { padding: 120px 0 130px; background: var(--paper); }
.services { padding: 130px 0; background: var(--cream); }
.atelier { padding: 130px 0 140px; background: var(--paper); }
.contact { padding: 130px 0 120px; background: var(--navy); color: #fff; }

.sec-head { margin-bottom: 56px; }

/* ===== Collections grid ===== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.cat-tile { position: relative; display: block; border-radius: 3px; overflow: hidden; }
.cat-img-wrap { aspect-ratio: 3/4; overflow: hidden; position: relative; background: var(--cream); }
.cat-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease-out); }
.cat-tile::after {
  content: ""; position: absolute; inset: 0; border: 1px solid transparent;
  transition: border-color .5s, inset .5s; pointer-events: none; z-index: 2;
}
.cat-tile:hover::after { border-color: rgba(201,162,94,.7); inset: 10px; }
.cat-tile:hover .cat-img-wrap img { transform: scale(1.08); }
.cat-name {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 44px 18px 16px; color: #fff; font-weight: 500; font-size: 14.5px;
  letter-spacing: .02em;
  background: linear-gradient(180deg, transparent, rgba(11,27,48,.88));
  transform: translateY(6px); opacity: .92; transition: all .45s var(--ease-out);
}
.cat-tile:hover .cat-name { transform: translateY(0); opacity: 1; }
.cat-tile:first-child { grid-column: span 2; grid-row: span 2; }
.cat-tile:first-child .cat-img-wrap { aspect-ratio: auto; height: 100%; }

/* ===== Services ===== */
.services-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 70px; align-items: start; }
.services-intro { position: sticky; top: 110px; }
.services-lead { color: var(--muted); margin-top: 18px; max-width: 38ch; }
.services-list { display: flex; flex-direction: column; }
.service-row {
  display: flex; align-items: center; gap: 28px;
  padding: 34px 8px; border-top: 1px solid var(--hairline);
  transition: background .3s, padding .4s var(--ease-out);
}
.service-row:last-child { border-bottom: 1px solid var(--hairline); }
.service-row:hover { background: rgba(201,162,94,.06); padding-left: 18px; }
.service-num { font-family: var(--serif); font-size: 1.1rem; color: var(--gold); min-width: 44px; }
.service-body h3 { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; color: var(--navy); }
.service-body p { color: var(--muted); font-size: 14.5px; margin-top: 6px; max-width: 52ch; }
.service-arrow { margin-left: auto; font-size: 1.5rem; color: var(--gold); transform: translateX(0); transition: transform .35s var(--ease-out); }
.service-row:hover .service-arrow { transform: translateX(8px); }

/* ===== Atelier ===== */
.atelier-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 80px; align-items: center; }
.atelier-img { position: relative; }
.atelier-img img { width: 100%; border-radius: 3px; box-shadow: var(--shadow-lg); }
.atelier-img::after {
  content: ""; position: absolute; inset: -18px 18px 18px -18px;
  border: 1px solid var(--hairline-gold); border-radius: 3px; z-index: -1;
}
.atelier-text .sec-title { margin-bottom: 22px; }
.atelier-lead { font-family: var(--serif); font-size: 1.5rem; line-height: 1.35; color: var(--navy); margin-bottom: 18px; }
.atelier-body { color: var(--muted); max-width: 50ch; }
.stats { display: flex; gap: 48px; margin-top: 40px; }
.stat-num { font-family: var(--serif); font-size: 2.6rem; color: var(--navy); display: block; line-height: 1; }
.stat-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 6px; display: block; }

/* ===== Contact ===== */
.contact .sec-title { color: #fff; margin-bottom: 34px; }
.gold-label { color: var(--gold-2); }
.gold-label::before { background: var(--gold-2); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 80px; }
.contact-lines p { margin-bottom: 16px; font-size: 15.5px; color: rgba(255,255,255,.85); }
.contact-lines a { color: var(--gold-2); border-bottom: 1px solid transparent; transition: border-color .3s; }
.contact-lines a:hover { border-color: var(--gold-2); }
.contact-hours { margin-top: 26px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.form-row input, .form-row textarea {
  width: 100%; padding: 15px 18px; border: 1px solid rgba(255,255,255,.16);
  border-radius: 3px; background: rgba(255,255,255,.05); color: #fff;
  font-family: var(--sans); font-size: 14.5px; transition: border-color .3s, background .3s;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: rgba(255,255,255,.45); }
.form-row input:focus, .form-row textarea:focus {
  outline: none; border-color: var(--gold); background: rgba(255,255,255,.08);
}
.contact-form .btn { margin-top: 6px; }
.form-note { margin-top: 12px; color: var(--gold-2); font-size: 14px; }

/* ===== Footer ===== */
.footer { background: #081420; color: #8b96a5; padding: 56px 0 48px; text-align: center; }
.footer-logo img { height: 40px; margin: 0 auto 14px; }
.footer-tag { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--gold); margin-bottom: 18px; }
.footer-nav { display: flex; justify-content: center; gap: 30px; margin-bottom: 20px; flex-wrap: wrap; }
.footer-nav a { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: #9aa7b5; transition: color .3s; }
.footer-nav a:hover { color: var(--gold-2); }
.footer-copy { font-size: 13px; }

/* ===== Scroll reveal ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===== Custom cursor (desktop only) ===== */
.cursor-dot {
  position: fixed; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); pointer-events: none; z-index: 300;
  transform: translate(-50%, -50%); transition: transform .12s linear, opacity .3s;
  opacity: 0;
}
.cursor-dot.on { opacity: .85; }
.cursor-dot.hover { transform: translate(-50%, -50%) scale(2.6); opacity: .55; }

/* ===== Mobile nav sheet ===== */
@media (max-width: 900px) {
  .nav {
    position: fixed; inset: 0; background: var(--navy); z-index: 120;
    flex-direction: column; justify-content: center; align-items: center; gap: 8px;
    opacity: 0; pointer-events: none; transition: opacity .4s var(--ease-out);
  }
  .nav.open { opacity: 1; pointer-events: auto; }
  .nav-link { font-family: var(--serif); font-size: 1.9rem; text-transform: none; letter-spacing: 0; padding: 10px; }
  .menu-btn { display: block; z-index: 130; }
  .header-cta { display: none; }
  .header-actions { gap: 10px; }
  .services-grid, .atelier-grid, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .services-intro { position: static; }
  .collections, .services, .atelier, .contact { padding: 84px 0; }
  .stats { gap: 30px; }
  .cat-tile:first-child { grid-column: span 2; }
}
@media (max-width: 560px) {
  .container { padding: 0 20px; }
  .cat-tile:first-child { grid-column: span 2; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hero-ctas .btn { width: 100%; }
  .hero-lockup { padding-bottom: 12vh; }
  .lang-btn { padding: 4px 7px; font-size: 10px; }
  .header-inner { height: 70px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero .hero-label, .hero .hero-title, .hero .hero-sub, .hero .hero-ctas { opacity: 1; transform: none; }
  .cursor-dot { display: none; }
}
