/* ============================================================
   Maré Alta · Cozinha do Mar
   Nested CSS · tema oceano / mar / praia
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --deep:      #05445e;   /* azul profundo */
  --ocean:     #0a6e8f;   /* azul mar */
  --teal:      #189ab4;   /* turquesa */
  --aqua:      #75e6da;   /* água clara */
  --foam:      #d4f1f4;   /* espuma */
  --sand:      #f7fbfd;   /* branco areia */
  --white:     #ffffff;
  --lemon:     #f4e04d;   /* amarelo limão */
  --lemon-soft:#fff3a8;
  --ink:       #082c3a;

  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Poppins", system-ui, sans-serif;

  --maxw: 1080px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 18px 50px -20px rgba(5, 68, 94, 0.45);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--sand);
  line-height: 1.6;
  overflow-x: hidden;

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

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

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);

  &.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Loader / opening animation
   ============================================================ */
.loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--deep), var(--ocean) 55%, var(--teal));
  overflow: hidden;
  transition: opacity 0.8s var(--ease), visibility 0.8s;

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

  & .loader__inner {
    text-align: center;
    color: var(--white);
    z-index: 2;
    animation: loaderPop 1s var(--ease) both;
  }

  & .loader__mark {
    display: block;
    font-size: clamp(3rem, 10vw, 5rem);
    animation: bob 2.4s ease-in-out infinite;
  }

  & .loader__word {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2rem, 7vw, 3.4rem);
    letter-spacing: 0.02em;
    margin-top: 0.3rem;
  }

  & .loader__sub {
    display: block;
    font-size: 0.85rem;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--aqua);
    margin-top: 0.6rem;
    padding-left: 0.5em;
  }

  /* rising water */
  & .loader__wave {
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 40%;
    background: radial-gradient(120% 100% at 50% 0, transparent 60%, rgba(117,230,218,0.25));
    animation: rise 1.6s var(--ease) 0.6s both;
  }
}

@keyframes loaderPop {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise {
  from { transform: translateY(100%); }
  to   { transform: translateY(60%); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-12px) rotate(3deg); }
}

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

  &.is-scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    padding-block: 0.7rem;
    box-shadow: 0 6px 30px -18px rgba(5, 68, 94, 0.6);
  }

  & .brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.35rem;
    color: var(--white);
    transition: color 0.4s;

    & .brand__mark { font-size: 1.5rem; }
  }

  &.is-scrolled .brand { color: var(--deep); }
}

.nav {
  & .nav__list {
    display: flex;
    gap: clamp(1rem, 2.5vw, 2rem);
    align-items: center;
  }

  & .nav__list a {
    position: relative;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--white);
    padding: 0.2rem 0;
    transition: color 0.3s;

    &::after {
      content: "";
      position: absolute;
      left: 0; bottom: -3px;
      width: 100%; height: 2px;
      background: var(--lemon);
      transform: scaleX(0);
      transform-origin: right;
      transition: transform 0.35s var(--ease);
    }

    &:hover::after { transform: scaleX(1); transform-origin: left; }
  }

  & .nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 34px; height: 30px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;

    & span {
      height: 2.5px;
      width: 100%;
      background: var(--white);
      border-radius: 2px;
      transition: transform 0.35s var(--ease), opacity 0.3s;
    }
  }
}

.site-header.is-scrolled .nav .nav__list a { color: var(--deep); }
.site-header.is-scrolled .nav .nav__toggle span { background: var(--deep); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6rem 1.5rem 8rem;
  color: var(--white);
  background:
    radial-gradient(120% 90% at 80% -10%, rgba(117,230,218,0.35), transparent 55%),
    linear-gradient(165deg, var(--deep) 0%, var(--ocean) 55%, var(--teal) 100%);
  overflow: hidden;

  /* floating light particles */
  &::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
      radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.6), transparent),
      radial-gradient(2px 2px at 70% 60%, rgba(255,255,255,0.5), transparent),
      radial-gradient(1.5px 1.5px at 45% 80%, rgba(244,224,77,0.7), transparent),
      radial-gradient(1.5px 1.5px at 85% 25%, rgba(255,255,255,0.5), transparent);
    animation: drift 14s linear infinite alternate;
    pointer-events: none;
  }

  & .hero__content {
    position: relative;
    z-index: 3;
    max-width: 760px;
  }

  & .hero__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 0.78rem;
    color: var(--aqua);
    margin: 0 0 1.2rem;
    padding-left: 0.4em;
  }

  & .hero__title {
    font-size: clamp(3rem, 11vw, 6.5rem);
    font-weight: 600;
    letter-spacing: -0.01em;

    & span { display: block; }
    & em {
      font-style: italic;
      color: var(--lemon);
    }
  }

  & .hero__lede {
    max-width: 30rem;
    margin: 1.8rem auto 2.4rem;
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: rgba(255,255,255,0.9);
  }

  /* staggered entry for hero reveals */
  & .reveal { transition-delay: calc(var(--i, 0) * 0.12s); }
}

@keyframes drift {
  from { transform: translateY(0); }
  to   { transform: translateY(-30px); }
}

.hero__waves {
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%;
  line-height: 0;
  z-index: 2;

  & svg { width: 100%; height: clamp(90px, 15vw, 180px); }

  & .wave { transform-origin: center; }
  & .wave--1 { fill: rgba(255,255,255,0.25); animation: sway 7s ease-in-out infinite; }
  & .wave--2 { fill: rgba(255,255,255,0.45); animation: sway 9s ease-in-out infinite reverse; }
  & .wave--3 { fill: var(--sand); animation: sway 11s ease-in-out infinite; }
}

@keyframes sway {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-28px); }
}

.scroll-hint {
  position: absolute;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;

  & .scroll-hint__dot {
    width: 22px; height: 34px;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 20px;
    position: relative;

    &::after {
      content: "";
      position: absolute;
      top: 6px; left: 50%;
      width: 4px; height: 4px;
      margin-left: -2px;
      background: var(--lemon);
      border-radius: 50%;
      animation: scrollDot 1.8s ease-in-out infinite;
    }
  }
}

@keyframes scrollDot {
  0%   { opacity: 0; transform: translateY(0); }
  40%  { opacity: 1; }
  80%  { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; }
}

/* ============================================================
   Menu sections
   ============================================================ */
.menu-section {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(4rem, 9vw, 7rem) clamp(1.2rem, 5vw, 2.5rem);

  &--alt {
    max-width: none;
    background:
      linear-gradient(180deg, transparent, rgba(212,241,244,0.5) 20%, rgba(212,241,244,0.5) 80%, transparent);

    /* re-center inner content */
    & > * { max-width: var(--maxw); margin-inline: auto; }
  }
}

.section-head {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  position: relative;

  & .section-head__num {
    display: block;
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    color: var(--teal);
    margin-bottom: 0.4rem;
  }

  & .section-head__title {
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    color: var(--deep);
    position: relative;
    display: inline-block;

    &::after {
      content: "";
      display: block;
      width: 56px; height: 4px;
      margin: 0.8rem auto 0;
      background: var(--lemon);
      border-radius: 4px;
    }
  }

  & .section-head__desc {
    margin: 0.9rem 0 0;
    color: var(--ocean);
    font-size: 1rem;
  }
}

/* ---------- Dish list ---------- */
.dish-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.2rem, 3vw, 2.2rem) clamp(2rem, 5vw, 4rem);

  &--drinks { /* same grid; kept for semantic hooks */ }
}

.dish {
  position: relative;
  padding: 0.4rem 0.2rem 0.6rem;
  transition: transform 0.4s var(--ease);

  &:hover { transform: translateY(-4px); }

  & .dish__head {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
  }

  & .dish__name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--deep);
    flex-shrink: 0;
  }

  & .dish__dots {
    flex: 1;
    border-bottom: 2px dotted rgba(24,154,180,0.4);
    transform: translateY(-4px);
  }

  & .dish__price {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--teal);
    flex-shrink: 0;

    &::after { content: " €"; font-size: 0.75em; color: var(--ocean); }
  }

  & .dish__desc {
    margin: 0.35rem 0 0;
    font-size: 0.92rem;
    color: #46626d;
  }

  & .dish__tag {
    display: inline-block;
    margin-top: 0.55rem;
    padding: 0.2rem 0.7rem;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--deep);
    background: var(--lemon-soft);
    border-radius: 999px;
  }
}

/* ============================================================
   Parallax quote sections
   ============================================================ */
.parallax {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: clamp(4rem, 10vw, 8rem) 1.5rem;
  text-align: center;
  color: var(--white);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;

  /* dark ocean overlay for legibility */
  &::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5,68,94,0.72), rgba(10,110,143,0.6));
  }

  &--1 { background-image: url("https://images.unsplash.com/photo-1505142468610-359e7d316be0?auto=format&fit=crop&w=1600&q=70"); }
  &--2 { background-image: url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1600&q=70"); }
  &--3 { background-image: url("https://images.unsplash.com/photo-1520250497591-112f2f40a3f4?auto=format&fit=crop&w=1600&q=70"); }

  & .parallax__quote {
    position: relative;
    z-index: 2;
    max-width: 44rem;
    margin: 0;

    & p {
      font-family: var(--font-display);
      font-weight: 500;
      font-style: italic;
      font-size: clamp(1.5rem, 4.5vw, 2.8rem);
      line-height: 1.25;
      margin: 0;

      /* subtle highlight on key emotion */
      & { text-wrap: balance; }
    }

    & cite {
      display: block;
      margin-top: 1.4rem;
      font-family: var(--font-body);
      font-style: normal;
      font-size: 0.85rem;
      letter-spacing: 0.25em;
      text-transform: uppercase;
      color: var(--lemon);
    }
  }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--deep);
  background: var(--lemon);
  border-radius: 999px;
  box-shadow: 0 12px 30px -12px rgba(244, 224, 77, 0.8);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);

  &:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 18px 40px -12px rgba(244, 224, 77, 0.9);
  }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  position: relative;
  background: linear-gradient(165deg, var(--ocean), var(--deep));
  color: var(--white);
  padding-top: clamp(60px, 10vw, 120px);
  text-align: center;

  & .site-footer__wave {
    position: absolute;
    top: -1px; left: 0;
    width: 100%;
    line-height: 0;

    & svg { width: 100%; height: clamp(60px, 8vw, 110px); }
    & path { fill: var(--sand); }
  }

  & .site-footer__body { padding: 2rem 1.5rem 3rem; }

  & .site-footer__brand {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 0.6rem;
  }

  & .site-footer__tag { color: var(--aqua); margin: 0.2rem 0; font-size: 0.95rem; }
  & .site-footer__meta { margin: 0.2rem 0; color: rgba(255,255,255,0.85); font-size: 0.9rem; }
  & .site-footer__note {
    margin-top: 1.6rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .dish-list { grid-template-columns: 1fr; }

  .nav {
    & .nav__toggle { display: flex; z-index: 120; }

    & .nav__list {
      position: fixed;
      inset: 0 0 0 auto;
      width: min(78vw, 320px);
      flex-direction: column;
      justify-content: center;
      gap: 1.8rem;
      padding: 2rem;
      background: linear-gradient(165deg, var(--deep), var(--ocean));
      transform: translateX(100%);
      transition: transform 0.5s var(--ease);

      & a { color: var(--white); font-size: 1.2rem; }
    }

    &.is-open .nav__list { transform: translateX(0); }
    &.is-open .nav__toggle span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
    &.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
    &.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
  }

  /* fixed backgrounds are janky on mobile */
  .parallax { background-attachment: scroll; }
}

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