/* ============================================================
   Portfólio Paulo Ambrosi
   Off-white · verde musgo · laranja
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
img, picture, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4 { overflow-wrap: break-word; }
ul[class] { list-style: none; padding: 0; }

/* ---------- Tokens: tema claro ---------- */
:root {
  --bg:          #F7F5F0;
  --bg-tint:     #F1EEE6;
  --surface:     #FFFFFF;
  --surface-2:   #F1EEE6;
  --ink:         #22261C;
  --ink-muted:   #59604E;
  --moss:        #4F5D3F;
  --moss-deep:   #3A4630;
  --moss-soft:   #7A8A66;
  --moss-wash:   #E8EADF;
  --accent:      #B05023;
  --accent-hover:#94431D;
  --accent-deco: #D9622B;
  --accent-wash: #FAEBE1;
  --border:      #E2DDD0;
  --border-firm: #CDC6B4;
  --border-ctrl: #8E897D;

  /* card de destaque: sempre fundo escuro, nos dois temas */
  --feature-bg:     #4F5D3F;
  --feature-line:   #5E6D4B;
  --feature-ink:    #FFFFFF;
  --feature-muted:  #DDE3D1;
  --feature-accent: #FFC299;

  --shadow-sm: 0 1px 2px rgba(34, 38, 28, .05);
  --shadow-md: 0 4px 16px -4px rgba(34, 38, 28, .10);
  --shadow-lg: 0 18px 48px -18px rgba(34, 38, 28, .28);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1120px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --ease: cubic-bezier(.22, .72, .28, 1);
  --header-h: 66px;

  color-scheme: light;
}

/* ---------- Tokens: tema escuro ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {

  --bg:          #161A14;
  --bg-tint:     #1C211A;
  --surface:     #1F241C;
  --surface-2:   #272D23;
  --ink:         #F0EEE8;
  --ink-muted:   #A9B19B;
  --moss:        #A9BA8E;
  --moss-deep:   #C4D0AD;
  --moss-soft:   #8A9B70;
  --moss-wash:   #262D20;
  --accent:      #F08A4B;
  --accent-hover:#F8A873;
  --accent-deco: #F08A4B;
  --accent-wash: #2E2117;
  --border:      #333A2E;
  --border-firm: #4A5341;
  --border-ctrl: #6F7667;

  --feature-bg:     #2C3623;
  --feature-line:   #3D4A31;
  --feature-ink:    #F2F0EA;
  --feature-muted:  #BDC8AC;
  --feature-accent: #F49A62;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 48px -18px rgba(0, 0, 0, .7);

  color-scheme: dark;
  }
}

[data-theme="dark"] {
  --bg:          #161A14;
  --bg-tint:     #1C211A;
  --surface:     #1F241C;
  --surface-2:   #272D23;
  --ink:         #F0EEE8;
  --ink-muted:   #A9B19B;
  --moss:        #A9BA8E;
  --moss-deep:   #C4D0AD;
  --moss-soft:   #8A9B70;
  --moss-wash:   #262D20;
  --accent:      #F08A4B;
  --accent-hover:#F8A873;
  --accent-deco: #F08A4B;
  --accent-wash: #2E2117;
  --border:      #333A2E;
  --border-firm: #4A5341;
  --border-ctrl: #6F7667;

  --feature-bg:     #2C3623;
  --feature-line:   #3D4A31;
  --feature-ink:    #F2F0EA;
  --feature-muted:  #BDC8AC;
  --feature-accent: #F49A62;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 48px -18px rgba(0, 0, 0, .7);

  color-scheme: dark;
}

/* ---------- Base ---------- */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  letter-spacing: -.005em;
}

h1, h2, h3, h4 {
  line-height: 1.12;
  letter-spacing: -.028em;
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.35rem, 1.5rem + 3.8vw, 4.1rem); font-weight: 650; }
h2 { font-size: clamp(1.7rem, 1.25rem + 1.9vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + .45vw, 1.4rem); }
h4 { font-size: 1.0625rem; }

p { text-wrap: pretty; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }

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

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

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 760px; }

.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section--tint { background: var(--bg-tint); }
.section + .section { border-top: 1px solid var(--border); }
.section--tint + .section, .section + .section--tint { border-top: 0; }

.section__head { max-width: 62ch; margin-bottom: clamp(2.25rem, 4vw, 3.5rem); }
.section__lead { color: var(--ink-muted); font-size: 1.075em; margin-top: .9rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-mono);
  font-size: .72rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--moss);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px;
  background: var(--accent-deco); border-radius: 2px;
}

/* ---------- Skip link ---------- */
.skip {
  position: absolute; left: .75rem; top: -100px; z-index: 200;
  background: var(--accent); color: #FFF;
  padding: .7rem 1.1rem; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
  transition: top .18s var(--ease);
}
.skip:focus { top: .75rem; color: #FFF; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.header.is-stuck { border-bottom-color: var(--border); }

.header__inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 650; letter-spacing: -.03em;
  color: var(--ink); text-decoration: none; font-size: 1.02rem;
  margin-right: auto;
}
.brand:hover { color: var(--ink); }
.brand__mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--moss); color: var(--bg);
  font-family: var(--font-mono); font-size: .76rem; font-weight: 700;
  letter-spacing: .02em;
  transition: transform .3s var(--ease);
}
.brand:hover .brand__mark { transform: rotate(-6deg) scale(1.06); }

.nav { display: flex; align-items: center; gap: .15rem; }
.nav__link {
  position: relative;
  padding: .5rem .72rem;
  font-size: .915rem; font-weight: 500;
  color: var(--ink-muted); text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color .2s var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link::after {
  content: ""; position: absolute;
  left: .72rem; right: .72rem; bottom: .22rem; height: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav__link:hover::after { transform: scaleX(1); }
.nav__link[aria-current] { color: var(--ink); font-weight: 600; }
.nav__link[aria-current]::after { transform: scaleX(1); }

.header__tools { display: flex; align-items: center; gap: .4rem; }

.iconbtn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: transparent; color: var(--ink-muted);
  border: 1px solid var(--border-ctrl);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.iconbtn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-wash); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn .icon-sun { display: none; }
[data-theme="dark"] .iconbtn .icon-sun { display: block; }
[data-theme="dark"] .iconbtn .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .iconbtn .icon-sun { display: block; }
  :root:not([data-theme="light"]) .iconbtn .icon-moon { display: none; }
}

.langswitch {
  display: inline-flex;
  border: 1px solid var(--border-ctrl);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: .72rem; font-weight: 500;
}
.langswitch a {
  padding: .5rem .58rem;
  color: var(--ink-muted); text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.langswitch a:hover { background: var(--surface-2); color: var(--ink); }
.langswitch a[aria-current] { background: var(--moss); color: var(--bg); }

.navtoggle { display: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .82rem 1.4rem;
  font-size: .95rem; font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease),
              color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn--primary { background: var(--accent); color: #FFF; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-hover); color: #FFF; box-shadow: var(--shadow-md); }

.btn--ghost { border-color: var(--border-ctrl); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--moss); color: var(--moss); background: var(--moss-wash); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3.5rem, 8vw, 6rem);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 70% at 12% 0%, var(--moss-wash) 0%, transparent 62%),
    radial-gradient(42% 58% at 92% 8%, var(--accent-wash) 0%, transparent 60%);
  opacity: .9; pointer-events: none;
}
.hero > .wrap { position: relative; }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__title { margin-bottom: 1rem; }
.hero__role {
  font-family: var(--font-mono);
  font-size: clamp(.85rem, .8rem + .25vw, .98rem);
  color: var(--moss); font-weight: 500;
  letter-spacing: -.01em;
  margin-bottom: 1.5rem;
}
.hero__role b { color: var(--accent); font-weight: 500; }
.hero__pitch {
  font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem);
  color: var(--ink-muted);
  max-width: 54ch; margin-bottom: 2rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.hero__meta {
  display: flex; flex-wrap: wrap; gap: 1.4rem;
  margin-top: 2.25rem;
  font-family: var(--font-mono); font-size: .78rem;
  color: var(--ink-muted);
}
.hero__meta span { display: inline-flex; align-items: center; gap: .45rem; }
.hero__meta svg { width: 14px; height: 14px; color: var(--moss); }

.hero__portrait { position: relative; width: clamp(180px, 22vw, 268px); }
.hero__portrait img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: calc(var(--radius) * 2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.hero__portrait::after {
  content: ""; position: absolute;
  inset: auto -14px -14px auto;
  width: 64%; height: 64%;
  border: 2px solid var(--accent);
  border-radius: calc(var(--radius) * 2);
  z-index: -1;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
.stat { background: var(--surface); padding: 1.5rem 1.35rem; }
.stat__num {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.4rem);
  font-weight: 700; line-height: 1;
  color: var(--accent);
  letter-spacing: -.045em;
}
.stat__label {
  margin-top: .55rem;
  font-size: .82rem; color: var(--ink-muted);
  line-height: 1.4;
}

/* ---------- Sobre ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); }
.about__body > p + p { margin-top: 1.1rem; }
.about__body p { color: var(--ink-muted); font-size: 1.05em; }

.factlist { display: grid; gap: 0; border-top: 1px solid var(--border); }
.factlist__item { display: grid; gap: .2rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.factlist__k {
  font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--moss);
}
.factlist__v { font-size: .95rem; color: var(--ink); font-weight: 500; }
.factlist__v small { display: block; font-weight: 400; color: var(--ink-muted); font-size: .85rem; }

/* ---------- Filtros + chips ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 2rem;
}
.filter {
  padding: .5rem 1rem;
  font-size: .855rem; font-weight: 500;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--border-ctrl);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all .22s var(--ease);
}
.filter:hover { color: var(--ink); border-color: var(--moss); }
.filter[aria-pressed="true"] {
  background: var(--moss); border-color: var(--moss);
  color: var(--bg); font-weight: 600;
}

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem .95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: .89rem; font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease), opacity .28s var(--ease),
              border-color .22s var(--ease), color .22s var(--ease);
}
.chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--moss-soft); flex: none;
  transition: background .22s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip:hover::before { background: var(--accent); }
.chip[hidden] { display: none; }
.chip.is-dimmed { opacity: 0; transform: scale(.94); }

.filter-count {
  margin-top: 1.5rem;
  font-family: var(--font-mono); font-size: .76rem;
  color: var(--ink-muted);
}

/* ---------- Cards de projeto ---------- */
.projects { display: grid; gap: 1.25rem; }
.projects__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.25rem;
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2.15rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-firm); }
.card:focus-within { border-color: var(--accent); }

.card--feature {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  background: var(--feature-bg);
  border-color: var(--feature-line);
  color: var(--feature-muted);
}
.card--feature h3,
.card--feature .card__title a { color: var(--feature-ink); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); }
.card--feature p { color: var(--feature-muted); }
.card--feature .eyebrow { color: var(--feature-muted); }
.card--feature .eyebrow::before { background: var(--feature-accent); }
.card--feature .card__org { color: var(--feature-accent); }
.card--feature .tag {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .20);
  color: var(--feature-ink);
}
.card--feature .card__more { color: var(--feature-accent); }
.card--feature:hover { border-color: var(--feature-accent); }
.card--feature .card__title a {
  background-image: linear-gradient(var(--feature-accent), var(--feature-accent));
}
.card--feature .card__title a:hover { color: var(--feature-accent); }
.card--feature .card__title a::after { content: ""; position: absolute; inset: 0; }
.card--feature .card__figure {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(0, 0, 0, .18);
}

.card__title { margin-bottom: .7rem; }
.card__title a {
  color: var(--ink); text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1.5px; background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .3s var(--ease), color .2s var(--ease);
}
.card__title a:hover { color: var(--accent); background-size: 100% 1.5px; }
.card__title a::after { content: ""; position: absolute; inset: 0; }

.card__org {
  font-family: var(--font-mono); font-size: .73rem;
  letter-spacing: .06em; color: var(--moss);
  margin-bottom: .5rem;
}
.card__text { color: var(--ink-muted); font-size: .95rem; flex: 1; }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.35rem; }
.tag {
  font-family: var(--font-mono);
  font-size: .71rem; font-weight: 500;
  padding: .3rem .6rem;
  color: var(--ink-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.card__more {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-top: 1.35rem;
  font-size: .89rem; font-weight: 600;
  color: var(--accent); text-decoration: none;
}
.card__more svg { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.card:hover .card__more svg { transform: translateX(4px); }

.card__figure {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.card__figure img { width: 100%; }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before {
  content: ""; position: absolute;
  left: 7px; top: .6rem; bottom: .6rem;
  width: 2px; background: var(--border); border-radius: 2px;
}
.tl {
  position: relative;
  padding: 0 0 2.25rem 2.35rem;
}
.tl:last-child { padding-bottom: 0; }
.tl::before {
  content: ""; position: absolute;
  left: 0; top: .5rem;
  width: 16px; height: 16px;
  background: var(--bg);
  border: 3px solid var(--moss-soft);
  border-radius: 50%;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.tl--current::before { border-color: var(--accent); }
.tl:hover::before { transform: scale(1.18); border-color: var(--accent); }
.tl__when {
  font-family: var(--font-mono); font-size: .74rem;
  letter-spacing: .06em; color: var(--moss);
  margin-bottom: .3rem;
}
.tl__role { margin-bottom: .2rem; }
.tl__where { font-size: .89rem; color: var(--ink-muted); margin-bottom: .75rem; }
.tl__list { display: grid; gap: .4rem; }
.tl__list li {
  position: relative; padding-left: 1.05rem;
  font-size: .94rem; color: var(--ink-muted);
}
.tl__list li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}

/* ---------- Contato ---------- */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.contact__item {
  display: flex; align-items: flex-start; gap: .9rem;
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  transition: transform .26s var(--ease), border-color .26s var(--ease), box-shadow .26s var(--ease);
}
.contact__item:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-md); color: var(--ink); }
.contact__icon {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--moss-wash); color: var(--moss);
  transition: background .26s var(--ease), color .26s var(--ease);
}
.contact__item:hover .contact__icon { background: var(--accent-wash); color: var(--accent); }
.contact__icon svg { width: 18px; height: 18px; }
.contact__k { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); }
.contact__v { font-weight: 550; font-size: .95rem; word-break: break-word; }

/* ---------- Footer ---------- */
.footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-tint);
}
.footer__inner {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: center; justify-content: space-between;
  font-size: .85rem; color: var(--ink-muted);
}
.footer__links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer__links a { color: var(--ink-muted); text-decoration: none; transition: color .2s var(--ease); }
.footer__links a:hover { color: var(--accent); }

/* ---------- Páginas de case ---------- */
.pagehead {
  padding-block: clamp(3rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem);
  background: var(--bg-tint);
  border-bottom: 1px solid var(--border);
}
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  font-family: var(--font-mono); font-size: .74rem;
  color: var(--ink-muted); margin-bottom: 1.4rem;
}
.crumbs a { color: var(--moss); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs span[aria-hidden] { color: var(--border-firm); }

.pagehead h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); }
.pagehead__sub { margin-top: 1rem; max-width: 62ch; color: var(--ink-muted); font-size: 1.08em; }

.article { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.article__body > * + * { margin-top: 1.15rem; }
.article__body h2 { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.article__body h3 { margin-top: 2rem; }
.article__body p { color: var(--ink-muted); }
.article__body ul { display: grid; gap: .55rem; padding-left: 0; list-style: none; }
.article__body ul li { position: relative; padding-left: 1.3rem; color: var(--ink-muted); }
.article__body ul li::before {
  content: ""; position: absolute; left: .15rem; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.article__body strong { color: var(--ink); font-weight: 600; }

.toc {
  position: sticky; top: calc(var(--header-h) + 1.5rem);
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.toc__title {
  font-family: var(--font-mono); font-size: .7rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--moss); margin-bottom: .9rem;
}
.toc ol { list-style: none; padding: 0; display: grid; gap: .1rem; counter-reset: toc; }
.toc a {
  display: block; padding: .38rem .55rem;
  font-size: .86rem; color: var(--ink-muted);
  text-decoration: none; border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all .2s var(--ease);
}
.toc a:hover { color: var(--ink); background: var(--surface-2); }
.toc a[aria-current] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.callout {
  padding: 1.35rem 1.5rem;
  background: var(--moss-wash);
  border-left: 3px solid var(--moss);
  border-radius: var(--radius-sm);
}
.callout p { color: var(--ink); }
.callout--accent { background: var(--accent-wash); border-left-color: var(--accent); }

.keyvals {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.keyval { background: var(--surface); padding: 1.15rem 1.25rem; }
.keyval dt {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--moss); margin-bottom: .35rem;
}
.keyval dd { margin: 0; font-size: .93rem; font-weight: 500; }

/* ---------- Galeria de prints ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.shot {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.shot:hover { border-color: var(--border-firm); box-shadow: var(--shadow-md); }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); }
.shot figcaption {
  padding: .9rem 1.1rem;
  font-size: .85rem; color: var(--ink-muted);
  border-top: 1px solid var(--border);
}
.shot--pending img { opacity: .75; }

.pending-note {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .72rem;
  padding: .35rem .7rem; border-radius: var(--radius-pill);
  background: var(--accent-wash); color: var(--accent);
  border: 1px dashed var(--accent);
}

/* ---------- Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.notfound {
  min-height: 70vh;
  display: grid; place-items: center; text-align: center;
  padding-block: 4rem;
}
.notfound__code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 700; line-height: 1;
  color: var(--accent); letter-spacing: -.05em;
}

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .about { grid-template-columns: 1fr; }
  .article { grid-template-columns: 1fr; }
  .toc { position: static; order: -1; }
  .card--feature { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { order: -1; width: clamp(140px, 34vw, 190px); }
}

@media (max-width: 768px) {
  .navtoggle { display: grid; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-14px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; }
  .nav__link { padding: .85rem .25rem; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
  .nav__link::after { display: none; }
  .nav__link[aria-current] { color: var(--accent); }
}

@media (max-width: 420px) {
  .header__inner { gap: .4rem; }
  .brand span:not(.brand__mark) { display: none; }
}

/* ---------- Impressão ---------- */
@media print {
  .header, .footer__links, .skip, .hero__actions { display: none; }
  body { background: #FFF; color: #000; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------- Cadeia de etapas do fluxo ---------- */
.flowchain {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  padding: 1.35rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.flowchain__step {
  position: relative;
  display: inline-flex; align-items: center;
  padding: .45rem .8rem;
  font-family: var(--font-mono); font-size: .74rem; font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-firm);
  border-radius: var(--radius-pill);
  transition: border-color .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
}
.flowchain__step:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.flowchain__step:not(:last-child)::after {
  content: "›";
  margin-left: .8rem; margin-right: -.35rem;
  color: var(--moss-soft); font-size: 1rem; line-height: 1;
}
.flowchain__step--end {
  background: var(--moss); border-color: var(--moss); color: var(--bg); font-weight: 600;
}
.flowchain__step--end:hover { color: var(--bg); border-color: var(--moss); }

/* legenda de captura */
.shot figcaption em { color: var(--moss); font-style: normal; font-size: .95em; }
.article__body .shot { margin-top: 1.75rem; }
