/* ---------- Tokens ---------- */
:root {
  --bg: #faf9f6;
  --ink: #1c1c1a;
  --ink-strong: #000;
  --lead: #3c3b37;
  --muted: #6b6b65;
  --faint: #75736c;
  --line: rgba(0, 0, 0, .09);
  --btn-border: rgba(0, 0, 0, .2);
  --btn-border-hover: #1c1c1a;
  --hover-bg: #f2f0e9;
  --rule: #1c1c1a;
  --eyebrow: #6b6b65;
  --tag-bg: #ebecee;
  --tag-ink: #5e6268;
  --primary-bg: #1c1c1a;
  --primary-ink: #faf9f6;
  --primary-hover: #000;
  --outer: #e9e7e0;

  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --gutter: 56px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131312;
    --ink: #f2f1ec;
    --ink-strong: #fff;
    --lead: #dcdad2;
    --muted: #a8a69e;
    --faint: #8f8d85;
    --line: rgba(242, 241, 236, .1);
    --btn-border: rgba(242, 241, 236, .22);
    --btn-border-hover: #c9ccd2;
    --hover-bg: #1c1c1a;
    --rule: #c9ccd2;
    --eyebrow: #c9ccd2;
    --tag-bg: #2b2d31;
    --tag-ink: #c9ccd2;
    --primary-bg: #f2f1ec;
    --primary-ink: #131312;
    --primary-hover: #fff;
    --outer: #0c0c0b;
  }
}

:root[data-theme="dark"] {
  --bg: #131312;
  --ink: #f2f1ec;
  --ink-strong: #fff;
  --lead: #dcdad2;
  --muted: #a8a69e;
  --faint: #8f8d85;
  --line: rgba(242, 241, 236, .1);
  --btn-border: rgba(242, 241, 236, .22);
  --btn-border-hover: #c9ccd2;
  --hover-bg: #1c1c1a;
  --rule: #c9ccd2;
  --eyebrow: #c9ccd2;
  --tag-bg: #2b2d31;
  --tag-ink: #c9ccd2;
  --primary-bg: #f2f1ec;
  --primary-ink: #131312;
  --primary-hover: #fff;
  --outer: #0c0c0b;
}

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

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

body {
  margin: 0;
  background: var(--outer);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.page {
  max-width: 1440px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

@media (min-width: 1441px) {
  .page { border-inline: 1px solid var(--line); }
}

/* ---------- Topo ---------- */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px var(--gutter);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3em;
}

.nav {
  display: flex;
  gap: 34px;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
}

.nav a { color: var(--muted); transition: color .15s; }
.nav a:hover { color: var(--ink); }

.topbar-actions { display: flex; align-items: center; gap: 4px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -6px -6px -6px 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s;
}
.icon-btn:hover { color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* ícone do tema: mostra o sol no escuro, a lua no claro */
.i-sun { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block !important; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}
:root[data-theme="dark"] .i-sun { display: block !important; }
:root[data-theme="dark"] .i-moon { display: none; }

.menu-btn { display: none; }
.menu-btn .i-close { display: none; }
.menu-btn[aria-expanded="true"] .i-menu { display: none; }
.menu-btn[aria-expanded="true"] .i-close { display: block; }

/* ---------- Grade principal ---------- */
.grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "hero photo"
    "hero index";
}

.hero {
  grid-area: hero;
  padding: 64px var(--gutter) 56px;
  border-right: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--eyebrow);
}

h1 {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 6.2vw, 88px);
  line-height: .94;
  letter-spacing: -.025em;
}

.rule { width: 64px; height: 1px; background: var(--rule); margin: 34px 0 0; }

.lead {
  margin: 30px 0 0;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -.005em;
  color: var(--lead);
  max-width: 30ch;
  text-wrap: pretty;
}

.body {
  margin: 20px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 44ch;
  text-wrap: pretty;
}

.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 40px 0 0; }

.btn {
  display: inline-block;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 2px;
  text-align: center;
  transition: background-color .15s, border-color .15s, color .15s;
}

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

.btn-ghost { border: 1px solid var(--btn-border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--btn-border-hover); }

.meta-links {
  display: flex;
  gap: 26px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
}
.meta-links a { color: var(--muted); transition: color .15s; }
.meta-links a:hover { color: var(--ink); }
.meta-links--hero { margin: 46px 0 0; }
.meta-links--footer { display: none; }

/* ---------- Foto ---------- */
.photo {
  grid-area: photo;
  position: relative;
  margin: 0;
  height: 340px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--hover-bg);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 2%;
  display: block;
}

.photo-fallback {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  font-family: var(--serif);
  font-size: 96px;
  letter-spacing: -.02em;
  color: var(--faint);
}

.photo.is-missing img { display: none; }
.photo.is-missing .photo-fallback { display: grid; }

/* ---------- Índice ---------- */
.index { grid-area: index; }

.row {
  display: flex;
  align-items: baseline;
  gap: 22px;
  padding: 24px var(--gutter) 24px 40px;
  border-bottom: 1px solid var(--line);
  transition: background-color .15s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--hover-bg); }

.row-num {
  flex: none;
  width: 22px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.row-text { display: grid; gap: 4px; flex: 1; min-width: 0; }

.row-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.2;
}

.row-sub { font-size: 13px; color: var(--muted); }

.tag {
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  padding: 3px 8px;
  background: var(--tag-bg);
  color: var(--tag-ink);
}

.arrow {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--faint);
  transition: transform .2s, color .15s;
}
.row:hover .arrow { transform: translate(2px, -2px); color: var(--ink); }

/* ---------- Rodapé ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 22px var(--gutter);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--faint);
}

.contacts { display: flex; flex-wrap: wrap; font-style: normal; }
.contacts a { transition: color .15s; }
.contacts a:hover { color: var(--ink); }
.contacts a + a::before { content: " · "; white-space: pre; color: var(--faint); }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 40px; }
  .lead { font-size: 17px; }
  .row { padding-left: 32px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  :root { --gutter: 24px; }

  .topbar { padding: 18px var(--gutter); }
  .brand { font-size: 12px; }

  .menu-btn { display: grid; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10;
    flex-direction: column;
    gap: 0;
    margin: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    font-size: 11.5px;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s, transform .18s, visibility 0s .18s;
  }
  .nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity .18s, transform .18s;
  }
  .nav a { padding: 16px var(--gutter); border-top: 1px solid var(--line); }

  .grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    align-content: start;
    grid-template-areas:
      "photo"
      "hero"
      "index";
  }

  .photo { height: 300px; }
  .photo img { object-position: 50% 0%; }

  .hero {
    padding: 30px var(--gutter) 32px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .eyebrow { font-size: 10.5px; }
  h1 { margin-top: 16px; font-size: 52px; line-height: .95; }
  .rule { width: 52px; margin-top: 24px; }
  .lead { margin-top: 22px; font-size: 16px; max-width: none; }
  .body { margin-top: 14px; font-size: 14px; max-width: none; }

  .ctas { display: grid; gap: 10px; margin-top: 28px; }
  .btn { padding: 15px 20px; font-size: 14.5px; }

  .meta-links--hero { display: none; }
  .meta-links--footer { display: flex; font-size: 10.5px; }

  .row { gap: 16px; padding: 18px var(--gutter); }
  .row-num { width: 18px; }
  .row-text { gap: 3px; }
  .row-title { font-size: 17px; }
  .row-sub { font-size: 12.5px; }
  .tag { font-size: 10px; padding: 3px 7px; }
  .arrow { width: 17px; height: 17px; }

  .footer {
    display: grid;
    gap: 14px;
    padding: 26px var(--gutter) 28px;
    font-size: 10px;
    letter-spacing: .12em;
  }
  .contacts { display: grid; gap: 5px; }
  .contacts a + a::before { content: none; }
  .tagline { display: none; }
}

/* ---------- Movimento ---------- */

/* Entrada: o texto sobe de leve, em sequência; a lista vem logo depois. */
@keyframes sobe {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes aparece {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes risca {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.topbar { animation: aparece .6s ease-out both; }

.hero > * { animation: sobe .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero > :nth-child(1) { animation-delay: .10s; }
.hero > :nth-child(2) { animation-delay: .18s; }
.hero > :nth-child(3) { animation: risca .8s cubic-bezier(.2, .7, .2, 1) .35s both; transform-origin: left; }
.hero > :nth-child(4) { animation-delay: .32s; }
.hero > :nth-child(5) { animation-delay: .40s; }
.hero > :nth-child(6) { animation-delay: .48s; }
.hero > :nth-child(7) { animation-delay: .56s; }

.index .row { animation: sobe .6s cubic-bezier(.2, .7, .2, 1) both; }
.index .row:nth-child(1) { animation-delay: .40s; }
.index .row:nth-child(2) { animation-delay: .48s; }
.index .row:nth-child(3) { animation-delay: .56s; }
.index .row:nth-child(4) { animation-delay: .64s; }

.footer { animation: aparece .8s ease-out .7s both; }

/* Foto: surge devagar quando termina de carregar, sem "pipocar" linha a linha. */
.js .photo img {
  opacity: 0;
  transform: scale(1.03);
  transition: opacity .9s ease-out, transform 1.4s cubic-bezier(.2, .7, .2, 1);
}
.js .photo.is-loaded img { opacity: 1; transform: none; }

/* Troca de tema: cores mudam em fade (navegadores sem View Transitions). */
.theme-fading, .theme-fading *, .theme-fading *::before, .theme-fading *::after {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease !important;
}

/* Troca de tema com View Transitions: a página inteira faz crossfade. */
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: .4s;
  animation-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .photo img { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
