/* ============================================================
   鮨 SORA · Sushi & Omakase
   Minimalista · preto / branco / vermelho · tema claro & escuro
   Nested CSS
   ============================================================ */

/* ---------- Themes ---------- */
:root {
  --red: #e2231a;
  --red-deep: #b81810;

  --font-jp: "Shippori Mincho", serif;
  --font-ui: "Noto Sans JP", system-ui, sans-serif;

  --maxw: 920px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

[data-theme="light"] {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --hair: rgba(17, 17, 17, 0.14);
  --marquee-bg: #111111;
  --marquee-ink: #f6f5f2;
}

[data-theme="dark"] {
  --bg: #0e0e0e;
  --surface: #151515;
  --ink: #f2f0ec;
  --muted: #9a9a9a;
  --hair: rgba(242, 240, 236, 0.16);
  --marquee-bg: #e2231a;
  --marquee-ink: #0e0e0e;
}

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

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

body {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 300;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);

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

h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.1; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

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

::selection { background: var(--red); color: #fff; }

/* smooth in-page scroll but honoured only when motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);

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

/* ============================================================
   Intro: enso brush + split panels
   ============================================================ */
.intro {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;

  & .intro__panel {
    position: absolute;
    top: 0;
    width: 50.5%;
    height: 100%;
    background: #0e0e0e;
    transition: transform 0.9s var(--ease) 1.9s;
  }
  & .intro__panel--left  { left: 0; }
  & .intro__panel--right { right: 0; }

  & .intro__center {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 0.4rem;
    text-align: center;
    transition: opacity 0.5s ease 1.7s;
  }

  & .intro__enso {
    width: clamp(140px, 32vw, 220px);
    height: auto;

    & path {
      stroke-dasharray: 620;
      stroke-dashoffset: 620;
      animation: draw 1.5s var(--ease) 0.2s forwards;
    }
  }

  & .intro__kanji {
    position: absolute;
    font-family: var(--font-jp);
    font-size: clamp(3rem, 9vw, 5rem);
    color: #f6f5f2;
    opacity: 0;
    animation: fadeUp 0.8s ease 1s forwards;
  }

  & .intro__romaji {
    margin-top: clamp(150px, 34vw, 230px);
    font-size: 0.8rem;
    letter-spacing: 0.7em;
    color: var(--red);
    opacity: 0;
    padding-left: 0.7em;
    animation: fadeUp 0.8s ease 1.25s forwards;
  }

  /* when done: panels slide off, center hidden */
  &.is-done {
    & .intro__panel--left  { transform: translateX(-101%); }
    & .intro__panel--right { transform: translateX(101%); }
    & .intro__center { opacity: 0; }
  }
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  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), border-color 0.4s, padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;

  &.is-scrolled {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--hair);
    padding-block: 0.7rem;
  }

  & .logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;

    & .logo__kanji {
      font-family: var(--font-jp);
      font-size: 1.6rem;
      color: var(--red);
    }
    & .logo__latin {
      font-weight: 500;
      letter-spacing: 0.32em;
      font-size: 0.95rem;
      padding-left: 0.32em;
    }
  }

  & .menu-nav {
    display: flex;
    gap: clamp(0.8rem, 2.4vw, 1.8rem);

    & a {
      font-family: var(--font-jp);
      font-size: 1.05rem;
      position: relative;
      transition: color 0.3s;

      &::after {
        content: "";
        position: absolute;
        left: 0; bottom: -4px;
        width: 100%; height: 1.5px;
        background: var(--red);
        transform: scaleX(0);
        transform-origin: right;
        transition: transform 0.35s var(--ease);
      }
      &:hover { color: var(--red); }
      &:hover::after { transform: scaleX(1); transform-origin: left; }
    }
  }
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  color: var(--ink);

  & .theme-toggle__track {
    position: relative;
    width: 46px; height: 24px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    transition: border-color 0.4s;
  }

  & .theme-toggle__thumb {
    position: absolute;
    top: 2px; left: 2px;
    width: 17px; height: 17px;
    border-radius: 50%;
    background: var(--red);
    transition: transform 0.4s var(--ease);
  }

  & .theme-toggle__label {
    font-family: var(--font-jp);
    font-size: 1rem;
    width: 1.2em;
    text-align: center;
  }
}

[data-theme="dark"] .theme-toggle .theme-toggle__thumb { transform: translateX(22px); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(7rem, 16vh, 11rem) clamp(1.4rem, 6vw, 3rem) 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;

  /* vertical Japanese phrase running down the side */
  & .hero__vertical {
    position: absolute;
    top: clamp(7rem, 16vh, 11rem);
    right: clamp(1rem, 4vw, 2rem);
    writing-mode: vertical-rl;
    font-family: var(--font-jp);
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.35em;
    color: var(--red);
    opacity: 0.9;
  }

  & .hero__kanji-lead {
    font-family: var(--font-jp);
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    color: var(--muted);
    margin: 0 0 1.2rem;
  }

  & .hero__title {
    font-family: var(--font-jp);
    font-weight: 600;
    font-size: clamp(2.6rem, 9vw, 5.5rem);
    letter-spacing: -0.01em;

    & .line {
      display: block;
      overflow: hidden;

      /* each line rises into place after the intro */
      & { --ty: 110%; }
    }
    & em { font-style: italic; color: var(--red); }
  }

  & .hero__lede {
    max-width: 30rem;
    margin: 2rem 0 2.6rem;
    color: var(--muted);
    font-size: clamp(0.98rem, 2vw, 1.1rem);
  }

  & .hero__index {
    position: absolute;
    left: clamp(1.4rem, 6vw, 3rem);
    bottom: 2rem;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    color: var(--muted);
  }
}

/* animate hero title lines up once page is ready */
.hero .line > * { display: inline-block; }
body:not(.is-loading) .hero__title .line {
  animation: lineUp 0.9s var(--ease) forwards;
}
.hero__title .line:nth-child(1) { animation-delay: 0.05s; }
.hero__title .line:nth-child(2) { animation-delay: 0.15s; }
.hero__title .line:nth-child(3) { animation-delay: 0.25s; }
.hero__title .line { transform: translateY(110%); opacity: 0; }

@keyframes lineUp {
  to { transform: translateY(0); opacity: 1; }
}

/* ---------- CTA ---------- */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.6rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  transition: color 0.4s var(--ease), background 0.4s var(--ease), border-color 0.4s;
  position: relative;
  overflow: hidden;

  & .cta__arrow { transition: transform 0.4s var(--ease); }

  &:hover {
    background: var(--red);
    border-color: var(--red);
    color: #fff;

    & .cta__arrow { transform: translateY(3px); }
  }
}

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

  & .course__head {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 1.2rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--hair);

    & .course__jp {
      font-family: var(--font-jp);
      font-size: clamp(2rem, 6vw, 3.2rem);
      color: var(--red);
      line-height: 1;
    }
    & .course__title {
      font-family: var(--font-ui);
      font-weight: 300;
      font-size: clamp(1rem, 3vw, 1.4rem);
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--ink);
    }
    & .course__num {
      margin-left: auto;
      font-size: 0.85rem;
      letter-spacing: 0.2em;
      color: var(--muted);
    }
  }
}

/* ---------- Items ---------- */
.items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: clamp(2rem, 6vw, 4.5rem);
}

.item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--hair);
  transition: padding-left 0.35s var(--ease);

  &:hover { padding-left: 0.6rem; }

  & .item__body { flex: 1; }

  & .item__name {
    font-size: 1.08rem;
    font-weight: 400;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;

    & .item__jp {
      font-family: var(--font-jp);
      font-size: 0.85rem;
      color: var(--muted);
    }
  }

  & .item__desc {
    margin: 0.25rem 0 0;
    font-size: 0.86rem;
    color: var(--muted);
  }

  & .item__price {
    font-family: var(--font-jp);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--ink);
    flex-shrink: 0;

    &::before { content: "€"; font-size: 0.7em; color: var(--red); margin-right: 0.15em; }
  }

  /* chef feature: red rule + accent */
  &--feature {
    position: relative;

    & .item__name { color: var(--red); font-weight: 500; }
    &::before {
      content: "";
      position: absolute;
      left: -0.9rem; top: 1.2rem; bottom: 1.2rem;
      width: 3px;
      background: var(--red);
    }
  }
}

/* ============================================================
   Disruptive marquee cut
   ============================================================ */
.marquee {
  overflow: hidden;
  background: var(--marquee-bg);
  color: var(--marquee-ink);
  padding: 1rem 0;
  transform: rotate(-2deg) scale(1.04);
  margin: clamp(1.5rem, 5vw, 3.5rem) 0;
  border-block: 2px solid var(--red);
  transition: background 0.5s var(--ease), color 0.5s var(--ease);

  & .marquee__track {
    display: flex;
    width: max-content;
    animation: slide 26s linear infinite;

    & span {
      font-family: var(--font-jp);
      font-size: clamp(1.1rem, 3vw, 1.8rem);
      letter-spacing: 0.15em;
      white-space: nowrap;
      padding-right: 1rem;
    }
  }

  &:hover .marquee__track { animation-play-state: paused; }
}

@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   Footer
   ============================================================ */
.foot {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.4rem, 6vw, 3rem) 4rem;
  text-align: center;
  border-top: 1px solid var(--hair);

  & .foot__mark {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;

    & .foot__kanji { font-family: var(--font-jp); font-size: 2rem; color: var(--red); }
    & .foot__name { font-weight: 500; letter-spacing: 0.35em; padding-left: 0.35em; }
  }

  & .foot__line { margin: 0.3rem 0; font-size: 0.95rem; }
  & .foot__meta { margin: 0.3rem 0; color: var(--muted); font-size: 0.88rem; }
  & .foot__note {
    margin-top: 1.6rem;
    font-family: var(--font-jp);
    font-size: 0.85rem;
    color: var(--muted);
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .topbar .menu-nav { display: none; }
  .items { grid-template-columns: 1fr; }
  .hero .hero__vertical { display: none; }
  .item--feature::before { left: -0.6rem; }
}

/* ---------- 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; }
  .hero__title .line { transform: none; opacity: 1; }
  .intro__enso path { stroke-dashoffset: 0; }
}
