/* Los Perales — Production styles */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&family=JetBrains+Mono:wght@400;500;700&family=Work+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f4efe6;
  --bg-2: #ece6d8;
  --bg-3: #e1d9c8;
  --paper: #faf7f0;
  --ink: #1c1a16;
  --ink-2: #3a3731;
  --ink-3: #726c62;
  --ink-4: #a39d90;
  --rule: #c9c1b0;
  --rule-2: #ded5c2;

  --brand: #2c2c2c;
  --brand-2: #1a1a1a;
  --gold: #c9a84c;
  --gold-2: #e8c96e;
  --gold-soft: #f5edcf;
  --accent: #c9a84c;
  --av: #4f7a3a;
  --av-soft: #e2ead4;
  --re: #b98a1e;
  --re-soft: #f3e8cc;
  --so: #8a3a34;
  --so-soft: #eadcd8;

  --shadow-sm: 0 1px 2px rgba(28,26,22,0.06), 0 2px 4px rgba(28,26,22,0.04);
  --shadow-md: 0 6px 18px rgba(28,26,22,0.10), 0 2px 4px rgba(28,26,22,0.05);
  --shadow-lg: 0 24px 48px -12px rgba(28,26,22,0.22), 0 8px 16px rgba(28,26,22,0.06);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  --dur: 220ms;
  --ease: cubic-bezier(0.2, 0.65, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: 'Work Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; font-feature-settings: 'ss01','cv11'; }
body { min-height: 100vh; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.hand { font-family: 'Caveat', cursive; }

/* ————————— Top nav ————————— */
.nav { position: sticky; top: 0; z-index: 30; background: rgba(244,239,230,0.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.nav-inner { max-width: 1320px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo-frame {
  position: relative;
  display: inline-flex;
  width: 66px;
  height: 54px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
  isolation: isolate;
  animation: logo-arrive 720ms var(--ease-out) both;
}
.brand-logo-frame::after {
  content: '';
  position: absolute;
  inset: -30% -55%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,0.52) 50%, transparent 62%);
  transform: translateX(-72%) skewX(-10deg);
  opacity: 0;
}
.brand-logo-frame img {
  width: 66px;
  height: auto;
  display: block;
  transform-origin: 50% 70%;
  animation: logo-breathe 7s ease-in-out 900ms infinite;
  transition: transform 420ms var(--ease-out), filter 420ms var(--ease-out);
}
.brand:hover .brand-logo-frame::after,
.brand:focus-visible .brand-logo-frame::after {
  animation: logo-shine 900ms var(--ease-out);
}
.brand:hover .brand-logo-frame img,
.brand:focus-visible .brand-logo-frame img {
  transform: scale(1.025) translateY(-1px);
  filter: saturate(1.08) brightness(1.04);
}
.brand:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 8px; }

.brand-copy { display: flex; min-width: 0; flex-direction: column; }
.brand-wordmark { color: var(--ink); font-family: Georgia, 'Times New Roman', serif; font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -.035em; white-space: nowrap; }
.brand-tagline { margin-top: 5px; color: var(--ink-3); font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }

.footer-logo { display: inline-flex; margin-bottom: 16px; align-items: center; gap: 13px; }
.footer-logo .brand-logo-frame { width: 78px; height: 64px; animation-delay: 120ms; }
.footer-logo .brand-logo-frame img { width: 78px; animation-name: logo-breathe-footer; }
.footer-logo .brand-wordmark { color: var(--paper); font-size: 28px; }
.footer-logo .brand-tagline { color: var(--ink-4); font-size: 12px; }

@keyframes logo-arrive {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes logo-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.012); }
}
@keyframes logo-breathe-footer {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}
@keyframes logo-shine {
  0% { opacity: 0; transform: translateX(-72%) skewX(-10deg); }
  22% { opacity: 0.78; }
  100% { opacity: 0; transform: translateX(72%) skewX(-10deg); }
}
.nav-links { display: flex; gap: 24px; margin-left: auto; }
.nav-links a { position: relative; font-size: 14px; color: var(--ink-2); padding: 8px 0; transition: color var(--dur) var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after { content:''; position: absolute; bottom: 2px; left: 0; right: 0; height: 2px; background: var(--gold); border-radius: 2px; }
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* Mobile menu */
.m-menu-btn { display: none; }
#m-menu { background: var(--bg); border-top: 1px solid var(--rule); padding: 14px 24px; display: flex; flex-direction: column; gap: 12px; }
#m-menu a { font-size: 15px; color: var(--ink-2); padding: 6px 0; border-bottom: 1px solid var(--rule-2); }

/* ————————— Buttons ————————— */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 500; transition: all var(--dur) var(--ease); white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--brand); color: var(--paper); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-gold { background: var(--gold); color: #1a1a1a; border-color: var(--gold); font-weight: 600; }
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-ghost { border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--rule); background: var(--paper); transition: all var(--dur) var(--ease); }
.icon-btn:hover { border-color: var(--ink-3); }

/* ————————— Lang toggle ————————— */
.lang-switch { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); padding: 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
.lang-switch button { border: 0; background: transparent; color: var(--ink-3); padding: 6px 12px; border-radius: 999px; transition: all var(--dur) var(--ease); }
.lang-switch button.active { background: var(--ink); color: var(--paper); }

/* ————————— Cards & chips ————————— */
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; transition: all var(--dur) var(--ease); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--ink-3); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-family: 'JetBrains Mono', monospace; border: 1px solid; }
.chip.av { color: var(--av); border-color: var(--av); background: var(--av-soft); }
.chip.re { color: var(--re); border-color: var(--re); background: var(--re-soft); }
.chip.so { color: var(--so); border-color: var(--so); background: var(--so-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.av { background: var(--av); }
.dot.re { background: var(--re); }
.dot.so { background: var(--so); }

/* ————————— Placeholder (diagonal lines) ————————— */
.ph {
  position: relative; width: 100%; height: 100%; min-height: 160px;
  background: var(--bg-3);
  display: grid; place-items: center; color: var(--ink-4);
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  overflow: hidden;
}
.ph::before, .ph::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.ph::before {
  background:
    linear-gradient(to top right, transparent calc(50% - 0.6px), var(--ink-4) 50%, transparent calc(50% + 0.6px)),
    linear-gradient(to top left, transparent calc(50% - 0.6px), var(--ink-4) 50%, transparent calc(50% + 0.6px));
  opacity: 0.45;
}
.ph-label { position: relative; z-index: 2; background: var(--bg-3); padding: 4px 10px; border-radius: 4px; }

/* ————————— Layout ————————— */
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.wrap-sm { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.stack > * + * { margin-top: var(--s, 24px); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.grid { display: grid; gap: 20px; }
.h-sect { font-size: 36px; line-height: 1.06; letter-spacing: -0.02em; font-weight: 700; margin: 0; }
.h-sect-sub { color: var(--ink-3); font-size: 15px; margin: 6px 0 0; max-width: 60ch; }
.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }

hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

/* ————————— Footer ————————— */
.footer { background: var(--ink); color: var(--bg); margin-top: 80px; padding: 60px 24px 30px; }
.footer .wrap { max-width: 1320px; margin: 0 auto; }
.footer a { color: var(--bg-2); }
.footer a:hover { color: var(--paper); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.foot-grid h4 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4); margin: 0 0 14px; font-family: 'JetBrains Mono', monospace; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.foot-bot { border-top: 1px solid var(--ink-2); padding-top: 20px; display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-4); font-family: 'JetBrains Mono', monospace; }
.foot-legal { display: flex; align-items: center; gap: 22px; }

/* ————————— Page transitions ————————— */
.page-enter { animation: fadeUp 420ms var(--ease-out) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ————————— Modal ————————— */
.modal-back { position: fixed; inset: 0; background: rgba(28,26,22,0.55); backdrop-filter: blur(4px); z-index: 80; display: grid; place-items: center; padding: 24px; animation: fadeIn 180ms var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; } }
.modal { background: var(--paper); border-radius: var(--r-xl); max-width: 860px; width: 100%; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: popIn 260ms var(--ease-out); }
@keyframes popIn { from { opacity:0; transform: scale(0.96) translateY(8px); } }

/* ————————— Toast ————————— */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: var(--r-md); font-size: 14px; z-index: 90; box-shadow: var(--shadow-lg); animation: toastIn 260ms var(--ease-out); transition: opacity 400ms; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* Utility */
.hidden { display: none !important; }
.inline-flex { display: inline-flex; gap: 8px; align-items: center; }
.text-ink-3 { color: var(--ink-3); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.pr { position: relative; }

/* ————————— Responsive ————————— */

/* Tablet (≤1080px) */
@media (max-width: 1080px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}

/* Tablet/mobile nav (≤860px) */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-desktop-only { display: none !important; }
  .m-menu-btn { display: grid !important; place-items: center; }
}

/* Mobile (≤640px) */
@media (max-width: 640px) {
  .wrap, .wrap-sm { padding-left: 16px; padding-right: 16px; }
  .nav-inner { padding: 10px 16px; gap: 14px; }
  .brand { gap: 7px; }
  .brand-logo-frame { width: 52px; height: 44px; }
  .brand-logo-frame img { width: 52px; }
  .brand-wordmark { font-size: 19px; }
  .brand > .brand-copy .brand-tagline { display: none; }
  .h-sect { font-size: 26px; }
  .spread { flex-wrap: wrap; gap: 10px; }
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
  .foot-bot { flex-direction: column; gap: 6px; }
  .foot-legal { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (max-width: 390px) {
  .brand-logo-frame { width: 46px; height: 40px; }
  .brand-logo-frame img { width: 46px; }
  .brand-wordmark { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-logo-frame,
  .brand-logo-frame img,
  .brand:hover .brand-logo-frame::after,
  .brand:focus-visible .brand-logo-frame::after {
    animation: none;
  }
  .brand-logo-frame img { transition: none; }
}
