/* =========================
   TOKENS
========================= */

:root {
  --paper: #0b0909;
  --paper-2: #141010;
  --ink: #f2ebe6;
  --ink-2: #b9aea8;
  --ink-3: #d4524d; /* textos de apoio em vermelho mais suave que o destaque */
  --rule: #2a2222;
  --accent: #ff3b3b;
  --accent-strong: #d90f0f;
  --accent-soft: rgba(255, 40, 40, .1);
  --on-ink: #0b0909;

  /* neon: o mesmo vermelho do nome elétrico */
  --neon: #ff0000;
  --glow: 0 0 6px rgba(255, 0, 0, .7), 0 0 22px rgba(255, 0, 0, .35);
  --glow-box: 0 0 0 1px rgba(255, 40, 40, .55), 0 0 28px -4px rgba(255, 0, 0, .45);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);

  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: dark;
}


/* =========================
   BASE
========================= */

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

html {
  /* brilhos e bordas elétricas passam da borda dos cards; nada pode criar rolagem lateral */
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* textura leve de papel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .35;
  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%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

strong {
  font-weight: 500;
  color: var(--ink);
}

::selection {
  background: var(--accent-strong);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.mono {
  font-family: var(--mono);
  font-size: .8125rem;
  letter-spacing: .01em;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  transition: top .2s;
}

.skip-link:focus {
  top: 12px;
}


/* =========================
   FUNDO DE PARTÍCULAS (React Bits)
========================= */

.particles-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.particles-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.particles-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}


/* =========================
   BORDA ELÉTRICA (React Bits)
========================= */

.electric-border {
  position: relative;
  isolation: isolate;
}

.electric-border__canvas {
  position: absolute;
  z-index: 1;
  display: block;
  pointer-events: none;
}


/* =========================
   HEADER
========================= */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}

.header.scrolled {
  border-bottom-color: var(--rule);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  height: 76px;
}

/* lista simples: no desktop só aparece se a navegação gooey não carregar */
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

@media (min-width: 801px) {
  .js .header:not(.has-gooey):not(.no-gooey) .nav-links {
    visibility: hidden;
  }
}

/* o botão do menu fica no canto, sem tirar a navegação do centro */
.nav-actions {
  position: absolute;
  right: var(--gutter);
  display: flex;
  align-items: center;
  gap: 4px;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  position: relative;
}

.menu-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .3s var(--ease), top .3s var(--ease);
}

.menu-toggle span:first-child {
  top: 17px;
}

.menu-toggle span:last-child {
  top: 25px;
}

.menu-toggle[aria-expanded="true"] span:first-child {
  top: 21px;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:last-child {
  top: 21px;
  transform: rotate(-45deg);
}


/* =========================
   GOOEY NAV (React Bits)
========================= */

.gooey-host {
  margin-inline: auto;
}

/* no desktop a navegação gooey substitui a lista simples */
.header.has-gooey .nav-links {
  display: none;
}

.gooey-nav {
  --gn-pad: 6px;
  --gn-gap: 4px;
  --gn-font: 14px;
  --gn-x: 16px;
  --gn-y: 9px;
  position: relative;
  display: inline-flex;
  max-width: 100%;
  font-size: var(--gn-font);
  line-height: 1.2;
}

.gooey-nav--sm {
  --gn-pad: 5px;
  --gn-gap: 2px;
  --gn-font: 13px;
  --gn-x: 13px;
  --gn-y: 7px;
}

.gooey-nav--lg {
  --gn-pad: 7px;
  --gn-gap: 6px;
  --gn-font: 16px;
  --gn-x: 20px;
  --gn-y: 11px;
}

.gooey-nav--framed {
  padding: var(--gn-pad);
  border-radius: 999px;
  background: var(--gn-frame);
  box-shadow: var(--gn-frame-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
}

.gooey-nav__stage {
  position: relative;
  max-width: 100%;
}

.gooey-nav__canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  /* brilho de neon em volta da bolinha vermelha */
  filter: drop-shadow(0 0 7px rgba(255, 0, 0, .45));
}

.gooey-nav__fallback {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  border-radius: 999px;
  background: var(--gn-pill);
  pointer-events: none;
}

.gooey-nav__list {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gn-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gooey-nav__list--active {
  position: absolute;
  inset: 0;
  color: var(--gn-active-ink);
  visibility: hidden;
  clip-path: inset(100%);
  pointer-events: none;
}

.gooey-nav__item {
  display: flex;
}

.gooey-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: var(--gn-y) var(--gn-x);
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--gn-muted);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.gooey-nav__list--active .gooey-nav__link {
  color: inherit;
}

.gooey-nav__item[data-active] .gooey-nav__link {
  color: var(--gn-ink);
}

.gooey-nav__link:focus-visible {
  outline: 2px solid var(--gn-ink);
  outline-offset: 2px;
}

.gooey-nav__icon {
  display: inline-flex;
  flex: none;
}

.gooey-nav__icon svg {
  width: 1.15em;
  height: 1.15em;
}

.gooey-nav__rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px var(--gn-frame-edge),
    inset 0 1px 0 var(--gn-frame-highlight);
  pointer-events: none;
}

@media (hover: hover) {
  .gooey-nav__link:hover {
    color: var(--gn-ink);
  }
}

/* no celular continua o menu de tela cheia */
@media (max-width: 800px) {
  .gooey-host {
    display: none;
  }

  .header.has-gooey .nav-links {
    display: flex;
  }
}


/* =========================
   BOTÕES E LINKS
========================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: .9375rem;
  font-weight: 500;
  border: 1px solid var(--ink);
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .3s, transform .2s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-solid {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.btn-solid:hover {
  background: #f01515;
  border-color: #f01515;
  box-shadow: 0 0 24px rgba(255, 0, 0, .45);
}

.btn-line {
  border-color: var(--rule);
}

.btn-line:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--glow-box);
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.arrow-link span {
  transition: transform .25s var(--ease);
}

.arrow-link:hover span {
  transform: translateX(4px);
}


/* =========================
   INTRO
========================= */

.intro {
  padding-top: clamp(48px, 9vw, 112px);
  padding-bottom: clamp(64px, 10vw, 128px);
}


.intro-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  color: var(--ink-3);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.clock {
  font-variant-numeric: tabular-nums;
}

.intro-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4rem, 16vw, 12.5rem);
  line-height: .9;
  letter-spacing: -.035em;
  white-space: nowrap;
  margin: clamp(24px, 4vw, 44px) 0 clamp(28px, 4vw, 48px);
}

.intro-title {
  position: relative;
}

.intro-electric {
  display: none;
}

/* com JS o nome é desenhado pelo efeito; o h1 continua para leitores de tela.
   O texto comum só aparece se o efeito falhar (.no-electric) */
.js .intro-title:not(.no-electric) .intro-name {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.js .intro-title:not(.no-electric) .intro-electric {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  max-height: 480px;
  margin: clamp(8px, 2vw, 24px) 0 clamp(12px, 2vw, 28px);
  cursor: crosshair;
  touch-action: pan-y;
  /* esmaece as bordas para o brilho não formar um retângulo */
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 6%, #000 94%, transparent),
    linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 6%, #000 94%, transparent),
    linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
  mask-composite: intersect;
}

.intro-name em {
  font-style: italic;
  color: var(--accent);
}

/* topo em duas colunas: nome e texto à esquerda, crachá pendurado à direita */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: stretch;
}

.hero-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-main .intro-title .intro-electric {
  margin-top: 0;
}

/* a coluna do crachá sobe até o topo da seção, para o cordão sair lá de cima */
.hero-badge {
  position: relative;
  min-height: clamp(540px, 72vh, 700px);
  margin-top: calc(-1 * clamp(48px, 9vw, 112px));
}

.lanyard {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-badge .lanyard-stage {
  position: absolute;
  inset: 0;
  /* o cordão surge do escuro aos poucos, sem corte reto no topo */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, .35) 60px, #000 170px);
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, .35) 60px, #000 170px);
}

.lanyard-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* sem WebGL aparece a foto estática */
.badge-fallback {
  display: block;
  width: min(280px, 70%);
  height: auto;
  margin: 120px auto 0;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255, 40, 40, .5), 0 0 30px -6px rgba(255, 0, 0, .5);
}

.js .hero-badge:not(.no-3d) .badge-fallback {
  display: none;
}

.lanyard-canvas {
  opacity: 0;
  transition: opacity .8s var(--ease);
}

.hero-badge.is-3d .lanyard-canvas {
  opacity: 1;
}

.badge-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
  color: var(--ink-3);
  pointer-events: none;
}

.hero-badge:not(.is-3d) .badge-hint {
  display: none;
}

.intro-text p {
  color: var(--ink-2);
  max-width: 58ch;
}

.intro-text p + p {
  margin-top: 16px;
}

.lead {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.45;
  letter-spacing: -.01em;
  color: var(--ink) !important;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.now {
  margin-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--accent);
  padding-top: 16px;
}

.now dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 32px;
}

.now-title {
  font-weight: 400;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.now dl > div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.now dt {
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--ink-3);
  padding-top: 3px;
}

.now dd {
  line-height: 1.45;
}

.now dd span {
  color: var(--ink-3);
  font-size: .9375rem;
}


/* =========================
   SEÇÕES
========================= */

.section {
  padding-block: clamp(64px, 9vw, 120px);
}

.section-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 20px;
  margin-bottom: clamp(24px, 4vw, 48px);
}

/* linha de neon que some para a direita */
.section-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--neon), rgba(255, 0, 0, .35) 55%, transparent);
  box-shadow: 0 0 10px rgba(255, 0, 0, .55);
}

/* títulos em contorno, como o nome no topo */
.section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.75rem, 7vw, 5.25rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: transparent;
  -webkit-text-stroke: 1.2px var(--accent);
  text-shadow: 0 0 18px rgba(255, 0, 0, .45);
}

.section-index {
  color: var(--accent);
  text-shadow: var(--glow);
}

/* o título acende com uma piscada quando entra na tela */
.js .section-head h2 {
  opacity: .12;
}

.js .section-head h2.lit {
  opacity: 1;
  /* acende e depois segue falhando de vez em quando, como letreiro com mau contato */
  animation:
    neon-on 1.1s steps(1) both,
    neon-faulty var(--faulty, 7s) steps(1) 1.1s infinite;
}

/* cada letreiro falha num ritmo diferente, para não piscarem juntos */
#experiencia { --faulty: 6.3s; }
#projetos { --faulty: 8.7s; }
#stack { --faulty: 5.4s; }
#formacao { --faulty: 9.6s; }

@keyframes neon-faulty {
  0%, 71% { opacity: 1; }
  72% { opacity: .25; }
  73% { opacity: 1; }
  74% { opacity: .4; }
  76%, 90% { opacity: 1; }
  91% { opacity: .15; }
  93%, 100% { opacity: 1; }
}

@keyframes neon-on {
  0% { opacity: .12; }
  8% { opacity: 1; }
  14% { opacity: .2; }
  22% { opacity: 1; }
  30% { opacity: .35; }
  38%, 100% { opacity: 1; }
}

.github-cta {
  align-self: center;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px 0 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: .9375rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .2s, color .2s;
}

.github-cta:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
  box-shadow: 0 0 24px rgba(255, 0, 0, .45);
}

.github-cta-arrow {
  transition: transform .25s var(--ease);
}

.github-cta:hover .github-cta-arrow {
  transform: translate(2px, -2px);
}

.kicker {
  color: var(--ink-3);
  margin-bottom: 10px;
}


/* =========================
   EXPERIÊNCIA
========================= */

.ledger-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px clamp(24px, 4vw, 56px);
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
}

.ledger-row:first-child {
  padding-top: 8px;
}

.ledger-when {
  display: flex;
  flex-direction: column;
  color: var(--ink-3);
  padding-top: 4px;
}

.ledger-what h3 {
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.01em;
}

.ledger-org {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: .9375rem;
}

.ledger-stack {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.ledger-body {
  color: var(--ink-2);
}

.ticks {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.ticks li {
  position: relative;
  padding-left: 20px;
  font-size: .96875rem;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .78em;
  width: 9px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(255, 0, 0, .8);
}


/* =========================
   PROJETOS
========================= */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 32px);
}

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color .3s, box-shadow .3s;
}

.pcard:hover,
.pcard:focus-within {
  border-color: rgba(255, 40, 40, .55);
  box-shadow: 0 0 32px -6px rgba(255, 0, 0, .4), 0 18px 40px -28px rgba(0, 0, 0, .6);
}

.pcard-media {
  container-type: inline-size;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  padding: 7%;
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%),
    var(--paper-2);
  border-bottom: 1px solid var(--rule);
  border-radius: 7px 7px 0 0;
  overflow: hidden;
}

.pcard-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: clamp(20px, 2.6vw, 28px);
}

.pcard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--ink-3);
}

.pcard-badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.pcard h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: -.02em;
}

.pcard-open {
  text-align: left;
  font: inherit;
  letter-spacing: inherit;
}

/* o botão do título cobre o card inteiro */
.pcard-open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.pcard-open:focus-visible {
  outline: none;
}

.pcard:has(.pcard-open:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.pcard-desc {
  color: var(--ink-2);
  font-size: .96875rem;
  max-width: 54ch;
}

.pcard-tags {
  color: var(--ink-3);
}

.pcard-more {
  margin-top: auto;
  padding-top: 8px;
  color: var(--accent);
}

.pcard-more b {
  display: inline-block;
  font-weight: 400;
  transition: transform .3s var(--ease);
}

.pcard:hover .pcard-more b {
  transform: rotate(90deg);
}

.pcard--wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

.pcard--wide .pcard-media {
  aspect-ratio: auto;
  min-height: 100%;
  border-bottom: 0;
  border-right: 1px solid var(--rule);
  border-radius: 7px 0 0 7px;
  padding: 4%;
}

.pcard--wide .pcard-body {
  justify-content: center;
  padding: clamp(24px, 3.4vw, 44px);
}

.pcard--wide h3 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
}


/* janelas das ilustrações */

.frame {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .08),
    0 2px 4px rgba(0, 0, 0, .06),
    0 22px 40px -18px rgba(0, 0, 0, .45);
  transition: transform .6s var(--ease);
}

.pcard:hover .frame {
  transform: translateY(-1.2cqi) scale(1.015);
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
}

.frame-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: max(22px, 4.4cqi);
  padding: 0 max(8px, 1.8cqi);
  background: #ecebe8;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.frame-dots {
  display: flex;
  gap: max(4px, .9cqi);
}

.frame-dots i {
  width: max(7px, 1.4cqi);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(0, 0, 0, .16);
}

.frame-dots--mac i:nth-child(1) { background: rgb(255, 92, 92); }
.frame-dots--mac i:nth-child(2) { background: rgb(255, 189, 68); }
.frame-dots--mac i:nth-child(3) { background: rgb(0, 202, 78); }

.frame-url {
  flex: 1;
  max-width: 60%;
  margin-inline: auto;
  padding: 1px 10px;
  border-radius: 999px;
  background: #fff;
  color: #6b6b6b;
  font-size: max(10px, 1.7cqi);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* janela escura: terminal e cliente HTTP */
.frame--dark {
  background: #151515;
}

.frame--dark .frame-bar {
  background: #222;
  border-bottom-color: #2e2e2e;
}

.frame--dark .frame-dots i {
  background: #3a3a3a;
}

.frame--dark .frame-url {
  background: #2c2c2c;
  color: #9a9a9a;
}

.mock-api {
  padding: 4cqi 4.4cqi;
  font-size: max(9px, 2.15cqi);
  line-height: 1.55;
  color: #d6d6d6;
}

.mock-api p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-api .verb {
  display: inline-block;
  min-width: 6ch;
  font-weight: 600;
}

.verb--post { color: #f2a33c; }
.verb--get { color: #6fcf97; }

.mock-api .json {
  color: #9aa7b4;
  padding-left: 6ch;
}

.mock-api .res {
  padding-left: 6ch;
  margin-bottom: 1.6cqi;
  color: #8a8a8a;
}

.mock-api .res span {
  color: #6fcf97;
}

.mock-term {
  margin: 0;
  padding: 3.4cqi 4.4cqi;
  font-size: max(8px, 1.95cqi);
  line-height: 1.5;
  color: #cfcfcf;
  white-space: pre;
  overflow: hidden;
}

.caret {
  display: inline-block;
  width: .6em;
  height: 1.1em;
  vertical-align: -.2em;
  background: #cfcfcf;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* janela do Swing */
.frame--swing {
  width: 86%;
}

.frame--swing .frame-bar {
  justify-content: space-between;
  background: #f3f3f3;
}

.frame-title {
  color: #333;
  font-size: max(10px, 1.8cqi);
}

.frame-win {
  display: flex;
  gap: max(8px, 2cqi);
}

.frame-win i {
  width: max(7px, 1.3cqi);
  height: max(7px, 1.3cqi);
  border: 1px solid #777;
}

.frame-win i:first-child {
  height: 0;
  border-width: 1px 0 0;
  align-self: center;
}

.mock-cifra {
  display: grid;
  gap: 2.2cqi;
  padding: 3cqi;
  background: rgb(45, 45, 45);
  font-family: Arial, Helvetica, sans-serif;
  font-size: max(8px, 1.9cqi);
  color: #fff;
}

.cifra-title {
  text-align: center;
  font-weight: 700;
  font-size: max(10px, 2.6cqi);
}

.cifra-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.4cqi;
  font-weight: 700;
}

.cifra-key {
  min-width: 7cqi;
  padding: .3cqi 1cqi;
  background: #fff;
  color: #111;
  font-weight: 400;
}

.cifra-btn {
  padding: .8cqi 1.8cqi;
  background: rgb(70, 130, 180);
  font-weight: 700;
}

.cifra-box {
  position: relative;
  padding: 2cqi 1.4cqi 1.4cqi;
  border: 1px solid #8a8a8a;
}

.cifra-box span {
  position: absolute;
  top: -.75em;
  left: 1.2cqi;
  padding: 0 .6cqi;
  background: rgb(45, 45, 45);
  color: #cfcfcf;
  font-size: max(8px, 1.6cqi);
}

.cifra-box p {
  padding: .8cqi 1.2cqi;
  background: #fff;
  color: #111;
  font-family: Consolas, "Geist Mono", monospace;
}

/* calculadora */
.frame--calc {
  width: 40cqi;
  background: rgb(30, 30, 30);
}

.frame--calc .frame-bar {
  background: rgb(30, 30, 30);
  border-bottom: 0;
}

.mock-calc {
  font-family: Courier, "Geist Mono", monospace;
}

.calc-display {
  padding: 1.5cqi 2.6cqi;
  background: rgb(46, 49, 50);
  color: #fff;
  text-align: right;
  font-size: max(14px, 4.4cqi);
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgb(30, 30, 30);
}

.k {
  display: grid;
  place-items: center;
  aspect-ratio: 1.25;
  background: rgb(99, 99, 99);
  color: #fff;
  font-size: max(9px, 2.2cqi);
}

.k--dark { background: rgb(68, 68, 68); }
.k--op { background: rgb(242, 163, 60); }

.k--wide {
  grid-column: span 2;
  aspect-ratio: auto;
}

/* campo minado (o tabuleiro é montado pelo js/main.js) */
.mock-mines {
  display: grid;
  grid-template-columns: repeat(var(--cols, 14), 1fr);
  background: #8a8a8a;
  gap: 1px;
  padding: 1px;
}

.mock-mines span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  font-size: max(7px, 2.3cqi);
  font-weight: 700;
  background: rgb(184, 184, 184);
  box-shadow: inset 1px 1px 0 #e4e4e4, inset -1px -1px 0 #7a7a7a;
}

.mock-mines .open {
  box-shadow: none;
}

.mock-mines .n1 { color: rgb(0, 100, 0); }
.mock-mines .n2 { color: #0000ff; }
.mock-mines .n3 { color: #b8a400; }

.mock-mines .flag {
  background: rgb(8, 179, 247);
  color: #000;
}


/* =========================
   DETALHES DO PROJETO
========================= */

.pdialog {
  width: min(1080px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55);
}

.pdialog::backdrop {
  background: rgba(10, 10, 8, .55);
  backdrop-filter: blur(4px);
}

.pdialog[open] {
  animation: dialog-in .45s var(--ease);
}

.pdialog[open]::backdrop {
  animation: fade-in .3s ease;
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
}

@keyframes fade-in {
  from { opacity: 0; }
}

html:has(.pdialog[open]) {
  overflow: hidden;
}

.pdialog-inner {
  position: relative;
}

.pdialog-close {
  position: sticky;
  top: 12px;
  z-index: 2;
  float: right;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 12px 12px -56px 0;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  transition: border-color .2s, transform .3s var(--ease);
}

.pdialog-close:hover {
  border-color: var(--ink);
  transform: rotate(90deg);
}

.pdialog-media {
  container-type: inline-size;
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(24px, 4vw, 44px) clamp(16px, 5vw, 64px) clamp(20px, 3vw, 32px);
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%),
    var(--paper-2);
  border-bottom: 1px solid var(--rule);
}

/* no detalhe as ilustrações ficam um pouco mais contidas */
.pdialog-media .frame--swing { width: 54%; }
.pdialog-media .frame--calc { width: 22cqi; }
.pdialog-media .frame--dark { width: 62%; }
.pdialog-media .frame--browser { width: 88%; }

.gallery-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
}

.gallery-tabs button {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: .875rem;
  transition: background-color .2s, color .2s;
}

.gallery-tabs button[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}

.pdialog-content {
  padding: clamp(24px, 4vw, 48px) clamp(20px, 5vw, 64px) clamp(32px, 5vw, 56px);
}

.pdialog-content h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -.025em;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.pdialog-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
}

.pdialog-text > p {
  color: var(--ink-2);
  max-width: 62ch;
}

.pdialog-text > p + p {
  margin-top: 14px;
}

.pdialog-text h3 {
  margin: 28px 0 4px;
  font-size: 1.0625rem;
  font-weight: 500;
}

.pdialog-text .flow,
.pdialog-text .routes {
  margin-top: 20px;
}

.pdialog-facts {
  align-self: start;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
}

.pdialog-facts h3 {
  font-weight: 400;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.pdialog-facts > p {
  color: var(--ink-2);
}

.pdialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.pdialog-note {
  margin-top: 12px;
  font-size: .875rem;
  color: var(--ink-3) !important;
}


.flow {
  counter-reset: step;
  display: grid;
  gap: 0;
}

.flow li {
  counter-increment: step;
  position: relative;
  padding: 11px 0 11px 32px;
  border-top: 1px dashed var(--rule);
  color: var(--ink-2);
}

.flow li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--ink-3);
}

.flow b,
.routes b {
  font-weight: 500;
  color: var(--accent);
}

.routes {
  display: grid;
}

.routes li {
  display: grid;
  grid-template-columns: 72px 1fr;
  padding: 11px 0;
  border-top: 1px dashed var(--rule);
  color: var(--ink-2);
}


/* =========================
   ÓRBITA DOS PROJETOS (React Bits, por Dominik Koch)
========================= */

.orbit-container {
  position: relative;
  margin-left: auto;
  margin-right: auto;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.orbit-container[data-draggable] {
  cursor: grab;
  touch-action: pan-y pinch-zoom;
}

.orbit-container[data-dragging],
.orbit-container[data-dragging] * {
  cursor: grabbing;
}

.orbit-path-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.orbit-item {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform, opacity;
}

.orbit-container[data-intro] .orbit-item {
  opacity: 0;
}

.orbit-item[data-clickable] {
  cursor: pointer;
}

.orbit-item-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--orbit-radius, 0px);
  box-shadow: 0 calc(var(--orbit-shadow, 0) * 16px) calc(var(--orbit-shadow, 0) * 36px)
    rgba(0, 0, 0, calc(var(--orbit-shadow, 0) * 0.45));
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.orbit-item:hover .orbit-item-inner,
.orbit-item:focus-visible .orbit-item-inner {
  transform: scale(var(--orbit-hover-scale, 1));
}

.orbit-item:focus-visible {
  outline: none;
}

.orbit-item:focus-visible .orbit-item-inner {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.orbit-center-content {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.orbit-center-content > * {
  pointer-events: auto;
}

/* ajustes do site */
#projetos.has-orbit .projects-grid {
  display: none;
}

.projects-orbit {
  /* a órbita usa a largura da tela além da coluna de texto, até 1440px */
  --orbit-w: min(100vw - var(--gutter) * 2, 1440px);
  width: var(--orbit-w);
  margin-left: calc((100% - var(--orbit-w)) / 2);
  margin-bottom: clamp(32px, 5vw, 64px);
  /* as miniaturas são desenhadas em 520px e reduzidas; nada passa da largura da página */
  overflow-x: clip;
}

.projects-orbit .orbit-item-inner {
  border: 1px solid rgba(255, 40, 40, .45);
  background: var(--paper-2);
  box-shadow: 0 0 24px -6px rgba(255, 0, 0, .45), 0 14px 30px -12px rgba(0, 0, 0, .7);
}

/* a ilustração é desenhada com 520px de largura, no formato do item, e reduzida como
   miniatura, para os textos manterem a proporção em vez de estourar a moldura */
.projects-orbit .pcard-media {
  width: 520px;
  height: calc(520px / var(--orbit-aspect, 1));
  aspect-ratio: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  transform: scale(var(--orbit-zoom, .3));
  transform-origin: 0 0;
}

/* na órbita a janela ocupa o quadrado inteiro, de ponta a ponta, sem moldura sobrando */
.projects-orbit .frame {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}

.projects-orbit .frame > :not(.frame-bar) {
  flex: 1;
  min-height: 0;
}

.projects-orbit .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}

.projects-orbit .mock-calc {
  display: flex;
  flex-direction: column;
}

.projects-orbit .calc-keys {
  flex: 1;
  grid-auto-rows: 1fr;
}

/* calculadora e tabuleiro se ajustam à altura do item, sem passar da borda */
.projects-orbit .calc-display { padding-block: 1.2cqi; font-size: 6cqi; }
.projects-orbit .k { min-height: 0; aspect-ratio: auto; font-size: 3.2cqi; }
.projects-orbit .mock-mines { grid-auto-rows: 1fr; }
.projects-orbit .mock-mines span { min-height: 0; aspect-ratio: auto; font-size: 3cqi; }

.orbit-hint {
  color: var(--ink-3);
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .orbit-item-inner {
    transition: none;
  }
}


/* =========================
   STACK
========================= */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 32px 24px;
}

.stack-col h3 {
  font-weight: 400;
  color: var(--ink-3);
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.stack-col li {
  font-size: 1.125rem;
  padding: 5px 0;
}

.stack-ai-link {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
}

.ai-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(32px, 5vw, 72px);
  margin-top: clamp(48px, 7vw, 80px);
  padding: clamp(24px, 4vw, 48px);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--neon);
  border-radius: 4px;
  box-shadow: -10px 0 30px -18px rgba(255, 0, 0, .7);
  scroll-margin-top: 96px;
}

.ai-intro h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin-bottom: 16px;
}

.ai-intro p:not(.kicker) {
  color: var(--ink-2);
  max-width: 46ch;
}

.ai-uses {
  counter-reset: use;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 32px;
  align-content: start;
}

.ai-uses li {
  counter-increment: use;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.ai-uses h4 {
  font-size: 1.0625rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.ai-uses h4::before {
  content: counter(use, decimal-leading-zero);
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 400;
  color: var(--accent);
  margin-right: 10px;
}

.ai-uses p {
  color: var(--ink-2);
  font-size: .96875rem;
}


/* =========================
   FORMAÇÃO
========================= */

.edu {
  padding-bottom: 40px;
  margin-bottom: clamp(40px, 6vw, 72px);
  border-bottom: 1px solid var(--rule);
}

.edu h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.02em;
}

.edu p:last-child {
  margin-top: 8px;
  color: var(--ink-2);
}

.courses-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 16px;
}

.courses-head h3 {
  font-size: 1.1875rem;
  font-weight: 500;
}

.courses-total {
  color: var(--ink-3);
}

.serif-num {
  font-family: var(--serif);
  font-size: 2.25rem;
  line-height: 1;
  color: var(--ink);
  margin-right: 4px;
}

.courses table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.courses th {
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 400;
  color: var(--ink-3);
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--ink);
}

.courses td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}

.courses td:nth-child(2) {
  color: var(--ink-2);
}

.courses .num {
  text-align: right;
  padding-right: 0;
  font-family: var(--mono);
  font-size: .875rem;
}

.note {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: .75rem;
  white-space: nowrap;
}


/* =========================
   CONTATO
========================= */

.contact {
  padding-top: clamp(72px, 10vw, 140px);
  padding-bottom: clamp(72px, 10vw, 120px);
  position: relative;
  isolation: isolate;
}

/* mesma linha de neon dos títulos, no topo do contato */
.contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon) 30%, var(--neon) 70%, transparent);
  box-shadow: 0 0 12px rgba(255, 0, 0, .6);
}

/* luz vermelha atrás do contato; some antes de chegar às bordas, sem corte no rodapé */
.contact::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 20% 0 0;
  background: radial-gradient(ellipse 34% 42% at 36% 55%, rgba(255, 0, 0, .09), rgba(255, 0, 0, .03) 55%, transparent 100%);
  pointer-events: none;
}

.contact > .section-index {
  margin-bottom: 28px;
}

.contact-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 6rem);
  line-height: .98;
  letter-spacing: -.03em;
  max-width: 14ch;
}

.contact-title em {
  color: var(--accent);
  text-shadow: 0 0 22px rgba(255, 0, 0, .5);
}

.contact-mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: clamp(36px, 5vw, 56px);
}

.mail-link {
  font-size: clamp(1.15rem, 3vw, 1.75rem);
  letter-spacing: -.01em;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  overflow-wrap: anywhere;
  transition: color .2s, border-color .2s;
}

.mail-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.copy-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
  transition: border-color .2s, color .2s;
}

.copy-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.copy-status {
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--accent);
}

.btn-whatsapp {
  gap: 10px;
  margin-top: 28px;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.btn-whatsapp:hover {
  background: #f01515;
  border-color: #f01515;
  box-shadow: 0 0 24px rgba(255, 0, 0, .45);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin-top: 40px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--ink-2);
  transition: color .2s;
}

.contact-links a:hover {
  color: var(--accent);
}


/* =========================
   FOOTER
========================= */

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 24px;
  padding-bottom: 32px;
  background: linear-gradient(var(--rule), var(--rule)) top center / calc(100% - var(--gutter) * 2) 1px no-repeat;
  color: var(--ink-3);
}

.footer a:hover {
  color: var(--ink);
}


/* =========================
   ANIMAÇÃO
========================= */

/* blocos que entram com o AnimatedContent (js/modules/animate-in.js) ficam escondidos até ele assumir */
.js [data-animate]:not(.is-animated) {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

}


/* =========================
   RESPONSIVO
========================= */

@media (max-width: 1024px) {
  .ledger-row {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  .ledger-body {
    grid-column: 2;
  }

  .stack-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pcard--wide {
    grid-template-columns: 1fr;
  }

  .pcard--wide .pcard-media {
    aspect-ratio: 16 / 9;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    border-radius: 7px 7px 0 0;
  }
}

@media (max-width: 800px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-links a {
    display: block;
    padding: 14px 0;
    font-family: var(--serif);
    font-size: 1.75rem;
    color: var(--ink);
    border-bottom: 1px solid var(--rule);
  }

  .nav-links a::after {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-badge {
    min-height: 480px;
    margin-top: 0;
  }

  .now dl {
    grid-template-columns: 1fr;
  }

  .pdialog-cols {
    grid-template-columns: 1fr;
  }

  .ledger-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ledger-when {
    flex-direction: row;
    gap: 6px;
    order: -1;
  }

  .ledger-when span:last-child::before {
    content: "– ";
  }

  .ledger-body {
    grid-column: auto;
    margin-top: 6px;
  }

  .stack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-block {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .github-cta {
    margin-left: 0;
  }

  .ai-uses {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 560px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .pdialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 16px);
    margin-bottom: 0;
    border-radius: 14px 14px 0 0;
  }

  .pdialog-media .frame--swing,
  .pdialog-media .frame--dark,
  .pdialog-media .frame--browser { width: 100%; }
  .pdialog-media .frame--calc { width: 46cqi; }

  .courses thead {
    display: none;
  }

  .courses tr {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }

  .courses td {
    padding: 0;
    border: 0;
  }

  .courses td:nth-child(2) {
    grid-row: 2;
    font-size: .9375rem;
  }

  .courses td.num {
    grid-row: 1 / span 2;
    align-self: center;
    padding-left: 16px;
  }

  .note {
    margin: 4px 0 0;
    display: table;
  }
}
