/* ==========================================================================
   Pequenas casas na internet — João Azevedo
   ========================================================================== */

@property --bg     { syntax: '<color>'; inherits: true; initial-value: #ECE7DF; }
@property --ink    { syntax: '<color>'; inherits: true; initial-value: #161514; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #D2491C; }

:root {
  --paper: #ECE7DF;
  --paper-ink: #161514;
  --paper-accent: #C9431A;

  --bg: var(--paper);
  --ink: var(--paper-ink);
  --accent: var(--paper-accent);
  --muted: color-mix(in oklab, var(--ink) 62%, var(--bg));
  --line: color-mix(in oklab, var(--ink) 16%, transparent);
  --soft: color-mix(in oklab, var(--ink) 6%, transparent);

  --f-display: 'Instrument Serif', 'Times New Roman', serif;
  --f-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', monospace;

  --gutter: clamp(16px, 4vw, 64px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);

  transition: --bg 0.9s var(--ease-io), --ink 0.9s var(--ease-io), --accent 0.9s var(--ease-io);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121110;
    --paper-ink: #ECE7DF;
    --paper-accent: #F0703F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #121110;
  --paper-ink: #ECE7DF;
  --paper-accent: #F0703F;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Grão de papel */
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  z-index: 100;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) { body::after { mix-blend-mode: screen; opacity: .05; } }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* --------------------------------------------------------------------------
   Peças comuns
   -------------------------------------------------------------------------- */
.label {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 28px;
}
.label::before { content: ''; width: 28px; height: 1px; background: currentColor; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 22px;
  border-radius: 999px;
  font-size: 15px; font-weight: 500;
  text-decoration: none;
  transition: transform .4s var(--ease), background-color .3s, color .3s, border-color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--line { border: 1px solid var(--line); }
.btn--line:hover { border-color: var(--ink); }

.link {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .5s var(--ease);
  padding-bottom: 2px;
}
.link:hover { background-size: 0 1px; background-position: 100% 100%; }

.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Cabeçalho
   -------------------------------------------------------------------------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px var(--gutter);
  font-size: 14px;
  transition: transform .5s var(--ease), background-color .4s;
}
.top.is-hidden { transform: translateY(-100%); }
.top.is-solid {
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; letter-spacing: -.01em; justify-self: start; }
.brand__mark { width: 22px; height: 22px; fill: var(--ink); transition: transform .6s var(--ease); }
.brand:hover .brand__mark { transform: rotate(-12deg) scale(1.08); }
.top__nav { display: flex; gap: 6px; }
.top__nav a {
  text-decoration: none; padding: 8px 14px; border-radius: 999px;
  transition: background-color .3s;
}
.top__nav a:hover { background: var(--soft); }
.top__clock {
  justify-self: end; margin: 0;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px; color: var(--muted);
}
.top__clock time { color: var(--ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --------------------------------------------------------------------------
   Abertura
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: 100px var(--gutter) 84px;
  overflow: hidden;
  --mx: 0; --my: 0;
}
.hero__copy { position: relative; z-index: 2; text-align: center; max-width: min(820px, 54vw); }
.kicker {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 28px;
}
.kicker__rule { width: 36px; height: 1px; background: currentColor; }
.hero__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(64px, min(11vw, 17.5svh), 188px);
  line-height: .86;
  letter-spacing: -.035em;
  margin: 0;
}
.hero__title .line { display: block; overflow: hidden; padding: 0 .06em .06em; }
.hero__title .line > span { display: inline-block; }
.js .hero__title .line > span { transform: translateY(110%); animation: rise 1.25s var(--ease) forwards; }
.hero__title .line:nth-child(2) > span { animation-delay: .1s; }
.hero__title .line:nth-child(3) > span { animation-delay: .2s; }
.hero__title em { color: var(--accent); padding-right: .04em; }
@keyframes rise { to { transform: none; } }

.hero__lede {
  max-width: 540px; margin: 34px auto 0;
  font-size: clamp(16px, 1.25vw, 18px); color: var(--muted); text-wrap: pretty;
}
.hero__actions { display: flex; gap: 12px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.hero__scroll span { width: 1px; height: 38px; background: linear-gradient(var(--ink), transparent); transform-origin: top; animation: drip 2.2s var(--ease-io) infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* Provas espalhadas */
.hero__prints { position: absolute; inset: 0; z-index: 1; }
.print {
  position: absolute; left: var(--x); top: var(--y); width: var(--w);
  transform: translate3d(calc(var(--mx) * var(--d) * -38px), calc(var(--my) * var(--d) * -30px), 0);
  transition: transform .9s var(--ease);
  text-decoration: none;
}
.print__card {
  display: block;
  background: #fff;
  border-radius: 10px;
  padding: 0 0 0;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 12px 28px -8px rgba(0,0,0,.22), 0 40px 80px -30px rgba(0,0,0,.3);
  transform: rotate(var(--r));
  transition: transform .7s var(--ease), box-shadow .7s var(--ease);
}
.js .print__card { opacity: 0; animation: drop 1.4s var(--ease) forwards; animation-delay: calc(.35s + var(--i) * .09s); }
@keyframes drop {
  from { opacity: 0; transform: translateY(70px) rotate(calc(var(--r) * 3)) scale(.86); }
  to   { opacity: 1; transform: rotate(var(--r)); }
}
.print:hover { z-index: 5; }
.print:hover .print__card { transform: rotate(0deg) scale(1.06); box-shadow: 0 2px 2px rgba(0,0,0,.06), 0 30px 60px -12px rgba(0,0,0,.35); }
.print__bar {
  display: flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px; background: #F3F1EE; border-bottom: 1px solid #E4E0DA;
}
.print__bar i { width: 6px; height: 6px; border-radius: 50%; background: #D4CFC7; }
.print__bar b { margin-left: 8px; font: 500 9px/1 var(--f-mono); color: #8B857C; letter-spacing: .04em; }
.print img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }

/* --------------------------------------------------------------------------
   Fita
   -------------------------------------------------------------------------- */
.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden;
  padding: 22px 0;
  white-space: nowrap;
}
.marquee__track { display: inline-flex; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: inline-flex; align-items: center; }
.marquee a {
  font-family: var(--f-display); font-size: clamp(30px, 4vw, 56px); line-height: 1;
  text-decoration: none; padding: 0 .5em; transition: color .3s, font-style .3s;
}
.marquee a:hover { color: var(--accent); font-style: italic; }
.marquee .star { color: var(--accent); font-size: 22px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* --------------------------------------------------------------------------
   Introdução à exposição
   -------------------------------------------------------------------------- */
.intro {
  padding: clamp(100px, 16vw, 220px) var(--gutter) clamp(60px, 8vw, 120px);
  display: grid; grid-template-columns: 1fr; max-width: 1500px; margin: 0 auto;
}
.intro__title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(56px, 9vw, 150px); line-height: .9; letter-spacing: -.03em; margin: 0;
}
.intro__title em { color: var(--accent); }
.intro__text {
  margin-top: 44px; max-width: 520px; justify-self: end; color: var(--muted); font-size: 17px;
}
.intro__text p { margin: 0 0 16px; text-wrap: pretty; }
.intro__hint { font-size: 14px; }
kbd {
  font-family: var(--f-mono); font-size: 12px; padding: 3px 8px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--ink);
}

/* --------------------------------------------------------------------------
   Salas (projetos)
   -------------------------------------------------------------------------- */
.exhibit { position: relative; height: 240vh; }
.exhibit__sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid;
  grid-template-columns: minmax(300px, 4fr) 7fr;
  gap: clamp(32px, 5vw, 96px);
  align-items: center;
  padding: 84px var(--gutter) 48px;
  max-width: 1680px; margin: 0 auto;
  overflow: hidden;
}
.exhibit__bignum {
  position: absolute; left: calc(var(--gutter) - .06em); bottom: -.2em;
  font-family: var(--f-display); font-size: clamp(200px, 34vw, 560px); line-height: .8;
  color: var(--ink); opacity: .05; pointer-events: none; letter-spacing: -.05em;
  user-select: none;
}
.exhibit__info { position: relative; z-index: 2; }
.exhibit__num {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  display: flex; gap: 14px; align-items: center; color: var(--muted); margin: 0 0 22px;
}
.exhibit__num b { color: var(--accent); font-weight: 500; }
.exhibit__title {
  font-size: clamp(46px, 5.4vw, 92px); line-height: .95; margin: 0 0 22px;
  font-weight: 400;
  text-wrap: balance;
}
.exhibit__title em { color: var(--accent); }
.exhibit__title strong { font-weight: 800; }
.exhibit__kind { font-family: var(--f-display); font-style: italic; font-size: 22px; margin: 0 0 14px; color: var(--muted); }
.exhibit__desc { font-size: 16.5px; color: color-mix(in oklab, var(--ink) 80%, var(--bg)); max-width: 470px; margin: 0 0 26px; text-wrap: pretty; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 28px; }
.chips li {
  font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
}
.exhibit__meta { display: grid; grid-template-columns: auto 1fr; gap: 10px 22px; align-items: center; margin: 0 0 32px; font-size: 13.5px; }
.exhibit__meta dt { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.exhibit__meta dd { margin: 0; }
.swatches { display: flex; }
.swatches span {
  width: 22px; height: 22px; border-radius: 50%; margin-right: -6px;
  box-shadow: 0 0 0 2px var(--bg);
  transition: margin .4s var(--ease);
}
.exhibit__meta:hover .swatches span { margin-right: 4px; }
.exhibit__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Moldura de browser */
.exhibit__stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-end; }
.browser {
  position: relative;
  width: min(100%, calc((100svh - 230px) * 1.6));
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--ink) 10%, transparent),
    0 30px 60px -20px rgba(0,0,0,.35),
    0 70px 120px -40px rgba(0,0,0,.35);
  cursor: pointer;
  transition: transform .8s var(--ease);
}
.browser:hover { transform: translateY(-4px); }
.browser__bar {
  height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 14px;
  background: #F4F2EF; border-bottom: 1px solid #E5E1DB;
}
.browser__bar i { width: 11px; height: 11px; border-radius: 50%; background: #DDD8D0; }
.browser__bar i:nth-child(1) { background: #EE6A5F; }
.browser__bar i:nth-child(2) { background: #F5BD4F; }
.browser__bar i:nth-child(3) { background: #61C454; }
.browser__url {
  margin: 0 auto; transform: translateX(-24px);
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 14px; border-radius: 7px; background: #fff;
  font: 500 12px/1 var(--f-mono); color: #6F6A63; letter-spacing: .02em;
  min-width: 40%; justify-content: center;
}
.browser__url svg { width: 10px; height: 10px; fill: #A39E96; }
.browser__viewport { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #fff; }
.browser__viewport img { width: 100%; will-change: transform; }

.phone {
  position: absolute; left: -2%; bottom: 4%;
  width: clamp(110px, 10.5vw, 188px);
  aspect-ratio: 390 / 844;
  border-radius: 22px;
  padding: 6px;
  background: #111;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 30px 60px -16px rgba(0,0,0,.5);
  margin: 0;
  z-index: 2;
  transform: rotate(-4deg);
  transition: transform .8s var(--ease);
}
.exhibit__stage:hover .phone { transform: rotate(0deg) translateY(-8px); }
.phone__screen { width: 100%; height: 100%; border-radius: 17px; overflow: hidden; background: #fff; position: relative; }
.phone__screen::before {
  content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 30%; height: 12px; background: #111; border-radius: 999px; z-index: 2;
}
.phone__screen img { width: 100%; will-change: transform; }

.exhibit__progress {
  display: flex; align-items: center; gap: 14px; margin-top: 20px;
  width: min(100%, calc((100svh - 230px) * 1.6));
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; color: var(--muted);
}
.exhibit__progress .bar { flex: 1; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.exhibit__progress .bar i { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* Entrada das salas */
.js .exhibit .exhibit__info > *,
.js .exhibit .exhibit__stage { opacity: 0; transform: translateY(30px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.js .exhibit.is-in .exhibit__info > *,
.js .exhibit.is-in .exhibit__stage { opacity: 1; transform: none; }
.js .exhibit.is-in .exhibit__info > :nth-child(2) { transition-delay: .06s; }
.js .exhibit.is-in .exhibit__info > :nth-child(3) { transition-delay: .12s; }
.js .exhibit.is-in .exhibit__info > :nth-child(4) { transition-delay: .18s; }
.js .exhibit.is-in .exhibit__info > :nth-child(5) { transition-delay: .24s; }
.js .exhibit.is-in .exhibit__info > :nth-child(n+6) { transition-delay: .3s; }
.js .exhibit.is-in .exhibit__stage { transition-delay: .15s; }

/* --------------------------------------------------------------------------
   Índice
   -------------------------------------------------------------------------- */
.index { position: relative; padding: clamp(110px, 14vw, 200px) var(--gutter) clamp(80px, 10vw, 140px); max-width: 1680px; margin: 0 auto; }
.index__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; margin-bottom: 56px; }
.index__head .label { margin: 0; }
.index__title { font-family: var(--f-display); font-weight: 400; font-size: clamp(52px, 7vw, 116px); line-height: .9; letter-spacing: -.03em; margin: 0; text-align: right; }
.index__title em { color: var(--accent); }

.index__table { border-bottom: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.2fr) 230px;
  align-items: center; gap: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  cursor: pointer;
  transition: opacity .4s var(--ease);
  position: relative;
}
.index__table:hover .row:not(:hover) { opacity: .32; }
.row__num { font-family: var(--f-mono); font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.row__name {
  font-family: var(--f-display); font-size: clamp(32px, 3.6vw, 56px); line-height: 1; letter-spacing: -.02em;
  transition: transform .6s var(--ease), color .3s;
  display: flex; align-items: center;
}
.row__name::before {
  content: ''; width: 0; height: 2px; background: var(--accent); transition: width .6s var(--ease), margin .6s var(--ease);
}
.row:hover .row__name, .row:focus-visible .row__name { color: var(--accent); font-style: italic; }
.row:hover .row__name::before, .row:focus-visible .row__name::before { width: 34px; margin-right: 14px; }
.row__cat, .row__fonts { font-size: 14px; color: var(--muted); }
.row__fonts { font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em; }
.row__domain {
  justify-self: end;
  font-family: var(--f-mono); font-size: 13px; text-decoration: none;
  display: inline-flex; gap: 8px; align-items: center;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  transition: background-color .3s, color .3s, border-color .3s;
}
.row__domain:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.index__preview {
  position: fixed; left: 0; top: 0; z-index: 40;
  width: 380px; aspect-ratio: 16 / 10;
  border-radius: 10px; overflow: hidden;
  pointer-events: none;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.45);
  opacity: 0; transform: translate3d(-50%, -50%, 0) scale(.6);
  transition: opacity .35s var(--ease), scale .5s var(--ease);
}
.index__preview.is-on { opacity: 1; }
.index__preview img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* --------------------------------------------------------------------------
   Colofão
   -------------------------------------------------------------------------- */
.colophon { position: relative; padding: clamp(110px, 14vw, 200px) var(--gutter) 40px; max-width: 1680px; margin: 0 auto; overflow: hidden; }
.colophon__big { font-family: var(--f-display); font-size: clamp(56px, 9vw, 160px); line-height: .9; letter-spacing: -.03em; margin: 0 0 80px; }
.colophon__big em { color: var(--accent); }
.colophon__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; padding-bottom: 80px; border-bottom: 1px solid var(--line); }
.colophon h3 { font-family: var(--f-mono); font-weight: 400; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.colophon__grid p { margin: 0; max-width: 380px; text-wrap: pretty; }
.colophon__base { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px 0; font-size: 13px; color: var(--muted); }
.colophon__base a { color: var(--ink); }
.colophon__wordmark {
  margin: 0; font-family: var(--f-display); font-style: italic;
  font-size: 15.4vw; line-height: .8; letter-spacing: -.045em; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px var(--line);
  transform: translateY(12%);
  user-select: none;
}

/* --------------------------------------------------------------------------
   Navegação lateral
   -------------------------------------------------------------------------- */
.rail {
  position: fixed; right: 22px; top: 50%; z-index: 45;
  transform: translate(20px, -50%); opacity: 0; pointer-events: none;
  display: flex; flex-direction: column; gap: 4px;
  transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.rail.is-on { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
.rail a {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  text-decoration: none; padding: 5px 0;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em;
}
.rail a span { opacity: 0; transform: translateX(6px); transition: opacity .3s, transform .4s var(--ease); white-space: nowrap; }
.rail a i { width: 14px; height: 1px; background: var(--ink); opacity: .35; transition: width .4s var(--ease), opacity .3s; }
.rail:hover a span { opacity: 1; transform: none; }
.rail:hover { background: color-mix(in oklab, var(--bg) 88%, transparent); border-radius: 12px; padding: 8px 0 8px 14px; margin-right: -2px; }
.rail a.is-active i { width: 34px; opacity: 1; background: var(--accent); }
.rail:hover a:not(.is-active) span { opacity: .55; }

/* --------------------------------------------------------------------------
   Vista de detalhe
   -------------------------------------------------------------------------- */
.case {
  --c-bg: var(--bg); --c-ink: var(--ink); --c-accent: var(--accent);
  width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  margin: 0; padding: 0; border: 0;
  background: var(--c-bg); color: var(--c-ink);
  overflow: hidden;
}
.case::backdrop { background: rgba(0,0,0,.35); }
.case[open] { animation: case-in .8s var(--ease) both; }
.case.is-closing { animation: case-out .45s var(--ease-io) both; }
@keyframes case-in { from { clip-path: inset(100% 0 0 0 round 24px); } to { clip-path: inset(0 0 0 0 round 0); } }
@keyframes case-out { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 100% 0 round 24px); } }

.case__inner { height: 100%; display: grid; grid-template-rows: auto 1fr; }
.case__bar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px var(--gutter);
  border-bottom: 1px solid color-mix(in oklab, var(--c-ink) 14%, transparent);
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
}
.case__bar .grow { flex: 1; }
.case__bar b { color: var(--c-accent); font-weight: 500; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1px solid color-mix(in oklab, var(--c-ink) 20%, transparent);
  transition: background-color .3s, color .3s, transform .4s var(--ease);
}
.iconbtn:hover { background: var(--c-ink); color: var(--c-bg); }
.iconbtn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.case__body { display: grid; grid-template-columns: minmax(320px, 5fr) 8fr; min-height: 0; }
.case__info { overflow: auto; padding: 48px var(--gutter) 60px; border-right: 1px solid color-mix(in oklab, var(--c-ink) 14%, transparent); }
.case__info h2:focus { outline: none; }
.case__info h2 { font-size: clamp(44px, 4.6vw, 80px); line-height: .95; margin: 0 0 14px; font-weight: 400; }
.case__info h2 em { color: var(--c-accent); }
.case__info h2 strong { font-weight: 800; }
.case__kind { font-family: var(--f-display); font-style: italic; font-size: 22px; opacity: .7; margin: 0 0 24px; }
.case__desc { font-size: 17px; margin: 0 0 30px; text-wrap: pretty; opacity: .88; }
.case h3 {
  font-family: var(--f-mono); font-weight: 400; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  opacity: .6; margin: 40px 0 14px;
}
.case .chips li { border-color: color-mix(in oklab, var(--c-ink) 20%, transparent); }
.specimen { border-top: 1px solid color-mix(in oklab, var(--c-ink) 14%, transparent); padding: 18px 0; display: grid; grid-template-columns: 86px 1fr; gap: 18px; align-items: center; }
.specimen:last-child { border-bottom: 1px solid color-mix(in oklab, var(--c-ink) 14%, transparent); }
.specimen__aa { font-size: 58px; line-height: 1; }
.specimen__name { font-size: 15px; font-weight: 500; font-family: var(--f-sans); }
.specimen__role { font-family: var(--f-mono); font-size: 11px; opacity: .6; letter-spacing: .08em; text-transform: uppercase; margin-left: 8px; }
.specimen__sample { font-size: 17px; opacity: .8; margin-top: 4px; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.palette button {
  text-align: left; border-radius: 12px; overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--c-ink) 14%, transparent);
  transition: transform .4s var(--ease);
}
.palette button:hover { transform: translateY(-3px); }
.palette button span { display: block; height: 62px; }
.palette button small { display: block; padding: 8px 10px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; }
.case__visit { margin-top: 40px; display: flex; gap: 10px; flex-wrap: wrap; }
.case .btn--solid { background: var(--c-ink); color: var(--c-bg); }
.case .btn--line { border-color: color-mix(in oklab, var(--c-ink) 22%, transparent); }

.case__view { display: flex; flex-direction: column; min-height: 0; padding: 26px var(--gutter) 30px; gap: 18px; }
.seg {
  align-self: center; display: inline-flex; padding: 4px; border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--c-ink) 18%, transparent);
}
.seg button { padding: 8px 18px; border-radius: 999px; font-size: 13.5px; transition: background-color .3s, color .3s; }
.seg button[aria-pressed="true"] { background: var(--c-ink); color: var(--c-bg); }
.case__screen { flex: 1; min-height: 0; display: flex; justify-content: center; }
.case .browser { width: 100%; max-width: 1100px; height: 100%; display: flex; flex-direction: column; cursor: default; }
.case .browser:hover { transform: none; }
.case .browser__viewport { aspect-ratio: auto; flex: 1; overflow: auto; overscroll-behavior: contain; }
.case .phone { position: relative; left: auto; bottom: auto; transform: none; height: 100%; width: auto; max-height: 760px; }
.case .phone__screen { overflow: auto; overscroll-behavior: contain; }
.case .phone__screen img { height: auto; }
.case__tip { text-align: center; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .55; margin: 0; }

/* --------------------------------------------------------------------------
   Cursor e avisos
   -------------------------------------------------------------------------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: grid; place-items: center;
    position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none;
    width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
    background: #fff; mix-blend-mode: difference;
    transition: width .45s var(--ease), height .45s var(--ease), margin .45s var(--ease), background-color .3s, opacity .3s;
  }
  .cursor__label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: 0; transition: opacity .2s; white-space: nowrap; }
  .cursor.is-big {
    width: 92px; height: 92px; margin: -46px 0 0 -46px;
    background: var(--accent); mix-blend-mode: normal; color: var(--bg);
  }
  .cursor.is-big .cursor__label { opacity: 1; transition-delay: .1s; }
  .cursor.is-hidden { opacity: 0; }
}

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 500;
  transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px;
  transition: opacity .3s, transform .5s var(--ease);
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
dialog .toast { z-index: 500; }

/* --------------------------------------------------------------------------
   Responsivo
   -------------------------------------------------------------------------- */
@media (min-width: 1101px) {
  .exhibit__sticky { padding-right: calc(var(--gutter) + 44px); }
}
@media (max-width: 1100px) {
  .rail { display: none; }
  .row { grid-template-columns: 52px minmax(0, 1.6fr) minmax(0, 1fr) 220px; }
  .row__fonts { display: none; }
}

@media (max-width: 900px) {
  .top { grid-template-columns: 1fr auto; }
  .top__nav { display: none; }

  .hero { display: flex; flex-direction: column; justify-content: flex-start; padding-top: 112px; padding-bottom: 60px; }
  .hero__copy { order: 1; max-width: 640px; }
  .hero__prints { order: 2; position: relative; inset: auto; width: 100%; height: 62vw; max-height: 380px; margin-top: 48px; }
  .print { left: 50%; top: 8%; width: 52vw; max-width: 330px; transform: translateX(calc(-50% + var(--mo) * 1%)); }
  .print__card { transform: rotate(var(--mr)); }
  .print:nth-child(n+6) { display: none; }
  @keyframes drop {
    from { opacity: 0; transform: translateY(60px) rotate(0deg) scale(.9); }
    to   { opacity: 1; transform: rotate(var(--mr)); }
  }
  .hero__scroll { display: none; }

  .intro__text { justify-self: start; }

  .exhibit { height: auto; padding: 40px 0 90px; }
  .exhibit__sticky { position: relative; height: auto; grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 0; overflow: visible; }
  .exhibit__bignum { top: -.1em; bottom: auto; right: var(--gutter); left: auto; font-size: 46vw; }
  .exhibit__stage { align-items: stretch; padding: 0 0 0 4vw; }
  .browser, .exhibit__progress { width: 100%; }
  .phone { left: -4vw; bottom: -8%; width: 25vw; }
  .exhibit__progress { padding-left: 22vw; }

  .row { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 20px 0; gap: 12px; }
  .row__cat { display: none; }
  .row__domain { padding: 7px 11px; font-size: 12px; }
  .index__title { text-align: left; }
  .index__preview { display: none; }

  .colophon__grid { grid-template-columns: 1fr; gap: 34px; }

  .case__body { grid-template-columns: 1fr; overflow: auto; }
  .case__info { overflow: visible; border-right: 0; padding-top: 32px; padding-bottom: 20px; }
  .case__view { min-height: 82svh; padding-bottom: 40px; }
  .case__screen { height: 72svh; flex: none; }
}

@media (max-width: 560px) {
  .top__clock { font-size: 11px; }
  .hero__title { font-size: clamp(58px, 18.5vw, 120px); }
  .btn { height: 46px; padding: 0 18px; font-size: 14px; }
  .row__domain span.d { display: none; }
  .row__name { font-size: 30px; }
  .case__bar .case__count { display: none; }
  .browser__bar { height: 30px; padding: 0 10px; gap: 5px; }
  .browser__bar i { width: 8px; height: 8px; }
  .browser__url { font-size: 10px; height: 20px; transform: translateX(-14px); }
  .exhibit__meta { grid-template-columns: 1fr; gap: 6px; }
  .exhibit__meta dd + dt { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .marquee__track { animation: none; }
}
