/* igor-php — "Laboratoire" theme: dark lab, terminal, lightning green from the logo. */

:root {
    --bg: #0B100C;
    --bg-raised: #131A14;
    --bg-band: #0E140F;
    --bg-deep: #070A07;
    --border: #222C23;
    --border-strong: #3A4A3B;
    --border-control: #566B57; /* 3:1 against every background: borders of buttons, tabs, icon buttons */
    --border-terminal: #2B382C;
    --border-hover: #4F6B3F;
    --text: #E4ECDD;
    --text-soft: #CFDACB;
    --muted: #B7C4B2;
    --dim: #7E8F7B;
    --info: #9AAB97;
    --code-soft: #8FA88A;
    --bg-tile: #0F1510;
    --bg-callout: #101611;
    --accent: #A6E35A;
    --accent-bright: #C8F58C;
    --accent-deep: #5E8F3A;
    --danger: #FF7A6E;
    --danger-soft: #FFB3AA;
    --danger-bg: #3A1C18;
    --danger-band: #2A1714;
    --danger-border: #4A2A26;
    --warning: #F2B544;
    --warning-soft: #F7D68E;
    --warning-bg: #3A2E14;
    --ok-band: #1A2A14;
    --ok-border: #344A26;
    --glow: color-mix(in srgb, var(--accent) 33%, transparent);
    --font-sans: 'Space Grotesk', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --radius: 14px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --radius-pill: 999px;
    --section-space: 96px;
}

/* Variable fonts (SIL Open Font License), latin subset, served locally. */
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/space-grotesk-latin-Dr-cltI.woff2") format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../fonts/jetbrains-mono-latin-AcnlIJe.woff2") format('woff2'); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.5;
}

a { color: var(--accent); }
a:hover { color: var(--accent-bright); }
code, pre { font-family: var(--font-mono); font-variant-ligatures: none; }
pre { margin: 0; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
img, video { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.container { max-width: 1200px; margin: 0 auto; padding-inline: 24px; }
.muted { color: var(--dim); font-size: 14px; }
/* Short inline code in prose never breaks in the middle of an identifier. */
p code { white-space: nowrap; }
.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; }
.center { text-align: center; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: var(--bg); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 10; }
.skip-link:focus { left: 8px; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 12px 22px; border-radius: var(--radius-md); text-decoration: none; font-weight: 500; transition: transform .2s ease, background .2s ease; }
.btn-primary { background: var(--accent); color: var(--bg); font-weight: 700; }
.btn-primary:hover { background: var(--accent-bright); color: var(--bg); transform: translateY(-1px); }
.btn-ghost { border: 1px solid var(--border-control); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.icon-btn { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border-control); color: var(--text); border-radius: var(--radius-sm); cursor: pointer; }
.icon-btn:hover, .icon-btn.is-copied { border-color: var(--accent); color: var(--accent); }

/* Header */
.site-header { border-bottom: 1px solid var(--border); }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-family: var(--font-mono); font-weight: 600; font-size: 18px; }
.brand img { width: 52px; height: 52px; filter: drop-shadow(0 0 10px var(--glow)); }
.brand { margin-right: auto; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-size: 15px; }
.nav-links a { color: var(--muted); text-decoration: none; padding-block: 10px; }
.nav-links a:hover { color: var(--text); }
.nav-tools { display: flex; align-items: center; gap: 16px; }
.lang-switch { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; font-family: var(--font-mono); font-size: 13px; }
.lang-switch a { display: inline-block; padding: 10px 8px; color: var(--dim); text-decoration: none; }
.lang-switch a[aria-current] { color: var(--accent); }

/* Hero */
.hero { position: relative; overflow: hidden; }
.grid-bg { position: absolute; inset: 0; background-image: linear-gradient(#A6E35A0D 1px, transparent 1px), linear-gradient(90deg, #A6E35A0D 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse at 70% 45%, #000 0%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 70% 45%, #000 0%, transparent 70%); }
.hero-inner { position: relative; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; padding-block: 72px 88px; }
.hero-text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -0.02em; }
.eyebrow { margin: 0; font-family: var(--font-mono); font-size: 14px; font-weight: 400; color: var(--accent); letter-spacing: 0.04em; }
.lead { font-size: 19px; line-height: 1.6; color: var(--muted); max-width: 640px; }
.lead code, .card code, .note code, .muted code { color: var(--text); }
p code.wrap { white-space: normal; overflow-wrap: anywhere; }
.command { display: flex; align-items: center; gap: 12px; max-width: 560px; padding: 12px 14px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-md); }
.command code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 15px; }
.prompt { color: var(--dim); }
.hero-visual { flex: 1 1 420px; min-width: 0; display: flex; justify-content: center; }
.logo-stage { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.logo { position: relative; width: 92%; animation: logo-in 1.1s cubic-bezier(.2, .9, .3, 1) both, float 5s ease-in-out 1.1s infinite, charge 6s ease-out 1.1s infinite; }
.aura { position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle, #A6E35A55 0%, #5E8F3A33 40%, #0B100C00 70%); animation: aura 4s ease-in-out infinite; }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.wire { stroke-dasharray: 40 260; animation: dash 2.6s linear infinite; }
.wire.w2 { animation-delay: -.9s; animation-duration: 2.1s; }
.wire.w3 { animation-delay: -1.7s; animation-duration: 3.2s; }
.bolt { position: absolute; opacity: 0; animation: strike 6s infinite; }
.bolt.b1 { top: 4%; right: 6%; }
.bolt.b2 { bottom: 18%; left: 4%; animation-delay: .25s; }

/* Audit report */
.report { max-width: 1000px; padding-block: 24px 96px; display: flex; flex-direction: column; gap: 16px; }
.terminal { position: relative; background: var(--bg-deep); border: 1px solid var(--border-terminal); border-radius: var(--radius); overflow: hidden; animation: zap 6s ease-out infinite; }
.terminal-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.terminal-bar span:not(.terminal-path) { width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong); }
.terminal-path { margin-left: 8px; font-family: var(--font-mono); font-size: 13px; color: var(--dim); }
.terminal-body { padding: 22px; font-size: 14px; line-height: 1.7; color: var(--text-soft); overflow-x: auto; }
.terminal-body .tl { display: block; opacity: 0; animation: type-in .3s ease-out forwards; animation-delay: calc(.2s + var(--i) * .25s); }
.terminal-body .file { color: var(--text); }
.terminal-body .crit { color: var(--danger); }
.terminal-body .warn { color: var(--warning); }
.terminal-body .info { color: var(--info); }
.terminal-body .ok { color: var(--accent); }
.terminal-body .dim { color: var(--dim); }
.cursor { display: inline-block; width: 9px; height: 17px; background: var(--accent); vertical-align: -3px; animation: blink 1s steps(1) infinite; }
.scan { position: absolute; left: 0; right: 0; top: 0; height: 60px; background: linear-gradient(#A6E35A00, #A6E35A14, #A6E35A00); pointer-events: none; animation: scan 4.5s linear infinite; }

/* Packagist stats band */
.stats { border-bottom: 1px solid var(--border); }
.stats-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; padding-block: 28px; }
.stats-list { display: flex; flex-wrap: wrap; gap: 24px 48px; margin: 0; }
.stats-list div { display: flex; flex-direction: column-reverse; gap: 4px; }
.stats-list dt { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.stats-list dd { margin: 0; font-family: var(--font-mono); font-size: clamp(26px, 3vw, 34px); font-weight: 600; color: var(--text); line-height: 1; }
.stats-trend { display: flex; align-items: center; gap: 14px; margin: 0; }
.stats-trend figcaption { font-family: var(--font-mono); font-size: 13px; color: var(--muted); max-width: 14ch; }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw-trend 1.6s ease-out 0.4s forwards; }
.trend-area { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: none; }
.stats-list dt a { color: inherit; text-decoration-color: var(--border-control); text-underline-offset: 3px; }
.stats-list dt a:hover { color: var(--accent); }
@keyframes draw-trend { to { stroke-dashoffset: 0; } }

/* Highlights band */
.highlights { border-block: 1px solid var(--border); background: var(--bg-band); }
.highlights-list { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; margin: 0 auto; padding-block: 28px; list-style: none; font-family: var(--font-mono); font-size: 14px; color: var(--muted); }

/* Sections */
.section { display: flex; flex-direction: column; gap: 40px; padding-block: var(--section-space) 48px; }
.section-head { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.01em; }
.cards { display: grid; gap: 20px; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.card .code { background: var(--bg); margin: 0; }
.card { display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); }
.card h3 { font-size: 21px; }
.card p { color: var(--muted); line-height: 1.6; }
.card-outline { background: transparent; }
.lift { transition: transform .2s ease, border-color .2s ease; }
.lift:hover { transform: translateY(-4px); border-color: var(--border-hover); }
.gauge { display: flex; flex-direction: column; gap: 6px; }
.gauge-labels { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--info); }
.gauge-track { height: 10px; border-radius: var(--radius-pill); background: var(--bg); border: 1px solid var(--border-terminal); overflow: hidden; }
.leak { height: 100%; border-radius: var(--radius-pill); animation: leak 5s ease-in infinite; }
.hand { transform-origin: 12px 12px; animation: spin 2.4s linear infinite; }
.flicker { animation: flicker 3s infinite; }
.callout { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; padding: 20px 24px; background: var(--bg-callout); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.demo { position: relative; flex: 0 1 420px; }
.demo video { display: block; width: 100%; border-radius: var(--radius-md); }
.demo-toggle { position: absolute; right: 8px; bottom: 8px; background: var(--bg-deep); }
.demo-toggle .icon-pause, .demo-toggle.is-playing .icon-play { display: none; }
.demo-toggle.is-playing .icon-pause { display: block; }
.callout p { flex: 1 1 320px; color: var(--muted); line-height: 1.6; }

/* Rules */
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1px; margin: 0; padding: 0; list-style: none; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rule { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--bg-tile); }
.rule-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.rule-head code { font-size: 14px; color: var(--text); }
.rule p { color: var(--muted); font-size: 15px; }
.rule-snippet { font-size: 13px; color: var(--code-soft); }
.rule-link { margin-top: auto; padding-top: 6px; font-family: var(--font-mono); font-size: 13px; text-decoration: none; }
.rule-link:hover { text-decoration: underline; }
.chip { font-family: var(--font-mono); font-size: 12px; padding: 4px 8px; border-radius: var(--radius-pill); white-space: nowrap; }
.chip-critical { color: var(--danger-soft); background: var(--danger-bg); }
.chip-warning { color: var(--warning-soft); background: var(--warning-bg); }
.note { color: var(--info); font-size: 15px; line-height: 1.6; max-width: 820px; }

/* Install */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 40px 32px; margin: 0; padding: 0; list-style: none; }
.step { display: flex; flex-direction: column; gap: 12px; }
.step-number { font-family: var(--font-mono); font-size: 28px; color: var(--accent); }
.step h3 { font-size: 20px; }
.code { padding: 16px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 13px; color: var(--text-soft); overflow-x: auto; }

/* Fix guide */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { flex: none; min-height: 44px; padding: 10px 16px; border-radius: var(--radius-md); cursor: pointer; font-family: var(--font-mono); font-size: 14px; background: transparent; color: var(--text-soft); border: 1px solid var(--border-control); }
.tab:hover { border-color: var(--accent); }
.tab[aria-selected="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.fix-panel { display: flex; flex-direction: column; gap: 24px; padding: 28px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); animation: rise .45s ease-out both; }
.fix-explain { display: flex; flex-wrap: wrap; gap: 32px; }
.fix-explain > div { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 8px; line-height: 1.6; }
.label { font-family: var(--font-mono); font-size: 13px; }
.label-danger { color: var(--danger); }
.label-ok { color: var(--accent); }
.diff { display: flex; flex-wrap: wrap; gap: 16px; }
.diff-side { flex: 1 1 420px; min-width: 0; margin: 0; display: flex; flex-direction: column; border-radius: var(--radius-md); overflow: hidden; }
.diff-side figcaption { padding: 10px 16px; font-family: var(--font-mono); font-size: 13px; }
.diff-side pre { flex: 1; padding: 16px; background: var(--bg); font-size: 13px; line-height: 1.6; color: var(--text-soft); overflow-x: auto; }
.diff-before { border: 1px solid var(--danger-border); }
.diff-before figcaption { background: var(--danger-band); color: var(--danger-soft); }
.diff-after { border: 1px solid var(--ok-border); }
.diff-after figcaption { background: var(--ok-band); color: var(--accent-bright); }

/* Footer */
.site-footer { margin-top: 48px; border-top: 1px solid var(--border); background: var(--bg-band); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: center; padding-block: 72px 40px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-block: 0 40px; font-size: 14px; }
.footer-links a { color: var(--muted); padding-block: 10px; }
.footer-links a:hover { color: var(--text); }
.footer-cta { display: flex; flex-direction: column; gap: 12px; flex: 1 1 420px; }
.footer-title { font-size: clamp(26px, 3vw, 36px); font-weight: 700; }

/* Small screens */
@media (max-width: 760px) {
    :root { --section-space: 64px; }
    .nav { gap: 4px 16px; }
    .brand img { width: 40px; height: 40px; }
    .nav-links { order: 3; width: 100%; gap: 4px 20px; }
    .btn-github { padding-inline: 12px; }
    .btn-github .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .hero-inner { padding-block: 40px 56px; gap: 24px; }
    .hero-visual { flex-basis: 100%; }
    .logo-stage { max-width: 300px; }
    .lead { font-size: 17px; }
    .terminal-body { padding: 16px; font-size: 12px; }
    .report { padding-bottom: 64px; }
    .tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -24px; padding: 4px 24px; scrollbar-width: thin; }
    .fix-panel, .card { padding: 20px; }
    .rule { padding: 20px; }
}

/* Animations */
@keyframes logo-in { 0% { opacity: 0; transform: translateY(30px) scale(.92); filter: brightness(3) drop-shadow(0 0 40px #C8F58C); } 60% { opacity: 1; filter: brightness(1.4) drop-shadow(0 0 30px #A6E35A); } 100% { opacity: 1; transform: none; filter: drop-shadow(0 0 24px #A6E35A66); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes charge { 0%, 86%, 100% { filter: drop-shadow(0 0 24px #A6E35A66); } 88% { filter: brightness(1.35) drop-shadow(0 0 50px #C8F58C); } 90% { filter: drop-shadow(0 0 24px #A6E35A66); } 92% { filter: brightness(1.25) drop-shadow(0 0 44px #C8F58C); } }
@keyframes aura { 0%, 100% { transform: scale(.92); opacity: .55; } 50% { transform: scale(1.05); opacity: .9; } }
@keyframes dash { from { stroke-dashoffset: 300; } to { stroke-dashoffset: 0; } }
@keyframes strike { 0%, 86%, 100% { opacity: 0; transform: scale(.6); } 88% { opacity: 1; transform: scale(1); } 90% { opacity: .2; } 92% { opacity: 1; } 96% { opacity: 0; } }
@keyframes type-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes zap { 0%, 88%, 100% { box-shadow: 0 0 0 1px var(--bg), 0 30px 80px -30px #A6E35A55; } 89% { box-shadow: 0 0 0 1px var(--accent), 0 30px 120px -10px #A6E35AAA; } 91% { box-shadow: 0 0 0 1px var(--bg), 0 30px 80px -30px #A6E35A55; } 93% { box-shadow: 0 0 0 2px var(--accent-bright), 0 30px 140px 0 #A6E35ACC; } }
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(900%); } }
@keyframes leak { 0% { width: 6%; background: var(--accent); } 70% { background: var(--warning); } 88% { width: 100%; background: var(--danger); } 94% { width: 100%; opacity: .2; } 100% { width: 6%; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flicker { 0%, 80%, 100% { opacity: 1; } 82% { opacity: .15; } 84% { opacity: 1; } 86% { opacity: .3; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .terminal-body .tl { opacity: 1; }
    .logo { filter: drop-shadow(0 0 24px #A6E35A66); }
    .trend-line { stroke-dashoffset: 0; }
}

/* Legal page */
.legal { max-width: 760px; padding-block: 72px var(--section-space); display: flex; flex-direction: column; gap: 40px; }
.legal h1 { font-size: clamp(32px, 4vw, 44px); line-height: 1.1; }
.legal section { display: flex; flex-direction: column; gap: 12px; }
.legal h2 { font-size: 22px; }
.legal p, .legal li { color: var(--text-soft); line-height: 1.7; }
.legal ul { margin: 0; padding-left: 20px; }
.legal address { font-style: normal; color: var(--text-soft); line-height: 1.7; }
.legal .updated { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.footer-legal { margin-top: -16px; padding-block: 0 32px; font-size: 13px; color: var(--muted); }
