:root {
  --bg: #0e0d0b;
  --surface: #171512;
  --surface-2: #1f1c18;
  --line: #2c2823;
  --text: #efe9dd;
  --muted: #a8a093;
  --accent: #ff5a2a;
  --accent-ink: #1a0b05;
  --c-sites: #ff5a2a;
  --c-sistemas: #6fc2a6;
  --c-design: #e9c15c;
  --c-prompts: #b9a8ff;
  --display: "Bricolage Grotesque", "Inter Tight", sans-serif;
  --body: "Inter Tight", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: #3a352e var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--accent-ink); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #3a352e; border-radius: 10px; border: 2px solid var(--bg); }
a { color: inherit; text-underline-offset: .2em; }
img { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Topo */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  background: linear-gradient(var(--bg) 55%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; letter-spacing: -.01em; }
.dot { display: inline-block; width: .5em; height: .5em; border-radius: 50%; background: var(--accent); }
.top nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.top nav a, .back { color: var(--muted); text-decoration: none; font-weight: 500; transition: color .2s; }
.top nav a:hover, .back:hover { color: var(--text); }
.back { display: inline-flex; align-items: center; gap: 8px; }

/* Abertura */
.hero { padding: clamp(48px, 10vh, 120px) var(--gutter) clamp(56px, 10vh, 112px); }
.hero-name {
  margin: 0; font-family: var(--display); font-weight: 800;
  font-size: clamp(3.4rem, 14vw, 13rem); line-height: .86; letter-spacing: -.04em;
}
.hero-name .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-name .line > span { display: inline-block; }
.hero-name .dot { width: .14em; height: .14em; margin-left: .04em; vertical-align: baseline; }
.hero-copy {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px;
  margin-top: clamp(32px, 6vh, 64px); max-width: 1100px;
}
.hero-title { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.hero-bio { margin: 0; color: var(--muted); max-width: 46ch; }

/* Trabalhos */
.works { padding: 0 var(--gutter) clamp(80px, 14vh, 160px); scroll-margin-top: 70px; }
.filter {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 20px 0 28px; border-top: 1px solid var(--line);
}
.chip {
  font: 500 15px/1 var(--body); color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: color .2s, border-color .2s, background .2s;
}
.chip .n { font-variant-numeric: tabular-nums; font-size: 13px; opacity: .7; }
.chip:hover { color: var(--text); border-color: #4a443b; }
.chip.is-on { background: var(--text); color: var(--bg); border-color: var(--text); }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(40px, 6vw, 72px) clamp(20px, 3vw, 40px); }
.item { grid-column: span 6; min-width: 0; }
.item:nth-child(4n+1), .item:nth-child(4n+4) { grid-column: span 7; }
.item:nth-child(4n+2), .item:nth-child(4n+3) { grid-column: span 5; }
.item[hidden] { display: none; }

.card { display: block; text-decoration: none; }
.media { aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--surface); }
.media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease), filter .6s; }
.card:hover .media img { transform: scale(1.035); }
.mono {
  --c: var(--accent);
  width: 100%; height: 100%; display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 85% 110%, color-mix(in oklab, var(--c) 28%, transparent), transparent 60%),
    var(--surface);
  transition: background-position .8s var(--ease);
}
.mono[data-cat="sistemas"] { --c: var(--c-sistemas); }
.mono[data-cat="design"] { --c: var(--c-design); }
.mono[data-cat="prompts"] { --c: var(--c-prompts); }
.mono span {
  font-family: var(--display); font-weight: 800; letter-spacing: -.04em;
  font-size: clamp(4rem, 9vw, 8rem); line-height: 1;
  color: color-mix(in oklab, var(--c) 70%, var(--text));
  transition: transform 1.1s var(--ease);
}
.card:hover .mono span { transform: translateY(-4%) scale(1.04); }

.meta { display: flex; gap: 14px; margin: 18px 0 6px; color: var(--muted); font-size: 14px; font-weight: 500; }
.meta span:first-child::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: 1px; opacity: .8; }
.item-title { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 2.2vw, 1.9rem); line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; }
.card:hover .item-title { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
.item-title a { text-decoration: none; }
.item-title a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.item-sum { margin: 8px 0 0; color: var(--muted); max-width: 52ch; }

/* Prompt no índice */
.item-prompt article { background: var(--surface); border-radius: 14px; padding: clamp(20px, 2.5vw, 32px); height: 100%; display: flex; flex-direction: column; }
.item-prompt .meta { margin-top: 0; color: var(--c-prompts); }
.prompt-preview {
  margin: 18px 0 0; padding: 16px 18px; flex: 1;
  background: var(--bg); border-radius: 10px; overflow: hidden;
  font: 400 13.5px/1.65 var(--mono); color: #cfc7b8; white-space: pre-wrap; word-break: break-word;
  mask-image: linear-gradient(#000 70%, transparent);
}
.prompt-actions { display: flex; align-items: center; gap: 20px; margin-top: 18px; }
.btn-copy {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: 600 15px/1 var(--body); color: var(--bg); background: var(--text);
  border: 0; border-radius: 999px; padding: 11px 18px;
  transition: background .2s, transform .2s var(--ease);
}
.btn-copy:hover { background: #fff; }
.btn-copy:active { transform: scale(.97); }
.btn-copy.is-done { background: var(--c-sistemas); }
.link-more { color: var(--muted); font-weight: 500; }
.link-more:hover { color: var(--text); }
.empty { color: var(--muted); padding: 40px 0; }

/* Contato */
.contact { padding: clamp(64px, 12vh, 128px) var(--gutter) 40px; border-top: 1px solid var(--line); }
.contact-title { margin: 0 0 32px; font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 8vw, 6rem); line-height: .95; letter-spacing: -.035em; }
.contact-links { list-style: none; margin: 0; padding: 0; }
.contact-links a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none;
  font-family: var(--display); font-weight: 600; font-size: clamp(1.25rem, 3vw, 2.2rem); letter-spacing: -.02em;
  transition: color .25s, padding .5s var(--ease);
}
.contact-links a svg { font-size: .9em; color: var(--muted); transition: transform .5s var(--ease), color .25s; }
.contact-links a:hover { color: var(--accent); padding-left: 12px; }
.contact-links a:hover svg { color: var(--accent); transform: translate(4px, -4px); }
.contact-links span { overflow-wrap: anywhere; }
.fine { margin: 48px 0 0; color: var(--muted); font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); font-weight: 600; padding: 12px 20px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); transition: opacity .3s, transform .5s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Página do projeto */
.project { padding: clamp(32px, 8vh, 96px) var(--gutter) clamp(72px, 12vh, 140px); }
.project-head { max-width: 980px; }
.project-head .meta { margin-top: 0; }
.project-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 7.5vw, 6rem); line-height: .95; letter-spacing: -.035em; text-wrap: balance; }
.project-sum { margin: 20px 0 0; font-size: clamp(1.1rem, 1.8vw, 1.35rem); color: var(--muted); max-width: 48ch; }
.btn-cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 28px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font-weight: 600; padding: 14px 22px; border-radius: 999px;
  box-shadow: 0 8px 24px -10px rgba(255, 90, 42, .6);
  transition: transform .4s var(--ease), box-shadow .4s;
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(255, 90, 42, .75); }
.btn-cta svg { transition: transform .4s var(--ease); }
.btn-cta:hover svg { transform: translate(3px, -3px); }
.project-cover { margin: clamp(40px, 7vh, 72px) 0 0; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface); }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.mono-lg span { font-size: clamp(6rem, 18vw, 14rem); }
.prose { max-width: 68ch; margin: clamp(40px, 7vh, 72px) 0 0; font-size: 1.12rem; }
.prose p { margin: 0 0 1.1em; }
.prompt-full { margin: clamp(40px, 7vh, 72px) 0 0; max-width: 900px; background: var(--surface); border-radius: 14px; overflow: hidden; }
.prompt-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--line); color: var(--c-prompts); font-weight: 600; }
.prompt-full pre { margin: 0; padding: 22px; font: 400 14.5px/1.7 var(--mono); color: #d8d0c2; white-space: pre-wrap; word-break: break-word; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2vw, 28px); margin-top: clamp(48px, 8vh, 96px); }
.gallery figure { margin: 0; border-radius: 14px; overflow: hidden; background: var(--surface); }
.gallery figure:nth-child(3n+1) { grid-column: 1 / -1; }
.gallery img { width: 100%; height: auto; }

@media (max-width: 860px) {
  .item, .item:nth-child(n) { grid-column: 1 / -1; }
  .hero-copy { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .top nav a:first-child { display: none; }
  .prompt-actions { flex-wrap: wrap; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
