/* =========================================================
   Cormie & Co - styles
   Single-colour treatment: cream ink on a terracotta ground.
   ========================================================= */

/* ---- Fonts --------------------------------------------- */
@font-face {
  font-family: "MilesToGo";
  src: url("fonts/TG-MilesToGo-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MilesToGo Scribble";
  src: url("fonts/TG-MilesToGo-Scribble.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens ------------------------------------- */
:root {
  --red:        #A83318;   /* the one colour - page ground */
  --red-deep:   #8C2912;   /* pressed / subtle depth */
  --ink:        #F7EFE2;   /* cream - all primary text & marks */
  --ink-soft:   #EAD9C4;   /* cream, dimmed - secondary text (AA on --red) */
  --line:       rgba(247, 239, 226, 0.34);
  --tint-weak:  rgba(247, 239, 226, 0.06);  /* field backgrounds etc - tinted with --ink */
  --tint-strong: rgba(247, 239, 226, 0.1);  /* focus/hover backgrounds - tinted with --ink */
  --tint-mid:   rgba(247, 239, 226, 0.5);   /* placeholders - tinted with --ink */

  --font-display: "MilesToGo", "Trebuchet MS", sans-serif;
  --font-scribble: "MilesToGo Scribble", "MilesToGo", cursive;
  --font-body: "Iowan Old Style", "Palatino Linotype", "Palatino",
               "Book Antiqua", Georgia, serif;

  --wrap: 1120px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --nav-h: 66px;
}

/* ---- Reset-ish ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--red);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.04rem, 1rem + 0.3vw, 1.2rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--ink-soft); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

.scribble {
  font-family: var(--font-scribble);
  color: var(--ink);
  font-weight: 400;
}

/* ---- Utilities --------------------------------------- */
.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.eyebrow {
  font-family: var(--font-scribble);
  color: var(--ink);
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.3;
  margin: 0 0 1rem;
}

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  background: var(--ink);
  color: var(--red);
  padding: 0.95em 2.4em;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(60, 18, 8, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover {
  background: var(--ink-soft);
  color: var(--red);
  transform: translateY(-1px);
  box-shadow: 0 13px 30px rgba(60, 18, 8, 0.34);
}
.btn:active { transform: translateY(0); }

.btn-menu {
  display: inline-block;
  margin-top: 1.1rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  padding: 0.6em 1.7em;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-menu:hover {
  background: var(--tint-strong);
  border-color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--ink);
  color: var(--red);
  padding: 0.6rem 1rem;
  border-radius: 4px;
  z-index: 200;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

/* =========================================================
   Nav
   ========================================================= */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--red) 80%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.site-nav.scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--red) 92%, transparent);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.site-nav.scrolled .brand { opacity: 1; }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2.1rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.015em;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--ink); border-bottom-color: var(--line); }
.nav-links a[aria-current="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.nav-links .btn {
  color: var(--red);
  padding: 0.5em 1.2em;
  font-size: 0.96rem;
  box-shadow: none;
}
.nav-links .btn:hover { color: var(--red); transform: none; box-shadow: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--ink);
}
.nav-toggle svg { width: 26px; height: 26px; }

/* =========================================================
   Hero - the masthead is the moment
   ========================================================= */
.hero {
  padding-block: clamp(1.5rem, 5vw, 4rem) clamp(2.5rem, 7vw, 5.5rem);
}
.hero__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 3vw, 2.5rem);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.masthead {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23vw;                 /* "Cormie" ≈ half the viewport width */
  line-height: 0.8;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-align: left;
}
.masthead .amp {
  display: block;
  color: var(--ink);
}
.hero__illus {
  flex: 0 0 auto;
  width: clamp(180px, 30vw, 420px);
  height: auto;
  /* recolour the blue-on-white ink sketch to cream line art on terracotta */
  filter: invert(1) grayscale(1) brightness(1.42) contrast(1.15) sepia(0.12);
  mix-blend-mode: screen;
}

.hero__intro {
  max-width: 58ch;
  margin-inline: auto;
  text-align: center;
}
.hero__lead {
  font-family: var(--font-scribble);
  font-size: clamp(1.45rem, 1.1rem + 1.5vw, 2.3rem);
  line-height: 1.3;
  color: var(--ink);
  margin: 0 auto 2.25rem;
  max-width: 32ch;
  text-wrap: balance;
}
.hero__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.hero__scroll {
  font-family: var(--font-scribble);
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}
.hero__scroll:hover { color: var(--ink-soft); }

/* =========================================================
   Enquiry modal — the enquiry section gets relocated in here
   (see main.js) when the hero "Enquire" button is clicked
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(20, 8, 4, 0.6);
  overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }

.modal-card {
  /* inverse colours - cream card on the terracotta page, so the bubble
     reads as a distinct popup rather than blending into the background */
  --red:        #F7EFE2;
  --ink:        #A83318;
  --ink-soft:   #B0462C;   /* AA-passing terracotta-on-cream, not a naive tint */
  --line:       rgba(168, 51, 24, 0.34);
  --tint-weak:  rgba(168, 51, 24, 0.06);
  --tint-strong: rgba(168, 51, 24, 0.1);
  --tint-mid:   rgba(168, 51, 24, 0.5);

  position: relative;
  background: var(--red);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 660px;
  max-height: 100%;
  overflow-y: auto;
  padding: clamp(1.25rem, 4vw, 1.75rem);
}
.modal-card .section {
  padding: 2.75rem 0 0.5rem;
  scroll-margin-top: 0;
}
.modal-card .section > .wrap {
  padding-inline: 0;
  max-width: none;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover {
  background: var(--tint-strong);
  border-color: var(--ink);
}

/* PDF menu popups - no card chrome, just the document and a close button
   floating clear of its edge so it stays visible over a white PDF page */
.modal-card--pdf {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  width: min(94vw, 900px);
  height: min(92vh, 1150px);
  max-width: none;
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.modal-card--pdf img {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: block;
  border: 0;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.modal-card--pdf .modal-close {
  top: -16px;
  right: -16px;
  background: var(--red);
  border-color: var(--red);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.modal-card--pdf .modal-close:hover {
  background: var(--red-deep);
  border-color: var(--red-deep);
}
.modal-pdf-fallback {
  flex: 0 0 auto;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.85;
}
.modal-pdf-fallback:hover { opacity: 1; }

/* =========================================================
   Chef strip — three illustrations between hero and timeline
   ========================================================= */
.chef-strip {
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.6rem, 2vw, 1.4rem);
  margin-top: clamp(1.5rem, 5vw, 3rem);
}
.chef-strip img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 14%;
  /* warm the near-white paper toward cream so it sits on the terracotta
     without jarring; linework stays dark and readable */
  filter: sepia(0.4) saturate(1.4) brightness(0.95) contrast(1.03);
}
/* middle illustration is framed tighter — trim its top so the
   figure lines up with the outer two */
.chef-strip img:nth-child(2) { object-position: 50% 28%; }

/* =========================================================
   Timeline of services
   ========================================================= */
.timeline {
  position: relative;
  max-width: 980px;
  margin-inline: auto;
  padding: clamp(1rem, 3vw, 2.5rem) var(--gutter) clamp(2rem, 5vw, 4rem);
}
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 0,
    var(--line) 3.5rem,
    var(--line) calc(100% - 3.5rem),
    transparent 100%
  );
  transform: translateX(-1px);
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(2.5rem, 7vw, 6rem);
  margin-block: clamp(2.25rem, 5.5vw, 4rem);
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}
.tl-item::before {                 /* node */
  content: "";
  position: absolute;
  left: 50%;
  top: 2.4rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 7px var(--red);
}

.tl-bubble {
  position: relative;
  padding: 0.25rem 0;
  text-align: center;
}
.tl-item:nth-child(odd)  .tl-bubble { grid-column: 1; }
.tl-item:nth-child(even) .tl-bubble { grid-column: 2; }
.tl-bubble h2 {
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem);
  margin-bottom: 0.6rem;
}
.tl-bubble p {
  color: var(--ink-soft);
  max-width: 42ch;
  margin-inline: auto;
}
.tl-bubble p + p { margin-top: 0.9rem; }

.tl-tags {
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.9rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.tl-tags li { position: relative; }
.tl-tags li + li::before {
  content: "·";
  position: absolute;
  left: -0.55rem;
  color: var(--line);
}

/* =========================================================
   Full-width sections (gallery, enquiry)
   ========================================================= */
.section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}
.section > .wrap { text-align: center; }
.section h2 { font-size: clamp(2rem, 1.4rem + 2.5vw, 3.1rem); }
.section__intro {
  color: var(--ink-soft);
  max-width: 48ch;
  margin: 0.5rem auto 0;
}

/* ---- Gallery ---------------------------------------- */
.gallery {
  margin-top: clamp(2rem, 5vw, 3.25rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.35rem, 1vw, 0.6rem);
}
.gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.gallery__note {
  font-family: var(--font-scribble);
  color: var(--ink);
  font-size: 1.15rem;
  margin: 1.5rem 0 0;
}

/* ---- Testimonials --------------------------------- */
.quotes {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.75rem);
}
.quote { margin: 0; }
.quote p {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.9rem);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 auto;
  max-width: 24ch;
  text-wrap: balance;
}
.quote footer {
  font-family: var(--font-scribble);
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin-top: 0.8rem;
}

/* ---- Enquiry form -------------------------------- */
.enquiry__form {
  margin: clamp(2rem, 5vw, 3rem) auto 0;
  max-width: 620px;
  text-align: left;
  display: grid;
  gap: 1.35rem;
}
.field { display: grid; gap: 0.4rem; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 1.35rem;
  align-items: start;
}
.field-row > .field {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  gap: 0.4rem;
}
.field label {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.field .opt { color: var(--ink-soft); font-family: var(--font-body); font-size: 0.9rem; }

.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--tint-weak);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.7em 0.85em;
  width: 100%;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.field textarea { min-height: 7.5rem; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--tint-mid); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--tint-strong);
}
.field :user-invalid {
  border-color: var(--ink);
}
.field-error {
  font-size: 0.9rem;
  color: var(--ink);
  min-height: 0;
}

.enquiry__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.enquiry__submit { margin-top: 0.5rem; justify-self: start; cursor: pointer; }
.form-status {
  font-family: var(--font-scribble);
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0;
}
.form-status:empty { display: none; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 4rem);
  margin-top: clamp(2rem, 6vw, 5rem);
}
.site-footer a { color: var(--ink); text-decoration: underline; }
.site-footer a:hover { color: var(--ink-soft); }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: baseline;
}
.site-footer .brand-lg { font-family: var(--font-display); font-size: 1.7rem; }
.site-footer .foot-meta { font-size: 0.95rem; line-height: 1.85; margin: 0; color: var(--ink-soft); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 820px) {
  .masthead { font-size: 24vw; letter-spacing: -0.03em; }
  .hero__head { flex-direction: column; }
  .hero__illus { width: clamp(180px, 52vw, 285px); margin-top: 0.75rem; }

  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--red);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.25rem;
    transform: translateY(-120%);
    transition: transform 0.25s ease;
    box-shadow: 0 14px 26px rgba(40, 12, 5, 0.3);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-links a[aria-current="true"] { border-bottom-color: var(--line); }
  .nav-links .btn { margin-top: 1rem; text-align: center; padding: 0.7em 1.2em; }
}

@media (max-width: 780px) {
  .timeline { max-width: 34rem; }
  .timeline::before { left: 21px; }
  .tl-item { grid-template-columns: 1fr; }
  .tl-item::before { left: 21px; top: 1.9rem; }
  .tl-item .tl-bubble,
  .tl-item:nth-child(odd)  .tl-bubble,
  .tl-item:nth-child(even) .tl-bubble {
    grid-column: 1;
    margin-left: 46px;
    text-align: left;
  }
  .tl-bubble p { margin-inline: 0; }
  .tl-tags { justify-content: flex-start; }

  .gallery { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
}

@media (min-width: 781px) and (max-width: 1000px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
