/* ============================================================
   Forno d'Ouro · Pastelaria & Padaria
   Paleta quente: crosta tostada, farinha, creme de ovos,
   chocolate e café. Nested CSS.
   ============================================================ */

:root {
  --flour:   #f6efe1;   /* branco sujo de farinha (fundo) */
  --cream:   #fbf6ec;   /* creme (cartões) */
  --dough:   #ecdfc8;   /* massa crua */
  --crust:   #c17d33;   /* crosta tostada */
  --crust-dk:#9c5f21;
  --egg:     #f2b134;   /* amarelo do creme de ovos */
  --egg-soft:#f8d98a;
  --choco:   #5a3826;   /* chocolate / café */
  --choco-dk:#3b241a;
  --latte:   #b98a5e;
  --ink:     #33241a;   /* castanho escuro (texto) */
  --muted:   #8a7358;

  --font-display: "DM Serif Display", Georgia, serif;
  --font-hand:    "Caveat", cursive;
  --font-body:    "Nunito Sans", system-ui, sans-serif;

  --maxw: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 20px 45px -28px rgba(90, 56, 38, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  /* warm flour-dusted backdrop */
  background:
    radial-gradient(circle at 15% 10%, rgba(242,177,52,0.10), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(193,125,51,0.10), transparent 45%),
    var(--flour);

  &.is-loading { overflow: hidden; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

h1, h2, h3, h4 { margin: 0; line-height: 1.1; font-weight: 400; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--crust); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--egg); color: var(--choco-dk); }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  &.is-visible { opacity: 1; transform: none; }
}

/* ============================================================
   Intro: coffee cup + rising steam
   ============================================================ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: linear-gradient(165deg, var(--dough), var(--flour));
  transition: opacity 0.7s ease, visibility 0.7s;

  &.is-done { opacity: 0; visibility: hidden; }

  & .intro__scene { text-align: center; position: relative; }

  & .intro__cup {
    font-size: clamp(3.5rem, 12vw, 5.5rem);
    animation: cupPop 0.7s var(--ease) both;
  }

  & .intro__steam {
    position: absolute;
    top: -8px; left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 60px;

    & span {
      position: absolute;
      bottom: 0;
      width: 8px; height: 34px;
      background: linear-gradient(to top, rgba(184,138,94,0.6), transparent);
      border-radius: 10px;
      filter: blur(2px);
      opacity: 0;
      animation: steam 2.4s ease-in-out infinite;
    }
    & span:nth-child(1) { left: 16px; animation-delay: 0.2s; }
    & span:nth-child(2) { left: 28px; animation-delay: 0.7s; height: 42px; }
    & span:nth-child(3) { left: 40px; animation-delay: 1.1s; }
  }

  & .intro__name {
    font-family: var(--font-display);
    font-size: clamp(2rem, 7vw, 3.2rem);
    color: var(--choco);
    margin: 0.6rem 0 0;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.5s forwards;
  }
  & .intro__sub {
    font-family: var(--font-hand);
    font-size: 1.4rem;
    color: var(--crust);
    margin: 0;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.75s forwards;
  }
}

@keyframes cupPop { from { opacity: 0; transform: scale(0.7) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes steam {
  0%   { opacity: 0; transform: translateY(0) scaleY(0.6); }
  30%  { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-40px) scaleY(1.2); }
}

/* ============================================================
   Header
   ============================================================ */
.head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 5vw, 3rem);
  transition: background 0.4s var(--ease), box-shadow 0.4s, padding 0.4s;

  &.is-scrolled {
    background: color-mix(in srgb, var(--cream) 92%, transparent);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding-block: 0.65rem;
  }

  & .mark {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--choco);
    & .mark__ico { font-size: 1.5rem; }
  }

  & .nav {
    display: flex;
    gap: clamp(1rem, 2.5vw, 2rem);
    & a {
      font-weight: 600;
      font-size: 0.95rem;
      color: var(--ink);
      position: relative;
      &::after {
        content: "";
        position: absolute; left: 0; bottom: -4px;
        width: 100%; height: 2px;
        background: var(--egg);
        transform: scaleX(0); transform-origin: right;
        transition: transform 0.35s var(--ease);
      }
      &:hover::after { transform: scaleX(1); transform-origin: left; }
    }
  }

  & .head__hours {
    margin: 0;
    font-family: var(--font-hand);
    font-size: 1.25rem;
    color: var(--crust);
  }
}

/* ============================================================
   Hero — asymmetric editorial
   ============================================================ */
.hero {
  min-height: 100svh;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(7rem, 15vh, 10rem) clamp(1.4rem, 6vw, 3rem) 4rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 2rem;

  & .hero__hand {
    font-family: var(--font-hand);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--crust);
    transform: rotate(-2deg);
    margin: 0 0 0.3rem;
  }

  & .hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 8vw, 5.2rem);
    color: var(--choco);
    letter-spacing: -0.01em;
    & em { font-style: italic; color: var(--crust); }
  }

  & .hero__lede {
    max-width: 30rem;
    margin: 1.6rem 0 2.2rem;
    color: var(--muted);
    font-size: 1.05rem;
  }

  & .hero__stamp { display: grid; place-items: center; }
}

/* rotating stamp seal */
.stamp {
  position: relative;
  width: clamp(180px, 34vw, 240px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;

  & svg {
    position: absolute;
    inset: 0;
    animation: spin 24s linear infinite;
    & text {
      font-family: var(--font-body);
      font-weight: 700;
      font-size: 13px;
      letter-spacing: 0.14em;
      fill: var(--crust);
      text-transform: uppercase;
    }
  }
  & .stamp__center {
    font-size: clamp(2.6rem, 7vw, 3.6rem);
    background: var(--cream);
    width: 58%; aspect-ratio: 1;
    border-radius: 50%;
    display: grid; place-items: center;
    box-shadow: inset 0 0 0 3px var(--egg-soft), var(--shadow);
  }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.9rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--choco-dk);
  background: var(--egg);
  border-radius: 999px;
  box-shadow: 0 10px 24px -12px rgba(242,177,52,0.9);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  &:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -12px rgba(242,177,52,1); }

  &--dark {
    background: var(--choco);
    color: var(--cream);
    box-shadow: 0 10px 24px -12px rgba(90,56,38,0.8);
  }
}

/* ============================================================
   Menu — two worlds
   ============================================================ */
.menu {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.4rem, 6vw, 3rem);

  & .menu__intro {
    text-align: center;
    margin-bottom: 2.5rem;

    & .menu__hand { font-family: var(--font-hand); font-size: 1.6rem; color: var(--crust); margin: 0; }
    & .menu__title { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3.2rem); color: var(--choco); }
    & .menu__note { max-width: 34rem; margin: 0.8rem auto 0; color: var(--muted); }
  }
}

/* ---------- Switch (tabs) ---------- */
.switch {
  position: relative;
  display: flex;
  max-width: 560px;
  margin: 0 auto 3rem;
  padding: 6px;
  background: var(--dough);
  border-radius: 999px;
  box-shadow: inset 0 2px 6px rgba(90,56,38,0.15);

  & .switch__tab {
    position: relative;
    z-index: 2;
    flex: 1;
    padding: 0.8rem 1rem;
    border: 0;
    background: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(0.85rem, 2.2vw, 1rem);
    color: var(--muted);
    border-radius: 999px;
    transition: color 0.35s var(--ease);

    & .switch__ico { margin-right: 0.3rem; }
    &.is-active { color: var(--choco-dk); }
  }

  /* sliding pill behind the active tab */
  & .switch__pill {
    position: absolute;
    z-index: 1;
    top: 6px; bottom: 6px;
    left: 6px;
    width: calc(50% - 6px);
    background: var(--cream);
    border-radius: 999px;
    box-shadow: 0 6px 16px -8px rgba(90,56,38,0.5);
    transition: transform 0.4s var(--ease);
  }
  &[data-active="levar"] .switch__pill { transform: translateX(100%); }
}

/* ---------- Panels ---------- */
.panel {
  display: none;
  animation: panelIn 0.55s var(--ease);

  &.is-active { display: block; }

  & .panel__lead {
    max-width: 40rem;
    margin: 0 auto 3rem;
    text-align: center;
    font-family: var(--font-hand);
    font-size: clamp(1.4rem, 3.5vw, 1.9rem);
    color: var(--crust);
    line-height: 1.4;
  }
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Category (editorial two-column) ---------- */
.cat {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.8rem, 4vw, 2.6rem) 0;
  border-top: 2px dashed var(--dough);

  &:first-of-type { border-top: 0; }

  & .cat__head {
    & .cat__hand { font-family: var(--font-hand); font-size: 1.4rem; color: var(--crust); display: block; }
    & .cat__title { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--choco); }
  }
}

/* ---------- Rows ---------- */
.rows { display: grid; gap: 0.3rem; }

.row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);

  &:hover { background: var(--cream); transform: translateX(4px); }

  & .row__ico {
    font-size: 1.5rem;
    width: 2.2rem;
    text-align: center;
    flex-shrink: 0;
  }
  & .row__body { flex: 1; }
  & h4 { font-family: var(--font-body); font-weight: 700; font-size: 1.02rem; color: var(--ink); }
  & p  { margin: 0.1rem 0 0; font-size: 0.85rem; color: var(--muted); }

  & .row__price {
    flex-shrink: 0;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--crust-dk);
    &::before { content: "€"; font-size: 0.7em; margin-right: 0.1em; color: var(--egg); }
  }

  /* the house favourite */
  &--star {
    background: linear-gradient(90deg, var(--egg-soft), transparent 70%);
    & h4::after { content: " ★"; color: var(--egg); }
    & .row__price::before { color: var(--crust); }
  }
}

/* ============================================================
   Parallax quote divider
   ============================================================ */
.quote {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 56vh;
  padding: clamp(4rem, 10vw, 7rem) 1.5rem;
  text-align: center;
  color: var(--cream);
  background-image:
    linear-gradient(rgba(59,36,26,0.72), rgba(90,56,38,0.72)),
    url("https://images.unsplash.com/photo-1509440159596-0249088772ff?auto=format&fit=crop&w=1600&q=70");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;

  & .quote__body {
    max-width: 44rem;
    margin: 0;

    & p {
      font-family: var(--font-display);
      font-style: italic;
      font-size: clamp(1.6rem, 4.5vw, 2.8rem);
      line-height: 1.3;
      margin: 0;
      text-wrap: balance;
    }
    & cite {
      display: block;
      margin-top: 1.4rem;
      font-family: var(--font-hand);
      font-style: normal;
      font-size: 1.5rem;
      color: var(--egg-soft);
    }
  }
}

/* ============================================================
   Visit
   ============================================================ */
.visit {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.4rem, 6vw, 3rem);

  & .visit__card {
    background: var(--cream);
    border: 2px dashed var(--crust);
    border-radius: 26px;
    padding: clamp(2.5rem, 6vw, 4rem);
    text-align: center;
    box-shadow: var(--shadow);

    & .visit__title { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 2.8rem); color: var(--choco); margin-bottom: 0.8rem; }
    & .visit__line { margin: 0.3rem 0; color: var(--muted); }
    & .btn { margin-top: 1.6rem; }
  }
}

/* ============================================================
   Footer
   ============================================================ */
.foot {
  background: var(--choco);
  color: var(--dough);
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) 1.5rem 3rem;

  & .foot__mark { font-family: var(--font-display); font-size: 1.7rem; color: var(--cream); margin: 0 0 0.4rem; }
  & .foot__tag { font-family: var(--font-hand); font-size: 1.4rem; color: var(--egg-soft); margin: 0; }
  & .foot__note { margin-top: 1.4rem; font-size: 0.85rem; color: rgba(236,223,200,0.6); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero .hero__lede { margin-inline: auto; }
  .hero .hero__stamp { order: -1; }
  .cat { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .head .nav { display: none; }
  .head .head__hours { display: none; }
  .quote { background-attachment: scroll; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .stamp svg { animation: none; }
}
