:root {
  color-scheme: dark;
  --ink: #f5f7fb;
  --muted: #afb5c2;
  --paper: #0b0d12;
  --paper-2: #11151d;
  --paper-3: #181d27;
  --line: #303746;
  --blue: #5272ff;
  --blue-dark: #3157ff;
  --purple: #9b74ff;
  --orange: #ff8a3d;
  --green: #45c98a;
  --white: #fff;
  --max: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #151a24;
  --muted: #5c6574;
  --paper: #f4f6fb;
  --paper-2: #ffffff;
  --paper-3: #e8ecf5;
  --line: #cbd2df;
  --blue: #3157df;
  --blue-dark: #2449ca;
  --purple: #7048cf;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 1rem; line-height: 1.65; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--blue), var(--purple) 68%, transparent 68%); z-index: 20; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #b7c4ff; outline-offset: 4px; }
a, button, summary, input, select, textarea { touch-action: manipulation; }
section[id], article[id] { scroll-margin-top: 6rem; }
[hidden] { display: none !important; }
.shell { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.narrow { max-width: 850px; margin-inline: auto; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px 18px; color: #000; background: #fff; }
.skip-link:focus { top: 12px; }

.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 25%); background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(10px); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.wordmark span { color: var(--blue); }
.site-nav { order: 2; display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); margin-left: auto; }
.site-nav a { color: var(--muted); font-size: .93rem; font-weight: 650; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--blue); text-decoration-thickness: 2px; }
.header-actions { order: 3; display: flex; gap: 8px; }
.theme-button, .menu-button { min-width: 42px; min-height: 42px; border: 1px solid var(--line); border-radius: 3px; padding: 8px 12px; color: var(--ink); background: var(--paper-2); cursor: pointer; }
.theme-button:hover, .menu-button:hover { border-color: var(--blue); }
.menu-button { display: none; border: 1px solid var(--line); border-radius: 0; padding: 8px 12px; color: var(--ink); background: transparent; }

.hero, .page-hero, .case-hero { padding: clamp(70px, 10vw, 142px) 0; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: clamp(44px, 8vw, 110px); align-items: center; }
.hero h1, .page-hero h1, .case-hero h1 { max-width: 950px; margin: 0 0 28px; font-size: clamp(2.7rem, 6.8vw, 6.5rem); line-height: .98; letter-spacing: -.065em; text-wrap: balance; }
.page-hero h1, .case-hero h1 { font-size: clamp(2.5rem, 5vw, 5.3rem); }
.hero-copy, .lead { max-width: 760px; margin: 0; color: color-mix(in srgb, var(--ink) 82%, var(--muted)); font-size: clamp(1.16rem, 2vw, 1.42rem); line-height: 1.55; }
.kicker { margin: 0 0 16px; color: #9db0ff; font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 32px 0; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 3px; padding: 10px 18px; background: transparent; color: var(--ink); font-weight: 750; text-decoration: none; cursor: pointer; }
.button:hover { border-color: #7d8ba6; background: var(--paper-3); }
.button.primary { border-color: var(--blue-dark); background: var(--blue-dark); color: #fff; }
.button.light { border-color: #fff; background: #fff; color: #111; }
.button.outline-light { border-color: #fff; }
.text-link { color: #aebcff; font-weight: 750; }
.portrait-placeholder { min-height: 440px; display: flex; flex-direction: column; justify-content: end; border: 1px solid var(--line); padding: 28px; background: repeating-linear-gradient(-45deg, var(--paper-2), var(--paper-2) 10px, var(--paper-3) 10px, var(--paper-3) 20px); transform: rotate(1deg); }
.portrait-mark { margin-bottom: auto; color: var(--purple); font-size: 5rem; font-weight: 900; letter-spacing: -.1em; }
.portrait-placeholder p { margin: 0; font-weight: 800; }
.portrait-placeholder small { color: var(--muted); }

.section { padding: clamp(72px, 9vw, 126px) 0; }
.section.ruled { border-block: 1px solid var(--line); background: var(--paper-2); }
.section-heading { display: grid; grid-template-columns: 1.35fr .65fr; align-items: end; gap: 40px; margin-bottom: 48px; }
.section-heading h2, .split h2, .contact-panel h2, .quote-layout h2 { margin: 0; font-size: clamp(2rem, 4vw, 4rem); line-height: 1.05; letter-spacing: -.045em; text-wrap: balance; }
.section-heading > p { margin: 0; color: var(--muted); }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.project-card { min-width: 0; border-top: 4px solid var(--blue); background: var(--paper-2); }
.project-card:nth-child(3n + 2) { border-color: var(--purple); transform: translateY(14px); }
.project-card-body { padding: 28px; }
.project-card h3 { margin: 0 0 12px; font-size: 1.75rem; line-height: 1.1; }
.project-card h3 a { text-decoration: none; }
.project-image { width: 100%; height: auto; object-fit: contain; background: #1a1f2a; }
.media-missing { width: 100%; aspect-ratio: 16 / 9; background: #1a1f2a; }
.media-missing { display: flex; flex-direction: column; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); color: var(--muted); }
.media-missing span { font-weight: 800; }
.media-missing small { opacity: .8; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; padding: 0; list-style: none; }
.tag-list li { border: 1px solid var(--line); padding: 4px 9px; color: #c8ceda; font-size: .82rem; }
.last-update { min-height: 3.2em; color: var(--muted); font-size: .9rem; }
.card-links { display: flex; flex-wrap: wrap; gap: .55rem 1rem; align-items: center; }
.update-list, .timeline, .news-list { margin: 0; padding: 0; list-style: none; }
.update-list li { display: grid; grid-template-columns: 145px 1fr; gap: 30px; padding: 24px 0; border-top: 1px solid var(--line); }
.update-list time, .news-list time { color: var(--muted); font-variant-numeric: tabular-nums; }
.update-list p { margin: 4px 0 0; color: #c8ced9; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(50px, 9vw, 120px); }
.timeline li { position: relative; margin-left: 12px; padding: 0 0 34px 34px; border-left: 1px solid #4d5668; }
.timeline li::before { content: ""; position: absolute; top: 5px; left: -6px; width: 11px; height: 11px; border-radius: 50%; background: var(--purple); }
.timeline span, .timeline small { display: block; color: var(--muted); }
.timeline strong { display: block; margin: 3px 0; font-size: 1.12rem; }
.dark-section { background: #3157ff; color: #fff; }
.dark-section .kicker, .dark-section .section-heading > p { color: #fff; }
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid rgba(255,255,255,.35); }
.service-grid article { min-height: 220px; padding: 24px; border: 1px solid rgba(255,255,255,.2); }
.service-grid h3 { margin-top: 0; }
.service-grid p { color: #fff; }
.experimental-note { max-width: 860px; margin: 32px 0; }
.contact-panel { display: grid; grid-template-columns: 1.2fr .8fr; gap: 50px; align-items: center; }
.contact-links { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.empty-state { border: 1px dashed #5c6576; padding: 28px; color: var(--muted); }

.prose-grid, .case-content { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: clamp(50px, 9vw, 120px); align-items: start; }
.prose { max-width: 760px; }
.prose h2 { margin: 56px 0 14px; font-size: 2rem; line-height: 1.15; }
.prose h2:first-child { margin-top: 0; }
.prose p, .plain-list { color: #cbd0da; font-size: 1.08rem; }
.plain-list { padding-left: 1.25rem; }
.plain-list li { margin-bottom: 10px; }
.fact-sheet, .case-aside { position: sticky; top: 100px; border: 1px solid var(--line); padding: 26px; background: var(--paper-2); }
.fact-sheet h2, .case-aside h2 { margin-top: 0; }
.fact-sheet dt { margin-top: 18px; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.fact-sheet dd { margin: 4px 0 0; }
.fact-sheet .button { width: 100%; margin-top: 10px; }
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 90px); align-items: center; }
.case-grid .project-image, .case-grid .media-missing { border: 1px solid var(--line); transform: rotate(-.6deg); }
.case-aside h2 { margin: 24px 0 5px; font-size: .85rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.case-aside h2:first-child { margin-top: 0; }
.case-aside p { margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 38px; }
.filter { border: 1px solid var(--line); padding: 8px 14px; background: transparent; color: var(--ink); cursor: pointer; }
.filter.active { border-color: var(--blue); background: var(--blue); }
.news-list { display: grid; gap: 14px; }
.news-list li { border-left: 4px solid var(--blue); padding: 25px 28px; background: var(--paper-2); }
.news-list li:nth-child(even) { border-color: var(--purple); }
.news-list li > div { display: flex; justify-content: space-between; gap: 20px; }
.news-list h2 { margin: 10px 0 4px; font-size: 1.3rem; }
.news-list p { margin: 0 0 10px; color: #cbd0d9; }
.type-badge { color: #aebdff; font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.blacklight-hero { padding: clamp(70px, 10vw, 130px) 0; background: #271141; border-bottom: 1px solid #7344a0; }
.blacklight-hero h1 { margin: 0 0 24px; font-size: clamp(2.5rem, 5vw, 5rem); line-height: 1; letter-spacing: -.055em; }
.blacklight-logo { width: min(100%, 180px); height: auto; aspect-ratio: 1; align-self: center; justify-self: center; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.product-card { border: 1px solid var(--line); padding: 20px; background: var(--paper-2); }
.product-photo-missing { display: grid; min-height: 170px; place-items: center; margin: -20px -20px 22px; padding: 20px; background: repeating-linear-gradient(-45deg, #181d27, #181d27 9px, #1d2330 9px, #1d2330 18px); color: var(--muted); text-align: center; }
.product-card h3 { margin: 0 0 12px; }
.product-card dl { display: grid; grid-template-columns: 88px 1fr; gap: 7px 10px; font-size: .88rem; }
.product-card dt { color: var(--muted); }
.product-card dd { margin: 0; }
.product-card summary { cursor: pointer; font-weight: 750; }
.product-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.text-button { border: 0; padding: 0; background: transparent; color: #b6c2ff; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.quote-layout { display: grid; grid-template-columns: .75fr 1.25fr; gap: clamp(40px, 8vw, 100px); }
.quote-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.quote-form label { display: grid; gap: 6px; font-weight: 700; }
.quote-form input, .quote-form select, .quote-form textarea { width: 100%; border: 1px solid #485164; border-radius: 0; padding: 11px 12px; background: #0e1117; color: var(--ink); }
.quote-form fieldset { display: flex; gap: 24px; border: 1px solid var(--line); }
.quote-form fieldset label { display: flex; align-items: center; gap: 8px; }
.quote-form fieldset input { width: auto; }
.wide { grid-column: 1 / -1; }
.form-status { min-height: 1.4em; margin: 0; color: #aebdff; }

.breadcrumbs { padding-top: 22px; color: var(--muted); font-size: .86rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: 7px; color: var(--line); }
.ecosystem-map { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 36px; }
.ecosystem-map::before { content: ""; position: absolute; top: 28px; right: 9%; left: 9%; height: 1px; background: var(--line); }
.ecosystem-node { position: relative; min-width: 0; border: 1px solid var(--line); border-top: 4px solid var(--blue); padding: 20px; background: var(--paper-2); text-decoration: none; }
.ecosystem-node::before { content: ""; position: absolute; top: 20px; left: 20px; width: 13px; height: 13px; border: 3px solid var(--paper-2); border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--line); }
.ecosystem-node h3 { margin: 40px 0 8px; font-size: 1.05rem; }
.ecosystem-node p { margin: 0; color: var(--muted); font-size: .9rem; }
.ecosystem-node[data-accent="purple"] { border-top-color: var(--purple); }
.ecosystem-node[data-accent="purple"]::before { background: var(--purple); }
.ecosystem-node[data-accent="orange"] { border-top-color: var(--orange); }
.ecosystem-node[data-accent="orange"]::before { background: var(--orange); }
.ecosystem-node[data-accent="neutral"] { border-top-color: var(--muted); }
.ecosystem-node[data-accent="neutral"]::before { background: var(--muted); }
.route-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.route-choice { border: 1px solid var(--line); padding: 24px; background: var(--paper-2); }
.route-choice h3 { margin: 0 0 8px; }
.route-choice p { color: var(--muted); }
.status-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.status-list li { display: grid; grid-template-columns: 180px 1fr; gap: 24px; border-top: 1px solid var(--line); padding: 18px 0; }
.status-label { color: var(--muted); font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.server-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.server-summary { border: 1px solid var(--line); padding: 24px; background: var(--paper-2); }
.server-summary h2 { margin: 4px 0 10px; }
.server-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; }
.server-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.server-status[data-tone="verified"]::before { background: var(--green); }
.boundary-note { border-left: 4px solid var(--purple); padding: 18px 22px; background: var(--paper-2); }
.contact-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.contact-option { border-top: 4px solid var(--blue); padding: 24px; background: var(--paper-2); }
.contact-option.blacklight { border-top-color: var(--orange); }
.contact-option h2 { margin-top: 0; }

:root[data-theme="light"] .dark-section { background: #2449ca; }
:root[data-theme="light"] .project-image,
:root[data-theme="light"] .media-missing { background: #e4e8f1; }
:root[data-theme="light"] .tag-list li,
:root[data-theme="light"] .update-list p,
:root[data-theme="light"] .prose p,
:root[data-theme="light"] .plain-list,
:root[data-theme="light"] .news-list p { color: #4b5566; }
:root[data-theme="light"] .quote-form input,
:root[data-theme="light"] .quote-form select,
:root[data-theme="light"] .quote-form textarea { background: #fff; color: var(--ink); }
:root[data-theme="light"] .site-footer { background: #e8ecf5; }

.site-footer { border-top: 1px solid var(--line); padding: 60px 0 20px; background: #080a0f; }
.footer-grid { display: grid; grid-template-columns: 1.7fr .65fr .65fr; gap: 50px; }
.footer-grid p { max-width: 590px; color: var(--muted); }
.footer-grid h2 { font-size: .82rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.footer-grid > div:not(:first-child) { display: flex; flex-direction: column; gap: 8px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-top: 55px; border-top: 1px solid var(--line); padding-top: 18px; color: #858c99; font-size: .82rem; }

.resume { color-scheme: light; background: #fff; color: #16181d; font-family: Arial, sans-serif; }
.resume main { width: min(calc(100% - 40px), 850px); margin: 34px auto; }
.resume header { border-bottom: 4px solid #3157ff; padding-bottom: 18px; }
.resume h1 { margin: 0; font-size: 2.5rem; letter-spacing: -.04em; }
.resume h2 { margin: 28px 0 8px; border-bottom: 1px solid #bbb; padding-bottom: 5px; font-size: 1.2rem; text-transform: uppercase; }
.resume h3 { margin: 13px 0 3px; font-size: 1rem; }
.resume p { margin: 5px 0; line-height: 1.45; }
.resume .kicker { color: #3157ff; }

@media (max-width: 900px) {
  .menu-button { display: inline-flex; }
  .site-nav { position: absolute; inset: 72px 20px auto; display: none; flex-direction: column; align-items: stretch; gap: 0; border: 1px solid var(--line); background: var(--paper-2); }
  .site-nav[data-open] { display: flex; }
  .site-nav a { padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .hero-grid, .section-heading, .split, .contact-panel, .case-grid, .prose-grid, .case-content, .quote-layout { grid-template-columns: 1fr; }
  .portrait-placeholder { min-height: 300px; transform: none; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .fact-sheet, .case-aside { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .ecosystem-map { grid-template-columns: repeat(2, 1fr); }
  .ecosystem-map::before { display: none; }
  .route-choices, .server-grid, .contact-options { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .shell { width: min(calc(100% - 28px), var(--max)); }
  .hero, .page-hero, .case-hero { padding-block: 62px; }
  .hero h1, .page-hero h1, .case-hero h1 { letter-spacing: -.05em; }
  .project-grid, .product-grid, .service-grid, .quote-form, .footer-grid, .ecosystem-map, .route-choices, .server-grid, .contact-options { grid-template-columns: 1fr; }
  .project-card:nth-child(3n + 2) { transform: none; }
  .update-list li { grid-template-columns: 1fr; gap: 4px; }
  .wide, .footer-grid > div:first-child { grid-column: auto; }
  .news-list li > div { flex-direction: column; gap: 4px; }
  .status-list li { grid-template-columns: 1fr; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  @page { size: A4; margin: 12mm 14mm; }
  .resume { font-size: 10.5pt; }
  .resume main { width: 100%; margin: 0; }
  .resume h1 { font-size: 26pt; }
  .resume h2 { margin-top: 14px; font-size: 13pt; }
  .resume h3 { margin-top: 8px; }
  .resume p { line-height: 1.32; }
  .resume a { color: inherit; text-decoration: none; }
  .resume article { break-inside: avoid; }
}
