/*
 * Saltwood Kitchen - site stylesheet
 * Vanilla CSS, no build step. Dark theme is the default; [data-theme="light"]
 * on <html> switches to the light palette (set before first paint by the
 * inline script in each page's <head>).
 */

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  /* Dark (default) palette: deep harbour ink, warm sand text, ember accent */
  --bg: #0c1a1f;
  --surface: #12262d;
  --surface-2: #183139;
  --text: #f1e9dc;
  --muted: #b9c5c2;
  --accent: #f08a4b;
  --accent-hover: #f6a26c;
  --accent-ink: #1a0f08;
  --link: #f6a26c;
  --border: rgba(241, 233, 220, 0.14);
  --focus: #ffd29a;
  --error: #ff9b8a;
  --success-bg: rgba(110, 196, 150, 0.14);
  --success-border: #6ec496;
  --nav-bg: rgba(12, 26, 31, 0.86);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 8px 28px rgba(0, 0, 0, 0.45);
  --track-off: #2b464f;

  /* Type */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-h1: Verdana, Geneva, sans-serif;

  /* Spacing scale: 4 8 12 16 24 32 48 64 96 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --radius: 12px;
  --radius-pill: 999px;
  --container: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 64px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #faf6ef;
  --surface: #ffffff;
  --surface-2: #f2ebdf;
  --text: #14252b;
  --muted: #4b5c60;
  --accent: #b4471a;
  --accent-hover: #963813;
  --accent-ink: #ffffff;
  --link: #a2400f;
  --border: rgba(20, 37, 43, 0.14);
  --focus: #b4471a;
  --error: #b3261e;
  --success-bg: rgba(46, 125, 82, 0.1);
  --success-border: #2e7d52;
  --nav-bg: rgba(250, 246, 239, 0.9);
  --shadow-1: 0 1px 2px rgba(20, 37, 43, 0.08), 0 2px 8px rgba(20, 37, 43, 0.06);
  --shadow-2: 0 8px 28px rgba(20, 37, 43, 0.14);
  --track-off: #c9bfae;

  color-scheme: light;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

main { flex: 1 0 auto; }

img, svg { display: block; max-width: 100%; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1 {
  font-family: var(--font-h1);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s4);
  font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem);
}

h2, h3 { font-family: var(--font-serif); font-weight: 700; line-height: 1.25; margin: 0 0 var(--s3); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.9rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 var(--s4); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--s4); top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: var(--s2) var(--s4);
  border-radius: var(--radius); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s2); }

/* ── Navbar ────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-bar { display: flex; align-items: center; gap: var(--s3); min-height: var(--nav-h); position: relative; }

.brand {
  display: inline-flex; align-items: center; gap: var(--s2);
  color: var(--text); text-decoration: none; font-family: var(--font-serif);
  font-weight: 700; font-size: 1.15rem; white-space: nowrap; margin-right: auto; min-width: 0;
}
.brand svg { width: 34px; height: 34px; flex: none; }
.brand:hover { text-decoration: none; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s1); }
.site-nav a {
  display: block; padding: var(--s2) var(--s4); border-radius: var(--radius-pill);
  color: var(--text); text-decoration: none; font-weight: 500;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--surface-2); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px;
  background: transparent; color: var(--text); cursor: pointer; padding: 0;
  align-items: center; justify-content: center; flex: none;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* iPhone-style theme switch: pill track with a sliding round knob */
.theme-switch {
  flex: none; position: relative; width: 56px; height: 32px; padding: 0;
  border: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: var(--track-off); transition: background-color 0.25s ease;
}
.theme-switch[aria-checked="true"] { background: var(--accent); }
.theme-switch .knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.4, 1);
}
.theme-switch[aria-checked="true"] .knob { transform: translateX(24px); }
.theme-switch .knob svg { width: 16px; height: 16px; }
.theme-switch .icon-sun { display: none; }
.theme-switch[aria-checked="true"] .icon-sun { display: block; }
.theme-switch[aria-checked="true"] .icon-moon { display: none; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-2);
    padding: var(--s3) var(--gutter) var(--s4);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: var(--s1); }
  .site-nav a { padding: var(--s3) var(--s4); border-radius: 10px; font-size: 1.05rem; }
}

/* Small phones (320-360 px): brand + menu button + switch must fit on one row without touching */
@media (max-width: 360px) {
  .brand { font-size: 0.92rem; gap: 6px; }
  .brand svg { width: 28px; height: 28px; }
  .nav-bar { gap: var(--s2); }
  .nav-toggle { width: 40px; height: 40px; }
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: var(--s3) var(--s5); border-radius: var(--radius-pill);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-ghost { background: rgba(255, 255, 255, 0.06); color: #ffffff; border-color: rgba(255, 255, 255, 0.75); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); border-color: #ffffff; }

/* Hero buttons always sit on the dark photo overlay, whatever the theme */
.hero .btn-primary { background: #f08a4b; border-color: #f08a4b; color: #1a0f08; }
.hero .btn-primary:hover { background: #f6a26c; border-color: #f6a26c; }
.hero :focus-visible { outline-color: #ffd29a; }

/* ── Hero (home) ───────────────────────────────────────────────────────── */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(460px, 78vh, 720px);
  display: flex; align-items: center;
  color: #f7f1e6;
  padding: var(--s8) 0;
}
.hero-img {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  object-fit: cover; object-position: 60% 55%;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 16, 20, 0.88) 0%, rgba(6, 16, 20, 0.7) 45%, rgba(6, 16, 20, 0.35) 100%),
    linear-gradient(180deg, rgba(6, 16, 20, 0.25) 0%, rgba(6, 16, 20, 0.6) 100%);
}
.hero-content { max-width: 640px; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem;
  font-weight: 700; color: #ffc79d; margin-bottom: var(--s3);
}
.hero h1 { font-size: clamp(2.2rem, 1.3rem + 4.2vw, 3.7rem); color: #ffffff; }
.hero .tagline { font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem); color: #efe6d8; max-width: 34ch; margin-bottom: var(--s6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }

@media (max-width: 760px) {
  .hero::before { background: linear-gradient(180deg, rgba(6, 16, 20, 0.72) 0%, rgba(6, 16, 20, 0.86) 100%); }
  .hero { min-height: 0; padding: var(--s8) 0 var(--s7); }
}
@media (max-width: 420px) {
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ── Sections / cards ──────────────────────────────────────────────────── */
.section { padding: var(--s8) 0; }
.section-tight { padding: var(--s7) 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 62ch; }

.info-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s5); }
.info-item h2 { font-size: 1.05rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: var(--s2); }
.info-item p { margin: 0; font-size: 1.1rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s5); margin-top: var(--s6); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s5); box-shadow: var(--shadow-1);
}
.section-alt .card { background: var(--bg); }
.card p { color: var(--muted); margin: 0; }
.card-icon { width: 40px; height: 40px; margin-bottom: var(--s3); color: var(--accent); }

/* ── Page header (menu / contact) ──────────────────────────────────────── */
.page-header { padding: var(--s8) 0 var(--s6); border-bottom: 1px solid var(--border); background: var(--surface); }
.page-header .lead { margin-bottom: 0; }

/* ── Menu ──────────────────────────────────────────────────────────────── */
.menu-note {
  display: inline-flex; align-items: center; gap: var(--s2); margin: var(--s5) 0 0;
  padding: var(--s2) var(--s4); border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text); font-size: 0.95rem;
}
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--s7); }
.menu-section h2 { padding-bottom: var(--s3); border-bottom: 2px solid var(--accent); margin-bottom: var(--s4); }
.dish-list { list-style: none; margin: 0; padding: 0; }
.dish { padding: var(--s4) 0; border-bottom: 1px dashed var(--border); }
.dish:last-child { border-bottom: 0; }
.dish-head { display: flex; align-items: baseline; gap: var(--s3); }
.dish-name { font-weight: 700; font-size: 1.05rem; margin: 0; flex: 1 1 auto; min-width: 0; }
.dish-price { font-weight: 700; color: var(--accent); white-space: nowrap; flex: none; }
.dish-desc { color: var(--muted); margin: var(--s1) 0 0; font-size: 0.97rem; }
.veg { font-weight: 600; color: var(--muted); font-size: 0.9em; }

/* ── Contact ───────────────────────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--s7); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }

.details { margin: 0; }
.details dt { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; }
.details dd { margin: var(--s1) 0 var(--s5); font-size: 1.08rem; }
.details a { color: var(--text); }

.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 4vw, 32px); box-shadow: var(--shadow-1); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s5); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

label { font-weight: 600; }
.req { color: var(--accent); }
.hint { font-size: 0.85rem; color: var(--muted); font-weight: 400; }

input, textarea {
  font: inherit; color: var(--text); background: var(--bg); width: 100%; min-width: 0;
  border: 1px solid var(--border); border-radius: 10px; padding: var(--s3) var(--s3); min-height: 48px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: transparent; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.field-error { color: var(--error); font-size: 0.9rem; min-height: 0; margin: 0; }
.field-error:empty { display: none; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); margin-top: var(--s5); }
.demo-note { font-size: 0.85rem; color: var(--muted); margin: var(--s4) 0 0; }
.form-summary { color: var(--error); font-weight: 600; margin: 0 0 var(--s4); }
.form-summary:empty { display: none; }

.confirmation {
  margin: var(--s5) 0 0; padding: var(--s4); border-radius: 10px;
  background: var(--success-bg); border-left: 4px solid var(--success-border); font-weight: 600;
}
.confirmation[hidden] { display: none; }
.confirmation:focus { outline: none; }

/* ── 404 ───────────────────────────────────────────────────────────────── */
.not-found { text-align: center; padding: var(--s9) 0; }
.not-found .lead { margin: 0 auto var(--s6); }
.not-found-actions { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; }
.not-found .btn-ghost { color: var(--text); border-color: var(--border); background: transparent; }
.not-found .btn-ghost:hover { background: var(--surface-2); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: var(--s6) 0; font-size: 0.95rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4) var(--s6); }
.footer-brand { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text); font-family: var(--font-serif); font-weight: 700; }
.footer-brand svg { width: 28px; height: 28px; }
.footer-legal { display: flex; flex-direction: column; gap: var(--s1); text-align: right; }
.footer-legal p { margin: 0; }
.footer-legal a { color: var(--text); }
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-legal { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
