/* ─────────────────────────────────────────────────────────────
   Design System — rafes criativo
   Única fonte de verdade para tokens, componentes e layout.
   ───────────────────────────────────────────────────────────── */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ═══════════════════════════════════════════════════════════
   TOKENS
   ═══════════════════════════════════════════════════════════ */
:root {
  /* Layout */
  --hero-h:    420px;
  --header-h:   68px;
  --col: clamp(20px, 5vw, 64px);

  /* Paleta escura */
  --bg-deep:   #0a0010;
  --bg-hero:   linear-gradient(135deg, #2d0060 0%, #0a0010 100%);
  --text:      #fff;
  --surface:   rgba(255,255,255,0.13);
  --border:    rgba(255,255,255,0.14);
  --border-hi: rgba(255,255,255,0.36);
  --blur:        blur(20px) saturate(180%);
  --blur-strong: blur(28px) saturate(220%);

  /* Paleta clara */
  --bg-light:     #fff;
  --text-dark:    #101010;
  --text-mid:     #444;
  --text-muted:   #5c5c5c;
  --border-light: #e8e8e8;

  /* Marca */
  --accent: #7c3aed;

  /* Raios */
  --rad-xs:   7px;
  --rad:      12px;
  --rad-pill: 60px;
}

@media (min-width: 900px) {
  :root { --hero-h: 520px; --header-h: 72px; }
}

/* ═══════════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════════ */
html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  font-family: 'Eudoxus Sans', sans-serif;
  color: var(--text);
}
button, a { font-family: inherit; }
button { outline: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   LOADING SCREEN
   ═══════════════════════════════════════════════════════════ */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  transition: opacity .5s;
}
#loading-screen.out { opacity: 0; pointer-events: none; }

.loading-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: ldot 1.2s infinite ease-in-out;
  margin: 0 4px;
}
.loading-dot:nth-child(2) { animation-delay: .2s; }
.loading-dot:nth-child(3) { animation-delay: .4s; }
@keyframes ldot {
  0%,80%,100% { opacity:.2; transform:scale(.8); }
  40%         { opacity:1;  transform:scale(1);  }
}

/* ═══════════════════════════════════════════════════════════
   SCROLLER
   ═══════════════════════════════════════════════════════════ */
#scroller {
  height: 100dvh;
  overflow-y: auto;
  position: relative;
  scrollbar-width: none;
}
#scroller::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════════════════════════════════
   HEADER SHELL + HERO
   ═══════════════════════════════════════════════════════════ */
#header-shell {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  overflow: visible;
  pointer-events: none;
}

#hero {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--hero-h);
  overflow: hidden;
  transition: height 0.05s linear;
  background: var(--bg-hero);
}

/* Hero — grade escura (projeto / sobre) */
.hero-grid {
  position: absolute; inset: 0;
  background-color: #1c1c1c;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .4s;
}
.hero-grid span {
  color: rgba(255,255,255,0.14);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  user-select: none;
}

/* Hero — vinheta */
.hero-vignette::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.38) 0%, rgba(0,0,0,0) 45%,
    rgba(0,0,0,0) 55%, rgba(0,0,0,0.22) 100%);
  pointer-events: none;
}

/* ── Blobs — animações compositor-only (sem repaint) ── */
@keyframes d1 { to { transform: translate(38px,  28px) scale(1.06); } }
@keyframes d2 { to { transform: translate(-32px, 20px) scale(0.94); } }
@keyframes d3 { to { transform: translate(26px, -26px) scale(1.04); } }
@keyframes d4 { to { transform: translate(-20px,-18px) scale(1.07); } }
@keyframes d5 { to { transform: translate(16px,  36px) scale(0.96); } }

.blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
  animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
  animation-direction: alternate;
  animation-iteration-count: infinite;
  background: radial-gradient(circle, var(--blob-c) 0%, transparent 70%);
}

/* ═══════════════════════════════════════════════════════════
   NAV BAR
   ═══════════════════════════════════════════════════════════ */
#bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--col);
  background: transparent;
  transition: background 0.25s ease, backdrop-filter 0.25s ease, border-color 0.25s ease;
  pointer-events: auto;
  z-index: 10;
}
#bar.locked {
  background: rgba(8, 4, 20, 0.80);
  backdrop-filter: var(--blur-strong);
  -webkit-backdrop-filter: blur(28px) saturate(220%);
  border-top: 0.6px solid rgba(255,255,255,0.10);
}

#wordmark {
  color: #fff;
  font-weight: 700;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 1px 20px rgba(0,0,0,0.5);
  text-decoration: none;
}

#nav { display: flex; gap: 6px; align-items: center; }

/* ═══════════════════════════════════════════════════════════
   FEED
   ═══════════════════════════════════════════════════════════ */
#feed { background: var(--bg-light); }

#feed-grid,
#more-grid {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  #feed-grid,
  #more-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */
.card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  display: block;
  cursor: pointer;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s ease, transform .6s ease;
  text-decoration: none;
}
.card.visible { opacity: 1; transform: translateY(0); }
.card:hover .card-arrow { color: #fff; transform: translateX(4px); }
.card-arrow {
  transition: transform .25s ease, color .25s ease;
  color: rgba(255,255,255,0.5);
}

/* Cards sem aspect-ratio fixo na página Sobre */
#feed .card { aspect-ratio: unset; min-height: 380px; }
@media (min-width: 700px) { #feed .card { min-height: 420px; } }

/* ═══════════════════════════════════════════════════════════
   COMPONENTES COMPARTILHADOS
   ═══════════════════════════════════════════════════════════ */

/* Badge de categoria */
.badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 12px;
  border-radius: var(--rad-pill);
  border: 0.65px solid var(--text-muted);
  color: var(--text-muted);
  font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.55px; text-transform: uppercase;
  margin-bottom: 20px;
}

/* Pills — fundo sólido */
.pill-filled {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 13px;
  border-radius: var(--rad-pill);
  background: var(--text-dark); color: #fff;
  font-size: clamp(10px, 1.3vw, 12px); font-weight: 600;
  letter-spacing: -0.01em; text-decoration: none;
  transition: background .18s, transform .18s;
}
.pill-filled:hover { background: #2a2a2a; transform: translateY(-1px); }

/* Pills — só borda */
.pill-outline {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 13px;
  border-radius: var(--rad-pill);
  background: transparent;
  border: 0.9px solid var(--text-dark);
  color: var(--text-dark);
  font-size: clamp(10px, 1.3vw, 12px); font-weight: 600;
  letter-spacing: -0.01em; text-decoration: none;
  transition: background .18s, transform .18s;
}
.pill-outline:hover { background: rgba(0,0,0,0.05); transform: translateY(-1px); }

/* Pills de projeto (ligeiramente maiores) */
.pill-link {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border-radius: var(--rad-pill);
  background: var(--text-dark); color: #fff;
  font-size: clamp(10px, 1.3vw, 12px); font-weight: 600;
  letter-spacing: -0.01em; text-decoration: none;
  transition: background .2s, transform .18s;
}
.pill-link:hover { background: #2d2d2d; transform: translateY(-1px); }

/* Wrapper centrado */
.wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--col);
  text-align: center;
}

/* Divisória */
.divider { height: 1px; background: var(--border-light); }

/* Rótulo de seção */
.section-label {
  display: flex; align-items: center; justify-content: center;
  height: 48px; background: var(--bg-light);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.section-label span {
  font-size: clamp(12px, 1.5vw, 14px); font-weight: 500;
  color: var(--text-muted); letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════════
   PÁGINA SOBRE
   ═══════════════════════════════════════════════════════════ */
#intro {
  background: var(--bg-light);
  padding: clamp(40px, 7vw, 68px) var(--col) clamp(36px, 6vw, 56px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
#intro h1 {
  font-size: clamp(32px, 7.5vw, 52px); font-weight: 700;
  letter-spacing: -0.035em; line-height: 0.94;
  margin-bottom: 22px; color: var(--text-dark);
}
#bio { max-width: 520px; }
#bio p {
  font-size: clamp(12px, 1.6vw, 14px); line-height: 1.65;
  color: #333; letter-spacing: -0.01em; margin-bottom: 12px;
}
#bio p.note {
  color: #9a9a9a; font-size: clamp(10px, 1.3vw, 12px); margin-bottom: 0;
}
#social {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-top: 28px;
}

/* Rodapé informativo — Sobre, Projeto, Legal */
#page-footer {
  background: #fff;
  border-top: 1px solid #e5e5e5;
  padding: 32px var(--col) 28px;
}
#page-footer-inner {
  max-width: 760px;
  margin: 0 auto;
}
#page-footer-body {
  font-size: 13px;
  color: #555;
  line-height: 1.7;
  letter-spacing: -0.01em;
}
#page-footer-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#page-footer-body strong { font-weight: 700; color: #222; }
#page-footer-body em     { font-style: italic; }

/* ═══════════════════════════════════════════════════════════
   PÁGINAS DE PROJETO
   ═══════════════════════════════════════════════════════════ */
.project-intro { padding: 44px 0 48px; background: var(--bg-light); }
.project-intro h1 {
  font-size: clamp(34px, 7.5vw, 56px); font-weight: 700;
  letter-spacing: -0.03em; line-height: 0.92;
  margin-bottom: 20px; color: var(--text-dark);
}
.project-intro p {
  font-size: clamp(12px, 1.6vw, 14px); line-height: 1.65;
  color: var(--text-mid); letter-spacing: -0.01em;
}

/* ── Sistema de blocos de projeto ── */
#assets {
  display: flex; flex-direction: column;
  gap: 2px; padding: 2px 0;
  background: var(--border-light);
}

/* Linha de blocos */
.block-row { display: flex; gap: 2px; }

/* Bloco base */
.block {
  position: relative; overflow: hidden;
  flex-shrink: 0; flex-grow: 0;
}
.block-full  { flex-basis: 100%; }
.block-half  { flex-basis: calc(50% - 1px); }
.block-third { flex-basis: calc(33.333% - 1.334px); }

/* Responsive height via CSS vars (set inline) */
.block-img, .block-color, .block-video {
  height: var(--h-mob, 240px);
}
@media (min-width: 640px) {
  .block-img, .block-color, .block-video {
    height: var(--h-desk, 360px);
  }
}

/* Visibility toggles */
@media (max-width: 639px) { .block-hide-mob  { display: none !important; } }
@media (min-width: 640px) { .block-hide-desk { display: none !important; } }

/* Bloco de imagem */
.block-img { background: #eaeaea; }
.block-img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.block-img .block-ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.block-img .block-ph svg  { opacity: 0.18; }
.block-img .block-ph span {
  color: rgba(0,0,0,0.22); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}

/* Bloco de cor — background definido inline via style= */

/* Bloco de texto */
.block-text {
  background: var(--bg-light);
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(18px, 4vw, 36px);
  border-left: 1.5px solid var(--border-light);
}
.block-text:first-child { border-left: none; }
.block-text .bt-main {
  font-size: clamp(11px, 1.55vw, 14px);
  line-height: 1.45; letter-spacing: -0.025em;
  color: var(--text-dark);
}
.block-text .bt-main b { font-weight: 700; }
.block-text .bt-sub {
  font-size: clamp(8.5px, 0.95vw, 11px);
  color: var(--text-muted); line-height: 1.4;
  margin-top: 10px; letter-spacing: -0.015em;
}

/* Bloco de vídeo */
.block-video { background: #111; }

/* Bloco de citação */
.block-quote {
  display: flex; flex-direction: column; justify-content: center;
  align-items: center; padding: clamp(24px, 5vw, 48px);
  min-height: 160px;
}
.bq-text {
  font-size: clamp(15px, 2.2vw, 22px); font-weight: 600;
  letter-spacing: -0.025em; line-height: 1.4;
  color: var(--text-dark); font-style: italic;
  max-width: 680px;
}
.bq-author {
  display: block; margin-top: 14px;
  font-size: clamp(10px, 1.2vw, 13px); font-weight: 500;
  color: var(--text-muted); font-style: normal; letter-spacing: -0.01em;
}

/* Última linha tem divider embaixo */
.block-row:last-child { border-bottom: 1.5px solid var(--border-light); }

/* ── Responsividade dos blocos ── */
@media (max-width: 640px) {
  /* Empilha blocos half/third em coluna no mobile */
  .block-row { flex-direction: column; }
  .block-half,
  .block-third { flex-basis: 100%; }

  /* Remove borda lateral no texto quando empilhado */
  .block-text { border-left: none; border-top: 1.5px solid var(--border-light); }
  .block-text:first-child { border-top: none; }

  /* Fonte fixa em mobile — vw deixaria muito pequeno dentro de half/third */
  .block-text .bt-main { font-size: 13px; }
  .block-text .bt-sub  { font-size: 11px; }

  /* Altura mínima de segurança para blocos sem --h-mob definido */
  .block-img,
  .block-color,
  .block-video { min-height: 160px; }
}

/* Ficha técnica */
#ficha { padding: 44px 0; background: var(--bg-light); }
#ficha h2 {
  font-size: clamp(20px, 3.2vw, 30px); font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 20px; color: var(--text-dark);
}
#ficha-credits {
  font-size: clamp(11.5px, 1.5vw, 13.5px); line-height: 1.75;
  color: #333; letter-spacing: -0.01em; margin-bottom: 28px;
}
#ficha-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* Discover */
#discover {
  display: flex; align-items: center; justify-content: center;
  height: 48px; background: var(--bg-light);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
#discover span { font-size: 13px; font-weight: 500; color: var(--text-muted); letter-spacing: -0.02em; }

/* ═══════════════════════════════════════════════════════════
   RODAPÉ (todas as páginas)
   ═══════════════════════════════════════════════════════════ */
#footer {
  position: relative;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  padding: 32px var(--col) 28px;
  z-index: 10;
}
#footer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#footer-body {
  font-size: 13px;
  color: #555;
  line-height: 1.7;
  letter-spacing: -0.01em;
}
#footer-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#footer-body strong { font-weight: 700; color: #222; }
#footer-body em     { font-style: italic; }
/* ═══════════════════════════════════════════════════════════
   NOT FOUND (projeto / legal)
   ═══════════════════════════════════════════════════════════ */
#not-found {
  background: var(--bg-light);
  padding: 80px clamp(24px, 6vw, 64px);
  text-align: center;
}
#not-found h2 {
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 12px;
  color: var(--text-dark);
}
#not-found p  { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
#not-found a  {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--text-dark); color: #fff;
  padding: 10px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE (home sem projetos)
   ═══════════════════════════════════════════════════════════ */
#empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 42px 28px 56px;
  background: #fff; text-align: center;
}
.es-pill {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.16px solid #5c5c5c; border-radius: 100px;
  padding: 5px 10px; color: #5c5c5c;
  font-size: clamp(9px, 1.1vw, 11px); font-weight: 500;
  letter-spacing: -0.03em; margin-bottom: 20px;
}
.es-title {
  font-size: clamp(26px, 7vw, 34px); font-weight: 700;
  color: #000; letter-spacing: -0.03em; line-height: 0.9; margin-bottom: 18px;
}
.es-subtitle {
  font-size: clamp(11px, 1.3vw, 13px); font-weight: 400;
  color: #000; letter-spacing: -0.03em; line-height: 1.2;
  max-width: 340px; margin-bottom: 28px;
}
.es-bubble {
  background: rgba(217,217,217,0.20); border-radius: 14px;
  padding: 18px 20px 18px 22px;
  max-width: 360px; width: 100%; text-align: left; position: relative;
}
.es-bubble-label {
  font-size: 10.8px; font-weight: 400; color: #353535;
  letter-spacing: -0.03em; margin-bottom: 14px; display: block;
}
.es-bubble a {
  display: block; font-size: 10.8px; font-weight: 700; color: #353535;
  text-decoration: underline; letter-spacing: -0.03em; line-height: 1; margin-bottom: 10px;
}
.es-meta {
  font-size: 10.8px; font-weight: 400; color: #353535;
  letter-spacing: -0.03em; line-height: 1; margin-bottom: 8px;
}
.es-meta b { font-weight: 700; text-decoration: underline; }
.es-meta-plain b { font-weight: 700; text-decoration: none; }
.es-year-pill {
  position: absolute; bottom: 16px; right: 16px;
  border: 0.58px solid #353535; border-radius: 26px;
  padding: 3px 8px; font-size: 6.8px; font-weight: 700; color: #353535;
}