/* ==========================================================================
   MA — Omakase Sushi Restaurant
   Horizontal scroll · 4 panels · M ——— A
   ========================================================================== */

/* --- Font ---------------------------------------------------------------- */
@font-face {
  font-family: 'Time Sans Serif';
  src: url('/fonts/TimeSansSerif.woff2') format('woff2'),
       url('/fonts/TimeSansSerif.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- Design Tokens ------------------------------------------------------- */
:root {
  --color-bg: #FBF6F1;
  --color-text: #231F20;
  --color-text-muted: #4A4546;
  --color-btn-bg: #231F20;
  --color-btn-text: #FFFFFF;
  --color-btn-hover: #3A3536;
  --color-border: #D4CBC2;
  --color-focus: #8B7355;

  --font: 'Time Sans Serif', 'Georgia', 'Times New Roman', serif;
  --text-body: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
  --text-headline: clamp(1.5rem, 1.2rem + 1.25vw, 2rem);
  --text-letter: clamp(4rem, 9.67vh, 7rem);
  --text-logo: clamp(0.75rem, 0.6rem + 0.5vw, 0.875rem);

  --panel-pad: clamp(2.5rem, 5vw, 5rem);
  --logo-top: clamp(2rem, 4vh, 3rem);
  --line-top: 37.2%;
  --radius-pill: 24px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 600ms;
}

/* --- Dark Theme ---------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1A1A1A;
    --color-text: #F0EBE5;
    --color-text-muted: #B0A89E;
    --color-btn-bg: #F0EBE5;
    --color-btn-text: #1A1A1A;
    --color-btn-hover: #D4CBC2;
    --color-border: #3A3535;
    --color-focus: #C4A87C;
  }
}

/* --- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
h1, h2, h3 { font-family: var(--font); font-weight: 400; line-height: 1.2; }

/* --- Accessibility ------------------------------------------------------- */
.skip-link {
  position: absolute; top: -100%; left: var(--panel-pad);
  padding: 0.5rem 1rem; background: var(--color-btn-bg); color: var(--color-btn-text);
  font-size: 0.8rem; z-index: 1000; border-radius: 0 0 8px 8px;
  transition: top 150ms var(--ease);
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Scroll Container ---------------------------------------------------- */
.scroll-container {
  position: relative;
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-x: auto;
  overflow-y: hidden;
  /* scroll-behavior handled by JS for anchors/keyboard only */
  /* no snap — continuous free scroll */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll-container::-webkit-scrollbar { display: none; }

/* --- Panel (shared) ------------------------------------------------------ */
.panel {
  position: relative;
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* --- Brush Line (scroll-driven, fills progressively) --------------------- */
.brush-line {
  position: absolute;
  top: var(--line-top);
  left: 20.63vw;
  width: 375vw;
  height: 1.2vh;
  transform: translateY(-50%);
  background: url('/img/brush-line.svg') no-repeat left center / 100% 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  -webkit-mask-image: linear-gradient(to right, black 4%, transparent 7.5%);
  mask-image: linear-gradient(to right, black 4%, transparent 7.5%);
  will-change: opacity, mask-image;
  animation: line-hint 3s ease-in-out 1s infinite;
}
@media (prefers-color-scheme: dark) {
  .brush-line { filter: invert(0.92); }
}

/* --- Fixed M——A Logo (appears after hero) -------------------------------- */
.site-logo {
  position: fixed;
  top: var(--logo-top);
  left: 5.56%;
  width: clamp(5rem, 11.25vw, 10.125rem);
  height: auto;
  z-index: 100;
  user-select: none;
  opacity: 0;
  transition: opacity 400ms var(--ease);
  pointer-events: none;
}
.site-logo.is-visible {
  opacity: 1;
  pointer-events: auto;
}
@media (prefers-color-scheme: dark) {
  .site-logo { filter: invert(0.92); }
}

/* ==========================================================================
   Panel 1 — Hero (Large M)
   ========================================================================== */
.panel--hero {
  position: relative;
}

.hero__m {
  position: absolute;
  left: 13.19%;
  top: 32.52%;
  width: auto;
  height: var(--text-letter);
  color: var(--color-text);
  z-index: 3;
  animation: fade-in 5s var(--ease) both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes line-hint {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.6; }
}


.scroll-hint {
  position: absolute;
  top: var(--line-top);
  left: 42vw;
  transform: translateY(1.2rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  z-index: 5;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.scroll-hint.is-hidden { opacity: 0; pointer-events: none; }
.scroll-hint__arrow {
  display: inline-block; width: 2rem; height: 1px;
  background: var(--color-text-muted); position: relative;
}
.scroll-hint__arrow::after {
  content: ''; position: absolute; right: 0; top: 50%;
  width: 5px; height: 5px;
  border-right: 1px solid var(--color-text-muted);
  border-bottom: 1px solid var(--color-text-muted);
  transform: translateY(-50%) rotate(-45deg);
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-hint__arrow {
    animation: hint-pulse 2s ease-in-out infinite;
  }
  @keyframes hint-pulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
  }
}

/* ==========================================================================
   Panel 2 — Story
   ========================================================================== */
.panel--story {
  position: relative;
}

.story__content {
  position: absolute;
  z-index: 3;
  left: 20.63%;
  top: 41.4%;
  max-width: 20rem;
}

.story__headline {
  font-size: var(--text-headline);
  margin-bottom: 1.5rem;
}

.story__body {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: var(--text-body);
  line-height: 1.8;
}

/* "Saber mais" toggle */
.story__more {
  display: block;
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0.5;
  transition: color 300ms var(--ease), opacity 300ms var(--ease);
}
.story__more:hover,
.story__more:focus-visible { color: var(--color-text); opacity: 0.8; }

/* Expanded two-column text */
.story__expanded {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 41.4%;
  display: flex;
  gap: 3rem;
  max-width: 34rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.5s var(--ease), transform 1.5s var(--ease);
}
.story__expanded.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.story__col {
  flex: 1;
}
.story__col p {
  color: var(--color-text-muted);
  font-size: var(--text-body);
  line-height: 1.8;
}

/* Photo column — right side, infinite vertical carousel */
.story__photos {
  position: absolute;
  left: 65.97%;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 20.97%;
  overflow: hidden;
}

.story__track {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  will-change: transform;
  animation: carousel-up 200s linear infinite;
}

.story__photo {
  width: 100%;
  display: block;
  flex-shrink: 0;
  aspect-ratio: 3/4;
}

.story__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes carousel-up {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .story__track { animation: none; }
}

/* ==========================================================================
   Panel 3 — Gallery
   ========================================================================== */
.panel--gallery {
  position: relative;
}

.gallery__grid {
  position: absolute;
  inset: 0;
  z-index: 3;
}

/* --- Gallery Carousel Columns --- */
.gallery__col {
  position: absolute;
  top: 0;
  bottom: 0;
  overflow: hidden;
}

.gallery__col--left {
  left: 20.63%;
  width: 17.78%;
}

.gallery__col--center {
  left: 39.51%;
  width: 20.97%;
}

.gallery__col--right {
  left: 61.60%;
  width: 17.78%;
}

.gallery__track {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  will-change: transform;
}

.gallery__track--left {
  padding-top: 65vh;
  animation: carousel-up 260s linear infinite;
}

.gallery__track--center {
  animation: carousel-up 160s linear infinite;
}

.gallery__track--right {
  padding-top: 35vh;
  animation: carousel-up 300s linear infinite;
}

.gallery__photo {
  display: block;
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 3/4;
}

.gallery__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__spacer {
  flex-shrink: 0;
  height: 40vh;
}

.gallery__spacer--tall {
  height: 80vh;
}

@media (prefers-reduced-motion: reduce) {
  .gallery__track { animation: none; }
}

/* ==========================================================================
   Panel 4 — Contact / Reservation
   ========================================================================== */
.panel--contact {
  position: relative;
}

.contact__content {
  position: absolute;
  z-index: 3;
  left: 20.63%;
  top: 42.2%;
  max-width: 20rem;
}

.contact__headline {
  font-size: var(--text-headline);
  margin-bottom: 1rem;
}

.contact__desc {
  color: var(--color-text-muted);
  font-size: var(--text-body);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.contact__address {
  font-style: normal;
  color: var(--color-text-muted);
  opacity: 0.5;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.contact__a {
  position: absolute;
  left: 81.53%;
  top: 32.52%;
  width: auto;
  height: var(--text-letter);
  color: var(--color-text);
  z-index: 3;
  opacity: 0;
}

/* ==========================================================================
   Button
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.5rem;
  font-family: var(--font);
  font-size: var(--text-body);
  letter-spacing: 0.02em;
  background: var(--color-btn-bg);
  color: var(--color-btn-text);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  transition: background 300ms var(--ease), transform 300ms var(--ease);
}
.btn:hover, .btn:focus-visible {
  background: var(--color-btn-hover);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

/* ==========================================================================
   Language Switcher
   ========================================================================== */
.lang-switcher {
  position: fixed;
  top: var(--logo-top);
  right: var(--panel-pad);
  z-index: 100;
  display: flex;
  gap: 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lang-switcher__btn {
  padding: 0.15rem 0.35rem;
  color: var(--color-text-muted);
  transition: color 150ms var(--ease);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}
.lang-switcher__btn:hover,
.lang-switcher__btn:focus-visible { color: var(--color-text); }
.lang-switcher__btn.is-active { color: var(--color-text); }
.lang-switcher__sep { color: var(--color-border); user-select: none; }


/* ==========================================================================
   Reveal Animations
   ========================================================================== */

/* ==========================================================================
   Responsive — Mobile (vertical scroll)
   ========================================================================== */
@media (max-width: 767px) {
  body { overflow-x: hidden; overflow-y: auto; }

  .scroll-container {
    flex-direction: column;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .panel {
    flex: 0 0 auto;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    }

  /* Hide the brush line on mobile */
  .brush-line { display: none; }

  /* Hero */
  .hero__m {
    position: relative;
    left: 1.5rem;
    top: auto;
    height: clamp(5rem, 15vw, 8rem);
    margin-top: 30vh;
  }

  /* Story */
  .story__content {
    position: relative;
    left: auto;
    top: auto;
    max-width: 100%;
    padding: 1.5rem;
    padding-top: 40vh;
  }
  .story__photos { display: none; }
  .story__expanded {
    position: relative;
    left: auto;
    top: auto;
    max-width: 100%;
    padding: 0 1.5rem 1.5rem;
    flex-direction: column;
    gap: 1.5rem;
  }

  /* Gallery — stack columns, hide side columns */
  .gallery__col--left,
  .gallery__col--right { display: none; }
  .gallery__col--center {
    position: relative;
    left: auto;
    width: 100%;
    padding: 1rem;
  }
  .gallery__track { animation: none; }
  .gallery__spacer { display: none; }

  /* Contact */
  .contact__content {
    position: relative;
    left: auto;
    top: auto;
    max-width: 100%;
    padding: 1.5rem;
    padding-top: 40vh;
  }
  .contact__a {
    position: relative;
    left: auto;
    top: auto;
    height: clamp(5rem, 15vw, 8rem);
    margin-left: auto;
    display: block;
    margin-top: 2rem;
    margin-right: 1.5rem;
  }

  .scroll-hint { display: none; }
}

/* --- Tablet -------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1199px) {
  :root { --panel-pad: 3rem; }
  .story__photos { width: 14rem; }
  .story__content { max-width: 20rem; }
}

/* --- Large screens ------------------------------------------------------- */
@media (min-width: 1800px) {
  :root { --panel-pad: 8rem; }
}
