/* =========================================================
   NOIR CAFÉ MENU — style.css
   Design system: monocromático, bordas marcantes,
   muito espaço vazio. Dois modos: WHITE / BLACK SPACE.
   ========================================================= */

/* ---- Tokens (default = BLACK SPACE) ---- */
:root {
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --fg: #f3f1ea;
  --muted: #8a8884;
  --border: #f3f1ea;
  --ember: #c14a3a;
  --shadow: 0 10px 40px rgba(0,0,0,.6);

  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;
}

body.theme-white {
  --bg: #f5f3ee;
  --bg-elev: #ffffff;
  --fg: #0d0d0d;
  --muted: #6b6862;
  --border: #0d0d0d;
  --ember: #8a2a1c;
  --shadow: 0 8px 30px rgba(0,0,0,.08);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  transition: background-color .5s ease, color .5s ease;
  overflow-x: hidden;
}

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

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

kbd {
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  padding: 1px 6px;
  font-size: .75em;
}

/* scanlines sutis no modo black */
body.theme-black::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(255,255,255,.012) 2px,
    rgba(255,255,255,.012) 3px
  );
  mix-blend-mode: overlay;
}

/* ---- Type helpers ---- */
.serif {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: .12em;
}

.tiny {
  font-size: .68rem;
}

.small {
  font-size: .78rem;
}

.lg {
  font-size: 1.25rem;
}

.xl {
  font-size: 1.6rem;
}

.huge {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin: .25em 0;
}

.display {
  font-size: clamp(3.2rem, 9vw, 6.5rem);
  line-height: 1;
  margin: .15em 0;
}

.muted {
  color: var(--muted);
}

.bold {
  font-weight: 600;
}

.italic {
  font-style: italic;
}

.center {
  text-align: center;
}

.spaced {
  letter-spacing: .3em;
  text-transform: uppercase;
}

.ember {
  color: var(--ember);
}

.lead {
  font-size: 1.05rem;
  max-width: 48ch;
  color: var(--fg);
  opacity: .9;
}

.hint {
  margin-top: 1.5rem;
}

.rule {
  height: 1px;
  background: var(--border);
  opacity: .4;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
  padding: .8rem 1.2rem;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  transition: background .2s, color .2s, transform .2s;
}

.btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}

.btn-primary:hover {
  background: transparent;
  color: var(--fg);
}

.btn-outline {
  background: transparent;
}

.btn-ghost {
  border: 1px solid var(--border);
  padding: .55rem .9rem;
  font-size: .68rem;
}

.btn-icon {
  border: 1px solid var(--border);
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: .9rem;
}

.btn-link {
  border: 0;
  text-decoration: underline;
  letter-spacing: .25em;
  font-size: .68rem;
  padding: .6rem;
}

.btn-link:hover {
  background: transparent;
  color: var(--muted);
}

.badge-count {
  margin-left: .5rem;
  font-size: .65rem;
  padding: 0 .35rem;
  border: 1px solid var(--border);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fg);
}

/* ---- Layout ---- */
.section {
  padding: 6rem 6vw;
  max-width: 1400px;
  margin: 0 auto;
}

.section__head {
  text-align: center;
  margin-bottom: 3rem;
}

.section__head h2 {
  margin-top: .5rem;
}

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 6vw;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  backdrop-filter: blur(8px);
}

.nav__brand {
  font-size: 1.15rem;
  font-style: italic;
}

.nav__center {
  display: flex;
  gap: 1.5rem;
  font-size: .72rem;
}

.nav__center a:hover {
  opacity: .6;
}

.nav__right {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ---- Hero ---- */
.hero {
  padding-top: 4rem;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

.hero__frame {
  position: relative;
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  overflow: hidden;
}

.hero__cup {
  width: 55%;
  height: auto;
  filter: invert(0);
}

body.theme-black .hero__cup {
  filter: invert(1);
}

.easter {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: .9rem;
  background: transparent;
  opacity: .35;
  transition: opacity .2s, transform .2s;
}

.easter:hover {
  opacity: 1;
  transform: scale(1.1);
}

.easter.found {
  opacity: .15;
  pointer-events: none;
}

/* Steam */
.steam {
  position: absolute;
  bottom: 55%;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 80px;
  pointer-events: none;
}

.steam span {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 10px;
  height: 30px;
  background: linear-gradient(to top, var(--fg), transparent);
  border-radius: 50%;
  opacity: 0;
  filter: blur(6px);
  animation: steam 3.5s ease-out infinite;
}

.steam span:nth-child(1) {
  left: 30%;
  animation-delay: 0s;
}

.steam span:nth-child(2) {
  left: 50%;
  animation-delay: 1.2s;
}

.steam span:nth-child(3) {
  left: 70%;
  animation-delay: 2.4s;
}

@keyframes steam {
  0% {
    transform: translate(-50%, 0) scale(1);
    opacity: 0;
  }

  25% {
    opacity: .35;
  }

  100% {
    transform: translate(-50%, -60px) scale(1.6);
    opacity: 0;
  }
}

/* ---- Product grid ---- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  border: 1px solid var(--border);
  padding: .35rem;
  margin: 0 auto 3rem;
  width: fit-content;
}

.filter {
  padding: .65rem 1.1rem;
  font-size: .7rem;
  letter-spacing: .2em;
  border: 0;
}

.filter:hover {
  background: var(--bg-elev);
}

.filter.is-active {
  background: var(--fg);
  color: var(--bg);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  transition: transform .3s ease;
  position: relative;
  animation: fade-up .5s ease both;
}

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

.card__media {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #fff;
}

body.theme-black .card__media {
  background: #1a1a1a;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

.card:hover .card__media img {
  transform: scale(1.03);
}

.card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: .25rem .55rem;
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .2em;
}

.card__fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__fav.is-on {
  background: var(--fg);
  color: var(--bg);
}

.card__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1;
}

.card__name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.card__desc {
  color: var(--muted);
  font-size: .9rem;
  min-height: 2.6em;
}

.card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.card__price {
  font-family: var(--font-mono);
  font-size: .85rem;
  letter-spacing: .15em;
}

.card__add {
  border: 1px solid var(--border);
  padding: .5rem .9rem;
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .2em;
}

.card__add:hover {
  background: var(--fg);
  color: var(--bg);
}

/* ---- About ---- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  max-width: 900px;
  margin: 2rem auto 0;
  font-size: 1.05rem;
}

/* ---- Contact ---- */
.contact__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.contact__card {
  border: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: background .25s, color .25s;
}

.contact__card:hover {
  background: var(--fg);
  color: var(--bg);
}

.contact__card:hover .muted {
  color: var(--bg);
  opacity: .7;
}

/* ---- Footer ---- */
.footer {
  padding: 3rem 6vw 2rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer a strong {
  border-bottom: 1px solid var(--border);
}

/* ---- Loading ---- */
.loading {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s ease;
}

.loading.is-out {
  opacity: 0;
  pointer-events: none;
}

.loading__inner {
  width: min(420px, 85vw);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.progress {
  height: 8px;
  border: 1px solid var(--border);
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--fg);
  transition: width .1s linear;
}

/* ---- Loading final glitch ---- */
.loading-finish-glitch {
  position: relative;
  display: inline-block;
  animation: loading-glitch-shake 0.08s steps(2) infinite;
}

.loading-finish-glitch::before,
.loading-finish-glitch::after {
  content: attr(data-glitch);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  pointer-events: none;
  opacity: 0.75;
  overflow: hidden;
}

.loading-finish-glitch::before {
  color: var(--ember);
  transform: translate(-2px, 1px);
  clip-path: inset(0 0 52% 0);
}

.loading-finish-glitch::after {
  color: var(--muted);
  transform: translate(2px, -1px);
  clip-path: inset(48% 0 0 0);
}

@keyframes loading-glitch-shake {
  0% {
    transform: translate(0);
    letter-spacing: -0.01em;
  }

  20% {
    transform: translate(-2px, 1px);
    letter-spacing: 0.02em;
  }

  40% {
    transform: translate(2px, -1px);
    letter-spacing: -0.02em;
  }

  60% {
    transform: translate(-1px, 0);
    letter-spacing: 0.01em;
  }

  80% {
    transform: translate(1px, 1px);
    letter-spacing: 0.03em;
  }

  100% {
    transform: translate(0);
    letter-spacing: -0.01em;
  }
}

.loading.is-finishing .loading__inner {
  animation: loading-final-pulse 0.18s steps(2) infinite;
}

@keyframes loading-final-pulse {
  0%,
  100% {
    filter: none;
  }

  50% {
    filter: contrast(1.3);
  }
}

/* ---- Dialog (RPG) ---- */
.dialog {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: min(560px, 92vw);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  z-index: 80;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  box-shadow: var(--shadow);
}

.dialog.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dialog__head {
  display: flex;
  justify-content: space-between;
  margin-bottom: .35rem;
}

/* ---- Drawer (cart) ---- */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(420px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s ease;
  box-shadow: var(--shadow);
}

.drawer:not(.hidden) {
  display: flex;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.drawer__items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.drawer__foot {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.drawer__foot .big {
  font-size: 1.05rem;
  margin: .5rem 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: .85rem;
  padding: 1rem 0;
  border-bottom: 1px dashed var(--border);
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.cart-item__name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.cart-item__meta {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--muted);
  margin: .15rem 0 .5rem;
}

.cart-item__qty {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.cart-item__qty button {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
}

.cart-item__qty button:hover {
  background: var(--fg);
  color: var(--bg);
}

.cart-item__remove {
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .2em;
  margin-left: .75rem;
  opacity: .6;
}

.cart-item__remove:hover {
  opacity: 1;
  color: var(--ember);
}

.cart-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
  font-family: var(--font-serif);
}

/* ---- Modals ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity .25s;
}

.modal:not(.hidden) {
  opacity: 1;
}

.modal__card {
  background: var(--bg);
  border: 1px solid var(--border);
  width: min(420px, 100%);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.modal__card.wide {
  width: min(640px, 100%);
}

.tabs {
  display: flex;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: .75rem;
  font-size: .7rem;
  letter-spacing: .2em;
}

.tab.is-active {
  background: var(--fg);
  color: var(--bg);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.auth-form input {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: .7rem .85rem;
  font-family: var(--font-mono);
  font-size: .85rem;
  margin-bottom: .5rem;
}

.auth-form input:focus {
  outline: 1px solid var(--fg);
}

.auth-error {
  min-height: 1.2em;
}

.auth-logged {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1rem;
}

/* ---- Quiz ---- */
.quiz-progress {
  display: flex;
  gap: .35rem;
  margin: .5rem 0 1rem;
}

.quiz-progress span {
  flex: 1;
  height: 3px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}

.quiz-progress span.is-done {
  background: var(--fg);
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.quiz-options button {
  border: 1px solid var(--border);
  padding: 1.25rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  text-align: left;
  transition: background .2s, color .2s;
}

.quiz-options button:hover {
  background: var(--fg);
  color: var(--bg);
}

.quiz-result {
  text-align: center;
  padding: 1rem 0;
}

.quiz-result h4 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin: .5rem 0;
}

.quiz-result .picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.quiz-result .pick {
  border: 1px solid var(--border);
  padding: 1rem;
}

.quiz-result .pick img {
  aspect-ratio: 1/1;
  object-fit: cover;
  margin-bottom: .5rem;
}

.quiz-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin-top: 1rem;
}

/* ----- Custom Cursor ----- */
.cursor-ring,
.cursor-dot {
  display: none;
  pointer-events: none;
  position: fixed;
  z-index: 9999;
}

@media (hover: hover) and (pointer: fine) {
  body.has-cursor,
  body.has-cursor * {
    cursor: none !important;
  }

  .cursor-ring {
    display: block;
    width: 28px;
    height: 28px;
    border: 2px solid #111;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width .15s, height .15s, background .15s, border-color .15s, box-shadow .15s;
    mix-blend-mode: normal;
    background: rgba(255, 255, 255, 0.18);
    box-shadow:
      0 0 0 2px #f4f1ea,
      0 0 14px rgba(0, 0, 0, 0.35);
  }

  .cursor-dot {
    display: block;
    width: 5px;
    height: 5px;
    background: #111;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    mix-blend-mode: normal;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
  }

  .cursor-ring.is-hover {
    width: 46px;
    height: 46px;
    background: rgba(0, 0, 0, 0.08);
  }

  body.theme-black .cursor-ring {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
      0 0 0 2px #050505,
      0 0 18px rgba(255, 255, 255, 0.55);
  }

  body.theme-black .cursor-dot {
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.65);
  }

  body.theme-white .cursor-ring {
    border-color: #111;
    background: rgba(255, 255, 255, 0.28);
    box-shadow:
      0 0 0 2px #f4f1ea,
      0 0 16px rgba(0, 0, 0, 0.45);
  }

  body.theme-white .cursor-dot {
    background: #111;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
  }
}

/* ---- Animations ---- */
.fade-up {
  animation: fade-up .6s ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.glitch:hover {
  animation: glitch .35s steps(2) infinite;
}

@keyframes glitch {
  0%,
  100% {
    transform: translate(0);
  }

  25% {
    transform: translate(-1px, 1px);
  }

  50% {
    transform: translate(1px, -1px);
  }

  75% {
    transform: translate(-1px, 0);
  }
}

/* ---- Scrollbar (subtle) ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--muted);
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

/* ============= RESPONSIVE ============= */
@media (max-width: 900px) {
  .nav {
    gap: .5rem;
    padding: .85rem 5vw;
    flex-wrap: wrap;
  }

  .nav__center {
    display: none;
  }

  .section {
    padding: 4rem 5vw;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .quiz-options {
    grid-template-columns: 1fr;
  }

  .quiz-result .picks {
    grid-template-columns: 1fr;
  }

  .btn-ghost {
    padding: .5rem .65rem;
    font-size: .62rem;
  }
}

@media (max-width: 480px) {
  .display {
    font-size: 3.2rem;
  }

  .huge {
    font-size: 2.2rem;
  }

  .nav__right .btn-ghost span:not(.dot):not(#theme-label):not(#auth-label) {
    display: none;
  }

  .filters {
    width: 100%;
    justify-content: center;
  }

  .filter {
    padding: .55rem .75rem;
    font-size: .62rem;
  }
}