/* ============================================================
   MARTÍNEZ 1890 · PROPUESTA "ATELIER" — editorial, silenciosa, atemporal
   Referencias: Noma, Atomix, Canlis, Eleven Madison Park
   ============================================================ */
:root{
  --bg:#F7F4EE; --bg-rgb:247,244,238;
  --ink:#15120E; --ink-soft:#524A3F; --ink-faint:#655C4E;
  --hairline:#D3C7B0;
  --accent:#7C1620; --accent-soft:#A6434C;

  --serif:'Fraunces', Georgia, serif;
  --sans:'Inter', -apple-system, sans-serif;

  --ease:cubic-bezier(.22,.61,.36,1);
  --t1:220ms; --t2:420ms; --t3:700ms;

  --edge:clamp(1.25rem, 5vw, 4rem);
  --measure:640px;
  --header-h:64px;
  --nav-h:56px;
  /* Footer palette */
  --footer-bg:#15120E; --footer-text:#EDE5D9; --footer-muted:#B0A898;
  --footer-accent:#E2A6A6; --footer-border:rgba(255,255,255,.1);
  --footer-link:#A89E90; --footer-social:#B0A898;
  --footer-schedule-text:#B0A898; --footer-schedule-hover:#D9D2C6;
}
@media(min-width:1024px){:root{--measure:720px;}}
@media(min-width:1440px){:root{--measure:800px;}}
[data-theme="dark"]{
  --bg:#242526; --bg-rgb:36,37,38;
  --footer-bg:#1B1C1D; --footer-text:#C5C3C0;
  --ink:#E5E4E2; --ink-soft:#A9A8A6; --ink-faint:#A5A4A2;
  --hairline:#5A5958;
  --accent:#E0A09D; --accent-soft:#C1505C;
}

*,*::before,*::after{box-sizing:border-box; margin:0; padding:0;}
html{overflow-x:hidden; scroll-behavior:smooth; overscroll-behavior:contain;}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
  *{animation-duration:.01ms !important; transition-duration:.01ms !important; transition-delay:0ms !important;}
}
@media (prefers-contrast:more){
  :root{--hairline:#8C8272; --ink-soft:#332E27; --footer-text:#FFFFFF; --footer-muted:#C8C0B4; --footer-border:rgba(255,255,255,.3);}
  [data-theme="dark"]{--hairline:#6E655A; --ink-soft:#D6CFC2;}
}

body{
  background:var(--bg); color:var(--ink); font-family:var(--sans);
  font-size:16px; line-height:1.7; -webkit-font-smoothing:antialiased;
  transition:background var(--t2) var(--ease), color var(--t2) var(--ease);
}
img{max-width:100%; display:block;}
a{color:inherit;}
:focus-visible{outline:1px solid var(--accent); outline-offset:4px;}
.sr-only{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0);}
.skip-link{position:absolute; top:-60px; left:0; background:var(--ink); color:var(--bg); padding:.85rem 1.4rem; z-index:1000; font-size:.8rem; transition:top var(--t1) var(--ease);}
.skip-link:focus{top:0;}

/* ============ HEADER ============ */
header{
  position:fixed; top:0; left:0; right:0; z-index:100;
  padding:1.1rem var(--edge);
  display:flex; align-items:center; justify-content:space-between;
  border-bottom:1px solid transparent;
  transition:background var(--t2) var(--ease), border-color var(--t2) var(--ease), padding var(--t2) var(--ease);
}
header.scrolled{
  background:rgba(var(--bg-rgb),.9); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  border-bottom:1px solid var(--hairline);
  padding-top:.7rem; padding-bottom:.7rem;
}
.brand-mark img{height:30px; width:auto; transition:height var(--t1) var(--ease);}
header.scrolled .brand-mark img{height:24px;}

.header-right{display:flex; align-items:center; gap:1.6rem;}
.lang-row{display:flex; align-items:center; gap:.55rem; font-family:var(--sans);}
.lang-item{
  background:none; border:none; color:var(--ink-faint); cursor:pointer;
  font-size:.7rem; font-weight:500; letter-spacing:.12em; padding:.4rem 0; position:relative;
  transition:color var(--t1) var(--ease);
}
.lang-item::after{
  content:''; position:absolute; left:0; right:0; bottom:-3px; height:1px;
  background:var(--accent); transform:scaleX(0); transform-origin:left;
  transition:transform var(--t2) var(--ease);
}
.lang-item:hover{color:var(--ink);}
.lang-item.active{color:var(--ink); font-weight:600;}
.lang-item.active::after{transform:scaleX(1);}
.lang-sep{color:var(--hairline); font-size:.7rem;}

.theme-toggle{
  background:none; border:1px solid var(--hairline); color:var(--ink-soft);
  width:34px; height:34px; border-radius:50%; cursor:pointer; font-size:.9rem;
  display:flex; align-items:center; justify-content:center;
  transition:border-color var(--t1) var(--ease), color var(--t1) var(--ease);
}
.theme-toggle:hover{border-color:var(--accent); color:var(--accent);}
.theme-icon-stack{position:relative; width:16px; height:16px; display:inline-block;}
.theme-icon{
  position:absolute; top:0; left:0; width:16px; height:16px;
  opacity:0; transform:rotate(-90deg) scale(.4);
  transition:opacity var(--t1) var(--ease), transform var(--t1) var(--ease);
}
.theme-icon-sun{opacity:1; transform:rotate(0deg) scale(1);}
[data-theme="dark"] .theme-icon-sun{opacity:0; transform:rotate(90deg) scale(.4);}
[data-theme="dark"] .theme-icon-moon{opacity:1; transform:rotate(0deg) scale(1);}

/* ============ HERO ============ */
@keyframes fadeUp{from{opacity:0; transform:translateY(16px);} to{opacity:1; transform:translateY(0);}}
@keyframes heroReveal{0%{opacity:0; transform:scale(.97); filter:blur(1px);} 100%{opacity:1; transform:scale(1); filter:blur(0);}}
.hero{
  position:relative;
  min-height:49vh; min-height:49svh; display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; padding:6rem var(--edge) 3rem; gap:1.6rem;
}
.hero-logo{width:min(345px, 69vw); height:auto; opacity:0; animation:heroReveal .9s var(--ease) .1s forwards; will-change:opacity,transform,filter; backface-visibility:hidden;}
.hero-rule{width:40px; height:1px; background:var(--accent); opacity:0; animation:fadeUp var(--t3) var(--ease) .3s forwards;}
.hero-tagline{
  font-family:var(--serif); font-style:italic; font-weight:400; font-size:clamp(1.15rem,2.4vw,1.6rem);
  color:var(--ink-soft); max-width:480px; text-wrap:balance; opacity:0; animation:fadeUp var(--t3) var(--ease) .45s forwards;
}
.hero-since{
  font-size:.68rem; letter-spacing:.32em; text-transform:uppercase; color:var(--ink-faint);
  opacity:0; animation:fadeUp var(--t3) var(--ease) .6s forwards;
}
/* ============ NAV ============ */
.menu-nav{
  position:sticky; top:var(--header-h); z-index:90;
  background:rgba(var(--bg-rgb),.92); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  border-bottom:1px solid var(--hairline);
}
.menu-nav-scroll{
  max-width:var(--measure); margin:0 auto; display:flex; flex-wrap:wrap; justify-content:center;
  gap:.65rem 2rem; overflow-x:visible; padding:.9rem var(--edge); scrollbar-width:none;
}
.menu-nav-scroll::-webkit-scrollbar{display:none;}
.menu-nav a{
  flex-shrink:0; font-size:.72rem; font-weight:600; letter-spacing:.14em; text-transform:uppercase;
  color:var(--ink-faint); text-decoration:none; white-space:nowrap; position:relative; padding-bottom:.3rem;
  transition:color var(--t1) var(--ease);
  cursor:pointer;
}
.menu-nav a::after{
  content:''; position:absolute; left:0; right:0; bottom:0; height:2px; background:var(--accent);
  transform:scaleX(0); transform-origin:left; transition:transform var(--t2) var(--ease);
}
.menu-nav a:hover{color:var(--ink);}
.menu-nav a.active{color:var(--ink);}
.menu-nav a.active::after{transform:scaleX(1);}

/* ============ MAIN ============ */
main{max-width:var(--measure); margin:0 auto; padding:0 var(--edge); scroll-margin-top:calc(var(--header-h) + 12px);}
.lang-content{display:none; opacity:0; transition:opacity 260ms var(--ease);}
.lang-content.active{display:block;}
.lang-content.active.is-visible{opacity:1;}

.section{margin:clamp(3.5rem, 8vw, 5.5rem) 0; scroll-margin-top:calc(var(--header-h) + var(--nav-h) + 16px);}
[id^="carta-"]{scroll-margin-top:calc(var(--header-h) + var(--nav-h) + 16px);}
.section:first-child{margin-top:clamp(2.5rem, 7vw, 4.5rem);}
.subsection{margin:clamp(1.75rem, 4vw, 2.5rem) 0;}
.subsection:first-child{margin-top:.5rem;}
.section-title{
  font-family:var(--serif); font-weight:600; font-size:clamp(1.6rem,4vw,2.3rem);
  letter-spacing:.01em; text-align:left; color:var(--ink); text-rendering:optimizeLegibility;
  border-bottom:1.5px solid var(--ink-faint); padding-bottom:1.1rem; margin-bottom:2.2rem;
}
h3.section-title{
  font-size:1.3rem; margin-top:0; padding-bottom:.7rem;
}

.item{
  display:flex; justify-content:space-between; align-items:baseline; gap:1.5rem;
  padding:1.15rem 0; border-bottom:1px solid var(--hairline);
  opacity:0; transform:translateY(14px) scale(.96);
  transition:opacity .45s var(--ease), transform .45s var(--ease), border-color var(--t1) var(--ease), background var(--t1) var(--ease);
  position:relative; backface-visibility:hidden;
}
.item:not(.visible){will-change:opacity,transform;}
.item.visible{opacity:1; transform:translateY(0) scale(1);}
.item::before{
  content:''; position:absolute; left:-.5rem; top:.4rem; bottom:.4rem; width:2px; background:var(--accent);
  opacity:0; transition:opacity var(--t1) var(--ease);
}
.item:hover{transform:translateX(0.6rem); border-color:var(--ink-faint); background:rgba(124,22,32,.025);}
.item:hover::before{opacity:1;}
.item:last-of-type{border-bottom:none;}
.item-name{font-family:var(--serif); font-weight:500; font-size:1.08rem; color:var(--ink); transition:letter-spacing .3s var(--ease);}
.item-name:hover{letter-spacing:.02em;}
.item-desc{font-size:.83rem; color:var(--ink-soft); margin-top:.3rem; font-style:italic; line-height:1.55;}
.item-price{font-family:var(--serif); font-weight:500; font-size:1.05rem; color:var(--ink-soft); white-space:nowrap; transition:transform .3s var(--ease), color .3s var(--ease);}
.item-price:hover{transform:scale(1.06); color:var(--accent);}



/* ============ FOOTER ============ */
footer{background:var(--footer-bg); color:var(--footer-text); margin-top:2rem;}
.footer-inner{max-width:var(--measure); margin:0 auto; padding:5rem var(--edge) 2.5rem;}
.footer-brand{font-family:var(--serif); font-size:clamp(1.8rem,4vw,2.4rem); text-align:center; margin-bottom:.5rem;}
.footer-tagline{text-align:center; font-style:italic; font-family:var(--serif); color:var(--footer-text); font-size:1.05rem; margin-bottom:1.6rem;}
.footer-menu-note{border-top:1px solid var(--footer-border); border-bottom:1px solid var(--footer-border); padding:1.4rem 0; margin-bottom:2.6rem; text-align:center; font-size:.85rem; color:var(--footer-text); line-height:1.8;}
.footer-cta-row{display:grid; grid-template-columns:1fr; gap:1rem; margin-bottom:3rem;}
@media(min-width:640px){.footer-cta-row{grid-template-columns:1fr 1fr;}}
#footerDailyMenu{margin-top:.6rem;}

.footer-map{border:1px solid var(--footer-border); padding:1.6rem; text-align:center; display:flex; flex-direction:column; justify-content:center;}
.footer-map-text{font-family:var(--serif); font-style:italic; color:var(--footer-text); font-size:1rem; margin-bottom:.9rem;}
.footer-map-cta{font-size:.7rem; letter-spacing:.14em; text-transform:uppercase; color:var(--footer-accent); text-decoration:none; border-bottom:1px solid var(--accent-soft); padding-bottom:2px; align-self:center; transition:opacity var(--t1) var(--ease);}
.footer-map-cta:hover{opacity:.75;}

.footer-legal{text-align:center; font-size:.72rem; color:var(--footer-muted); border-top:1px solid var(--footer-border); padding-top:1.8rem; line-height:1.9;}
.footer-legal a{color:var(--footer-link); text-decoration:underline;}
.footer-legal .footer-web{display:inline-block; margin-bottom:.6rem;}
.footer-web-icon{vertical-align:-2px; margin-right:4px; opacity:.7;}

.qr-box{text-align:center; margin:5rem auto; padding-bottom:1rem;}
.qr-box img{width:130px; height:130px; margin:0 auto 1rem; filter:grayscale(1) contrast(1.05);}
.qr-caption{font-size:.72rem; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-faint);}

.footer-social{display:flex; justify-content:center; gap:1.2rem; padding:2rem 0 1.5rem; border-top:1px solid var(--footer-border); margin-top:1rem;}
.footer-social a{display:flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:50%; border:1px solid rgba(255,255,255,.15); color:var(--footer-social); text-decoration:none; transition:all var(--t2) var(--ease);}
.footer-social a svg{width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round;}
.footer-social a:hover{border-color:var(--accent-soft); color:var(--footer-schedule-hover); transform:translateY(-2px); box-shadow:0 4px 12px rgba(166,67,76,.15);}

.footer-schedule-toggle{display:flex; align-items:center; justify-content:center; gap:.7rem; margin:0 auto; padding:1rem 0; background:none; border:none; color:var(--footer-schedule-text); font-family:inherit; font-size:.72rem; letter-spacing:.14em; text-transform:uppercase; cursor:pointer; transition:color var(--t2) var(--ease); width:100%;}
.footer-schedule-toggle svg{opacity:.7; flex-shrink:0;}
.footer-schedule-toggle:hover{color:var(--footer-schedule-hover);}
.footer-schedule-dot{width:6px; height:6px; border-radius:50%; background:var(--accent-soft); transition:background var(--t2) var(--ease);}
.footer-schedule-dot.closed{background:var(--ink-faint);}
.footer-schedule-chevron{transition:transform .3s var(--ease); font-size:.8rem;}
.footer-schedule-toggle.open .footer-schedule-chevron{transform:rotate(180deg);}

.footer-schedule-panel{display:grid; grid-template-rows:0fr; overflow:hidden; opacity:0; transition:grid-template-rows .4s var(--ease), opacity .3s var(--ease);}
.footer-schedule-panel.open{grid-template-rows:1fr; opacity:1; border-top:1px solid var(--footer-border); margin:0 var(--edge);}
.footer-schedule-panel > div{overflow:hidden;}
.footer-schedule-grid{display:grid; grid-template-columns:auto 1fr; gap:.6rem 2rem; max-width:280px; margin:1.6rem auto 0; padding:1.4rem 2rem; border:1px solid var(--footer-border); border-radius:2px;}
.footer-schedule-day{font-family:var(--serif); font-style:italic; font-size:.88rem; color:var(--footer-text); text-align:right;}
.footer-schedule-hours{font-size:.78rem; color:var(--footer-schedule-text); letter-spacing:.04em;}
.footer-schedule-day.closed{color:var(--footer-schedule-hover);}
.footer-schedule-day.today{color:var(--footer-accent);}
.footer-schedule-hours.today{color:var(--footer-schedule-hover); font-weight:600;}

.footer-in{opacity:0; transform:translateY(20px); transition:all .8s var(--ease);}
.footer-in.visible{opacity:1; transform:translateY(0);}

.story{margin-top:clamp(3rem,7vw,5rem); text-align:center;}
.story-rule{width:40px; height:1px; background:var(--accent); margin:0 auto 1.4rem;}
.story-text{font-family:var(--serif); font-style:italic; font-size:clamp(1rem,2.2vw,1.15rem); line-height:1.8; color:var(--ink-soft); max-width:560px; margin:0 auto;}

.scroll-top{
  position:fixed; bottom:clamp(1.25rem,4vw,2.5rem); right:clamp(1.25rem,4vw,2.5rem);
  z-index:99; width:44px; height:44px; border-radius:50%;
  background:var(--accent); color:var(--bg); border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  font-size:1.3rem; box-shadow:0 4px 16px rgba(0,0,0,.12);
  opacity:0; transform:translateY(12px);
  transition:opacity var(--t2) var(--ease), transform var(--t2) var(--ease), background var(--t2) var(--ease);
  pointer-events:none;
}
.scroll-top.visible{opacity:1; transform:translateY(0); pointer-events:auto;}
.scroll-top:hover{background:var(--accent-soft); transform:translateY(-2px); box-shadow:0 6px 20px rgba(0,0,0,.18);}

/* ============ MÓVIL ESTRECHO (hasta 414px) ============ */
@media(max-width:414px){
  :root{--header-h:52px;}
  header{padding:.8rem var(--edge);}
  .brand-mark img{height:24px;}
  header.scrolled .brand-mark img{height:20px;}
  .header-right{gap:1rem;}
  .lang-row{gap:.4rem;}
  .lang-item{font-size:.65rem;}
  .theme-toggle{width:30px; height:30px; font-size:.8rem;}
  .hero{padding:5rem var(--edge) 2rem; gap:1.2rem; min-height:45vh; min-height:45svh;}
  .hero-logo{width:min(230px, 63vw);}
  .hero-tagline{font-size:clamp(.95rem, 3.2vw, 1.15rem);}
  .hero-since{font-size:.6rem;}
  .menu-nav-scroll{gap:.5rem 1.3rem; padding:.65rem var(--edge);}
  .menu-nav a{font-size:.65rem; letter-spacing:.12em;}
   .section-title{font-size:clamp(1.3rem,5vw,1.6rem); padding-bottom:.8rem; margin-bottom:1.5rem;}
  h3.section-title{font-size:1.1rem; margin-top:0;}
  .subsection{margin:clamp(1.25rem, 5vw, 1.75rem) 0;}
  .subsection:first-child{margin-top:.4rem;}
  .item{gap:1rem; padding:.9rem 0;}
  .item-name{font-size:.95rem;}
  .item-desc{font-size:.78rem;}
   .item-price{font-size:.9rem;}
   .footer-inner{padding:3rem var(--edge) 2rem;}
   .footer-brand{font-size:clamp(1.4rem,6vw,1.8rem);}
    .footer-tagline{font-size:.9rem; margin-bottom:1rem;}
    .footer-menu-note{padding:.9rem 0; margin-bottom:1.4rem; font-size:.8rem;}
    .footer-cta-row{gap:.8rem; margin-bottom:1.6rem;}
    .footer-map{padding:1rem;}
    .footer-legal{padding-top:.8rem; margin-bottom:0;}
    .footer-schedule-toggle{padding:.5rem 0;}
    .footer-schedule-panel.open{margin:0;}
    .footer-schedule-grid{margin:.8rem auto 0; padding:.8rem 1.2rem;}
    .footer-social{padding:.6rem 0 .5rem; margin-top:0;}
    .qr-box{margin:3rem auto;}
    .qr-box img{width:100px; height:100px;}
}

/* ============ MÓVIL MEDIO (415-640px) ============ */
@media(min-width:415px) and (max-width:640px){
  .hero-logo{width:min(276px, 63vw);}
  .item-name{font-size:1rem;}
  .item-price{font-size:.95rem;}
}

/* ============ TABLET (641-1023px) ============ */
@media(min-width:641px) and (max-width:1023px){
  .hero{padding:6rem var(--edge) 3rem; min-height:39vh; min-height:39svh;}
  .hero-logo{width:min(299px, 57.5vw);}
  .hero-tagline{max-width:540px;}
  .section{margin:clamp(3.5rem,6vw,4.5rem) 0;}
  .section-title{font-size:clamp(1.4rem,3.5vw,1.9rem);}
  .item-name{font-size:1.12rem;}
  .item-price{font-size:1.05rem;}
  .footer-inner{padding:4rem var(--edge) 2.5rem;}
}

/* ============ ESCRITORIO MEDIO (1024-1439px) ============ */
@media(min-width:1024px){
  .item-name{font-size:1.18rem;}
  .item-price{font-size:1.1rem;}
  .hero-tagline{max-width:640px;}
  .menu-nav-scroll{max-width:none; gap:1.3rem; justify-content:center; flex-wrap:wrap; overflow-x:visible;}
  .menu-nav a{font-size:.68rem; letter-spacing:.1em;}
}

/* ============ ESCRITORIO GRANDE (1440px+) ============ */
@media(min-width:1440px){
  .hero{padding:7rem var(--edge) 4rem; gap:2rem;}
  .hero-logo{width:min(391px, 46vw);}
  .hero-tagline{font-size:clamp(1.2rem,1.8vw,1.6rem); max-width:660px;}
  .section-title{font-size:clamp(1.8rem,2.8vw,2.5rem);}
  .item-name{font-size:1.25rem;}
  .item-desc{font-size:.88rem;}
  .item-price{font-size:1.15rem;}
  .menu-nav-scroll{gap:1.8rem;}
  .menu-nav a{font-size:.72rem; letter-spacing:.12em;}
}

/* ============ ESCRITORIO 4K (1920px+) ============ */
@media(min-width:1920px){
  .hero{padding:8rem var(--edge) 5rem;}
  .footer-inner{padding:6rem var(--edge) 3rem;}
  .footer-brand{font-size:clamp(2rem,2.4vw,2.8rem);}
}

/* ============ IMPRESIÓN (menú en papel) ============ */
@media print{
  *{-webkit-print-color-adjust:exact; print-color-adjust:exact;}
  html{font-size:11pt;}
  header,.menu-nav,.scroll-top,.qr-box{display:none !important;}
  body{background:#fff;color:#000;}
  .hero{min-height:auto;padding:0 0 .8rem;}
  .hero-logo{width:200px;opacity:1;animation:none;}
  .hero-rule{opacity:1;animation:none;}
  .hero-tagline,.hero-since{color:#000;opacity:1;animation:none;max-width:none;}
  .lang-content{opacity:1 !important;}
  .section{margin:1.2rem 0;}
  .section-title{color:#000;border-color:#000;font-size:1.35rem;padding-bottom:.5rem;margin-bottom:1rem;}
  h3.section-title{color:#000;border-color:#999;}
  .item{opacity:1 !important;transform:none !important;page-break-inside:avoid;padding:.55rem 0;}
  .item:hover{transform:none;}
  .item::before{display:none;}
  .item-name,.item-price{color:#000;}
  .item-desc{color:#444;}
  footer{background:#fff;color:#000;margin-top:1rem;}
  .footer-inner{padding:1rem 0 0;opacity:1 !important;transform:none !important;}
  .footer-brand,.footer-tagline,.footer-menu-note,.footer-legal,.footer-legal a,.footer-web{color:#000;}
  .footer-tagline{margin-bottom:1rem;}
  .footer-menu-note{border-color:#000;margin-bottom:1.2rem;}
  .footer-map{border-color:#000;}
  .footer-map-text,.footer-map-cta{color:#000;}
  .footer-cta-row{grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1.2rem;}
  .footer-legal{border-color:#000;padding-top:.8rem;}
  .story{opacity:1 !important; transform:none !important;}
  .story-rule{background:#000;}
  .story-text{color:#000;}
}