/* =========================================================
   Preethiviraj Murugesan | Portfolio
   Palette: warm blue-grey canvas, white cards and navy/teal accents; optional midnight mode.
   Type: Bricolage Grotesque (display) + Public Sans (text)
   ========================================================= */

:root {
  color-scheme: dark;
  --bg: #101c2b;
  --bg-band: #162639;
  --surface: #14253a;
  --surface-2: #1a2e45;
  --line: #24394f;
  --line-strong: #35506b;
  --text: #eef3f6;
  --muted: #9cafbf;
  --teal: #45c7b4;
  --teal-ink: #062421;
  --green: #8fd6a3;
  --warn: #f08a7a;
  --sun: #f4b740;
  --sky-top: #16314d;
  --sky-bottom: #1d4160;
  --module: #23476a;
  --module-lit: #4fb8d6;
  --roof: #1a2a3d;
  --shadow: 0 24px 60px rgba(2, 8, 16, .45);
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-text: 'Public Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --header-h: 68px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #edf3f5; --bg-band: #e1ecf0; --surface: #ffffff; --surface-2: #f4f8f9;
    --line: #d1dee3; --line-strong: #b0c5cf; --text: #14283c; --muted: #526777;
    --teal: #0f7d71; --teal-ink: #ffffff; --green: #23804a; --warn: #b8402e; --sun: #d99412;
    --sky-top: #bfdcef; --sky-bottom: #e6f2f8; --module: #2a4b6b; --module-lit: #2f8fc0; --roof: #dfe6ea;
    --shadow: 0 20px 50px rgba(20, 45, 70, .12);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf3f5; --bg-band: #e1ecf0; --surface: #ffffff; --surface-2: #f4f8f9;
  --line: #d1dee3; --line-strong: #b0c5cf; --text: #14283c; --muted: #526777;
  --teal: #0f7d71; --teal-ink: #ffffff; --green: #23804a; --warn: #b8402e; --sun: #d99412;
  --sky-top: #bfdcef; --sky-bottom: #e6f2f8; --module: #2a4b6b; --module-lit: #2f8fc0; --roof: #dfe6ea;
  --shadow: 0 20px 50px rgba(20, 45, 70, .12);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px + env(safe-area-inset-top, 0px)); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.65 var(--font-text); overflow-x: hidden; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 650; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: inherit; }
img, svg, video { max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--teal); color: var(--teal-ink); }
.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.small { font-size: .875rem; }
.fine { font-size: .8rem; color: var(--muted); margin: 0; line-height: 1.5; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 300; background: var(--teal); color: var(--teal-ink); padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

/* ---------- Header ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 101; background: var(--bg); }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 100; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav { height: var(--header-h); display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.monogram { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--teal); color: var(--teal-ink); font: 750 .95rem/1 var(--font-display); letter-spacing: -.02em; }
.brand-name { font-size: .95rem; }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav-links a { display: block; padding: 8px 11px; border-radius: var(--radius-sm); text-decoration: none; font-size: .9rem; color: var(--muted); transition: color .15s, background .15s; }
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--text); background: var(--surface); }
.nav-tools { display: flex; gap: 6px; }
.tool-btn { height: 38px; min-width: 38px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: transparent; border-radius: var(--radius-sm); color: var(--text); transition: border-color .15s, background .15s; }
.tool-btn:hover { border-color: var(--line-strong); background: var(--surface); }
.tool-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
kbd { font: 500 .7rem/1 var(--font-text); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 3px 5px; }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .i-sun { display: none; }
  :root:not([data-theme="dark"]) .i-moon { display: block; }
}
.menu-btn { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 1px solid transparent; transition: transform .15s, background .15s, border-color .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: var(--teal-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--teal) 86%, var(--text)); }
.btn-ghost { border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface); }
.btn-text { padding: 0 8px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
.btn-text:hover { text-decoration-color: var(--teal); }
.btn-link { white-space: nowrap; background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 104px); }
.hero-name { font-weight: 600; margin-bottom: 4px; }
.hero-role { color: var(--muted); font-size: .95rem; margin-bottom: 28px; max-width: 46ch; }
.hero h1 { font-size: clamp(2.3rem, 4.4vw, 3.7rem); font-weight: 750; line-height: 1.03; letter-spacing: -0.03em; max-width: 15ch; text-wrap: balance; margin-bottom: 24px; font-variation-settings: "opsz" 96; }
.hero-lead { font-size: 1.08rem; color: var(--muted); max-width: 54ch; margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.hero-creds { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.hero-creds li { font-size: .82rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }

/* Sun simulator */
.sun-sim { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); }
.sun-sim-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sun-sim figcaption { font-weight: 600; font-size: .95rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 5px 12px; font-size: .82rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--teal); color: var(--teal-ink); font-weight: 600; }
.seg button:not([aria-pressed="true"]):hover { color: var(--text); }
.sun-svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.sky-grid line { stroke: var(--line-strong); stroke-width: 1; }
.sky-grid text, .plan-note, .north text { fill: var(--muted); font: 500 11px var(--font-text); }
.sun-path { fill: none; stroke: var(--sun); stroke-opacity: .55; stroke-width: 1.5; stroke-dasharray: 3 5; }
.sun-body { cursor: grab; }
.sun-body:active { cursor: grabbing; }
.sun-core { fill: var(--sun); stroke: color-mix(in srgb, var(--sun) 60%, #fff); stroke-width: 2; }
.sun-body.below .sun-core { fill: var(--line-strong); stroke: none; }
.sun-body.below circle:first-child { opacity: 0; }
.roof { fill: var(--roof); }
.roof-edge { fill: none; stroke: var(--line-strong); stroke-dasharray: 4 4; }
.module { stroke: color-mix(in srgb, var(--module) 60%, #000); stroke-width: .8; transition: fill .25s; }
.shadow { fill: #000; opacity: .32; }
.plant { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1.2; }
.north path { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.sun-controls { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; margin: 12px 0 10px; }
.sun-controls label { font-size: .85rem; color: var(--muted); }
.sun-controls output { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3.2em; text-align: right; }
.play-btn .i-pause { display: none; }
.play-btn.playing .i-play { display: none; }
.play-btn.playing .i-pause { display: block; }
.play-btn svg { fill: currentColor; stroke: none; }
.readouts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 10px; }
.readouts div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.readouts dt { font-size: .72rem; color: var(--muted); line-height: 1.3; }
.readouts dd { margin: 2px 0 0; font: 650 1.05rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }

/* Range inputs */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--teal) var(--fill, 50%), var(--line-strong) var(--fill, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--teal); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 3px solid var(--teal); margin-top: -7px; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 3px solid var(--teal); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 9vw, 112px); }
.band { background: var(--bg-band); border-block: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head.split { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.section-head.split > div { max-width: 600px; }
.section-head h2 { text-wrap: balance; }
.section-head h2, .about h2, .pv-head h2, .contact h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin-bottom: 14px; letter-spacing: -0.02em; }
.section-head p { color: var(--muted); margin: 0; }
.lede { font-size: 1.12rem; }
.kicker { color: var(--teal); font-weight: 600; font-size: .92rem; margin-bottom: 10px; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about-photo { position: sticky; top: calc(var(--header-h) + 32px); }
.photo-placeholder, .about-photo img { width: 100%; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); object-fit: cover; }
.photo-placeholder { display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--surface) 0 14px, var(--surface-2) 14px 28px); border: 1px solid var(--line); }
.photo-placeholder span { font: 750 3.6rem/1 var(--font-display); color: var(--muted); letter-spacing: -.04em; }
.about-body { max-width: 720px; }
.about-body > p { color: var(--muted); }
.about-body > p.lede { color: var(--text); }
.facts { list-style: none; padding: 0; margin: 32px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-block: 1px solid var(--line); }
.facts li { padding: 18px 16px 18px 0; }
.facts li + li { padding-left: 16px; border-left: 1px solid var(--line); }
.facts strong { display: block; font: 650 1.3rem/1.2 var(--font-display); margin-bottom: 4px; }
.facts span { display: block; line-height: 1.4; }
.facts span { font-size: .85rem; color: var(--muted); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pillar svg { width: 30px; height: 30px; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 8px; }
.pillar h3 { font-size: 1.05rem; margin-bottom: 6px; }
.pillar p { font-size: .9rem; color: var(--muted); margin: 0; }

/* ---------- Career SLD ---------- */
.sld { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.sld-bus { position: relative; display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); padding: 34px 24px 26px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.sld-bus::before { content: ""; position: absolute; left: 40px; right: 40px; top: 52px; height: 3px; background: var(--line-strong); }
.sld-bus .bus-live { position: absolute; left: 40px; top: 52px; height: 3px; background: var(--teal); width: 0; transition: width .45s ease; }
.sld-node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; background: none; border: 0; padding: 0 6px; text-align: center; color: var(--muted); min-width: 96px; }
.sld-node .sym { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-strong); transition: border-color .2s, background .2s, transform .2s; position: relative; z-index: 1; }
.sld-node .sym svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sld-node .txt { display: flex; flex-direction: column; align-items: center; }
.sld-node .lbl { font-weight: 600; font-size: .88rem; line-height: 1.25; color: var(--text); }
.sld-node .yr { font-size: .76rem; }
.sld-node:hover .sym { border-color: var(--teal); }
.sld-node[aria-selected="true"] .sym { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); transform: scale(1.08); }
.sld-node[aria-selected="true"] .lbl { color: var(--teal); }
.sld-node.live .sym::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--teal); opacity: .5; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { from { transform: scale(.85); opacity: .6; } to { transform: scale(1.35); opacity: 0; } }
.sld-panel { padding: 28px clamp(20px, 4vw, 40px) 32px; display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 32px; }
.sld-panel .when { color: var(--teal); font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.sld-panel h3 { font-size: 1.5rem; margin-bottom: 6px; }
.sld-panel .org { font-weight: 600; margin-bottom: 10px; }
.sld-panel .sum { color: var(--muted); margin: 0; }
.sld-panel ul { margin: 0; padding-left: 1.1em; }
.sld-panel li { margin-bottom: .55em; }
.sld-panel li::marker { color: var(--teal); }
.sld-panel .tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--teal) 18%, transparent); color: var(--teal); margin-bottom: 10px; }
.sld-panel.swap { animation: swap .3s ease; }
@keyframes swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- PVDesigner ---------- */
.pv-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; margin-bottom: 32px; }
.pv-head .lede { color: var(--muted); max-width: 64ch; margin: 0; }
.pv-head h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 750; letter-spacing: -.03em; }
.pv-status { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 14px 16px; max-width: 300px; font-size: .88rem; }
.pv-status strong { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pv-status strong::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun) 25%, transparent); }
.pv-status.live strong::before { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 25%, transparent); }
.pv-status span { color: var(--muted); }

.workflow { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.ribbon { display: flex; gap: 2px; padding: 8px; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.rb-btn { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 92px; padding: 10px 8px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: .8rem; font-weight: 500; }
.rb-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rb-btn:hover { color: var(--text); background: var(--surface); }
.rb-btn[aria-selected="true"] { color: var(--text); background: var(--surface); border-color: var(--line-strong); }
.rb-btn[aria-selected="true"] svg { stroke: var(--teal); }
.rb-btn.done svg { stroke: var(--teal); }
.workflow-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.wf-svg { display: block; width: 100%; height: auto; background: var(--bg); border-right: 1px solid var(--line); }
.wf-text { padding: 28px; }
.wf-text .step { color: var(--teal); font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.wf-text h3 { font-size: 1.45rem; margin-bottom: 10px; }
.wf-text p { color: var(--muted); }
.wf-text dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 16px 0 0; font-size: .9rem; }
.wf-text dt { color: var(--muted); }
.wf-text dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.wf-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
/* drawing styles */
.wf-roof { fill: var(--roof); stroke: var(--text); stroke-width: 1.6; }
.wf-setback { fill: none; stroke: var(--warn); stroke-width: 1; stroke-dasharray: 5 4; }
.wf-obst { fill: var(--surface-2); stroke: var(--muted); stroke-width: 1.2; }
.wf-dim { stroke: var(--muted); stroke-width: 1; fill: none; }
.wf-label { fill: var(--muted); font: 500 11px var(--font-text); }
.wf-mod { fill: var(--module); stroke: color-mix(in srgb, var(--module) 50%, #000); stroke-width: .7; }
.wf-inv { fill: var(--surface-2); stroke: var(--teal); stroke-width: 1.6; }
.wf-string { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wf-cable { fill: none; stroke-width: 2.2; stroke-dasharray: 7 4; }
.wf-calc rect { fill: var(--surface); stroke: var(--line-strong); }
.wf-calc text { fill: var(--text); font: 500 11px var(--font-text); }
.wf-calc .ok { fill: var(--green); }
.layer { transition: opacity .35s; }
.layer.off { opacity: 0; pointer-events: none; }
.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.draw.go { animation: draw .9s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.wf-string.done { stroke-dasharray: none; stroke-dashoffset: 0; }
.wf-cable.done { stroke-dasharray: 7 4; stroke-dashoffset: 0; }
.wf-label { paint-order: stroke; stroke: var(--roof); stroke-width: 3px; }
.pop { transform-box: fill-box; transform-origin: center; }
.pop.go { animation: pop .35s ease backwards; }
@keyframes pop { from { opacity: 0; transform: scale(.4); } }

.pv-grid { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: clamp(24px, 4vw, 48px); margin-top: 48px; }
.pv-col h3 { font-size: 1.1rem; margin-bottom: 16px; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding: 6px 0 6px 26px; border-bottom: 1px solid var(--line); font-size: .93rem; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 12px; height: 7px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg); }
.challenges { display: grid; gap: 16px; }
.challenge { padding-left: 16px; border-left: 2px solid var(--teal); }
.challenge h4 { margin: 0 0 4px; font: 600 .98rem/1.3 var(--font-text); }
.challenge p { margin: 0; font-size: .9rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; }
.chips li { font-size: .82rem; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 11px; }
.pv-links { display: grid; gap: 10px; margin-top: 18px; }
.pv-links .btn { width: 100%; min-height: 46px; height: auto; padding: 10px 20px; text-align: center; line-height: 1.3; }
.pv-links .pending { font-size: .85rem; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 10px 14px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 40px; }
.gallery:empty { display: none; }
.shot { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); aspect-ratio: 16 / 10; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.shot:hover img { transform: scale(1.03); }
.shot .play { position: absolute; inset: 0; display: grid; place-items: center; }
.shot .play span { width: 52px; height: 52px; border-radius: 50%; background: rgba(0,0,0,.6); display: grid; place-items: center; }
.shot .play svg { width: 22px; fill: #fff; }
.shot.placeholder { display: grid; place-items: center; border-style: dashed; color: var(--muted); font-size: .85rem; text-align: center; padding: 16px; cursor: default; background: transparent; }

/* ---------- Projects ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 6px; }
.filter button { border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 7px 14px; font-size: .86rem; color: var(--muted); }
.filter button:hover { color: var(--text); }
.filter button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.project { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: border-color .2s, transform .2s; }
.project:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.project-art { position: relative; height: 150px; background: var(--surface-2); border-bottom: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.project-art svg { width: 70%; height: 80%; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.project-art svg .soft { stroke: var(--line-strong); }
.project-art svg .dot { fill: var(--teal); stroke: none; }
.project:hover .project-art .trace { animation: trace 1.6s ease; }
@keyframes trace { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
.project-art .trace { stroke-dasharray: 400; stroke-dashoffset: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.completed { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.status.active { color: var(--sun); background: color-mix(in srgb, var(--sun) 16%, transparent); }
.status.experimental { color: #b9a4f5; background: color-mix(in srgb, #b9a4f5 16%, transparent); }
:root[data-theme="light"] .status.experimental { color: #6b4fc8; }
.project-art .status { position: absolute; top: 12px; left: 12px; }
.project-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.project-body h3 { font-size: 1.2rem; margin-bottom: 8px; }
.project-body p { color: var(--muted); font-size: .93rem; }
.project-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.project-foot .chips { margin: 0; }
.project-foot .chips li { font-size: .74rem; padding: 2px 8px; border-color: var(--line); color: var(--muted); }
.more-btn { flex: none; border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 7px 14px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.more-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.project.hidden { display: none; }

/* ---------- Lab ---------- */
.lab { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 28px); }
.lab-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 28px; overflow-x: auto; }
.lab-tabs button { border: 0; background: none; padding: 10px 14px 12px; color: var(--muted); font-weight: 600; font-size: .95rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.lab-tabs button:hover { color: var(--text); }
.lab-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--teal); }
.lab-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 56px); }
.lab-panel[hidden] { display: none; }
.field { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px; margin-bottom: 20px; }
.field label, .field .label { font-size: .9rem; color: var(--muted); }
.field output { font-weight: 650; font-family: var(--font-display); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.field input[type="range"], .field .seg { grid-column: 1 / -1; }
.field .seg { justify-self: start; margin-top: 6px; }
.assume { font-size: .8rem; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; }
.lab-result { display: flex; flex-direction: column; gap: 14px; }
.string-strip { display: flex; flex-wrap: wrap; gap: 4px; min-height: 30px; }
.string-strip span { width: 16px; height: 26px; border-radius: 2px; background: var(--module); border: 1px solid var(--module-lit); animation: pop .25s ease backwards; }
.vbar { position: relative; height: 34px; border-radius: var(--radius-sm); background: var(--surface-2); margin-top: 6px; }
.vbar-window { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--green) 20%, transparent); border-inline: 1px dashed var(--green); }
.vbar-max { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--warn); }
.vbar-mark { position: absolute; top: 4px; bottom: 4px; width: 4px; border-radius: 2px; transform: translateX(-2px); transition: left .3s ease, background .2s; }
.mark-lo { background: var(--teal); }
.mark-hi { background: var(--text); }
.vbar-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.vbar-legend li { display: flex; align-items: center; gap: 6px; }
.vbar-legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.vbar-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .9rem; }
.checks .ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.checks .pass .ico { background: var(--green); color: var(--bg); }
.checks .info .ico { border: 1px solid var(--muted); color: var(--muted); font-style: italic; font-family: Georgia, serif; }
.checks .fail .ico { background: var(--warn); color: var(--bg); }
.checks .val { font-weight: 650; font-variant-numeric: tabular-nums; }
.checks .fail { outline: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); }
.gauge { position: relative; max-width: 300px; margin: 0 auto; width: 100%; }
.gauge svg { width: 100%; display: block; }
.g-track, .g-fill { fill: none; stroke-width: 14; stroke-linecap: round; }
.g-track { stroke: var(--surface-2); }
.g-fill { stroke: var(--green); stroke-dasharray: 251.3; transition: stroke-dashoffset .4s ease, stroke .2s; }
.g-fill.over { stroke: var(--warn); }
.g-limit { stroke: var(--text); stroke-width: 3; stroke-linecap: round; transition: all .3s; }
.gauge-value { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
.gauge-value strong { display: block; font: 750 2rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.gauge-value span { font-size: .82rem; color: var(--muted); }
.yield-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yield-figs div { background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; }
.yield-figs span { font-size: .82rem; color: var(--muted); display: block; }
.yield-figs strong { font: 750 1.8rem/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); align-items: end; gap: 6px; height: 160px; padding-top: 10px; }
.months span { position: relative; background: linear-gradient(to top, var(--teal), color-mix(in srgb, var(--teal) 55%, var(--sun))); border-radius: 4px 4px 1px 1px; transition: height .35s ease; }
.months span:hover::after { content: attr(data-v); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: .72rem; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.months-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.lab-fine { margin-top: 24px; }

/* ---------- Skills ---------- */
.matcher { margin-bottom: 32px; }
.role-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.role-picks button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-size: .9rem; color: var(--text); }
.role-picks button:hover { border-color: var(--teal); }
.role-picks button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); font-weight: 600; }
.match-note { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--teal); }
.match-note p { margin: 0; flex: 1 1 320px; }
.match-note .count { font-weight: 600; color: var(--teal); }
.match-note a { font-size: .88rem; font-weight: 600; color: var(--teal); }
.skill-groups { columns: 3 300px; column-gap: 16px; }
.skill-group { break-inside: avoid; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; }
.skill-group h3 { font-size: 1.05rem; margin-bottom: 14px; }
.skill-group ul { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; padding: 0; margin: 0; }
.skill { font-size: .86rem; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); transition: background .2s, border-color .2s, opacity .2s, color .2s; }
.matching .skill { opacity: .38; }
.matching .skill.hit { opacity: 1; background: color-mix(in srgb, var(--teal) 20%, var(--surface)); border-color: var(--teal); color: var(--text); font-weight: 600; }

/* ---------- Education ---------- */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); }
.edu-sub { font: 600 .92rem/1.3 var(--font-text); color: var(--muted); margin-bottom: 8px; }
.edu-list { list-style: none; padding: 0; margin: 0; }
.edu-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.edu-list strong { font: 650 1.12rem/1.3 var(--font-display); }
.edu-list .org { grid-column: 1; color: var(--muted); font-size: .9rem; }
.edu-list .date { grid-row: 1; grid-column: 2; color: var(--muted); font-variant-numeric: tabular-nums; }
.edu-list a { grid-column: 2; grid-row: 2; font-size: .85rem; color: var(--teal); font-weight: 600; justify-self: end; }

/* ---------- Contact ---------- */
.contact { background: var(--bg-band); border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: 1fr minmax(0, 460px); gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact .lede { color: var(--muted); max-width: 48ch; }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; }
.contact-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-list li > span:first-child { width: 90px; color: var(--muted); font-size: .88rem; }
.contact-list a { font-weight: 600; text-decoration-color: var(--line-strong); text-underline-offset: 4px; overflow-wrap: anywhere; }
.contact-list a:hover { text-decoration-color: var(--teal); }
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; display: grid; gap: 16px; }
.f-row { display: grid; gap: 6px; }
.f-row label { font-size: .9rem; font-weight: 600; }
.opt { color: var(--muted); font-weight: 400; }
.f-row input, .f-row textarea { width: 100%; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 12px; resize: vertical; }
.f-row input:focus, .f-row textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 30%, transparent); }
.f-row [aria-invalid="true"] { border-color: var(--warn); }
.f-error { color: var(--warn); margin: 0; font-size: .9rem; }
.contact-form .btn { justify-self: start; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: .85rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.footer a { color: var(--text); }

/* ---------- Dialogs ---------- */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(4, 10, 18, .68); backdrop-filter: blur(4px); }
.dlg { width: min(760px, 100% - 32px); max-height: min(88vh, 900px); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.dlg[open] { animation: dlg-in .25s ease; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.dlg-close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--surface); }
#dlgBody { padding: 32px clamp(20px, 4vw, 40px) 36px; overflow-y: auto; max-height: inherit; }
#dlgBody h2 { font-size: 1.8rem; margin: 10px 0 12px; padding-right: 40px; }
#dlgBody h3 { font-size: 1.05rem; margin: 24px 0 8px; }
#dlgBody p { color: var(--muted); }
#dlgBody ul:not(.chips) { padding-left: 1.1em; margin: 0; }
#dlgBody li::marker { color: var(--teal); }
#dlgBody .gallery { margin-top: 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
#dlgBody .dlg-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.lightbox { width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; padding: 56px 16px; border: 0; background: rgba(4, 10, 18, .94); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.lightbox #lbMedia { max-width: min(1200px, 100%); max-height: calc(100% - 40px); display: flex; justify-content: center; }
.lightbox img, .lightbox video, .lightbox iframe { max-width: 100%; max-height: 80vh; border-radius: var(--radius-sm); }
.lightbox iframe { width: min(1000px, 90vw); aspect-ratio: 16 / 9; border: 0; }
.lightbox figcaption { color: #dfe7ee; font-size: .9rem; text-align: center; }
.lightbox .tool-btn { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(0,0,0,.4); }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
.jump { width: min(560px, 100% - 32px); margin-top: 12vh; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.jump input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 18px 20px; font-size: 1.05rem; outline: none; }
.jump ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.jump li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.jump li small { color: var(--muted); }
.jump li[aria-selected="true"] { background: var(--surface-2); outline: 1px solid var(--teal); }
.jump-hint { margin: 0; padding: 10px 20px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 400; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav-links { position: fixed; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 16px 18px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; font-size: 1rem; }
  .menu-btn { display: inline-flex; }
  .nav-tools { margin-left: auto; }
  .hero { grid-template-columns: 1fr; }
  .hero h1 { max-width: 16ch; }
  .pv-grid { grid-template-columns: 1fr 1fr; }
  .pv-grid .pv-col:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { position: static; max-width: 220px; }
  .pillars { grid-template-columns: 1fr; gap: 18px; }
  .workflow-body { grid-template-columns: 1fr; }
  .wf-svg { border-right: 0; border-bottom: 1px solid var(--line); }
  .pv-head { grid-template-columns: 1fr; }
  .pv-status { max-width: none; }
  .lab-panel { grid-template-columns: 1fr; }
  .sld-panel { grid-template-columns: 1fr; gap: 16px; }
  .edu-grid, .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { width: min(100% - 32px, 1180px); }
  .brand-name { display: none; }
  .jump-btn kbd { display: none; }
  .readouts { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: 1fr; }
  .facts li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .pv-grid { grid-template-columns: 1fr; }
  .pv-grid .pv-col:nth-child(2) { grid-row: auto; }
  .project-grid { grid-template-columns: 1fr; }
  .sld-bus { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 22px 20px; }
  .sld-bus::before { left: 44px; right: auto; top: 30px; bottom: 30px; width: 3px; height: auto; }
  .sld-bus .bus-live { left: 44px !important; top: 30px; width: 3px !important; height: var(--live-h, 0); transition: height .45s ease; }
  .sld-node { flex-direction: row; text-align: left; gap: 14px; }
  .sld-node .txt { align-items: flex-start; }
  .hero-actions .btn { flex: 1 1 auto; }
  .sun-sim { padding: 12px; }
  .sun-sim-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media print {
  .site-header, .sun-sim, .lab, .contact-form, .matcher, .footer { display: none; }
  body { background: #fff; color: #000; }
}

/* Focused Streamlit application directory — professional, not a toy dashboard */
.app-count{color:var(--text-muted, #8896a9);font-size:.86rem;white-space:nowrap;align-self:center}
.app-filter{display:flex;gap:.55rem;flex-wrap:wrap;margin:0 0 1.5rem}
.app-filter button{border:1px solid var(--line, #425168);border-radius:50px;padding:.55rem .9rem;background:transparent;color:inherit;cursor:pointer;font:inherit;font-size:.83rem}
.app-filter button[aria-pressed="true"]{border-color:var(--accent, #2eaa95);color:var(--accent, #2eaa95);background:color-mix(in srgb,var(--accent, #2eaa95) 10%,transparent)}
.apps-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}
.streamlit-app{display:flex;flex-direction:column;min-width:0;padding:1.45rem;border:1px solid var(--line, #425168);border-radius:16px;background:var(--surface,rgba(70,88,100,.08));transition:transform .18s ease,border-color .18s ease}
.streamlit-app:hover{transform:translateY(-3px);border-color:var(--accent, #2eaa95)}
.streamlit-app[hidden]{display:none}
.sa-top{display:flex;align-items:center;gap:.65rem;margin-bottom:1.1rem}.sa-icon{font-size:1.3rem;color:var(--accent,#2eaa95);display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:color-mix(in srgb,var(--accent,#2eaa95) 12%,transparent)}
.sa-category{font-size:.7rem;letter-spacing:.085em;font-weight:700;opacity:.75}.streamlit-app h3{font-size:1.04rem;line-height:1.35;margin:0 0 .6rem}.streamlit-app p{font-size:.9rem;line-height:1.65;opacity:.84;flex:1;margin:0 0 1rem}.streamlit-app .chips{margin:0 0 1rem}.sa-bottom{display:flex;gap:.6rem;flex-wrap:wrap;justify-content:space-between;align-items:center;border-top:1px solid var(--line,#425168);padding-top:1rem;font-size:.81rem}.sa-status{opacity:.72}.sa-bottom a{font-weight:700;text-decoration:none;color:var(--accent,#2eaa95)}.sa-unlinked{opacity:.58}.app-note{font-size:.83rem;opacity:.72;margin-top:1rem}
@media(max-width:960px){.apps-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.apps-grid{grid-template-columns:1fr}.streamlit-app{padding:1.2rem}}
@media(prefers-reduced-motion:reduce){.streamlit-app{transition:none}.streamlit-app:hover{transform:none}}

/* v4: engineering-first, restrained supporting software */
.hero{align-items:center}.engineering-hero-panel{border:1px solid var(--line,rgba(120,150,165,.25));border-radius:20px;padding:1.6rem;background:var(--card,rgba(14,33,46,.4));min-width:0}.engineering-hero-grid{display:grid;gap:1rem}.engineering-hero-grid>div{display:grid;grid-template-columns:2.4rem 1fr;gap:.2rem .6rem;padding-bottom:.8rem;border-bottom:1px solid rgba(120,150,165,.15)}.engineering-hero-grid>div:last-child{border:0;padding:0}.engineering-hero-grid span{grid-row:span 2;color:var(--accent,#18aa9f);font-size:.8rem}.engineering-hero-grid strong{font-size:1.05rem}.engineering-hero-grid small{color:var(--muted,#8c9ca8);line-height:1.5}.engineering-grid,.supporting-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.2rem}.engineering-case,.supporting-tools article{border:1px solid rgba(120,150,165,.2);border-radius:16px;padding:1.55rem;background:var(--card,transparent)}.engineering-case h3,.supporting-tools h3{margin:.6rem 0;font-size:1.28rem}.engineering-case p,.supporting-tools p{line-height:1.7}.engineering-case ul{padding-left:1.2rem;line-height:1.9}.case-no{font-size:.7rem;font-weight:700;letter-spacing:.13em;color:var(--accent,#18aa9f)}.supporting-tools a{color:var(--accent,#18aa9f);font-weight:650}.eng-focus .section-head{max-width:780px}@media(max-width:740px){.engineering-grid,.supporting-tools{grid-template-columns:1fr}.engineering-hero-panel{width:100%}}

section[hidden]{display:none!important}

/* Subtle scroll motion with accessible reduced-motion fallback */
.scroll-reveal { opacity:0; transform:translateY(18px); transition:opacity .65s ease, transform .65s cubic-bezier(.2,.75,.3,1); }
.scroll-reveal.is-visible { opacity:1; transform:none; }
.current-focus { padding-top:clamp(36px,5vw,72px); padding-bottom:clamp(36px,5vw,72px); }
.current-focus-tags { display:flex; flex-wrap:wrap; gap:10px; }
.current-focus-tags span { padding:9px 13px; border:1px solid var(--line); border-radius:999px; background:var(--surface); color:var(--text); font-size:.9rem; }
.live-app-links {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-top:19px;}
.live-app-links a {display:block; border:1px solid var(--line); background:var(--surface); padding:10px; border-radius:10px; text-decoration:none; font-size:.88rem;}
.live-app-links a:hover {border-color:var(--accent); transform:translateY(-2px);}
@media(max-width:480px){.live-app-links{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.scroll-reveal{opacity:1;transform:none;transition:none}}

/* Quiet engineering portfolio canvas: clear hierarchy without loud gradients. */
.hero { background: linear-gradient(155deg, var(--bg), var(--bg-band)); }

/* Portfolio finalisation: restrained software evidence image */
.simulation-preview { display:block; width:100%; max-height:185px; object-fit:cover; object-position:top; border-radius:12px; margin:14px 0; border:1px solid var(--line, #cbd5dd); }
