/* ==========================================================================
   Mieko Pottery - wabi-sabi aesthetic
   Paleta: laranja #FF8800, preto #1a1a1a, creme #f5f0ea, cinza #8a8680
   ========================================================================== */

:root {
  /* Opt out of auto-dark-mode on mobile browsers (Samsung Internet, Chrome). */
  color-scheme: light;
  --color-orange: #ff8800;
  --color-orange-hover: #e67600;
  --color-ink: #1a1a1a;
  --color-ink-soft: #2a2a2a;
  --color-cream: #f5f0ea;
  --color-cream-deep: #ebe3d9;
  --color-neutral: #8a8680;
  --color-neutral-soft: #bdb7ae;

  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;

  --shadow-soft: 0 8px 32px rgba(26, 26, 26, 0.08);
  --shadow-lift: 0 16px 48px rgba(26, 26, 26, 0.14);

  --radius-organic-1: 24px 8px 32px 12px;
  --radius-organic-2: 12px 32px 8px 28px;
  --radius-organic-3: 18px 28px 14px 22px;

  --ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--color-cream);
  color: var(--color-ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
}

/* Subtle paper/clay grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 1 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeUp 0.8s var(--ease-soft) both;
}

.logo {
  max-width: 260px;
  width: 70%;
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
  border-radius: 16px 6px 20px 8px;
  box-shadow: 0 12px 32px rgba(26,26,26,0.12);
}

.tagline {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  font-weight: 400;
  font-style: italic;
  color: var(--color-ink);
  letter-spacing: 0.01em;
  margin-bottom: 0.4rem;
}

.sub-tagline {
  font-size: 0.85rem;
  color: var(--color-neutral);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ==========================================================================
   Link buttons
   ========================================================================== */
.links {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 3.5rem;
  animation: fadeUp 0.9s 0.15s var(--ease-soft) both;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.3rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-organic-1);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s var(--ease-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  text-align: left;
}

.link-btn:nth-child(2) { border-radius: var(--radius-organic-2); }
.link-btn:nth-child(3) { border-radius: var(--radius-organic-3); }

.link-btn .icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.link-btn__hint {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.7;
  letter-spacing: 0.02em;
}

.link-btn--primary {
  background-color: var(--color-orange);
  color: #fff;
  border-color: var(--color-orange);
}

.link-btn--primary:hover,
.link-btn--primary:focus-visible {
  background-color: var(--color-orange-hover);
  border-color: var(--color-orange-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.link-btn--outline {
  background-color: var(--color-ink);
  color: var(--color-cream);
  border-color: var(--color-ink);
}

.link-btn--outline:hover,
.link-btn--outline:focus-visible {
  background-color: var(--color-ink-soft);
  border-color: var(--color-orange);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.link-btn:active { transform: translateY(0); }
.link-btn:focus-visible { outline: 3px solid var(--color-orange); outline-offset: 3px; }

.link-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-cream-deep);
  text-align: center;
  color: var(--color-neutral);
  font-size: 0.85rem;
}

.footer__fineprint {
  font-size: 0.75rem;
  margin-top: 0.4rem;
  opacity: 0.8;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  /* Use dynamic viewport height — correctly excludes mobile browser/system UI.
     Safe-area insets protect the CTA button from Android nav bar / iOS notch. */
  height: 100dvh;
  background-color: rgba(26, 26, 26, 0.94);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  overflow-y: auto;                         /* fallback: scroll if still tight */
  animation: fadeIn 0.25s ease-out;
}

.lightbox[hidden] { display: none; }

.lightbox__figure {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox__img {
  max-width: 100%;
  /* Leave ~180px for title + CTA + gaps + safe-area padding */
  max-height: min(70dvh, calc(100dvh - 180px));
  object-fit: contain;
  border-radius: var(--radius-organic-1);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

/* Short-height screens (landscape phones, small viewports): shrink image +
   compact title/CTA so the whole modal fits without scrolling. */
@media (max-height: 640px) {
  .lightbox__img { max-height: min(55dvh, calc(100dvh - 140px)); }
  .lightbox__title { font-size: 1rem; }
  .lightbox__cta { padding: 0.55rem 1.1rem; font-size: 0.88rem; }
  .lightbox__figure { gap: 0.6rem; }
}

.lightbox__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  color: var(--color-cream);
  text-align: center;
  max-width: 90vw;
}

.lightbox__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  font-style: italic;
}

.lightbox__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  background-color: var(--color-orange);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 999px;
  transition: all 0.25s var(--ease-soft);
}

.lightbox__cta:hover,
.lightbox__cta:focus-visible {
  background-color: var(--color-orange-hover);
  transform: translateY(-2px);
}

.lightbox__cta .icon { width: 18px; height: 18px; }

.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.lightbox__close { top: 1.5rem; right: 1.5rem; z-index: 2; }
.lightbox__nav--prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 1rem; top: 50%; transform: translateY(-50%); }

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--color-orange);
}

.lightbox__nav--prev:hover { transform: translateY(-50%) translateX(-2px); }
.lightbox__nav--next:hover { transform: translateY(-50%) translateX(2px); }

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
