/*
Theme Name: DBA Dutra
Theme URI: https://dbadutra.com
Author: Dutra
Author URI: https://dbadutra.com
Description: Tema editorial e animado para o blog DBA Dutra (Oracle, OCI, Exadata, E-Business Suite), com barra lateral animada. The visual language is borrowed from execution plans: plan-node section markers, cost annotations, an animated query plan in the hero, and reading layouts tuned for long technical posts with code. Dark by default with a light theme toggle.
Version: 1.9.2
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dbadutra
Tags: blog, dark-mode, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* Layout concept: the page reads like an EXPLAIN plan — mono plan-node labels head each section,
   cost/row annotations act as metadata, and a live query plan animates in the hero. */
:root {
  --bg: #0a111e;          /* deep ink, biased blue */
  --bg-2: #101a2c;        /* raised surface */
  --bg-3: #172338;
  --fg: #e4eaf4;
  --muted: #8794ab;
  --line: rgba(160, 182, 214, .14);
  --line-strong: rgba(160, 182, 214, .32);
  --accent: #6cc7ff;      /* index cyan */
  --accent-ink: #04121f;
  --warm: #ffb547;        /* wait-event amber */
  --ok: #7ee2b8;
  --code-bg: #060c16;

  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --step--1: .82rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem);
  --step-3: clamp(2.2rem, 1.6rem + 2.6vw, 3.6rem);
  --step-4: clamp(2.8rem, 1.6rem + 5.4vw, 6.6rem);

  --wrap: 1240px;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef2f7; --bg-2: #e2e8f1; --bg-3: #d6deea;
    --fg: #0c1424; --muted: #56627a;
    --line: rgba(20, 38, 70, .13); --line-strong: rgba(20, 38, 70, .3);
    --accent: #0a62c2; --accent-ink: #ffffff; --warm: #a8620a; --ok: #13805a;
    --code-bg: #0c1424;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eef2f7; --bg-2: #e2e8f1; --bg-3: #d6deea;
  --fg: #0c1424; --muted: #56627a;
  --line: rgba(20, 38, 70, .13); --line-strong: rgba(20, 38, 70, .3);
  --accent: #0a62c2; --accent-ink: #ffffff; --warm: #a8620a; --ok: #13805a;
  --code-bg: #0c1424;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
img, video, svg { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px;
}
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.05; letter-spacing: -.025em; text-wrap: balance; margin: 0; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.screen-reader-text, .sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 12px; left: 12px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; clip: auto; width: auto; height: auto; }
.mono { font-family: var(--f-mono); }
.label {
  font-family: var(--f-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Reading progress ---------- */
.progress { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; height: 2px; width: 100%; z-index: 70; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--warm)); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: transform .45s var(--ease), border-color .3s, background-color .4s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.logo { font-family: var(--f-mono); font-weight: 600; font-size: 1.02rem; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 1px; white-space: nowrap; }
.logo .logo-db { color: var(--accent); }
.logo .logo-sep { color: var(--muted); margin-inline: 1px; }
.logo .caret { width: .55em; height: 1.05em; background: var(--accent); margin-left: 4px; animation: blink 1.1s steps(1) infinite; }
.custom-logo { max-height: 40px; width: auto; }
.nav { margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav a {
  font-family: var(--f-mono); font-size: .82rem; color: var(--muted); padding: 8px 12px; border-radius: 999px; display: block;
  transition: color .2s, background-color .2s;
}
.nav a:hover, .nav .current-menu-item > a { color: var(--fg); background: var(--bg-2); }
.header-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  appearance: none; border: 1px solid var(--line); background: transparent; color: var(--fg);
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--bg-2); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
.menu-toggle { display: none; }
kbd { font-family: var(--f-mono); font-size: .72rem; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--muted); }

@media (max-width: 1100px) {
  .menu-toggle { display: grid; }
  .nav {
    position: fixed; inset: calc(68px + env(safe-area-inset-top, 0px)) 0 auto 0; background: var(--bg);
    border-bottom: 1px solid var(--line); padding: 12px var(--gutter-r) 24px var(--gutter-l);
    clip-path: inset(0 0 100% 0); transition: clip-path .5s var(--ease); margin: 0;
  }
  .nav.is-open { clip-path: inset(0 0 0 0); }
  .nav ul { flex-direction: column; }
  .nav a { font-family: var(--f-display); font-size: 1.6rem; color: var(--fg); padding: 10px 0; border-radius: 0; background: none !important; }
  .header-tools { margin-left: auto; }
}

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; align-items: start; justify-items: center; padding: 18vh var(--gutter-r) 0 var(--gutter-l);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-overlay .search-form { width: min(720px, 100%); transform: translateY(14px); transition: transform .4s var(--ease); }
.search-overlay.is-open .search-form { transform: none; }
.search-form { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); background: var(--bg-2); border-radius: 14px; padding: 6px 6px 6px 16px; }
.search-form .prompt { font-family: var(--f-mono); color: var(--accent); }
.search-form input[type="search"] { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); font: 500 1.15rem var(--f-mono); padding: 12px 4px; }
.search-form input::placeholder { color: var(--muted); }
.search-form input:focus-visible { outline: none; }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--fg);
  position: relative; display: inline-flex; align-items: center; gap: 10px; overflow: hidden; isolation: isolate;
  font-family: var(--f-mono); font-size: .86rem; font-weight: 500; color: var(--fg);
  padding: 13px 20px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; cursor: pointer;
  transition: color .35s var(--ease), border-color .35s;
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fg); transform: translateY(101%); transition: transform .45s var(--ease); border-radius: inherit; }
.btn:hover { color: var(--bg); border-color: var(--fg); }
.btn:hover::before { transform: none; }
.btn--solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--solid:hover { color: var(--bg); }
.btn .arr { transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(48px, 8vw, 104px) clamp(40px, 6vw, 80px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 30%, transparent 75%);
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.hero__copy { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.term { min-width: 0; }
@media (max-width: 520px) { .term .typed { white-space: normal; max-width: 100%; animation: caretb 1s steps(1) infinite; } }
.term { font-family: var(--f-mono); font-size: .86rem; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.term .ps { color: var(--ok); }
.term .typed { color: var(--fg); border-right: 2px solid var(--accent); padding-right: 3px; white-space: nowrap; overflow: hidden; display: inline-block; max-width: 100%;
  animation: type 1.8s steps(40) .2s both, caretb 1s steps(1) infinite; }
.hero h1 { font-size: clamp(2.5rem, 1.3rem + 3.6vw, 5rem); font-weight: 500; letter-spacing: -.04em; line-height: 1.04; font-variation-settings: "wdth" 90; overflow-wrap: break-word; }
.hero h1 em { font-style: normal; color: var(--accent); font-weight: 700; }
.hero h1 .strike { position: relative; color: var(--muted); font-weight: 300; }
.hero h1 .strike::after { content: ""; position: absolute; left: -.02em; right: -.02em; top: 55%; height: .045em; border-radius: 1em; opacity: .9; background: var(--warm); transform-origin: 0 50%; animation: strike .7s var(--ease) 1.5s both; }
.hero__sub { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 34ch; }
.hero__sub strong { color: var(--fg); font-weight: 500; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* split words (load animation only) */
.js [data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding: .18em .06em .12em; margin: -.18em -.06em -.12em; }
.js [data-split] .w > span { display: inline-block; animation: rise 1s var(--ease) both; animation-delay: calc(var(--i) * 65ms + 150ms); }

/* ---------- Query plan illustration ---------- */
.plan-wrap { position: relative; min-width: 0; transform: translate3d(calc(var(--px, 0) * -10px), calc(var(--py, 0) * -10px), 0); transition: transform .6s var(--ease); }
.plan { display: block; width: 100%; overflow: visible; }
.plan .edge { fill: none; stroke: var(--line-strong); stroke-width: 1.4; stroke-dasharray: 3 6; animation: dash 1.4s linear infinite reverse; }
.plan .node-in { animation: pop .7s var(--ease) both; animation-delay: calc(var(--i) * 160ms + 500ms); transform-box: fill-box; transform-origin: center; }
.plan .node rect { fill: var(--bg-2); stroke: var(--line-strong); stroke-width: 1; transition: stroke .25s, fill .25s; }
.plan .node:hover rect { stroke: var(--accent); fill: var(--bg-3); }
.plan .node.hot rect { stroke: var(--warm); }
.plan .n-title { font: 600 13px var(--f-mono); fill: var(--fg); }
.plan .n-sub { font: 400 10.5px var(--f-mono); fill: var(--muted); }
.plan .n-dot { fill: var(--ok); animation: breathe 2.4s ease-in-out infinite; }
.plan .hot .n-dot { fill: var(--warm); }
.plan .pulse { fill: var(--accent); }
.plan .pulse.warm { fill: var(--warm); }
.plan .tag-row { font: 400 10.5px var(--f-mono); fill: var(--muted); }
.plan .tag-row tspan.v { fill: var(--accent); }
.plan-foot {
  margin-top: 12px; font-family: var(--f-mono); font-size: .78rem; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px dashed var(--line-strong); padding-top: 10px;
}
.plan-foot b { color: var(--ok); font-weight: 500; }

/* ---------- Alternative hero animations (MAA, Data Guard, OCI) ---------- */
.hero-viz {
  display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line-strong); border-radius: 20px;
  background: color-mix(in srgb, var(--bg-2) 72%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: pop .8s var(--ease) .4s backwards;
}
.viz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.live { display: inline-flex; align-items: center; gap: 7px; font: 500 .7rem var(--f-mono); color: var(--ok); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: ping 2.2s infinite; }
.oci .n-title, .oci .n-sub { font-family: var(--f-mono); }
.oci .n-title { font-size: 13px; font-weight: 600; fill: var(--fg); }
.oci .n-sub { font-size: 10.5px; fill: var(--muted); }

/* Visitor switcher */
.hero-stage { min-width: 0; display: grid; gap: 14px; }
.hero-tabs {
  justify-self: start; display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in srgb, var(--bg-2) 70%, transparent);
  animation: pop .6s var(--ease) .3s backwards;
}
.hero-tabs button {
  font: 500 .76rem var(--f-mono); color: var(--muted); background: transparent; border: 0; border-radius: 999px;
  padding: 8px 14px; cursor: pointer; transition: color .25s, background-color .3s var(--ease);
}
.hero-tabs button:hover { color: var(--fg); }
.hero-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.hero-tabs button { position: relative; overflow: hidden; }
.is-rotating .hero-tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px;
  background: currentColor; opacity: .45; transform: scaleX(var(--rot, 0)); transform-origin: 0 50%; transition: transform 1s linear;
}
.rot-reset .hero-tabs button::after { transition: none !important; }
.hero-panel { min-width: 0; }
.hero-panel[hidden] { display: none !important; }
.hero-panel.enter > * { animation: panelIn .55s var(--ease) backwards; }
@media (max-width: 520px) { .hero-tabs { justify-self: stretch; justify-content: space-between; border-radius: 16px; } .hero-tabs button { padding: 8px 10px; } }

/* MAA tiers */
.maa__tiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tier {
  --c: #c98a55;
  display: grid; grid-template-columns: 26px minmax(0, 1fr) 84px; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); cursor: default;
  opacity: .6; transition: opacity .4s, border-color .4s, transform .5s var(--ease), box-shadow .4s;
  animation: pop .6s var(--ease) both; animation-delay: calc(var(--i) * 120ms + 600ms);
}
.tier--silver { --c: #a9b6c6; } .tier--gold { --c: #e2b04a; } .tier--platinum { --c: #8fd3ff; }
.maa:not(.is-live) .tier, .tier.is-active, .tier:focus-visible { opacity: 1; }
.tier.is-active { border-color: var(--c); transform: translateX(6px); box-shadow: 0 14px 34px -18px var(--c); }
.tier__medal { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.75), var(--c) 55%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.tier.is-active .tier__medal { animation: medal 1.6s ease-in-out infinite; }
.tier__txt { display: grid; gap: 2px; min-width: 0; }
.tier__txt strong { font: 600 1.05rem/1.1 var(--f-display); letter-spacing: -.01em; }
.tier__txt span { font: .7rem/1.35 var(--f-mono); color: var(--muted); }
.tier__bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.tier__bar i { display: block; height: 100%; width: var(--lvl); border-radius: inherit; background: var(--c); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1s var(--ease); }
.maa:not(.is-live) .tier__bar i, .tier.is-active .tier__bar i, .tier.done .tier__bar i { transform: scaleX(1); }
.maa__readout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.ro { display: grid; gap: 8px; min-width: 0; }
.ro__pair { display: grid; gap: 6px; }
.ro__pair > span { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: baseline; gap: 6px; }
.ro small { font: 500 .66rem var(--f-mono); color: var(--accent); letter-spacing: .06em; }
.ro b { font: 600 .98rem/1.25 var(--f-display); letter-spacing: -.01em; }
.ro b.flash { animation: flash .6s var(--ease) both; }

/* Data Guard */
.dg__sites { display: grid; grid-template-columns: minmax(0, 1fr) minmax(64px, .9fr) minmax(0, 1fr); align-items: center; gap: 10px; }
.dg__site { display: grid; justify-items: center; gap: 5px; text-align: center; padding: 14px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); min-width: 0; transition: border-color .4s, box-shadow .4s; }
.dg__site.is-primary { border-color: var(--accent); box-shadow: 0 14px 34px -20px var(--accent); }
.dg__site.flip { animation: flip .7s var(--ease); }
.cyl { width: 44px; height: 52px; fill: color-mix(in srgb, var(--ok) 10%, transparent); stroke: var(--muted); stroke-width: 1.5; transition: stroke .4s, fill .4s; }
.dg__site.is-primary .cyl { stroke: var(--accent); fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.dg__region { font: .66rem var(--f-mono); color: var(--muted); }
.dg__db { font: 600 .88rem var(--f-mono); overflow-wrap: anywhere; }
.dg__role { font: 600 .6rem var(--f-mono); letter-spacing: .04em; padding: 3px 8px; border-radius: 99px; border: 1px solid var(--ok); color: var(--ok); }
.dg__site.is-primary .dg__role { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dg__state { font: .6rem var(--f-mono); color: var(--muted); }
.dg__link { display: grid; gap: 8px; text-align: center; min-width: 0; }
.dg__mode, .dg__scn { font: .64rem var(--f-mono); color: var(--muted); }
.dg__scn b { color: var(--fg); font-weight: 500; font-variant-numeric: tabular-nums; }
.dg__track { position: relative; height: 2px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px); }
.dg__track i { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); opacity: 0; animation: redo 1.8s linear infinite; }
.dg__track i:nth-child(2) { animation-delay: .36s; } .dg__track i:nth-child(3) { animation-delay: .72s; } .dg__track i:nth-child(4) { animation-delay: 1.08s; } .dg__track i:nth-child(5) { animation-delay: 1.44s; }
.dg.rev .dg__track i { animation-name: redoRev; }
.dg.is-switching .dg__track i { animation-play-state: paused; background: var(--warm); }
.dg__stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font: .7rem var(--f-mono); color: var(--muted); }
.dg__stats b { color: var(--fg); font-weight: 500; }
.dg__log { margin: 0; font: .72rem/1.6 var(--f-mono); background: var(--code-bg); color: #dfe7f3; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: calc(1.6em * 4 + 20px); white-space: pre-wrap; overflow-wrap: anywhere; }
.dg__log .ok { color: #7ee2b8; } .dg__log .cmd { color: #6cc7ff; }
.dg__btn { justify-self: start; padding: 10px 16px; }
.dg__btn:disabled { opacity: .5; cursor: progress; }

/* OCI network path */
.oci__svg { display: block; width: 100%; overflow: visible; }
.oci__rail { fill: none; stroke: var(--line-strong); stroke-width: 1.4; stroke-dasharray: 3 6; }
.oci__seg { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .8s ease-in-out; }
.oci:not(.is-live) .oci__seg, .oci__seg.on { stroke-dashoffset: 0; }
.hop rect { fill: var(--bg-2); stroke: var(--line-strong); transition: stroke .3s, fill .3s; }
.hop__ok { fill: none; stroke: var(--line-strong); stroke-width: 1.2; transition: fill .3s, stroke .3s; }
.hop__tick { fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .3s; }
.oci:not(.is-live) .hop rect, .hop.on rect { stroke: var(--accent); }
.oci:not(.is-live) .hop__ok, .hop.on .hop__ok { fill: var(--ok); stroke: var(--ok); }
.oci:not(.is-live) .hop__tick, .hop.on .hop__tick { opacity: 1; }
.hop.on { animation: hopPop .5s var(--ease); transform-box: fill-box; transform-origin: center; }
.hop--target.on rect { fill: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); }
.oci__packet { fill: var(--warm); }
.oci:not(.is-live) .oci__packet { display: none; }
.oci__status b { color: var(--ok); font-weight: 500; }
.oci__status b.wait { color: var(--warm); }

@media (max-width: 520px) {
  .tier { grid-template-columns: 22px minmax(0, 1fr) 54px; gap: 10px; padding: 10px 12px; }
  .maa__readout { grid-template-columns: minmax(0, 1fr); }
  .dg__sites { grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); gap: 6px; }
  .dg__mode, .dg__scn { display: none; }
}

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding-block: 18px; user-select: none; }
.marquee__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; align-items: center; gap: 36px; padding-right: 36px; }
.marquee a { font-family: var(--f-display); font-size: clamp(1.6rem, 1rem + 2.4vw, 3rem); font-weight: 500; letter-spacing: -.03em; color: transparent; -webkit-text-stroke: 1px var(--muted); transition: color .3s, -webkit-text-stroke-color .3s; white-space: nowrap; }
.marquee a:hover { color: var(--fg); -webkit-text-stroke-color: var(--fg); }
.marquee .sep { font-family: var(--f-mono); color: var(--accent); font-size: 1rem; }

/* ---------- Section head (plan-node style) ---------- */
.section { padding-block: clamp(64px, 9vw, 128px); }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(32px, 4vw, 56px); }
.sec-head__l { display: grid; gap: 14px; min-width: 0; }
.node-label { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.node-label .arrow { color: var(--accent); }
.node-label .op { color: var(--fg); }
.node-label .cost { color: var(--muted); opacity: .8; }
.sec-head h2 { font-size: var(--step-3); font-weight: 500; letter-spacing: -.04em; }
.sec-head h2 em { font-style: normal; color: var(--accent); }

/* ---------- Cards ---------- */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { position: relative; min-width: 0; }
.card__link {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; height: 100%; gap: 16px;
  padding: 14px 14px 22px; border-radius: 18px; border: 1px solid var(--line); background: var(--bg);
  overflow: hidden; isolation: isolate;
  transition: border-color .35s, transform .5s var(--ease);
}
.card__link::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%);
}
.card__link:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.card__link:hover::before { opacity: 1; }
.cover {
  --h: 205;
  position: relative; aspect-ratio: 16 / 10; max-width: 100%; border-radius: 12px; overflow: hidden;
  background:
    radial-gradient(120% 90% at var(--cx, 20%) var(--cy, 10%), hsl(var(--h) 85% 62% / .55), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, hsl(calc(var(--h) + 40) 80% 55% / .35), transparent 60%),
    var(--bg-3);
}
.cover::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--line-strong) 1px, transparent 1px), linear-gradient(90deg, var(--line-strong) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(160deg, #000, transparent 80%); -webkit-mask-image: linear-gradient(160deg, #000, transparent 80%);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.card__link:hover .cover img { transform: scale(1.05); }
.cover__glyph {
  position: absolute; left: 14px; bottom: 8px; right: 14px;
  font-family: var(--f-display); font-weight: 700; letter-spacing: -.05em; line-height: .85;
  font-size: clamp(2.4rem, 4.2vw, 4.2rem); color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--fg) 55%, transparent);
  transition: transform .7s var(--ease), color .4s;
  white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.card__link:hover .cover__glyph { transform: translateY(-6px); color: color-mix(in srgb, var(--fg) 12%, transparent); }
.cover__sql { position: absolute; top: 10px; left: 12px; font: 500 .7rem var(--f-mono); color: color-mix(in srgb, var(--fg) 75%, transparent); background: color-mix(in srgb, var(--bg) 55%, transparent); padding: 3px 8px; border-radius: 6px; backdrop-filter: blur(6px); }
.card__meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-family: var(--f-mono); font-size: .74rem; color: var(--muted); padding-inline: 6px; }
.tag { color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); padding: 2px 9px; border-radius: 999px; }
.card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }
.card h3 { font-size: var(--step-1); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; padding-inline: 6px; }
.card__excerpt { color: var(--muted); font-size: .98rem; line-height: 1.55; padding-inline: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__more { margin-top: auto; padding-inline: 6px; font-family: var(--f-mono); font-size: .78rem; color: var(--fg); display: inline-flex; gap: 8px; align-items: center; }
.card__more .arr { display: inline-block; transition: transform .4s var(--ease); color: var(--accent); }
.card__link:hover .card__more .arr { transform: translateX(6px); }

/* featured */
.card--featured { grid-column: 1 / -1; }
.card--featured .card__link { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; padding: 16px; align-items: stretch; }
.card--featured .cover { aspect-ratio: auto; min-height: 340px; height: 100%; }
.card--featured .cover__glyph { font-size: clamp(3.4rem, 8vw, 8rem); }
.card--featured .card__body { display: flex; flex-direction: column; gap: 18px; padding: 18px 12px 12px 0; min-width: 0; }
.card--featured h3 { font-size: var(--step-3); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.card--featured .card__excerpt { font-size: 1.12rem; -webkit-line-clamp: 4; }
.card__body { display: contents; }
.card--featured .card__body { display: flex; }
.featured-flag { font-family: var(--f-mono); font-size: .74rem; color: var(--warm); display: inline-flex; align-items: center; gap: 8px; padding-inline: 6px; }
.featured-flag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warm); animation: breathe 2s ease-in-out infinite; }

@media (max-width: 1000px) { .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .posts { grid-template-columns: minmax(0, 1fr); }
  .card--featured .card__link { grid-template-columns: minmax(0, 1fr); }
  .card--featured .cover { min-height: 0; aspect-ratio: 16 / 10; }
  .card--featured .card__body { padding: 4px 0 6px; }
}

/* ---------- Topics (index list) ---------- */
.topics { border-top: 1px solid var(--line); }
.topic {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 24px; align-items: baseline;
  padding-block: 26px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden;
}
.topic::before { content: ""; position: absolute; inset: 0; background: var(--bg-2); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .45s var(--ease); z-index: -1; }
.topics { position: relative; isolation: isolate; }
.topic:hover::before { transform: scaleY(1); }
.topic__name { font-family: var(--f-display); font-size: var(--step-2); font-weight: 500; letter-spacing: -.03em; transition: transform .45s var(--ease); padding-left: 4px; }
.topic:hover .topic__name { transform: translateX(14px); color: var(--accent); }
.topic__desc { color: var(--muted); min-width: 0; }
.topic__rows { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; padding-right: 4px; }
.topic__rows b { color: var(--fg); font-weight: 500; }
@media (max-width: 760px) {
  .topic { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .topic__desc { grid-column: 1 / -1; grid-row: 2; font-size: .95rem; }
}

/* ---------- About ---------- */
.about .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.about__aside { position: sticky; top: 110px; display: grid; gap: 20px; justify-items: start; }
.seal { width: 168px; height: 168px; position: relative; display: grid; place-items: center; }
.seal svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 26s linear infinite; }
.seal text { font: 500 10.6px var(--f-mono); letter-spacing: .22em; fill: var(--muted); text-transform: uppercase; }
.seal__core { width: 92px; height: 92px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 1.6rem var(--f-display); letter-spacing: -.04em; overflow: hidden; }
.seal__core img { width: 100%; height: 100%; object-fit: cover; }
.about__text { font-family: var(--f-display); font-size: clamp(1.5rem, 1rem + 2vw, 2.6rem); font-weight: 400; line-height: 1.22; letter-spacing: -.025em; min-width: 0; }
.about__text .sw { transition: color .3s; }
.js .about__text .sw { color: color-mix(in srgb, var(--fg) 26%, transparent); }
.js .about__text .sw.on { color: var(--fg); }
.about__text em { font-style: normal; color: var(--accent) !important; }
.stats { margin-top: clamp(40px, 5vw, 64px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stat { padding: 22px 16px 0 0; display: grid; gap: 6px; min-width: 0; }
.stat + .stat { padding-left: 18px; border-left: 1px solid var(--line); }
.stat__n { font-family: var(--f-display); font-size: var(--step-3); font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.stat__n small { font-size: .45em; color: var(--muted); margin-left: 2px; }
@media (max-width: 860px) {
  .about .wrap { grid-template-columns: minmax(0, 1fr); }
  .about__aside { position: static; grid-auto-flow: column; align-items: center; }
  .seal { width: 128px; height: 128px; }
  .seal__core { width: 70px; height: 70px; font-size: 1.2rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 18px; }
}

/* ---------- Newsletter ---------- */
.newsletter { padding-block: clamp(40px, 6vw, 80px); }
.nl-box {
  position: relative; overflow: hidden; border-radius: 28px; padding: clamp(28px, 5vw, 72px);
  background: var(--fg); color: var(--bg); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; align-items: end;
}
.nl-box::after {
  content: "COMMIT;"; position: absolute; right: -2%; top: -8%; font: 700 clamp(5rem, 14vw, 13rem) var(--f-display); letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--bg) 18%, transparent); pointer-events: none; line-height: 1;
}
.nl-box h2 { font-size: var(--step-3); font-weight: 500; letter-spacing: -.04em; position: relative; }
.nl-box p { margin-top: 16px; color: color-mix(in srgb, var(--bg) 70%, transparent); max-width: 44ch; position: relative; }
.nl-form { position: relative; display: grid; gap: 10px; }
.nl-field { display: flex; gap: 8px; background: var(--bg); border-radius: 999px; padding: 6px; }
.nl-field input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); padding: 10px 14px; font: 500 .95rem var(--f-mono); }
.nl-field input:focus-visible { outline: none; }
.nl-field:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.nl-field .btn { padding: 11px 18px; }
.nl-note { font: .74rem var(--f-mono); color: color-mix(in srgb, var(--bg) 60%, transparent); }
.nl-ok { font: .82rem var(--f-mono); color: var(--bg); }
@media (max-width: 860px) { .nl-box { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-top: clamp(48px, 6vw, 80px); overflow: hidden; padding-bottom: env(safe-area-inset-bottom, 0px); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-grid h4 { font-family: var(--f-mono); font-size: .74rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a { position: relative; transition: color .2s; }
.foot-grid a:hover { color: var(--accent); }
.foot-lede { color: var(--muted); max-width: 36ch; margin-top: 12px; }
.status { display: inline-flex; gap: 8px; align-items: center; font: .78rem var(--f-mono); color: var(--muted); margin-top: 20px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: ping 2.2s infinite; }
.sig { display: flex; justify-content: center; margin-block: clamp(40px, 5vw, 64px) 32px; }
.sig__term {
  width: min(560px, 100%); min-width: 0; font-family: var(--f-mono); font-size: .82rem; line-height: 1.7; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 16px; padding: 0 20px 16px; overflow: hidden;
  background: color-mix(in srgb, var(--bg-2) 60%, transparent);
}
.sig__bar { display: flex; justify-content: space-between; gap: 12px; margin: 0 -20px 12px; padding: 8px 20px; border-bottom: 1px solid var(--line); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.sig__line .ps { color: var(--ok); }
.sig__cmd { color: var(--fg); }
.sig__head { margin-top: 8px; display: grid; }
.sig__head span { color: var(--line-strong); letter-spacing: -.05em; }
.sig__name { font-family: var(--f-display); font-size: clamp(1.7rem, 1.1rem + 2vw, 2.6rem); line-height: 1.15; letter-spacing: -.03em; display: flex; align-items: baseline; gap: .25em; padding: 2px 0 6px; }
.sig__name .wm-dba { color: var(--accent); font-weight: 700; }
.sig__name .wm-dutra { color: var(--fg); font-weight: 400; }
.sig__name .ch { display: inline-block; transition: color .3s, transform .4s var(--ease); }
.sig__name .ch:hover { color: var(--warm); transform: translateY(-.08em); }
.sig__name .wm-caret { align-self: center; width: .5em; height: .1em; margin-top: .5em; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
.sig__foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; font-size: .74rem; }
.sig__foot span:first-child { color: var(--ok); }
/* typing sequence (only when the footer starts below the fold and JS runs) */
.sig.pre .sig__head, .sig.pre .sig__foot { opacity: 0; transform: translateY(4px); }
.sig.pre .sig__name .ch { opacity: 0; }
.sig .sig__head, .sig .sig__foot { transition: opacity .5s, transform .5s var(--ease); }
.sig.pre .sig__name .ch.on { opacity: 1; animation: chIn .25s var(--ease) both; }
.sig.s-head .sig__head, .sig.s-foot .sig__foot { opacity: 1; transform: none; }
.sig.typing .sig__cmd::after { content: ""; display: inline-block; width: .55em; height: 1em; margin-left: 2px; vertical-align: -.15em; background: var(--fg); animation: blink .8s steps(1) infinite; }
@keyframes chIn { from { opacity: 0; transform: translateY(.3em); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font: .76rem var(--f-mono); color: var(--muted); padding-block: 24px 28px; border-top: 1px solid var(--line); margin-top: 8px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Single post ---------- */
.post-hero { padding-block: clamp(48px, 7vw, 96px) clamp(28px, 4vw, 48px); }
.post-hero .wrap { display: grid; gap: 26px; }
.crumbs { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--accent); }
.post-hero h1 { font-size: var(--step-4); font-weight: 500; letter-spacing: -.045em; line-height: .98; max-width: 16ch; }
.post-hero .dek { font-size: var(--step-1); color: var(--muted); max-width: 52ch; line-height: 1.5; }
.post-meta { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; font: .8rem var(--f-mono); color: var(--muted); padding-top: 22px; border-top: 1px solid var(--line); }
.post-meta .author { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.post-meta .author img, .avatar-fallback { width: 34px; height: 34px; border-radius: 50%; }
.avatar-fallback { background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 .8rem var(--f-display); }
.post-meta .v { color: var(--fg); }
.post-cover { margin-bottom: clamp(32px, 5vw, 64px); }
.post-cover .cover { aspect-ratio: 21 / 9; border-radius: 22px; }
.post-cover .cover__glyph { font-size: clamp(4rem, 13vw, 12rem); left: 24px; bottom: 14px; }
.post-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; gap: 48px; align-items: start; }
.toc { position: sticky; top: 110px; font-family: var(--f-mono); font-size: .78rem; }
.toc ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; color: var(--muted); border-left: 2px solid transparent; margin-left: -1px; transition: color .2s, border-color .2s; line-height: 1.35; }
.toc a:hover { color: var(--fg); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.toc[hidden] { display: none; }
.post-side { position: sticky; top: 110px; display: grid; gap: 14px; font: .78rem var(--f-mono); color: var(--muted); }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1100px) { .post-layout { grid-template-columns: 200px minmax(0, 1fr); } .post-side { display: none; } }
@media (max-width: 860px) { .post-layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

/* prose */
.prose { max-width: 68ch; font-size: 1.16rem; line-height: 1.72; min-width: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: var(--step-2); font-weight: 600; margin-top: 2.2em; scroll-margin-top: 100px; letter-spacing: -.03em; }
.prose h3 { font-size: var(--step-1); margin-top: 1.8em; scroll-margin-top: 100px; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1.5px; transition: color .2s; }
.prose a:hover { color: var(--accent); }
.prose > p:first-of-type::first-letter { font-family: var(--f-display); font-weight: 600; float: left; font-size: 4.4em; line-height: .82; padding: .06em .1em 0 0; color: var(--accent); }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 24px; border-left: 2px solid var(--warm); font-family: var(--f-display); font-size: 1.45rem; line-height: 1.35; letter-spacing: -.015em; }
.prose blockquote p { margin: 0; }
.prose code { font-family: var(--f-mono); font-size: .84em; background: var(--bg-2); border: 1px solid var(--line); padding: .1em .4em; border-radius: 6px; }
.prose pre {
  position: relative; background: var(--code-bg); color: #dfe7f3; border: 1px solid var(--line); border-radius: 14px;
  padding: 44px 20px 20px; overflow-x: auto; font: .88rem/1.65 var(--f-mono); max-width: 100%;
}
.prose pre::before { content: attr(data-lang); position: absolute; top: 12px; left: 18px; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #8794ab; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.prose pre .kw { color: #6cc7ff; } .prose pre .fn { color: #ffb547; } .prose pre .str { color: #7ee2b8; } .prose pre .cm { color: #66748c; font-style: italic; }
.copy-btn { position: absolute; top: 8px; right: 8px; font: .7rem var(--f-mono); color: #8794ab; background: transparent; border: 1px solid rgba(160,182,214,.25); border-radius: 8px; padding: 5px 9px; cursor: pointer; transition: color .2s, border-color .2s; }
.copy-btn:hover { color: #e4eaf4; border-color: rgba(160,182,214,.5); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--accent); font-family: var(--f-mono); }
.prose img, .prose figure { border-radius: 14px; }
.prose figcaption { font: .78rem var(--f-mono); color: var(--muted); margin-top: 10px; }
.prose table { width: 100%; border-collapse: collapse; font: .86rem var(--f-mono); font-variant-numeric: tabular-nums; }
.prose .table-wrap, .prose .wp-block-table { overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--muted); font-weight: 500; }
.prose hr { border: 0; height: 1px; background: var(--line); margin-block: 2.4em; }
.callout { border: 1px solid var(--line-strong); border-radius: 14px; padding: 18px 20px; background: var(--bg-2); font-size: 1.02rem; display: grid; gap: 6px; }
.callout .label { color: var(--warm); }
.callout p { margin: 0; }
.alignwide { max-width: min(var(--wrap), 100%); }
.alignfull { width: 100%; max-width: none; }
.wp-caption-text, .wp-element-caption { font: .78rem var(--f-mono); color: var(--muted); }

.post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 48px; }
.post-tags a { font: .76rem var(--f-mono); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; color: var(--muted); transition: color .2s, border-color .2s; }
.post-tags a:hover { color: var(--accent); border-color: var(--accent); }
.author-box { margin-top: 56px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
.author-box .avatar-fallback, .author-box img { width: 64px; height: 64px; font-size: 1.2rem; border-radius: 50%; }
.author-box h4 { font-size: 1.2rem; margin-bottom: 4px; }
.author-box p { color: var(--muted); font-size: 1rem; }
.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 56px; }
.post-nav a { border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 8px; transition: border-color .3s, background-color .3s; }
.post-nav a:hover { border-color: var(--line-strong); background: var(--bg-2); }
.post-nav .next { text-align: right; }
.post-nav strong { font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -.02em; line-height: 1.2; }
@media (max-width: 600px) { .post-nav { grid-template-columns: minmax(0, 1fr); } .post-nav .next { text-align: left; } }

/* comments */
.comments { margin-top: 72px; }
.comments h3 { font-size: var(--step-2); margin-bottom: 24px; }
.comment-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.comment-list .children { list-style: none; padding-left: 24px; margin-top: 18px; border-left: 1px solid var(--line); display: grid; gap: 18px; }
.comment-body { border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.comment-meta { font: .78rem var(--f-mono); color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.comment-meta img { border-radius: 50%; }
.comment-author .fn { color: var(--fg); font-style: normal; }
.reply a { font: .76rem var(--f-mono); color: var(--accent); }
.comment-respond { margin-top: 32px; }
.comment-form { display: grid; gap: 14px; }
.comment-form label { display: block; font: .76rem var(--f-mono); color: var(--muted); margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; background: var(--bg-2); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: 1rem var(--f-body);
}
.comment-form .submit { font: 500 .86rem var(--f-mono); background: var(--accent); color: var(--accent-ink); border: 0; padding: 13px 22px; border-radius: 999px; cursor: pointer; }

/* archive / page headers */
.archive-head { padding-block: clamp(56px, 8vw, 112px) clamp(28px, 4vw, 48px); }
.archive-head h1 { font-size: var(--step-4); font-weight: 500; letter-spacing: -.045em; }
.archive-head p { color: var(--muted); margin-top: 16px; max-width: 56ch; font-size: var(--step-1); }
.pagination { margin-top: 56px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font-family: var(--f-mono); font-size: .86rem; }
.pagination .page-numbers { min-width: 42px; height: 42px; display: grid; place-items: center; padding-inline: 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.pagination .current, .pagination a:hover { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.empty { padding: 48px 0; color: var(--muted); }

/* 404 */
.e404 { padding-block: clamp(64px, 12vw, 160px); }
.e404 .code { font: 700 clamp(6rem, 22vw, 18rem) var(--f-display); letter-spacing: -.07em; line-height: .8; color: transparent; -webkit-text-stroke: 1px var(--line-strong); }
.e404 pre { font: .9rem/1.6 var(--f-mono); color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px; overflow-x: auto; margin: 28px 0; max-width: 640px; }
.e404 pre .err { color: var(--warm); }

/* ---------- Scroll reveal (only for content below the first screen) ---------- */
.js .reveal.pre { opacity: 0; transform: translateY(28px); }
.js .reveal { transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1px solid var(--accent); border-radius: 50%; pointer-events: none; z-index: 90; opacity: 0; transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background-color .3s, opacity .3s; }
.cursor.on { opacity: .9; }
.cursor.big { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Layout with sidebar ---------- */
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 4vw, 56px); align-items: start; }
.with-sidebar.layout--single { align-items: stretch; }
.main-col { min-width: 0; }
.with-sidebar .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.with-sidebar .card--featured .card__link { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.with-sidebar .card--featured .cover { min-height: 300px; }
.with-sidebar .card--featured h3 { font-size: var(--step-2); letter-spacing: -.03em; line-height: 1.05; }
.with-sidebar .sec-head h2 { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }
.layout--single .prose { max-width: 70ch; }

/* ---------- Sidebar ---------- */
.sidebar { min-width: 0; position: relative; }
.sidebar__head { display: none; }
.sidebar__inner { position: sticky; top: var(--stick, 92px); display: grid; gap: 16px; transition: top .3s var(--ease); }
.layout--single .sidebar__inner { position: static; height: 100%; align-content: start; }
.side-sticky { position: sticky; top: 92px; display: grid; gap: 16px; }

.sidebar .widget {
  --k: 0;
  position: relative; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  background: color-mix(in srgb, var(--bg-2) 50%, transparent);
  font-size: .98rem; line-height: 1.5;
  transition: border-color .3s, transform .3s var(--ease);
}
.sidebar .widget::before {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%; z-index: 1;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s var(--ease);
}
.sidebar .widget:hover { border-color: var(--line-strong); }
.sidebar .widget:hover::before { transform: scaleX(1); }
.sidebar .widget::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}
.sidebar .widget:hover::after { opacity: 1; }
.js .sidebar .widget { transition: opacity .8s var(--ease), transform .8s var(--ease), border-color .3s; transition-delay: calc(var(--k) * 90ms), calc(var(--k) * 90ms), 0s; }
.js .sidebar .widget.pre { opacity: 0; transform: translateX(32px); }

/* widget titles: "-> TITLE ———" with the rule drawing in */
.sidebar .widget-title, .sidebar .widget > h2, .sidebar .widget > h3, .sidebar .wp-block-heading, .sidebar .widgettitle {
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font: 500 .72rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.sidebar .widget-title::before, .sidebar .widget > h2::before, .sidebar .widget > h3::before, .sidebar .wp-block-heading::before, .sidebar .widgettitle::before { content: "->"; color: var(--accent); letter-spacing: 0; }
.sidebar .widget-title::after, .sidebar .widget > h2::after, .sidebar .widget > h3::after, .sidebar .wp-block-heading::after, .sidebar .widgettitle::after {
  content: ""; flex: 1; height: 1px; background: var(--line-strong); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 1s var(--ease) calc(var(--k) * 90ms + 200ms);
}
.sidebar .widget.in .widget-title::after, .sidebar .widget.in > h2::after, .sidebar .widget.in > h3::after, .sidebar .widget.in .wp-block-heading::after, .sidebar .widget.in .widgettitle::after,
.no-io .sidebar .widget-title::after { transform: scaleX(1); }

/* generic lists (categories, archives, recent posts, pages, meta…) */
.sidebar ul, .sidebar ol { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { border-bottom: 1px dashed var(--line); }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget li a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; position: relative; transition: color .25s, transform .35s var(--ease); }
.sidebar .widget li a:hover { color: var(--accent); transform: translateX(5px); }
.sidebar .widget li a > .count, .sidebar .count, .sidebar .wp-block-categories__post-count {
  font: 500 .72rem var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; flex: none;
}
.sidebar .widget li ul { padding-left: 14px; }

/* category bars: width is set by JS from the counts */
.sidebar .widget_categories li a::after, .sidebar .wp-block-categories li a::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: var(--w, 0%);
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));
  transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 80ms + 250ms);
}
.sidebar .widget.in.widget_categories li a::after, .sidebar .widget.in .wp-block-categories li a::after { transform: scaleX(1); }

/* author card */
.widget-author { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; }
.wa-photo { position: relative; width: 64px; height: 64px; grid-row: span 2; }
.wa-photo::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; background: conic-gradient(var(--accent), var(--warm), transparent 60%, var(--accent)); animation: spin 6s linear infinite; -webkit-mask: radial-gradient(circle, transparent 34px, #000 35px); mask: radial-gradient(circle, transparent 34px, #000 35px); }
.wa-photo img, .wa-photo .avatar-fallback { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-size: 1.2rem; }
.wa-text { display: grid; gap: 2px; min-width: 0; }
.wa-text strong { font: 600 1.05rem/1.2 var(--f-display); letter-spacing: -.01em; }
.wa-text span { font: .72rem var(--f-mono); color: var(--muted); }
.wa-bio { grid-column: 1 / -1; color: var(--muted); font-size: .95rem; margin-top: 10px; }
.wa-social { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.wa-social a, .widget-share .btn { font: 500 .72rem var(--f-mono); padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 999px; transition: background-color .25s, color .25s, border-color .25s; }
.wa-social a:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.widget-share .share { display: flex; gap: 6px; flex-wrap: wrap; }

/* search (theme form + block search) */
.sidebar .search-form { padding: 4px 4px 4px 12px; border-radius: 12px; }
.sidebar .search-form .prompt { display: none; }
.sidebar .search-form input[type="search"] { font-size: .9rem; padding: 9px 2px; }
.sidebar .search-form .btn { padding: 9px 13px; font-size: .76rem; }
.sidebar .wp-block-search__inside-wrapper { display: flex; gap: 6px; border: 1px solid var(--line-strong); background: var(--bg-2); border-radius: 12px; padding: 4px; }
.sidebar .wp-block-search__input, .sidebar input[type="text"], .sidebar input[type="email"], .sidebar input[type="password"], .sidebar select {
  width: 100%; min-width: 0; background: var(--bg-2); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: .9rem var(--f-mono);
}
.sidebar .wp-block-search__inside-wrapper .wp-block-search__input { border: 0; background: transparent; }
.sidebar .wp-block-search__button, .sidebar input[type="submit"], .sidebar button[type="submit"]:not(.btn) {
  font: 500 .76rem var(--f-mono); background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 9px; padding: 9px 13px; cursor: pointer;
}
.sidebar label { font: .74rem var(--f-mono); color: var(--muted); }
.sidebar p { margin: 0 0 10px; }
.sidebar p:last-child { margin-bottom: 0; }

/* popular posts */
.widget-popular ol { counter-reset: pop; display: grid; gap: 4px; }
.widget-popular li { border: 0 !important; }
.widget-popular li a { display: grid !important; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center !important; padding: 6px 0 !important; }
.wp-thumb { width: 56px; height: 56px; border-radius: 10px; aspect-ratio: auto; position: relative; overflow: hidden; }
.wp-thumb::after { counter-increment: pop; content: counter(pop, decimal-leading-zero); position: absolute; right: 5px; bottom: 3px; font: 600 .66rem var(--f-mono); color: var(--fg); }
.wp-thumb img { transition: transform .6s var(--ease); }
.widget-popular li a:hover .wp-thumb img { transform: scale(1.12); }
.wp-txt { display: grid; gap: 3px; min-width: 0; }
.wp-txt strong { font: 600 .95rem/1.25 var(--f-display); letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--fg); transition: color .25s; }
.widget-popular li a:hover strong { color: var(--accent); }
.wp-txt time { font: .7rem var(--f-mono); color: var(--muted); }

/* archive by year (accordion) */
.years { display: grid; }
.year { border-bottom: 1px dashed var(--line); }
.year:last-child { border-bottom: 0; }
.year summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; font: 600 1rem var(--f-display); transition: color .25s; }
.year summary::-webkit-details-marker { display: none; }
.year summary > span:first-child::before { content: "+"; display: inline-block; width: 18px; font-family: var(--f-mono); color: var(--accent); transition: transform .35s var(--ease); }
.year[open] summary > span:first-child::before { transform: rotate(45deg); }
.year summary:hover { color: var(--accent); }
.year ul { padding: 0 0 8px 18px !important; }
.year[open] ul { animation: drop .45s var(--ease) both; }
.year li { border: 0 !important; }
.year li a { padding: 5px 0 !important; font-size: .92rem; text-transform: capitalize; }

/* images and badges (certifications, ACE, user groups, banners) */
.sidebar .widget img { max-width: 100%; height: auto; border-radius: 8px; transition: transform .45s var(--ease), filter .45s; }
.sidebar .widget a:hover img, .sidebar .widget img:hover { transform: translateY(-3px) scale(1.04); }
.sidebar .textwidget, .sidebar .wp-block-gallery, .sidebar .badges { line-height: 0; }
.sidebar .textwidget p, .sidebar .textwidget > div { line-height: 0; }
.sidebar .textwidget img { display: inline-block; margin: 3px; vertical-align: middle; }
.sidebar .widget_media_image, .sidebar .widget_block:has(> figure.wp-block-image) { text-align: center; }
.badges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.badge {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; text-align: center; line-height: 1.1;
  font: 600 .58rem var(--f-mono); letter-spacing: .02em; color: var(--fg); padding: 6px;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 35%, var(--bg-3)), var(--bg-3) 70%);
  border: 1px solid var(--line-strong); transition: transform .45s var(--ease), border-color .3s;
}
.badge:hover { transform: translateY(-3px) rotate(-6deg); border-color: var(--accent); }
.badge.gold { background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--warm) 45%, var(--bg-3)), var(--bg-3) 70%); }
.sidebar .tagcloud, .sidebar .wp-block-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.sidebar .tagcloud a, .sidebar .wp-block-tag-cloud a { font: .74rem var(--f-mono) !important; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; transition: color .25s, border-color .25s; }
.sidebar .tagcloud a:hover, .sidebar .wp-block-tag-cloud a:hover { color: var(--accent); border-color: var(--accent); }
.sidebar .recentcomments, .sidebar .wp-block-latest-comments__comment { padding: 8px 0; font-size: .92rem; color: var(--muted); }
.sidebar .recentcomments a, .sidebar .wp-block-latest-comments__comment a { color: var(--fg); }
.sidebar .recentcomments a:hover { color: var(--accent); }

/* TOC inside the sidebar */
.sidebar .toc { position: relative; top: auto; font-family: var(--f-mono); font-size: .78rem; }
.sidebar .toc ol { margin: 0; border-left: 1px solid var(--line); display: grid; gap: 0; max-height: 46vh; overflow-y: auto; }
.sidebar .toc li { border: 0 !important; }
.sidebar .toc a { display: block; padding: 6px 0 6px 12px; color: var(--muted); border-left: 2px solid transparent; margin-left: -1px; line-height: 1.35; transform: none !important; }
.sidebar .toc a:hover { color: var(--fg); }
.sidebar .toc a.active { color: var(--accent); border-left-color: var(--accent); }

/* toggle + drawer (tablet/phone) */
.sidebar-toggle { display: none; }
.sidebar-scrim { position: fixed; inset: 0; z-index: 74; background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .3s both; }
@media (max-width: 1000px) {
  .with-sidebar { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 76; width: min(380px, 90vw); overflow-y: auto; overscroll-behavior: contain;
    background: var(--bg); border-left: 1px solid var(--line-strong); box-shadow: -30px 0 80px rgba(0, 0, 0, .35);
    padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) 16px;
    transform: translateX(105%); visibility: hidden; transition: transform .55s var(--ease), visibility 0s linear .55s;
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform .55s var(--ease), visibility 0s; }
  .sidebar__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .sidebar__inner, .side-sticky { position: static; height: auto; }
  .js .sidebar .widget.pre { opacity: 1; transform: none; }
  .sidebar.is-open .widget { animation: slideIn .6s var(--ease) both; animation-delay: calc(var(--k) * 70ms + 120ms); }
  .sidebar.is-open .widget .widget-title::after { transform: scaleX(1); }
  .sidebar.is-open .widget_categories li a::after { transform: scaleX(1); }
  .sidebar-toggle {
    display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 73;
    right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    font: 500 .78rem var(--f-mono); color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 999px; padding: 12px 16px; cursor: pointer;
    box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .35s var(--ease);
  }
  .sidebar-toggle:hover { transform: translateY(-2px); }
  .sidebar-toggle svg { width: 18px; height: 18px; }
}
@media (max-width: 760px) { .with-sidebar .posts { grid-template-columns: minmax(0, 1fr); } .with-sidebar .card--featured .card__link { grid-template-columns: minmax(0, 1fr); } }

/* CTA links */
.cta-links { position: relative; display: flex; flex-wrap: wrap; gap: 10px; }
.nl-box .cta-links .btn { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.nl-box .cta-links .btn::before { background: var(--accent); }
.nl-box .cta-links .btn:hover { color: var(--accent-ink); border-color: var(--accent); }

/* ---------- Keyframes ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes caretb { 50% { border-color: transparent; } }
@keyframes type { from { max-width: 0; } to { max-width: 60ch; } }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dash { to { stroke-dashoffset: -18; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { opacity: .35; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes medal { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--c) 10%, transparent); } }
@keyframes flash { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes redo { 0% { left: 0; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: calc(100% - 8px); opacity: 0; } }
@keyframes redoRev { 0% { left: calc(100% - 8px); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: 0; opacity: 0; } }
@keyframes flip { 40% { transform: rotateY(90deg) scale(.96); } 100% { transform: none; } }
@keyframes hopPop { 40% { transform: scale(1.04); } }
@keyframes panelIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 9px transparent; } }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .plan-wrap { max-width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .marquee__track { animation: none; }
  .js .reveal.pre, .js .sidebar .widget.pre { opacity: 1; transform: none; }
  .plan animateMotion { display: none; }
}
.sidebar .toc:not([hidden]) { display: block; }
/* Customizer live preview: keep the blue edit pencils inside the rounded widgets */
.sidebar .widget .customize-partial-edit-shortcut button { left: 6px; top: 6px; }
/* Widgets restored from the previous theme (certifications, badges, banners) */
.sidebar .legacy-body { line-height: 0; text-align: center; }
.sidebar .legacy-body p { line-height: 1.5; text-align: left; }
.sidebar .legacy-body img { display: inline-block; margin: 3px; vertical-align: middle; }

/* Image badges (certifications, user groups…) as round coins */
.sidebar .badge-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 10px; line-height: 0; }
.sidebar .badge-tile {
  position: relative; flex: 0 0 calc((100% - 30px) / 4); width: calc((100% - 30px) / 4); min-width: 0; height: auto; aspect-ratio: 1; max-width: 100%; border-radius: 50%; display: block; padding: 0; overflow: visible;
  background: radial-gradient(circle at 30% 25%, #ffffff, #e3e9f2 72%);
  box-shadow: 0 0 0 1px var(--line-strong), 0 6px 18px -10px rgba(0, 0, 0, .6);
  transition: transform .45s var(--ease), box-shadow .3s;
}
.sidebar .badge-tile::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: conic-gradient(var(--accent), var(--warm), transparent 55%, var(--accent));
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 2px), #000 calc(50% - 1px)); mask: radial-gradient(circle, transparent calc(50% - 2px), #000 calc(50% - 1px));
  animation: spin 3s linear infinite;
}
.sidebar .badge-tile:hover { transform: translateY(-4px) rotate(-6deg) scale(1.06); z-index: 1; }
.sidebar .badge-tile:hover::after { opacity: 1; }
.sidebar .badge-tile > a { position: absolute; inset: 14%; display: grid; place-items: center; }
.sidebar .badge-tile > img { position: absolute; top: 14%; left: 14%; width: 72% !important; height: 72% !important; }
.sidebar .badge-tile > img, .sidebar .badge-tile > a > img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; margin: 0 !important; border-radius: 0 !important; transform: none !important; filter: none !important; display: block; }
.sidebar .widget.in .badge-tile, .sidebar.is-open .badge-tile { animation: coinIn .55s var(--ease) backwards; animation-delay: calc(var(--n, 0) * 45ms + 200ms); }
.sidebar .widget.has-badges .legacy-body, .sidebar .widget.has-badges .textwidget { text-align: left; }
@keyframes coinIn { from { opacity: 0; transform: scale(.5) rotate(-25deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sidebar .badge-tile::after { animation: none; } }
.sidebar .badge-tile__txt { position: absolute; inset: 12%; display: none; place-items: center; font: 600 .56rem/1.15 var(--f-mono); color: var(--fg); text-align: center; overflow-wrap: anywhere; overflow: hidden; }
.sidebar .badge-tile.is-text { background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 35%, var(--bg-3)), var(--bg-3) 70%); }
.sidebar .badge-tile.is-text > a, .sidebar .badge-tile.is-text > img { inset: 0; opacity: 0; }
.sidebar .badge-tile.is-text .badge-tile__txt { display: grid; }

/* Contact box in the sidebar */
.widget-contact .wc-title { font: 600 1.15rem/1.2 var(--f-display); letter-spacing: -.015em; color: var(--fg); margin: 0 0 6px; }
.widget-contact .wc-text { color: var(--muted); font-size: .95rem; margin: 0 0 12px; }
.sidebar .widget-contact .wc-links li { border-bottom: 1px dashed var(--line); }
.sidebar .widget-contact .wc-links li:last-child { border-bottom: 0; }
.sidebar .widget-contact .wc-links a { display: grid !important; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; }
.widget-contact .wc-links svg { width: 30px; height: 30px; padding: 6px; border-radius: 9px; border: 1px solid var(--line-strong); color: var(--accent); transition: background-color .3s, color .3s, border-color .3s, transform .4s var(--ease); }
.widget-contact .wc-links a:hover svg { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: rotate(-8deg); }
.widget-contact .wc-links .arr { color: var(--muted); transition: transform .35s var(--ease), color .3s; }
.widget-contact .wc-links a:hover .arr { transform: translate(3px, -3px); color: var(--accent); }
.widget-contact .wc-admin a { font: .78rem var(--f-mono); color: var(--warm); }
.widget-contact .wc-form { display: flex; gap: 6px; margin-top: 12px; }
.widget-contact .wc-form input { flex: 1; min-width: 0; }

/* PT | EN translate toggle */
.lang-toggle {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center; height: 40px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; font: 600 .7rem var(--f-mono); letter-spacing: .04em;
  transition: border-color .2s;
}
.lang-toggle:hover { border-color: var(--line-strong); }
.lang-toggle::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--accent);
  transition: transform .45s var(--ease);
}
.is-en .lang-toggle::before, .lang-toggle.on-en::before { transform: translateX(100%); }
.lang-toggle span, .lang-toggle a { position: relative; z-index: 1; padding: 0 9px; color: var(--muted); transition: color .3s; line-height: 30px; text-align: center; }
.lang-toggle.is-native .lang-pt { color: var(--accent-ink); }
.lang-toggle.is-native.on-en .lang-pt { color: var(--muted); }
.lang-toggle.is-native.on-en .lang-en { color: var(--accent-ink); }
.lang-toggle.is-native .lang-en:not([aria-current]):hover, .lang-toggle.is-native .lang-pt:not([aria-current]):hover { color: var(--fg); }
.lang-toggle .lang-pt, .is-en .lang-toggle .lang-en { color: var(--accent-ink); }
.is-en .lang-toggle .lang-pt { color: var(--muted); }
.lang-toggle.is-busy { opacity: .6; cursor: progress; }
/* hide Google Translate's own bar, tooltips and highlight */
.goog-te-banner-frame, iframe.skiptranslate, #goog-gt-tt, .goog-te-balloon-frame, .goog-tooltip, .VIpgJd-ZVi9od-ORHb-OEVmcd, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf { display: none !important; }
#google_translate_element { position: absolute !important; left: -9999px !important; top: 0; width: 1px; height: 1px; overflow: hidden; }
body { top: 0 !important; }
font[style] { background: none !important; box-shadow: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
@media (max-width: 420px) { .lang-toggle span { padding: 0 6px; } }

/* Texts with their own English version (hero title, terminal line) */
.t-en { display: none; }
.is-en .t-en { display: inline; }
.is-en .t-pt { display: none; }
