/* landermarini.dev — shared styles */
:root {
  --paper: #E4E8E0;
  --sheet: #F3F4EF;
  --ink: #18232D;
  --ink-2: #56626C;
  --grid: #C3CAC0;
  --hair: #DCE0D7;
  --live: #B0700E;
  --glow: rgba(240, 170, 40, .30);
  --glow-hi: rgba(240, 170, 40, .60);
  --signal: #B3202A;
  --focus: #2A5CAA;
  --pre-bg: #18232D;
  --pre-ink: #E9ECE5;
  --font: "Archivo", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B1218; --sheet: #111B23; --ink: #DCE2DA; --ink-2: #8E9BA4;
    --grid: #2A3945; --hair: #1B2832; --live: #F4B942;
    --glow: rgba(244, 185, 66, .22); --glow-hi: rgba(244, 185, 66, .55);
    --signal: #FF7A7A; --focus: #82A8F0; --pre-bg: #0A1015; --pre-ink: #DCE2DA;
  }
}
:root[data-theme="dark"] {
  --paper: #0B1218; --sheet: #111B23; --ink: #DCE2DA; --ink-2: #8E9BA4;
  --grid: #2A3945; --hair: #1B2832; --live: #F4B942;
  --glow: rgba(244, 185, 66, .22); --glow-hi: rgba(244, 185, 66, .55);
  --signal: #FF7A7A; --focus: #82A8F0; --pre-bg: #0A1015; --pre-ink: #DCE2DA;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font); font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--focus); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Drawing sheet frame ─────────────────────────── */
.sheet {
  max-width: 1180px;
  margin: clamp(.5rem, 2.5vw, 2rem) auto;
  background: var(--sheet);
  border: 2px solid var(--ink);
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
}
.ref-x {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 22px repeat(8, 1fr) 22px;
  font: 500 .72rem/1 var(--font); font-stretch: 85%; color: var(--ink-2);
}
.ref-x span { text-align: center; padding: .32rem 0; border-left: 1px solid var(--hair); }
.ref-x span:first-child, .ref-x span:nth-child(2) { border-left: 0; }
.ref-x.top { border-bottom: 1px solid var(--ink); }
.ref-x.bottom { border-top: 1px solid var(--ink); }
.ref-y {
  display: flex; flex-direction: column; justify-content: space-around; align-items: center;
  font: 500 .72rem/1 var(--font); font-stretch: 85%; color: var(--ink-2);
}
.ref-y.left { border-right: 1px solid var(--ink); }
.ref-y.right { border-left: 1px solid var(--ink); }
.body { min-width: 0; display: flex; flex-direction: column; }
.body > main { flex: 1; }

/* ── Top bar ─────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .55rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--hair);
  font-stretch: 85%; font-size: .95rem;
}
.brand { font-weight: 650; text-decoration: none; margin-right: auto; }
.topbar a:not(.brand) { text-decoration: none; color: var(--ink-2); }
.topbar a:not(.brand):hover, .topbar a[aria-current] { color: var(--ink); text-decoration: underline; }
.theme {
  font: inherit; font-size: .85rem; color: var(--ink-2);
  background: none; border: 1px solid var(--grid); border-radius: 3px;
  padding: .15rem .6rem; cursor: pointer;
}
.theme:hover { color: var(--ink); border-color: var(--ink-2); }

/* ── Hero / single-line diagram ──────────────────── */
.hero {
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2rem) clamp(1rem, 2vw, 1.5rem);
  background-image:
    linear-gradient(var(--hair) 1px, transparent 1px),
    linear-gradient(90deg, var(--hair) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: -1px -1px;
}
.diagram { position: relative; container-type: inline-size; }
.hero-text { margin-bottom: 1.75rem; }
h1 {
  font-weight: 800; font-stretch: 62%;
  font-size: clamp(3rem, 14vw, 6.5rem); line-height: .86;
  letter-spacing: -.005em; margin: 0 0 1rem;
}
.lede { margin: 0; max-width: 34ch; color: var(--ink-2); font-size: clamp(1rem, 2.6vw, 1.2rem); line-height: 1.45; }
.diagram[data-layout="h"] .hero-text { position: absolute; left: 0; top: 27%; width: 31%; margin: 0; }
.diagram[data-layout="h"] h1 { font-size: 6.4cqw; }
.diagram[data-layout="h"] .lede { font-size: max(.85rem, 1.42cqw); }
.diagram[data-layout="v"] .sld { max-width: 440px; }

.sld { display: block; width: 100%; height: auto; overflow: visible; user-select: none; -webkit-user-select: none; }
.sld text { font-family: var(--font); }
.sld .w { stroke: var(--ink); stroke-width: 2; fill: none; }
.sld .w.thin { stroke-width: 1.6; }
.sld .w.dash { stroke-width: 1.2; stroke-dasharray: 3 2.5; }
.sld .w.bus { stroke-width: 5; }
.sld .box { fill: var(--sheet); stroke: var(--ink); stroke-width: 2; }
.sld .f {
  stroke: var(--live); stroke-width: 2.6; fill: none; stroke-linecap: round;
  stroke-dasharray: 3 11; opacity: 0; transition: opacity .25s;
}
.sld .f.bus-f { stroke-width: 3; }
.sld .f.on { opacity: 1; animation: flow .9s linear infinite; }
@keyframes flow { from { stroke-dashoffset: 14; } to { stroke-dashoffset: 0; } }

.sld .blade {
  stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round;
  transform-box: fill-box; transform-origin: 50% 100%;
  transition: transform .24s cubic-bezier(.3, 1.6, .5, 1);
}
.sld .open .blade { transform: rotate(-30deg); }
.sld .dot { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.6; }

.sld .load .b { fill: var(--sheet); stroke: var(--ink); stroke-width: 2; transition: fill .35s, stroke .35s; }
.sld .load .l { fill: none; stroke: var(--ink); stroke-width: 2; transition: stroke .35s; }
.sld .load.on .b { fill: var(--glow); stroke: var(--live); }
.sld .load.on .l { stroke: var(--live); }
.sld .mtext { fill: var(--ink); font-weight: 700; font-size: 12px; font-stretch: 80%; pointer-events: none; }

.sld .lbl-tag { fill: var(--signal); font-weight: 650; font-size: 13px; font-stretch: 85%; }
.sld .lbl-name { fill: var(--ink); font-weight: 750; font-size: 23px; font-stretch: 70%; }
.sld .lbl-det, .sld .lbl-sm { fill: var(--ink-2); font-size: 12px; font-stretch: 85%; }
.sld .lbl-t { fill: var(--ink-2); font-size: 10px; font-weight: 700; pointer-events: none; }
.diagram[data-layout="v"] .lbl-tag { font-size: 16px; }
.diagram[data-layout="v"] .lbl-name { font-size: 29px; }
.diagram[data-layout="v"] .lbl-det, .diagram[data-layout="v"] .lbl-sm { font-size: 15px; }
.diagram[data-layout="v"] .lbl-t { font-size: 12px; }

.sld .col { cursor: pointer; transition: opacity .2s; }
.sld .col .hit { fill: transparent; stroke: none; }
.sld .col:focus { outline: none; }
.sld .col:focus-visible .hit { stroke: var(--focus); stroke-width: 2; stroke-dasharray: 4 4; }
.sld .col:hover .lbl-name, .sld .col:focus-visible .lbl-name { fill: var(--focus); text-decoration: underline; }
.sld .col:hover .f.on, .sld .col:focus-visible .f.on { animation-duration: .28s; }
.sld .col:hover .load.on .b, .sld .col:focus-visible .load.on .b { fill: var(--glow-hi); }
.sld:has(.col:hover) .col:not(:hover) { opacity: .45; }

.sld .btn { cursor: pointer; }
.sld .btn:focus { outline: none; }
.sld .btn .ring { fill: transparent; stroke: transparent; stroke-width: 1.5; }
.sld .btn:hover .ring { stroke: var(--grid); stroke-dasharray: 3 3; }
.sld .btn:focus-visible .ring { stroke: var(--focus); stroke-dasharray: 3 3; }
.sld .tbtn { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.5; transition: fill .15s; }
.sld .btn:hover .tbtn { fill: var(--focus); }
.sld .btn.tripped .tbtn, .sld .btn.tripped:hover .tbtn { fill: var(--signal); }

.hint { margin: 1rem 0 0; font-size: .9rem; color: var(--ink-2); max-width: 70ch; }
.fallback-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-weight: 700; font-stretch: 75%; font-size: 1.4rem; }

/* ── Content sections ────────────────────────────── */
.sections { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink); }
.sec { padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 3vw, 2rem); border-top: 1px solid var(--hair); min-width: 0; }
.sec.first { border-top: 0; }
.sec.r { border-left: 1px solid var(--hair); }
.sec.full { grid-column: 1 / -1; }
.sec-h { display: flex; align-items: baseline; gap: .75rem; margin: 0 0 .85rem; }
.tag { font-weight: 650; font-stretch: 85%; font-size: .9rem; color: var(--signal); }
h2 { font-weight: 750; font-stretch: 70%; font-size: clamp(1.9rem, 3.4vw, 2.5rem); line-height: 1; margin: 0; }
.sec p { margin: 0 0 .85rem; max-width: 62ch; }
.sec ul { margin: 0; padding-left: 1.1rem; }
.sec li { margin: .3rem 0; }
.sec li::marker { color: var(--signal); }
.mail { font-weight: 750; font-stretch: 72%; font-size: clamp(1.5rem, 3.2vw, 2rem); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.more { display: inline-block; margin-top: 1rem; font-weight: 650; font-stretch: 85%; }

/* ── Simple page (404) ───────────────────────────── */
.page-head { padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem) 2rem; min-height: 50vh; }
.page-head h1 { font-size: clamp(3rem, 12vw, 5.5rem); margin-bottom: .75rem; }

/* ── Portfolio / about ───────────────────────────── */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 5vw, 4rem); }
.about-grid .lead { font-size: clamp(1.1rem, 1.8vw, 1.3rem); line-height: 1.5; }
.career h3, .tools h3 { font-weight: 600; font-stretch: 85%; font-size: .85rem; color: var(--ink-2); margin: 0 0 .9rem; }
.career ol { list-style: none; margin: 0; padding: 0; position: relative; }
.career li:not(:last-child)::after { content: ""; position: absolute; left: 6px; top: 1.2rem; bottom: -.45rem; width: 2px; background: var(--ink); }
.career li:last-child { padding-bottom: 0; }
.career li { position: relative; padding: 0 0 1.5rem 2rem; }
.career li::before {
  content: ""; position: absolute; left: 0; top: .42rem;
  width: 14px; height: 14px; border: 2px solid var(--ink); background: var(--sheet);
}
.career li.now::before { background: var(--live); border-color: var(--live); box-shadow: 0 0 0 4px var(--glow); }
.career .period { display: block; font-size: .85rem; font-stretch: 85%; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.career .role { display: block; font-weight: 750; font-stretch: 70%; font-size: clamp(1.45rem, 2.4vw, 1.75rem); line-height: 1.05; margin-top: .1rem; }
.career .org { display: block; font-weight: 600; font-stretch: 85%; color: var(--signal); margin-top: .15rem; }
.career .org span { color: var(--ink-2); font-weight: 400; }
.career p { margin: .4rem 0 0; color: var(--ink-2); max-width: 52ch; }
.tools { margin-top: 1.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip {
  display: inline-block; border: 1px solid var(--grid); border-radius: 2px;
  padding: .1rem .55rem; font-size: .85rem; font-stretch: 85%; color: var(--ink); line-height: 1.5;
}

/* ── Language switch ─────────────────────────────── */
.lang { display: flex; border: 1px solid var(--grid); border-radius: 3px; overflow: hidden; }
.lang button {
  font: inherit; font-size: .8rem; font-stretch: 85%; color: var(--ink-2);
  background: none; border: 0; border-left: 1px solid var(--grid); padding: .18rem .5rem; cursor: pointer;
}
.lang button:first-child { border-left: 0; }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }

/* ── Title block ─────────────────────────────────── */
.tb { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.4fr; border-top: 2px solid var(--ink); }
.tb > div { padding: .5rem .85rem; border-left: 1px solid var(--ink); min-width: 0; }
.tb > div:first-child { border-left: 0; }
.tb small { display: block; font-size: .7rem; font-stretch: 85%; color: var(--ink-2); }
.tb strong { font-weight: 650; font-stretch: 80%; font-size: 1rem; overflow-wrap: anywhere; }
.tb [data-state="off"] strong { color: var(--signal); }
.tb [data-state="on"] strong { color: var(--live); }

/* ── Small screens ───────────────────────────────── */
@media (max-width: 760px) {
  .sheet { grid-template-columns: 14px minmax(0, 1fr) 14px; margin: 0; border-width: 0 0 0 0; }
  .ref-x { grid-template-columns: 14px repeat(4, 1fr) 14px; }
  .ref-x span:nth-child(n+6):not(:last-child) { display: none; }
  .sections { grid-template-columns: 1fr; }
  .sec.r { border-left: 0; }
  .sec.first + .sec { border-top: 1px solid var(--hair); }
  .about-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; row-gap: .5rem; }
  .tb { grid-template-columns: 1fr 1fr; }
  .tb > div:first-child { grid-column: 1 / -1; }
  .tb > div:nth-child(n+2) { border-top: 1px solid var(--ink); }
  .tb > div:nth-child(2n) { border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sld .f.on { animation: none; stroke-dasharray: none; }
  .sld .blade { transition: none; }
}
