/* Tavolingo — shared styles. "Trattoria chalkboard" look: chalk on a slate board,
   gingham tablecloth strips, printed paper menu cards. Mobile-first; light + dark.
   Board/paper scopes, gingham and section components live in trattoria.css. */
:root {
  --chalk: #f4f1e8;
  --chalk-yellow: #f2d16b;
  --board: #22302b;
  --linen: #f1e9da;
  --paper: #fbf6ec;
  --red: #c9302c;
  --red-hover: #ad231f;
  --red-edge: #8e1d1a;
  --wood: #8a5b38;
  --wood-dark: #5c3a22;

  /* Paper context (default in light mode) */
  --bg: var(--linen);
  --card: var(--paper);
  --ink: #2b2620;
  --ink-soft: #5c5348;
  --heading: #22302b;
  --line: #dccfb7;
  --line-strong: #c2b192;
  --accent: #a92420;
  --accent-soft: #f6e0d8;
  --basil: #3d6b35;
  --basil-soft: #e2ead3;
  --focus: #c9302c;
  --ok: #2f6a2c;
  --bad: #b3261e;
  --warn: #7a5200;
  --chalk-shadow: none;

  --squiggle-red: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16' preserveAspectRatio='none'%3E%3Cpath d='M3 10c30-6 62-7 96-4s66 3 98-3' fill='none' stroke='%23C9302C' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M10 13c40-4 90-5 150-2' fill='none' stroke='%23C9302C' stroke-width='2' stroke-linecap='round' opacity='.5'/%3E%3C/svg%3E");
  --squiggle-chalk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16' preserveAspectRatio='none'%3E%3Cpath d='M3 10c30-6 62-7 96-4s66 3 98-3' fill='none' stroke='%23F2D16B' stroke-width='4' stroke-linecap='round' opacity='.92'/%3E%3Cpath d='M10 13c40-4 90-5 150-2' fill='none' stroke='%23F2D16B' stroke-width='2' stroke-linecap='round' opacity='.5'/%3E%3C/svg%3E");
  --scribble-red: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 60' preserveAspectRatio='none'%3E%3Cpath d='M58 5C31 2 5 12 4 30s23 27 49 26 44-11 43-27S73 3 42 8' fill='none' stroke='%23C9302C' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  --scribble-chalk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 60' preserveAspectRatio='none'%3E%3Cpath d='M58 5C31 2 5 12 4 30s23 27 49 26 44-11 43-27S73 3 42 8' fill='none' stroke='%23F59A8E' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  --squiggle: var(--squiggle-red);
  --scribble: var(--scribble-red);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(43, 38, 32, .08), 0 10px 24px -14px rgba(43, 38, 32, .38);
  --shadow-lg: 0 2px 4px rgba(43, 38, 32, .08), 0 26px 48px -24px rgba(43, 38, 32, .55);
  --font-hand: "Caveat Brush", "Segoe Print", "Bradley Hand", cursive;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: 16px;
  --page-tex:
    repeating-linear-gradient(0deg, rgba(120, 96, 60, .035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(120, 96, 60, .03) 0 1px, transparent 1px 4px);
  --board-tex:
    radial-gradient(70% 55% at 14% 18%, rgba(244, 241, 232, .07), transparent 70%),
    radial-gradient(45% 40% at 86% 76%, rgba(244, 241, 232, .055), transparent 70%),
    radial-gradient(35% 25% at 62% 8%, rgba(244, 241, 232, .04), transparent 75%),
    linear-gradient(103deg, transparent 22%, rgba(244, 241, 232, .03) 34%, transparent 48%),
    repeating-linear-gradient(-24deg, rgba(244, 241, 232, .02) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(64deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 13px),
    linear-gradient(170deg, #26362f, #1e2a26);
  --gingham-check: 12px;
  --gingham-base: #fbf6ec;
  --gingham-tint: rgba(201, 48, 44, .56);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a2521;
    --card: #26342f;
    --ink: #f4f1e8;
    --ink-soft: #c5cbbf;
    --heading: #f4f1e8;
    --line: rgba(244, 241, 232, .2);
    --line-strong: rgba(244, 241, 232, .34);
    --accent: #f59a8e;
    --accent-soft: rgba(245, 154, 142, .13);
    --basil: #a9cf8f;
    --basil-soft: rgba(169, 207, 143, .14);
    --focus: #f2d16b;
    --ok: #9fd28f;
    --bad: #f5a3a3;
    --warn: #f0c46a;
    --squiggle: var(--squiggle-chalk);
    --scribble: var(--scribble-chalk);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -14px rgba(0, 0, 0, .75);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 28px 52px -22px rgba(0, 0, 0, .9);
    --page-tex:
      radial-gradient(60% 40% at 80% 10%, rgba(244, 241, 232, .035), transparent 70%),
      repeating-linear-gradient(-24deg, rgba(244, 241, 232, .015) 0 1px, transparent 1px 9px);
    --gingham-base: #e3dccd;
    --gingham-tint: rgba(185, 42, 38, .62);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font: 400 1.0625rem/1.65 var(--font-body); color: var(--ink);
  background: var(--page-tex), var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
h1, h2, h3 { margin: 0 0 .5em; color: var(--heading); text-wrap: balance; }
h1, h2 { font-family: var(--font-hand); font-weight: 400; line-height: 1.02; letter-spacing: .005em; text-shadow: var(--chalk-shadow); }
h1 { font-size: clamp(2.9rem, 8vw + 1rem, 5.3rem); }
h2 { font-size: clamp(2.4rem, 4vw + 1.3rem, 3.6rem); }
h3 { font: 800 1.2rem/1.25 var(--font-body); letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; transition: color .2s var(--ease), text-decoration-color .2s; }
a:hover { color: var(--ink); }
em { font-style: normal; color: var(--accent); }
code { padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: .92em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1120px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: .6rem 1rem; background: var(--red); color: #fff; font-weight: 800; border-radius: 10px; transition: top .2s var(--ease); }
.skip:focus { top: 8px; }

/* ---------- Header (board) ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(30, 42, 38, .93); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(244, 241, 232, .14); box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .6); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 400 1.85rem/1 var(--font-hand); color: var(--chalk); text-decoration: none; letter-spacing: .01em; }
.brand:hover { color: var(--chalk); }
.brand svg { width: 32px; height: 32px; flex: none; transition: transform .35s var(--ease); }
.brand:hover svg { transform: rotate(-10deg) scale(1.05); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { display: none; padding: .5rem .85rem; min-height: 44px; align-items: center; color: var(--ink-soft); text-decoration: none; font-weight: 700; border-radius: 10px; transition: background-color .2s, color .2s; }
.nav a:not(.btn):hover { background: rgba(244, 241, 232, .08); color: var(--chalk-yellow); }
@media (min-width: 760px) { .nav a:not(.btn) { display: inline-flex; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .75rem 1.4rem; border-radius: 12px; border: 2px solid transparent;
  font: 800 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; text-align: center;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--red); color: #fff; border-color: var(--red-hover); box-shadow: 0 3px 0 var(--red-edge), 0 12px 22px -12px rgba(140, 30, 26, .7); }
.btn-primary:hover { background: var(--red-hover); color: #fff; box-shadow: 0 5px 0 var(--red-edge), 0 16px 26px -12px rgba(140, 30, 26, .75); }
.btn-primary:active { box-shadow: 0 1px 0 var(--red-edge); }
.btn-ghost { background: transparent; color: var(--ink); border-color: currentColor; }
.btn-ghost:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); }
.btn-soft { background: var(--card); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow); }
.btn-soft:hover { border-color: var(--ink); }
.btn-soft svg { color: var(--accent); }
.btn-sm { min-height: 44px; padding: .5rem 1rem; font-size: .95rem; }
.btn-block { width: 100%; }
.arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow, .card-link:hover .arrow { transform: translateX(4px); }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
@media (min-width: 900px) { section { padding: 96px 0; } }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 .9rem; color: var(--accent); font: 800 .8rem/1.3 var(--font-body); letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; flex: none; width: 28px; height: 9px; background: var(--squiggle) center / 100% 100% no-repeat; }
.lead { font-size: clamp(1.1rem, 1vw + .9rem, 1.28rem); color: var(--ink-soft); max-width: 60ch; }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head h2::after { content: ""; display: block; width: 132px; height: 12px; margin-top: 8px; background: var(--squiggle) center / 100% 100% no-repeat; }
.section-head[style*="center"] h2::after { margin-inline: auto; }

/* ---------- Hero (board) ---------- */
.hero { position: relative; isolation: isolate; overflow: clip; padding: 40px 0 64px; }
.hero .wrap { display: grid; gap: 52px; align-items: center; }
.hero h1 em { color: var(--chalk-yellow); padding-bottom: .08em; background: var(--squiggle-chalk) 0 100% / 100% .2em no-repeat; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 20px; }
.cta-row .btn { flex: 1 1 220px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 0; list-style: none; color: var(--ink-soft); font-size: .94rem; font-weight: 600; }
.trust li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; border: 1.5px dashed var(--basil); color: var(--basil); font-size: .75rem; font-weight: 800; }
@media (min-width: 900px) {
  .hero { padding: 80px 0 104px; }
  .hero .wrap { grid-template-columns: 1.12fr .88fr; }
  .cta-row .btn { flex: 0 0 auto; }
}

/* Printed menu pinned to the board */
.menu-card {
  position: relative; margin: 14px 4px 24px; padding: 34px 24px 30px; border-radius: 4px;
  background: var(--card); color: var(--ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 34px 56px -26px rgba(0, 0, 0, .8);
  transform: rotate(-1.2deg); transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.menu-card:hover { transform: rotate(0) translateY(-4px); }
.menu-card::before { content: ""; position: absolute; inset: 9px; border: 1.5px solid var(--line-strong); outline: 1px solid var(--line); outline-offset: -5px; border-radius: 2px; pointer-events: none; }
.menu-card::after { content: ""; position: absolute; top: -12px; left: 50%; width: 92px; height: 26px; margin-left: -46px; background: rgba(236, 226, 200, .78); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); transform: rotate(-3deg); }
.menu-card h2 { font-size: 2.4rem; text-align: center; margin-bottom: 2px; color: var(--accent); text-shadow: none; }
.menu-card .sub { text-align: center; font-size: .76rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 20px; }
.menu-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.menu-card li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; }
.menu-card li::after { content: ""; order: 2; border-bottom: 2px dotted var(--line-strong); transform: translateY(-4px); }
.menu-card .it { order: 1; font: 800 1.06rem/1.3 var(--font-body); }
.menu-card .ph { order: 3; font-size: .78rem; color: var(--accent); font-weight: 800; white-space: nowrap; }
.menu-card .en { grid-column: 1 / -1; order: 4; font-size: .92rem; font-style: italic; color: var(--ink-soft); margin-top: -10px; }
.menu-card .deco { position: absolute; right: -8px; bottom: -26px; width: 64px; height: 64px; color: var(--ink); --wine-fill: var(--red); transform: rotate(8deg); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .3)); transition: transform .4s var(--ease); }
.menu-card:hover .deco { transform: rotate(-4deg) scale(1.06); }

/* ---------- Footer + simple pages ---------- */
.site-footer { padding: 0 0 40px; color: var(--ink-soft); font-size: .94rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--chalk-yellow); }
.prose { max-width: 680px; padding: 56px 0 72px; }
.prose h1 { font-size: clamp(2.6rem, 5vw + 1.2rem, 3.8rem); }
.prose h2 { font-size: 2.1rem; margin-top: 2.2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose li::marker { color: var(--accent); }
.center-card { position: relative; overflow: hidden; max-width: 620px; margin: 64px auto 80px; padding: 52px 24px 40px; text-align: center; border-radius: var(--radius); background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow-lg); animation: enter .4s var(--ease) both; }
.center-card .deco-icon { display: block; margin: 0 auto 8px; width: 76px; height: 76px; color: var(--ink); --wine-fill: var(--red); transform: rotate(-6deg); }
.center-card .cta-row { justify-content: center; }

/* ---------- Motion ---------- */
@keyframes enter { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.enter { animation: enter .3s var(--ease) both; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .45s var(--ease), transform .45s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
  .menu-card, .menu-card .deco, .center-card .deco-icon { transform: none; }
}
