/* Joer — site styles. Cyber brutalist: hairline grid, HUD frames, mono labels and buttons, one acid accent. */

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-offset); }
[tabindex="-1"]:focus { outline: none; } /* sections focused by in-page jumps */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

body {
  margin: 0;
  /* Hairline grid behind everything, like a blueprint plate */
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / var(--grid-cell) var(--grid-cell),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / var(--grid-cell) var(--grid-cell),
    var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--selection-bg); color: var(--selection-fg); }

h1, h2, p, figure { margin: 0; }
img { display: block; max-width: 100%; }

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

.j-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.j-link { transition: color .25s ease; }
.j-link:hover { color: var(--text-hover); }

.j-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Focus — 2px solid, 3px offset; orange on graphite surfaces */
a:focus-visible,
button:focus-visible {
  outline: var(--rule-strong) solid var(--ink);
  outline-offset: 3px;
}
.j-on-panel a:focus-visible { outline-color: var(--accent); }

/* ---------- Wordmark + header ---------- */
/* Sticky bar spans the full viewport; the inner .j-wrap keeps the content width */
.j-header-bar {
  position: sticky;
  top: var(--a11y-height, 0px);
  z-index: 5;
  /* Translucent + blurred so the page shows softly through it while scrolling */
  background: color-mix(in srgb, var(--surface-page) 82%, transparent);
  border-bottom: var(--rule-hair) solid var(--hud-line);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
/* Shadow appears once the page starts scrolling (class set by menu.js) */
.j-header-bar.is-scrolled { box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--ink) 45%, transparent); }
.j-header {
  display: grid;
  /* Equal side columns keep the nav list centred on the page */
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  min-height: 72px;
}
/* Every cell is closed by a hairline, like a HUD strip */
.j-wordmark,
.j-header__nav > .j-nav-list { border-right: var(--rule-hair) solid var(--hud-line); }
.j-wordmark {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  padding-right: var(--space-24);
  gap: 3px;
}
.j-wordmark__logo { display: block; height: 34px; width: auto; aspect-ratio: 762 / 128; }

.j-header__nav {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
}
.j-nav-list {
  align-self: stretch;
  border-left: var(--rule-hair) solid var(--hud-line);
  display: flex;
  align-items: center;
  gap: var(--space-28);
  margin: 0;
  padding: 0 var(--space-32);
  list-style: none;
}
/* "+" between items, set like grid crossings */
.j-nav-list > li { display: flex; align-items: center; gap: var(--space-28); }
.j-nav-list > li + li::before {
  content: "+";
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-accent);
}
/* Display-type labels with a mono index; the label rolls up to a copy of itself on hover */
.j-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-12) 0;
  transition: color .25s ease;
}
.j-nav-link:hover { color: var(--text-hover); }
.j-nav-link__num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .04em;
  opacity: .55;
  transition: opacity .25s ease;
}
/* Trim both boxes to cap height so flex centring lines up the glyphs, not the font's line boxes */
.j-nav-link__num,
.j-nav-link__label > span,
.j-nav-link__label::after { text-box: trim-both cap alphabetic; }
.j-nav-link__num::before { content: "("; }
.j-nav-link__num::after { content: ")"; }
.j-nav-link__label {
  display: grid;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.j-nav-link__label > span,
.j-nav-link__label::after {
  grid-area: 1 / 1;
  transition: transform .5s cubic-bezier(.77, 0, .18, 1);
}
.j-nav-link__label::after { content: attr(data-text); transform: translateY(110%); }
.j-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--rule-strong);
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s cubic-bezier(.77, 0, .18, 1);
}
.j-nav-link:hover .j-nav-link__label > span { transform: translateY(-110%); }
.j-nav-link:hover .j-nav-link__label::after { transform: none; }
.j-nav-link:is(:hover, [aria-current]) .j-nav-link__num { opacity: 1; }
.j-nav-link[aria-current]::after { transform: scaleX(1); transform-origin: left; }

.j-header__cta { justify-self: end; align-self: center; gap: var(--space-12); }

/* Button arrow: same motion as the work list — the arrow slides out along its direction while a twin slides in */
.j-btn__arrow {
  position: relative;
  flex: none;
  display: block;
  width: 1.9em;
  aspect-ratio: 1;
  margin: -.4em 0; /* bigger arrow, same button height */
  overflow: hidden;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.j-btn__arrow--out { transform: rotate(-45deg); }
.j-btn__arrow--down { transform: rotate(90deg); }
.j-btn__arrow svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform .5s cubic-bezier(.7, 0, .2, 1);
}
.j-btn__arrow svg + svg { transform: translateX(-110%); }
.j-btn:is(:hover, :focus-visible) .j-btn__arrow svg:first-child { transform: translateX(110%); }
.j-btn:is(:hover, :focus-visible) .j-btn__arrow svg + svg { transform: translateX(0); }

/* ---------- Menu toggle (two lines + word, small screens only) ---------- */
.j-menu-toggle {
  display: none;
  grid-column: -2;
  justify-self: end;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) 0 var(--space-12) var(--space-12);
  border: 0;
  background: none;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 18px;
  text-transform: uppercase;
  cursor: pointer;
}
/* "Menu" rolls up, "Fechar" rolls in */
.j-menu-toggle__label { display: grid; overflow: hidden; line-height: 1.2; }
.j-menu-toggle__label > span {
  grid-area: 1 / 1;
  text-align: right;
  transition: transform .5s cubic-bezier(.77, 0, .18, 1);
}
.j-menu-toggle__label > span + span { transform: translateY(110%); }
.is-menu-open .j-menu-toggle__label > span:first-child { transform: translateY(-110%); }
.is-menu-open .j-menu-toggle__label > span + span { transform: none; }

.j-menu-toggle__lines { position: relative; width: 30px; height: 10px; }
.j-menu-toggle__lines::before,
.j-menu-toggle__lines::after {
  content: "";
  position: absolute;
  right: 0;
  height: var(--rule-strong);
  background: currentColor;
  transition: top .3s ease, width .3s ease, transform .5s cubic-bezier(.77, 0, .18, 1);
}
.j-menu-toggle__lines::before { top: 0; width: 30px; }
.j-menu-toggle__lines::after { top: 8px; width: 18px; }
.j-menu-toggle:hover .j-menu-toggle__lines::after { width: 30px; }
.is-menu-open .j-menu-toggle__lines::before,
.is-menu-open .j-menu-toggle__lines::after { top: 4px; width: 30px; }
.is-menu-open .j-menu-toggle__lines::before { transform: rotate(45deg) scaleX(.85); }
.is-menu-open .j-menu-toggle__lines::after { transform: rotate(-45deg) scaleX(.85); }

/* Header sits on top of the open menu, switching to on-panel colors */
.j-header-bar { transition: background .3s ease, color .3s ease, box-shadow .3s ease; }
/* Lock on body, not html: overflow on html would stop body's overflow-x from reaching the viewport,
   making body the scroll container and pushing the sticky header (and its close button) off-screen */
.is-menu-open body { overflow: hidden; }
.is-menu-open .j-header-bar { background: var(--surface-panel); color: var(--text-on-panel); }
.is-menu-open .j-header-bar a:focus-visible,
.is-menu-open .j-menu-toggle:focus-visible { outline-color: var(--accent); }

/* ---------- Fullscreen menu ---------- */
/* Stays below the header (z-index 5): the solid header bar masks the list when it scrolls */
.j-menu {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface-panel);
  color: var(--text-on-panel);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path .7s cubic-bezier(.77, 0, .18, 1), visibility 0s linear .7s;
}
.is-menu-open .j-menu {
  clip-path: inset(0);
  visibility: visible;
  transition: clip-path .7s cubic-bezier(.77, 0, .18, 1), visibility 0s;
}
.j-menu__inner {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  padding-top: max(var(--header-offset), calc(var(--header-bottom, 0px) + var(--space-24)));
  padding-bottom: var(--space-24);
}
.j-menu__head,
.j-menu__foot,
.j-menu-row__num,
.j-menu-row__meta { opacity: 0; transition: opacity .4s ease, color .25s ease; }
.is-menu-open :is(.j-menu__head, .j-menu__foot, .j-menu-row__num, .j-menu-row__meta) {
  opacity: 1;
  transition-delay: .45s, 0s;
}
.j-menu__head { padding-bottom: 0; }
.j-menu__list { list-style: none; margin: 0; padding: 0; border-top: var(--rule-strong) solid var(--border-on-panel); }
.j-menu-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2vw, var(--space-32));
  padding: 0 clamp(var(--space-4), 1.4vw, var(--space-20));
  border-bottom: var(--rule-strong) solid var(--border-on-panel);
  transition: background .25s ease;
}
.j-menu-row__num,
.j-menu-row__meta { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; }
.j-menu-row__meta { text-align: right; }
/* Each title is masked; its inner word slides up into view, staggered by --i */
.j-menu-row__title {
  display: block;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: clamp(54px, min(16vw, 11svh), 150px);
  line-height: 1.12;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--text-display);
  transition: color .25s ease;
}
.j-menu-row__title > span {
  display: block;
  transform: translateY(105%);
  transition: transform .45s cubic-bezier(.77, 0, .18, 1);
}
.is-menu-open .j-menu-row__title > span {
  transform: none;
  transition-duration: .8s;
  transition-delay: calc(.2s + var(--i) * .07s);
}
/* hover/tap: invert, like the work list */
.j-menu-row:is(:hover, :focus-visible, :active) { background: var(--accent); }
.j-menu-row:is(:hover, :focus-visible, :active) > span { color: var(--ink); }
.j-on-panel .j-menu-row:focus-visible { outline-color: var(--paper); outline-offset: -4px; }

.j-menu__foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: var(--space-12) var(--space-24);
  flex-wrap: wrap;
}
.j-menu > .j-stripes--band { flex: none; height: var(--space-40); }

/* ---------- Buttons ---------- */
.j-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 0;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
/* Big action: a slab with the arrow pushed to the far edge */
.j-btn--solid {
  gap: var(--space-40);
  min-width: 260px;
  padding: var(--space-18) var(--space-22);
  font-size: 14px;
  background: var(--ink);
  color: var(--accent);
}
.j-btn--solid:hover { background: var(--paper); color: var(--ink); }
.j-btn--outline {
  gap: var(--space-24);
  padding: var(--space-12) var(--space-18);
  font-size: 13px;
  border: var(--rule-hair) solid var(--border-strong);
}
.j-btn--outline:hover { background: var(--ink); color: var(--accent); }
/* Header action: always the accent, whatever the surface */
.j-btn--accent {
  gap: var(--space-24);
  padding: var(--space-12) var(--space-18);
  font-size: 13px;
  background: var(--accent);
  color: var(--ink-deep);
}
.j-btn--accent:hover { background: var(--paper); color: var(--ink-deep); }
/* In light mode the page itself is the accent, so the action inverts to ink */
html:not(.is-dark) .j-btn--accent { background: var(--ink); color: var(--accent); }

/* ---------- Labels ---------- */
.j-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-transform: uppercase;
}
/* Section index, "/03": the slash number in the accent, the title after it */
.j-index { color: var(--text-accent); margin-right: var(--space-14); }
.j-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-16);
  padding-bottom: var(--space-14);
  flex-wrap: wrap;
}

/* HUD corners: four short brackets on any framed block (.j-hud) */
.j-hud { position: relative; }
.j-hud::before,
.j-hud::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  border: 0 solid var(--text-accent);
}
.j-hud::before { top: -1px; left: -1px; border-width: var(--rule-strong) 0 0 var(--rule-strong); }
.j-hud::after { bottom: -1px; right: -1px; border-width: 0 var(--rule-strong) var(--rule-strong) 0; }

/* ---------- Statements ---------- */
.j-statement { font-weight: 800; text-wrap: balance; }
.j-statement--hero {
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: .96;
  letter-spacing: -.04em;
}
.j-statement--manifesto {
  font-size: clamp(36px, 6vw, 92px);
  line-height: .98;
  letter-spacing: -.035em;
}
.j-statement--panel {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.12;
  letter-spacing: -.6px;
}
.j-highlight { color: var(--text-display); }

/* ---------- Hero ---------- */
.j-hero { position: relative; padding-top: clamp(32px, 5vw, 64px); }

/* Hero action: same colors as the header's Contato (.j-btn--accent), at the larger slab size */
.j-btn--hero { gap: var(--space-40); white-space: nowrap; min-width: 260px; padding: var(--space-18) var(--space-22); font-size: 14px; }

/* Particle clouds (assets/js/particles.js). pointer-events: none lets every click and hover pass straight through */
.j-particles { position: absolute; pointer-events: none; }

/* Face laid over the face in the profile photo (particles.js maps it onto the img's object-fit box).
   Halftone dots in the current theme's accent color */
.j-particles--photo {
  inset: 0;
  width: 100%;
  height: 100%;
  --particle-ink: var(--accent);
  --particle-light: var(--accent);
  transition: transform 1.2s cubic-bezier(.2, .7, .2, 1);
}
.j-panel__media:is(:hover, :focus-within) .j-particles--photo { transform: scale(1.1); } /* zooms with the photo */

/* Hand rising from behind the profile panel (data-shape="hand", placed inside .j-profile) */
.j-particles--hand {
  right: min(0px, (100% - 100vw) / 2);
  bottom: calc(100% - 240px);          /* the lower part tucks behind the panel's top edge */
  width: 100vw;
  height: min(100vh, 1000px);
  z-index: -1;
}
.is-high-contrast .j-particles { display: none; }

/* David bust standing on the right of the hero (data-shape="bust"), behind the copy */
.j-particles--bust {
  top: 0;
  right: 0;
  bottom: 0;
  width: min(62%, 760px);
  height: 100%;
  z-index: 0;
  --particle-ink: var(--text-primary);
  --particle-light: var(--text-display);
  --hand-x: .57;
  --hand-y: .5;
  --hand-size: .92;
}
.j-hero__grid { position: relative; z-index: 1; }
@media (max-width: 900px) {
  /* Narrow: the bust steps back behind the title, off the right edge */
  .j-particles--bust { width: 100%; opacity: .35; --hand-x: .78; --hand-size: .8; }
}

.j-hero__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-32);
  padding: clamp(32px, 4vw, 56px) 0 clamp(64px, 8vw, var(--space-112));
  align-items: end;
}
.j-hero__title { grid-column: 1 / -1; max-width: 1200px; }
@media (min-width: 901px) {
  .j-hero__title { max-width: min(1200px, 62%); } /* wraps short of the bust on the right */
}
.j-hero__aside { display: grid; gap: var(--space-18); justify-items: start; }

/* Entrance — each word rises out of its own slot, then the highlight is inked in blush */
.j-word {
  display: inline-block;
  clip-path: inset(-.6em -.3em -.22em -.3em); /* room for accents and descenders */
}
.j-word > span {
  display: inline-block;
  animation: j-word-rise .95s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i) * 55ms + 120ms);
}
.j-hero__words .j-highlight .j-word > span {
  animation-name: j-word-rise, j-word-ink;
  animation-duration: .95s, .7s;
  animation-delay: calc(var(--i) * 55ms + 120ms), calc(var(--i) * 70ms + 700ms);
}
.j-hero > .j-eyebrow,
.j-hero__aside { animation: j-fade-up .8s cubic-bezier(.2, .8, .2, 1) both; }
.j-hero > .j-eyebrow { animation-delay: .05s; }
.j-hero__aside { animation-delay: 1.05s; }
@keyframes j-word-rise { from { transform: translateY(140%) rotate(5deg); } }
@keyframes j-word-ink { from { color: var(--text-primary); } }
@keyframes j-fade-up { from { opacity: 0; transform: translateY(16px); } }

/* Paused or reduced motion: everything is in place from the start */
.is-motion-paused :is(.j-word > span, .j-hero > .j-eyebrow, .j-hero__aside) { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  :is(.j-word > span, .j-hero > .j-eyebrow, .j-hero__aside) { animation: none !important; }
}

.j-lead {
  font-size: 17px;
  line-height: 1.5;
  font-weight: 500;
  max-width: 640px;
  text-wrap: pretty;
}

/* ---------- Profile panel ---------- */
.j-profile { position: relative; z-index: 2; padding-bottom: clamp(40px, 5vw, var(--space-64)); } /* under the a11y bar (3) and header (5) */
.j-panel {
  background: var(--surface-panel);
  color: var(--text-on-panel);
  border-radius: 0;
  padding: clamp(24px, 4vw, var(--space-56));
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(var(--space-32), 4vw, var(--space-56));
}
/* HUD frame: chamfered plate, an inner hairline that follows the cut, and small marks in the gutter.
   Shared by the essay card; --plate, --line and --mark let a block repaint it. */
:is(.j-profile .j-panel, .j-acs-panel, .j-facts--hud, .j-ctx, .j-model, .j-storm, .j-essay-card, .j-pj-card, .j-tally) {
  --plate: var(--surface-panel);
  --mark: var(--accent);
  --cut: clamp(32px, 4vw, 56px);    /* big chamfers: top-left, bottom-right */
  --cut-s: 16px;                    /* small chamfers: top-right, bottom-left */
  --frame: 16px;                    /* gutter between the plate edge and the hairline */
  --line: color-mix(in srgb, var(--accent) 70%, transparent);
  position: relative;
  isolation: isolate;
  background:
    /* "+" in the bottom gutter, left of the chamfer */
    linear-gradient(var(--mark), var(--mark)) right calc(var(--cut) + 18px) bottom 3px / 2px 10px no-repeat,
    linear-gradient(var(--mark), var(--mark)) right calc(var(--cut) + 14px) bottom 7px / 10px 2px no-repeat,
    /* hatch in the bottom gutter */
    repeating-linear-gradient(60deg, var(--mark) 0 2px, transparent 2px 6px) left calc(var(--cut-s) + 40px) bottom 4px / 72px 8px no-repeat,
    /* slanted tabs in the top gutter */
    repeating-linear-gradient(-60deg, var(--mark) 0 18px, transparent 18px 26px) right 34% top 4px / 78px 8px no-repeat,
    /* tick marks in the left gutter */
    repeating-linear-gradient(var(--mark) 0 3px, transparent 3px 9px) left 4px top 18% / 6px 48px no-repeat,
    var(--plate);
  color: var(--text-on-panel);
  clip-path: polygon(
    var(--cut) 0, calc(100% - var(--cut-s)) 0, 100% var(--cut-s),
    100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%,
    var(--cut-s) 100%, 0 calc(100% - var(--cut-s)),
    0 72%, 8px calc(72% - 8px), 8px calc(42% + 8px), 0 42%,  /* notch in the left edge */
    0 var(--cut)
  );
  border-radius: 0;
  padding: clamp(40px, 4.5vw, 64px);
}
/* Hairline = orange plate with a graphite plate 1px smaller on top of it */
:is(.j-profile .j-panel, .j-acs-panel, .j-facts--hud, .j-ctx, .j-model, .j-storm, .j-essay-card, .j-pj-card, .j-tally)::before,
:is(.j-profile .j-panel, .j-acs-panel, .j-facts--hud, .j-ctx, .j-model, .j-storm, .j-essay-card, .j-pj-card, .j-tally)::after {
  content: "";
  position: absolute;
  z-index: -1;
  --c: calc(var(--cut) - var(--frame) * .4);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  pointer-events: none;
}
:is(.j-profile .j-panel, .j-acs-panel, .j-facts--hud, .j-ctx, .j-model, .j-storm, .j-essay-card, .j-pj-card, .j-tally)::before { inset: var(--frame); background: var(--line); }
:is(.j-profile .j-panel, .j-acs-panel, .j-facts--hud, .j-ctx, .j-model, .j-storm, .j-essay-card, .j-pj-card, .j-tally)::after {
  inset: calc(var(--frame) + 1px);
  --c: calc(var(--cut) - var(--frame) * .4 - .4px);
  background: var(--plate);
}
/* Dot grid in the top gutter, by the small chamfer */
.j-panel__hud {
  position: absolute;
  top: 3px;
  right: calc(var(--cut-s) + 24px);
  width: 54px;
  height: 10px;
  background: radial-gradient(circle, var(--mark, var(--accent)) 1.1px, transparent 1.5px) 0 0 / 6px 5px;
  pointer-events: none;
}
.is-high-contrast :is(.j-profile .j-panel, .j-acs-panel, .j-facts--hud, .j-ctx, .j-model, .j-storm, .j-essay-card, .j-pj-card, .j-tally) { clip-path: none; border: 1px solid #fff; }
.j-panel__main {
  display: flex;
  flex-direction: column;
  gap: clamp(var(--space-40), 4vw, var(--space-56));
  min-width: 0;
}
.j-panel__head { display: grid; gap: var(--space-24); align-content: start; }
.j-panel__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-16);
  padding-bottom: var(--space-14);
  border-bottom: var(--rule-hair) solid var(--border-on-panel);
}
.j-panel__bio {
  font-weight: 700;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.25;
  letter-spacing: -.4px;
  max-width: 30ch;
  color: var(--text-display);
  text-wrap: pretty;
}

/* Two figures side by side; the caption reads first, the number lands below */
.j-stats {
  margin: auto 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-24);
}
.j-stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: var(--space-12);
}
.j-stat__value {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(88px, 10vw, 168px);
  line-height: .82;
  letter-spacing: -.02em;
}
.j-stat__caption {
  max-width: 22ch;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
}

.j-panel__media {
  position: relative;
  min-height: clamp(420px, 46vw, 680px);
  border: var(--rule-strong) solid var(--border-on-panel);
  border-radius: 0;
  overflow: hidden;
  background: var(--surface-media);
  box-shadow: 0 32px 40px -28px rgba(0, 0, 0, .75);
  transform: perspective(1200px) rotateY(-10deg) rotateX(4deg);
  transform-origin: 60% 50%;
  animation: j-media-float 7s ease-in-out infinite;
  will-change: transform;
}
/* Leans away from the copy and drifts, like a print pinned off the wall */
@keyframes j-media-float {
  0%, 100% { transform: perspective(1200px) rotateY(-10deg) rotateX(4deg) translateY(0); }
  50%      { transform: perspective(1200px) rotateY(-5deg) rotateX(-1deg) translateY(-16px); }
}
.j-panel__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: transform 1.2s cubic-bezier(.2, .7, .2, 1);
}
.j-panel__media:is(:hover, :focus-within) img { transform: scale(1.1); }

/* Contact links under the photo, set in mono like the labels */
.j-panel__side {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  min-width: 0;
}
.j-media-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-12);
  padding-top: var(--space-40);
}
.j-media-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-18);
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  border: var(--rule-strong) solid var(--border-on-panel);
  color: var(--text-display);
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.j-media-link__label { display: inline-flex; align-items: center; gap: var(--space-12); }
.j-media-link__icon { width: 20px; height: 20px; flex: none; }
.j-media-link:is(:hover, :focus-visible) .j-btn__arrow svg:first-child { transform: translateX(110%); }
.j-media-link:is(:hover, :focus-visible) .j-btn__arrow svg + svg { transform: translateX(0); }
.j-media-link:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.j-media-link--primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.j-media-link--primary:hover { background: var(--paper); border-color: var(--paper); }
.j-on-panel .j-media-link:focus-visible { outline-color: var(--paper); }
/* Fade to graphite at the foot so the caption sits on the photo */
.j-panel__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(to top, var(--surface-media), transparent);
  pointer-events: none;
}
.j-panel__caption {
  position: absolute;
  z-index: 1;
  left: var(--space-20);
  right: var(--space-20);
  bottom: var(--space-20);
  display: flex;
  justify-content: space-between;
  gap: var(--space-12);
  padding-top: var(--space-12);
  border-top: var(--rule-hair) solid var(--border-on-panel);
  color: var(--text-display);
}
/* Stripe tab notched into the photo's top corner */
.j-stripes--corner {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  width: clamp(96px, 12vw, 168px);
  height: clamp(56px, 6vw, 84px);
  border-bottom-left-radius: 0;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, var(--ink) 10px 24px);
}

@media (prefers-reduced-motion: reduce) {
  .j-panel__media { animation: none; }
}
@media (max-width: 560px) {
  .j-panel__media { min-height: 420px; }
  .j-stats { gap: var(--space-16); }
  .j-panel__caption { flex-direction: column; gap: var(--space-4); }
}

/* ---------- Stripes (the only texture) ---------- */
.j-stripes--field {
  height: clamp(140px, 20vw, 260px);
  border-radius: 0;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 24px, var(--ink) 24px 56px);
}
.j-stripes--hazard {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.j-stripes__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-14) var(--space-32);
  background: var(--surface-panel);
  border: var(--rule-hair) solid var(--border-on-panel);
  border-bottom: 0;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 100%, 0 100%);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}
/* Blinking block cursor */
.j-cursor {
  display: inline-block;
  width: .6em;
  height: 1.05em;
  margin-left: var(--space-4);
  background: currentColor;
  animation: j-cursor-blink 1.1s steps(1) infinite;
}
@keyframes j-cursor-blink { 50% { opacity: 0; } }
.is-motion-paused .j-cursor { animation: none; }
@media (prefers-reduced-motion: reduce) { .j-cursor { animation: none; } }
.j-stripes--band {
  height: var(--space-64);
  background: repeating-linear-gradient(-45deg, var(--accent) 0 18px, transparent 18px 42px);
}
.j-stripes--band.j-stripes--dark {
  background: repeating-linear-gradient(-45deg, var(--ink) 0 18px, transparent 18px 42px);
}

/* ---------- Areas ("O que faço"): three columns split by hairlines, one column on narrow screens ---------- */
.j-areas-section { padding-top: clamp(40px, 5vw, var(--space-64)); padding-bottom: clamp(40px, 6vw, var(--space-88)); }
.j-areas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: var(--rule-strong) solid var(--border-strong);
  border-bottom: var(--rule-strong) solid var(--border-strong);
}
.j-areas__item {
  display: grid;
  align-content: start;
  gap: var(--space-12);
  min-width: 0;
  padding: var(--space-24) var(--space-18) var(--space-32);
}
.j-areas__item + .j-areas__item { border-left: var(--rule-hair) solid var(--border-strong); }
.j-areas__item > * { margin: 0; }
.j-areas__num { font-family: var(--font-display); font-size: 40px; line-height: .85; color: var(--text-accent); }
.j-areas__name { font-weight: 800; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.15; letter-spacing: -.4px; text-wrap: balance; }
.j-areas__desc { font-size: 16px; line-height: 1.5; font-weight: 500; text-wrap: pretty; }
.j-areas__link { justify-self: start; margin-top: var(--space-6); }
@media (max-width: 900px) {
  .j-areas { grid-template-columns: minmax(0, 1fr); }
  .j-areas__item { padding-inline: 0; }
  .j-areas__item + .j-areas__item { border-left: 0; border-top: var(--rule-hair) solid var(--border-strong); }
}

/* ---------- Work list ---------- */
.j-works { padding-top: clamp(40px, 5vw, var(--space-64)); padding-bottom: clamp(80px, 10vw, var(--space-140)); }
.j-work { list-style: none; margin: 0; padding: 0; border-top: var(--rule-hair) solid var(--border-strong); }
.j-work-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(12px, 2vw, var(--space-32));
  padding: var(--space-20) clamp(0px, 1.4vw, var(--space-20)) var(--space-6);
  border-bottom: var(--rule-hair) solid var(--border-strong);
  transition: background .25s ease, opacity .25s ease;
}
.j-work-row__num { color: var(--text-accent); }
.j-work-row__num::before { content: "/"; }
.j-work-row__num,
.j-work-row__meta {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  transition: color .25s ease;
}
.j-work-row__title {
  font-family: var(--font-display);
  font-size: clamp(56px, 10.5vw, 150px);
  line-height: 1.3;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--text-primary);
  transition: color .25s ease;
  min-width: 0;
  overflow-wrap: anywhere;
}
.j-work-row__meta { display: grid; justify-items: end; gap: var(--space-4); text-align: right; }
.j-work-row__more { display: none; }
.j-work-row:hover .j-work-row__more,
.j-work-row:focus-visible .j-work-row__more { display: inline; }

/* big arrow: the glyph slides out along its direction while a twin slides in */
.j-work-row__arrow {
  position: relative;
  display: block;
  width: clamp(48px, 8vw, 120px);
  aspect-ratio: 1;
  overflow: hidden;
  color: var(--text-primary);
  transition: color .25s ease, transform .5s cubic-bezier(.2, .8, .2, 1);
}
.j-work-row__arrow--out { transform: rotate(-45deg); }
.j-work-row__arrow svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform .5s cubic-bezier(.7, 0, .2, 1);
}
.j-work-row__arrow svg + svg { transform: translateX(-110%); }
.j-work-row:is(:hover, :focus-visible) .j-work-row__arrow svg:first-child { transform: translateX(110%); }
.j-work-row:is(:hover, :focus-visible) .j-work-row__arrow svg + svg { transform: translateX(0); }
.j-work-row:is(:hover, :focus-visible) .j-work-row__arrow { transform: scale(1.08); }
.j-work-row:is(:hover, :focus-visible) .j-work-row__arrow--out { transform: rotate(-45deg) scale(1.08); }

/* hover: invert (default) */
.j-work--invert .j-work-row:hover,
.j-work--invert .j-work-row:focus-visible { background: var(--ink); }
.j-work--invert .j-work-row:hover > span,
.j-work--invert .j-work-row:focus-visible > span { color: var(--accent); }

/* hover: dim */
.j-work--dim:hover .j-work-row:not(:hover) { opacity: var(--opacity-dimmed); }

/* ---------- Manifesto band ---------- */
.j-manifesto {
  background: var(--surface-panel);
  color: var(--text-on-panel);
}
.j-manifesto__inner {
  padding-top: clamp(96px, 12vw, var(--space-180));
  padding-bottom: clamp(96px, 12vw, var(--space-180));
}
.j-manifesto__label { padding-bottom: var(--space-28); }

/* Essay card: a door from the manifesto to the architecture essay, framed like the profile panel
   (frame rules live with .j-profile .j-panel). The "Ler o ensaio" link stretches over the whole card.
   The drawing is a tiny context map; core context filled, generic one dashed. */
.j-essay-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(var(--space-24), 4vw, var(--space-64));
  margin-top: clamp(var(--space-56), 7vw, var(--space-112));
  transition: color .35s ease;
}
.j-essay-card__body { display: grid; gap: var(--space-18); justify-items: start; }
.j-essay-card__kicker {
  display: flex;
  justify-content: space-between;
  gap: var(--space-12);
  width: 100%;
  padding-bottom: var(--space-14);
  border-bottom: var(--rule-hair) solid currentColor;
}
.j-essay-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: inherit;
  font-size: clamp(40px, 5.4vw, 88px);
  line-height: .95;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--text-display);
  transition: color .35s ease;
}
.j-essay-card__text { max-width: 560px; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.5; font-weight: 500; text-wrap: pretty; }
.j-essay-card__more { display: inline-flex; align-items: center; gap: var(--space-12); padding-top: var(--space-6); font-size: 13px; color: inherit; text-decoration: none; }
.j-essay-card__more::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.j-essay-card__arrow { display: inline-block; transition: translate .35s cubic-bezier(.2, .8, .2, 1); }

.j-essay-card__map { width: 100%; height: auto; overflow: visible; }
.j-essay-card__ctx { fill: none; stroke: var(--accent); stroke-width: 2; transition: fill .35s ease, stroke .35s ease, translate .5s cubic-bezier(.2, .8, .2, 1); }
.j-essay-card__ctx--generic { stroke-dasharray: 6 5; }
.j-essay-card__label { fill: var(--accent); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; text-anchor: middle; transition: fill .35s ease; }
.j-essay-card__label--core { fill: var(--ink); }
.j-essay-card__ctx--core { fill: var(--paper); stroke: var(--paper); }
.j-essay-card__link {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 4 6;
  animation: j-essay-flow 1.6s linear infinite;
  transition: stroke .35s ease;
}
@keyframes j-essay-flow { to { stroke-dashoffset: -20; } }

/* At rest the card is an accent plate with ink marks; hover/focus drops it back to the graphite plate */
.j-essay-card:not(:is(:hover, :focus-within)) { --plate: var(--accent); --line: var(--ink); --mark: var(--ink); color: var(--ink); }
.j-essay-card:not(:is(:hover, :focus-within)) .j-essay-card__title { color: var(--ink); }
.j-essay-card:not(:is(:hover, :focus-within)) :is(.j-essay-card__ctx, .j-essay-card__link) { stroke: var(--ink); }
.j-essay-card:not(:is(:hover, :focus-within)) .j-essay-card__ctx--core { fill: var(--ink); }
.j-essay-card:not(:is(:hover, :focus-within)) .j-essay-card__label { fill: var(--ink); }
.j-essay-card:not(:is(:hover, :focus-within)) .j-essay-card__label--core { fill: var(--accent); }
.j-essay-card:is(:hover, :focus-within) { --plate: var(--surface-media); } /* lifts it off the graphite band */
.j-essay-card:is(:hover, :focus-within) .j-essay-card__arrow { translate: 6px 0; }
/* clip-path would cut an outline on the card, so the ring sits on the link text */
.j-on-panel .j-essay-card__more:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.is-motion-paused .j-essay-card__link { animation: none; }
@media (prefers-reduced-motion: reduce) { .j-essay-card__link { animation: none; } }
@media (max-width: 760px) {
  .j-essay-card { grid-template-columns: minmax(0, 1fr); }
  .j-essay-card__map { order: -1; max-width: 240px; }
}

/* ---------- Testimonial ---------- */
.j-quote-section { padding-bottom: clamp(80px, 10vw, var(--space-140)); }
.j-quote {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-32) clamp(var(--space-32), 5vw, var(--space-88));
  padding-top: clamp(40px, 5vw, var(--space-72));
  border-top: var(--rule-hair) solid var(--border-strong);
}
/* On the home page each testimonial is its own framed plate */
.j-quotes .j-quote {
  padding: clamp(var(--space-24), 2.4vw, var(--space-40));
  border: var(--rule-hair) solid var(--hud-line);
  background: color-mix(in srgb, var(--surface-page) 60%, transparent);
}
/* Author sits in the left column on wide screens, under the quote on narrow */
.j-quote__author {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  gap: var(--space-20);
  align-content: start;
  position: sticky;
  top: var(--header-offset);
  align-self: start;
}
.j-quote__photo {
  width: clamp(120px, 14vw, 200px);
  height: auto;
  border-radius: 0;
}
.j-quote__who { display: grid; gap: var(--space-6); }
.j-quote__who b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 3.4vw, 52px);
  line-height: .95;
  text-transform: uppercase;
}
.j-quote__text { grid-column: 2; margin: 0; max-width: 820px; }
.j-quote__text::before {
  content: "“";
  display: block;
  height: .5em;
  font-family: var(--font-display);
  font-size: clamp(96px, 10vw, 160px);
  line-height: 1;
}
.j-quote__text p {
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.4px;
  text-wrap: pretty;
}
.j-quote__text mark {
  background: var(--ink);
  color: var(--accent);
  padding: 0 .15em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
/* Several testimonials stacked on the home page */
.j-quotes-section { padding-top: clamp(96px, 12vw, var(--space-160)); padding-bottom: clamp(80px, 10vw, var(--space-140)); }
.j-quotes { display: grid; gap: clamp(64px, 8vw, var(--space-112)); }
.j-quotes .j-quote__text p { font-size: clamp(20px, 1.8vw, 28px); }
.j-quote__note { display: block; margin-top: var(--space-20); }

/* Desktop: testimonials side by side, author under each quote */
@media (min-width: 1200px) {
  .j-quotes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(var(--space-32), 3vw, var(--space-56)); }
  .j-quotes .j-quote { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; }
  .j-quotes .j-quote__text { grid-column: 1; grid-row: 1; }
  .j-quotes .j-quote__text::before { font-size: 112px; }
  .j-quotes .j-quote__text p { font-size: clamp(18px, 1.35vw, 21px); letter-spacing: -.2px; }
  .j-quotes .j-quote__author {
    grid-column: 1;
    grid-row: 2;
    position: static;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-16);
  }
  .j-quotes .j-quote__photo { width: 80px; }
  .j-quotes .j-quote__who b { font-size: clamp(26px, 2vw, 34px); }
}

/* ---------- Articles ---------- */
.j-articles-section { padding-top: clamp(96px, 12vw, var(--space-160)); padding-bottom: clamp(96px, 12vw, var(--space-160)); }
.j-articles { list-style: none; margin: 0; padding: 0; border-top: var(--rule-strong) solid var(--border-strong); }
.j-article-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: clamp(12px, 2vw, var(--space-32));
  align-items: baseline;
  padding: var(--space-28) 0;
  border-bottom: var(--rule-hair) solid var(--border-strong);
  transition: color .25s ease;
}
.j-article-row:hover { color: var(--text-hover); }
.j-article-row__num,
.j-article-row__tag { font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; }
.j-article-row__title {
  font-size: clamp(28px, 3.6vw, 52px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.04;
  text-wrap: balance;
}

/* ---------- Contact footer ---------- */
.j-footer { background: var(--surface-panel); color: var(--text-on-panel); }
.j-footer__inner {
  padding-top: clamp(var(--space-64), 8vw, var(--space-112));
  padding-bottom: var(--space-32);
  display: grid;
  gap: clamp(48px, 6vw, var(--space-88));
}
.j-footer__row { display: flex; justify-content: space-between; gap: var(--space-24); flex-wrap: wrap; }
.j-footer__cta {
  font-family: var(--font-display);
  font-size: clamp(72px, 14vw, 210px);
  line-height: .86;
  text-transform: uppercase;
  letter-spacing: -.01em;
  transition: color .25s ease;
  justify-self: start;
}
.j-footer__cta:hover { color: var(--text-hover); }
/* Contact rows: HUD readout — mono label, bold value, arrow at the edge; accent fill wipes in on hover */
.j-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 720px;
  border-top: var(--rule-hair) solid color-mix(in srgb, var(--border-on-panel) 35%, transparent);
}
.j-contact-list > li { border-bottom: var(--rule-hair) solid color-mix(in srgb, var(--border-on-panel) 35%, transparent); }
.j-contact {
  position: relative;
  display: grid;
  grid-template-columns: 10.5em minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-18) var(--space-14);
  isolation: isolate;
  transition: color .35s cubic-bezier(.7, 0, .2, 1);
}
.j-contact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  /* chamfered top-right corner, like the panels */
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s cubic-bezier(.7, 0, .2, 1);
}
.j-contact:is(:hover, :focus-visible) { color: var(--ink-deep); }
.j-contact:is(:hover, :focus-visible)::before { transform: none; }
.j-contact__label {
  display: flex;
  align-items: baseline;
  gap: var(--space-12);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.j-contact__num { opacity: .55; }
.j-contact__value {
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 700;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.j-contact .j-btn__arrow { font-size: 14px; }
.j-contact:is(:hover, :focus-visible) .j-btn__arrow svg:first-child { transform: translateX(110%); }
.j-contact:is(:hover, :focus-visible) .j-btn__arrow svg + svg { transform: translateX(0); }
@media (max-width: 640px) {
  .j-contact { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-4); padding-inline: 8px; }
  .j-contact__label { grid-column: 1; }
  .j-contact__value { grid-column: 1; grid-row: 2; }
  .j-contact .j-btn__arrow { grid-column: 2; grid-row: 1 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  .j-contact::before { transition: none; }
}
.is-high-contrast .j-contact::before { background: #fff; clip-path: none; }
.is-high-contrast .j-contact:is(:hover, :focus-visible) { color: #000; }
.j-footer__legal {
  --mark: var(--accent);
  --line: color-mix(in srgb, var(--accent) 70%, transparent);
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: var(--space-16);
  padding-top: calc(var(--space-20) + 14px);
  flex-wrap: wrap;
}
/* Cyber divider: the profile panel's gutter marks strung along a hairline with chamfered end caps */
.j-footer__legal::before,
.j-footer__legal::after {
  content: "";
  position: absolute;
  top: 0;
  height: 14px;
  pointer-events: none;
}
.j-footer__legal::before {
  left: 0;
  right: 0;
  background:
    /* end caps: slanted wedges sitting on the hairline */
    linear-gradient(45deg, var(--mark) calc(100% - 4px), transparent 0) left 0 bottom 0 / 44px 6px no-repeat,
    linear-gradient(-45deg, var(--mark) calc(100% - 4px), transparent 0) right 0 bottom 0 / 44px 6px no-repeat,
    /* tick marks after the left cap */
    repeating-linear-gradient(90deg, var(--mark) 0 2px, transparent 2px 8px) left 56px top 2px / 42px 6px no-repeat,
    /* hatch */
    repeating-linear-gradient(60deg, var(--mark) 0 2px, transparent 2px 6px) left 22% top 0 / 72px 8px no-repeat,
    /* slanted tabs */
    repeating-linear-gradient(-60deg, var(--mark) 0 18px, transparent 18px 26px) right 34% top 0 / 78px 8px no-repeat,
    /* "+" before the right cap */
    linear-gradient(var(--mark), var(--mark)) right 64px top 0 / 2px 10px no-repeat,
    linear-gradient(var(--mark), var(--mark)) right 60px top 4px / 10px 2px no-repeat,
    /* hairline */
    linear-gradient(var(--line), var(--line)) left 0 bottom 0 / 100% 1px no-repeat;
}
/* Dot grid, as in the panel's top gutter */
.j-footer__legal::after {
  right: 16%;
  width: 54px;
  height: 10px;
  background: radial-gradient(circle, var(--mark) 1.1px, transparent 1.5px) 0 0 / 6px 5px;
}
@media (max-width: 640px) {
  .j-footer__legal::after { display: none; }
}
.is-high-contrast .j-footer__legal::before { background: linear-gradient(#fff, #fff) left 0 bottom 0 / 100% 1px no-repeat; }
.is-high-contrast .j-footer__legal::after { display: none; }

/* Circuit trace across the top of the footer: fixed-size SVG pieces joined by stretching hairlines,
   so rings and the hatch never distort. Main trace sits at y=26 of a 32-unit-tall piece. */
.j-circuit {
  --h: 32px;
  --mark: var(--accent);
  --faint: color-mix(in srgb, var(--accent) 35%, transparent);
  display: flex;
  height: var(--h);
  /* Sits on the seam: the main trace lines up with the footer's top edge and the raised
     parts rise into the section above, filled with the panel color */
  position: relative;
  z-index: 1;
  padding-left: 0;
  padding-right: 0;
  top: calc(var(--h) * -26 / 32);
  margin-bottom: calc(var(--h) * -26 / 32);
}
.j-circuit__line {
  flex: 1 1 0;
  min-width: 12px;
  height: 2px;
  margin-top: calc(var(--h) * 26 / 32 - 1px);
  background: var(--mark);
}
.j-circuit svg { flex: none; height: 100%; width: auto; overflow: visible; }
.j-circuit path, .j-circuit circle { fill: none; stroke: var(--mark); stroke-width: 2; vector-effect: non-scaling-stroke; }
.j-circuit .is-faint { stroke: var(--faint); stroke-width: 1; }
.j-circuit .is-fill { fill: var(--mark); stroke: none; }
.j-circuit .is-panel { fill: var(--surface-panel); stroke: none; }
.j-circuit circle { fill: var(--surface-panel); }
@media (max-width: 640px) {
  .j-circuit { --h: 20px; }
  .j-circuit__hatch, .j-circuit__hatch + .j-circuit__line { display: none; }
  .j-circuit__line { min-width: 8px; }
}
@media (max-width: 400px) {
  .j-circuit { --h: 18px; }
  .j-circuit__node, .j-circuit__node + .j-circuit__line { display: none; }
}
.is-high-contrast .j-circuit { --mark: #fff; --faint: #fff; }

/* ---------- WhatsApp 3D emblem (contact, right column) ---------- */
.j-footer__main {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(48px, 6vw, var(--space-88));
  align-items: center;
}
.j-footer__copy { display: grid; gap: clamp(48px, 6vw, var(--space-88)); }
.j-footer__main .j-footer__cta { font-size: clamp(64px, 8.6vw, 170px); }

.j-wa {
  display: block;
  justify-self: center;
  width: min(100%, 460px);
  aspect-ratio: 1;
  perspective: 1100px;
}
.j-wa__stage {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: j-wa-float 6s ease-in-out infinite;
}
.j-wa__logo {
  position: absolute;
  inset: 22%;
  transform-style: preserve-3d;
  animation: j-wa-spin 9s ease-in-out infinite;
  transition: transform .4s ease;
}
/* Extrusion: stacked copies of the glyph, darker toward the back */
.j-wa__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: color-mix(in srgb, var(--accent) calc(55% + var(--z) * 4%), #000);
  transform: translateZ(calc((var(--z) - 4) * 3px));
}
.j-wa__layer--front { fill: var(--accent); }
.j-wa__glow {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 38%, transparent) 0%, transparent 70%);
  transform: translateZ(-60px);
  animation: j-wa-breathe 3.2s ease-in-out infinite;
}
.j-wa__ring {
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  border: var(--rule-strong) solid var(--accent);
  opacity: 0;
  transform: translateZ(-30px);
  animation: j-wa-pulse 3.2s cubic-bezier(.2, .6, .3, 1) infinite;
}
.j-wa__ring--late { animation-delay: 1.6s; }

.j-wa__badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-14);
  border: var(--rule-hair) solid var(--accent);
  border-radius: 0;
  background: var(--ink-deep);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .45);
  animation: j-wa-bob 4.5s ease-in-out infinite;
}
.j-wa__badge--a {
  top: 10%; left: 0;
  background: var(--accent);
  color: var(--ink);
  font-weight: 400;
  transform: translateZ(70px);
}
.j-wa__badge--b { bottom: 14%; left: 0; transform: translateZ(40px); animation-delay: -1.5s; }
.j-wa__badge--c { top: 46%; right: 0; transform: translateZ(90px); animation-delay: -3s; transition: background .25s ease, color .25s ease; }
/* Hover/focus: emblem lifts toward the viewer, badges spread out, a hint appears */
.j-wa { cursor: pointer; }
.j-wa__logo,
.j-wa__glow,
.j-wa__badge { transition: scale .45s cubic-bezier(.2, .8, .3, 1.3), margin .45s cubic-bezier(.2, .8, .3, 1.3), opacity .3s ease; }
.j-wa:is(:hover, :focus-visible) .j-wa__logo { animation-play-state: paused; scale: 1.12; }
.j-wa:is(:hover, :focus-visible) .j-wa__glow { scale: 1.35; }
.j-wa:is(:hover, :focus-visible) .j-wa__ring { animation-duration: 1.4s; }
.j-wa:is(:hover, :focus-visible) .j-wa__badge--a { margin: -12px 0 0 -12px; }
.j-wa:is(:hover, :focus-visible) .j-wa__badge--b { margin: 0 0 -12px -12px; }
.j-wa:is(:hover, :focus-visible) .j-wa__badge--c { margin-right: -12px; background: var(--accent); color: var(--ink); }
.j-wa:active .j-wa__logo { scale: 1.02; transition-duration: .1s; }

.j-wa__hint {
  position: absolute;
  left: 50%;
  bottom: 2%;
  translate: -50% 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--paper);
  white-space: nowrap;
  opacity: 0;
  transform: translateZ(60px);
  transition: opacity .3s ease, translate .3s ease;
}
.j-wa__hint::after { content: "\2192\FE0E"; display: inline-block; margin-left: var(--space-6); animation: j-wa-nudge 1s ease-in-out infinite; }
.j-wa:is(:hover, :focus-visible) .j-wa__hint { opacity: 1; translate: -50% 0; }

.j-wa__dot {
  width: 8px; height: 8px;
  border-radius: 0;
  background: var(--ink);
  animation: j-wa-blink 1.4s ease-in-out infinite;
}

@keyframes j-wa-spin {
  0%, 100% { transform: rotateY(-28deg) rotateX(8deg); }
  50%      { transform: rotateY(28deg) rotateX(-6deg); }
}
@keyframes j-wa-float {
  0%, 100% { transform: translateY(0) rotateX(6deg); }
  50%      { transform: translateY(-14px) rotateX(-4deg); }
}
@keyframes j-wa-bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -10px; }
}
@keyframes j-wa-pulse {
  0%   { opacity: .7; scale: .9; }
  100% { opacity: 0; scale: 1.45; }
}
@keyframes j-wa-breathe {
  0%, 100% { opacity: .7; scale: .95; }
  50%      { opacity: 1; scale: 1.08; }
}
@keyframes j-wa-nudge {
  0%, 100% { translate: 0 0; }
  50%      { translate: 4px 0; }
}
@keyframes j-wa-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .25; }
}

@media (prefers-reduced-motion: reduce) {
  .j-wa__stage, .j-wa__logo, .j-wa__badge, .j-wa__glow, .j-wa__ring, .j-wa__dot, .j-wa__hint::after { animation: none !important; }
  .j-wa__logo { transform: rotateY(-18deg) rotateX(6deg); }
}

@media (max-width: 900px) {
  .j-footer__main { grid-template-columns: minmax(0, 1fr); }
  .j-quote { grid-template-columns: minmax(0, 1fr); }
  .j-quote__author,
  .j-quote__text { grid-column: 1; grid-row: auto; }
  .j-quote__author { position: static; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .j-quote__photo { width: 88px; }
  .j-footer__main .j-footer__cta { font-size: clamp(64px, 14vw, 210px); }
  .j-wa { width: min(100%, 360px); }
}

/* ---------- Below 1200px: nav moves into the fullscreen menu ---------- */
@media (max-width: 1199px) {
  .j-header__nav { display: none; }
  .j-menu-toggle { display: inline-flex; }
}
@media (min-width: 1200px) {
  .j-menu { display: none; }
}

/* ---------- Tablets + phones: compact header ---------- */
@media (max-width: 900px) {
  :root { --header-offset: calc(96px + var(--a11y-height, 0px)); }
  .j-header { padding-top: var(--space-16); padding-bottom: var(--space-16); }
  .j-wordmark__logo { height: 28px; }
}

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .j-menu-row { grid-template-columns: 28px minmax(0, 1fr); }
  .j-menu-row__meta { display: none; }

  .j-work-row,
  .j-article-row { grid-template-columns: 32px minmax(0, 1fr); }
  .j-work-row { grid-template-columns: minmax(0, 1fr) auto; }
  .j-work-row__num { display: none; } /* the title carries the row on its own */
  .j-work-row__arrow { grid-column: 2; grid-row: 1; width: 40px; }
  .j-work-row__meta,
  .j-article-row__tag { grid-column: 2; justify-items: start; text-align: left; }
  .j-work-row__meta { grid-column: 1; padding-bottom: var(--space-12); }
}

/* Lenis owns the easing, so native smooth scrolling steps aside while it runs */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
/* No overflow clip on .lenis-stopped: Lenis stops when animations are paused or motion is reduced, and native scroll must still work. The open menu locks scroll on body */
