:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --bg-strong: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --text: #172028;
  --muted: #5f6d75;
  --faint: #8b9aa3;
  --line: rgba(23, 32, 40, 0.12);
  --line-strong: rgba(23, 32, 40, 0.2);
  --accent: #1e88a8;
  --accent-soft: #d9eef3;
  --sage: #8ba99c;
  --sage-soft: #e5eee9;
  --graphite: #2d3740;
  --shadow: 0 24px 80px rgba(30, 48, 60, 0.1);
  --radius: 8px;
  --max: 1180px;
  --header-height: 76px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0f14;
    --bg-strong: #141820;
    --surface: rgba(20, 24, 32, 0.78);
    --surface-solid: #141820;
    --text: #e2e6ec;
    --muted: #8b95a0;
    --faint: #5a6470;
    --line: rgba(226, 230, 236, 0.1);
    --line-strong: rgba(226, 230, 236, 0.16);
    --accent: #3db8e0;
    --accent-soft: rgba(61, 184, 224, 0.12);
    --sage: #6dab96;
    --sage-soft: rgba(109, 171, 150, 0.12);
    --graphite: #c8cdd4;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  }
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0f14;
  --bg-strong: #141820;
  --surface: rgba(20, 24, 32, 0.78);
  --surface-solid: #141820;
  --text: #e2e6ec;
  --muted: #8b95a0;
  --faint: #5a6470;
  --line: rgba(226, 230, 236, 0.1);
  --line-strong: rgba(226, 230, 236, 0.16);
  --accent: #3db8e0;
  --accent-soft: rgba(61, 184, 224, 0.12);
  --sage: #6dab96;
  --sage-soft: rgba(109, 171, 150, 0.12);
  --graphite: #c8cdd4;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] body::before {
  opacity: 0.03;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  text-rendering: geometricPrecision;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.028;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-120%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  padding: 10px 14px;
  color: var(--text);
  transition: transform 160ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.page-shell {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.section-band {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  border-bottom: 1px solid rgba(23, 32, 40, 0.08);
  background: rgba(247, 249, 251, 0.78);
  backdrop-filter: blur(18px);
  transition:
    box-shadow 180ms var(--ease),
    background 180ms var(--ease);
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 40px rgba(30, 48, 60, 0.08);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--max), calc(100% - 40px));
  height: 100%;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  position: relative;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: linear-gradient(135deg, #fff, #edf7f8);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  position: absolute;
  content: "";
  background: var(--graphite);
}

.brand-mark::before {
  width: 14px;
  height: 1px;
  transform: translateY(-5px);
}

.brand-mark::after {
  width: 14px;
  height: 1px;
  transform: translateY(5px);
}

.brand-mark span {
  width: 1px;
  height: 18px;
  background: var(--accent);
}

.site-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-menu > a {
  position: relative;
  padding: 10px 0;
}

.site-menu > a::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--accent);
  content: "";
  transition: transform 180ms var(--ease);
}

.site-menu > a:hover,
.site-menu > a:focus-visible {
  color: var(--text);
}

.site-menu > a:hover::after,
.site-menu > a:focus-visible::after {
  transform: scaleX(1);
}

.language-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  padding: 2px;
}

.language-switch button {
  min-width: 52px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 9px 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}

.language-switch button.is-active {
  background: var(--text);
  color: #fff;
}

.nav-toggle {
  display: none;
}

.hero {
  overflow: hidden;
  min-height: calc(100dvh - var(--header-height) - 72px);
  padding: clamp(48px, 7vw, 86px) 0 54px;
}

.hero::after {
  position: absolute;
  right: max(24px, calc((100vw - var(--max)) / 2));
  bottom: 54px;
  width: 34vw;
  max-width: 460px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(30, 136, 168, 0.45), transparent);
  content: "";
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: clamp(40px, 7vw, 92px);
  align-items: center;
}

.hero-copy {
  max-width: 760px;
}

.system-line,
.section-kicker,
.panel-topline,
.project-meta,
.contact-type,
.capability-index {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 10.4ch;
  margin: 14px 0 22px;
  color: var(--text);
  font-size: clamp(3.5rem, 9vw, 8.8rem);
  font-weight: 720;
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 2vw, 1.32rem);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: var(--radius);
  padding: 0 18px;
  font-size: 0.94rem;
  font-weight: 650;
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    border-color 180ms var(--ease),
    background 180ms var(--ease);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-primary {
  border: 1px solid var(--text);
  background: var(--text);
  color: #fff;
  box-shadow: 0 14px 32px rgba(23, 32, 40, 0.16);
}

.button-secondary {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  border-color: rgba(30, 136, 168, 0.4);
  background: rgba(255, 255, 255, 0.9);
}

.signal-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(239, 248, 249, 0.78)),
    var(--surface-solid);
  box-shadow: var(--shadow);
  padding: 22px;
}

.signal-panel::before {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(30, 136, 168, 0.1);
  border-radius: 6px;
  pointer-events: none;
  content: "";
}

.panel-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 7px rgba(139, 169, 156, 0.16);
}

.signal-stack {
  display: grid;
  gap: 12px;
}

.signal-node {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px 14px;
  border: 1px solid rgba(23, 32, 40, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.signal-node span {
  grid-row: span 2;
  color: var(--faint);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
}

.signal-node strong {
  color: var(--text);
  font-size: 0.98rem;
}

.signal-node p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.projects-section,
.contact-section {
  padding: clamp(72px, 9vw, 122px) 0;
}

.section-heading {
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  font-weight: 710;
  line-height: 1;
  letter-spacing: 0;
}

.section-heading p {
  margin: 0;
}

.section-heading > p:not(.section-kicker) {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.project-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 34px 0 22px;
}

.filter-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 9px 13px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
}

.filter-button.is-active {
  border-color: rgba(30, 136, 168, 0.3);
  background: var(--accent-soft);
  color: #164e5f;
}

.project-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.project-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.64fr) minmax(260px, 1fr) auto;
  gap: 24px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
}

.project-row:hover .project-title {
  color: var(--accent);
}

.project-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.25rem, 2.4vw, 1.72rem);
  font-weight: 700;
  line-height: 1.15;
  transition: color 160ms var(--ease);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  color: var(--faint);
}

.project-copy {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
}

.project-links {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
  padding: 0 12px;
  color: var(--graphite);
  font-size: 0.83rem;
  font-weight: 650;
}

.project-links a:hover,
.project-links a:focus-visible {
  border-color: rgba(30, 136, 168, 0.34);
  background: var(--surface-solid);
}

.system-section {
  padding: clamp(72px, 9vw, 116px) 0;
  background: rgba(255, 255, 255, 0.38);
}

.bridge-section {
  padding: clamp(36px, 5vw, 60px) 0;
}

.bridge-text {
  max-width: 640px;
  margin: 0;
  color: var(--faint);
  font-size: 1.04rem;
  font-style: italic;
  line-height: 1.72;
  border-left: 2px solid var(--accent);
  padding-left: 20px;
}

.system-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1fr);
  gap: clamp(36px, 7vw, 84px);
  align-items: start;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.capability-item {
  min-height: 166px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  padding: 20px;
}

.capability-index {
  color: var(--sage);
}

.capability-item h3 {
  margin: 18px 0 8px;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.22;
}

.capability-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 36px;
}

.contact-card {
  display: grid;
  gap: 18px;
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  padding: 20px;
}

.contact-card strong {
  color: var(--text);
  font-size: 1.1rem;
}

.contact-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
}

.contact-actions a,
.contact-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  padding: 0 12px;
  color: var(--graphite);
  font-size: 0.83rem;
  font-weight: 650;
  cursor: pointer;
}

.contact-actions a:hover,
.contact-actions button:hover,
.contact-actions a:focus-visible,
.contact-actions button:focus-visible {
  border-color: rgba(30, 136, 168, 0.34);
  background: #fff;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  color: var(--muted);
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 0.92rem;
}

.footer-grid p {
  margin: 0;
}

.footer-grid a {
  color: var(--text);
  font-weight: 650;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  transform: translateY(18px);
  opacity: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(23, 32, 40, 0.94);
  padding: 11px 14px;
  color: #fff;
  font-size: 0.9rem;
  pointer-events: none;
  transition:
    opacity 180ms var(--ease),
    transform 180ms var(--ease);
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--text);
  border-color: var(--line-strong);
}

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }
:root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

:focus-visible {
  outline: 2px solid rgba(30, 136, 168, 0.45);
  outline-offset: 3px;
}

@media (max-width: 920px) {
  .hero-grid,
  .system-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 11ch;
  }

  .signal-panel {
    max-width: 620px;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-links {
    justify-content: flex-start;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 68px;
  }

  .page-shell,
  .nav-shell {
    width: min(100% - 28px, var(--max));
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
  }

  .nav-toggle .line {
    width: 17px;
    height: 1px;
    background: var(--text);
    transition:
      transform 160ms var(--ease),
      opacity 160ms var(--ease);
  }

  .nav-toggle .line + .line {
    margin-top: -12px;
  }

  .nav-toggle[aria-expanded="true"] .line:first-child {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .line:nth-child(2) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .site-menu {
    position: fixed;
    top: var(--header-height);
    right: 14px;
    left: 14px;
    display: grid;
    gap: 6px;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.94);
    padding: 14px;
    box-shadow: var(--shadow);
    transition:
      opacity 160ms var(--ease),
      transform 160ms var(--ease),
      visibility 160ms var(--ease);
  }

  .site-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-menu > a {
    padding: 12px;
  }

  .language-switch {
    width: 100%;
  }

  .language-switch button {
    min-height: 38px;
  }

  .hero {
    min-height: auto;
    padding: 42px 0 40px;
  }

  .hero-grid {
    gap: 24px;
  }

  .hero h1 {
    font-size: clamp(3.2rem, 17vw, 5.4rem);
  }

  .hero-lede {
    font-size: 1rem;
  }

  .hero-actions {
    margin-top: 24px;
  }

  .button {
    flex: 1 1 170px;
  }

  .signal-panel {
    padding: 16px;
  }

  .panel-topline {
    margin-bottom: 12px;
  }

  .signal-stack {
    gap: 8px;
  }

  .signal-node {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 2px 10px;
    padding: 12px;
  }

  .signal-node p {
    display: none;
  }

  .capability-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    align-items: flex-start;
    flex-direction: column;
  }
}

[data-theme="dark"] .site-header { background: rgba(12, 15, 20, 0.78); border-bottom-color: rgba(226, 230, 236, 0.06); }
[data-theme="dark"] .site-header.is-scrolled { background: rgba(12, 15, 20, 0.92); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); }
[data-theme="dark"] .nav-toggle { background: rgba(20, 24, 32, 0.7); }
[data-theme="dark"] .site-menu { background: rgba(12, 15, 20, 0.94); }
[data-theme="dark"] .language-switch { background: rgba(20, 24, 32, 0.7); }
[data-theme="dark"] .signal-panel { background: linear-gradient(135deg, rgba(20, 24, 32, 0.88), rgba(12, 15, 20, 0.78)), var(--surface-solid); }
[data-theme="dark"] .signal-node { background: rgba(20, 24, 32, 0.72); border-color: rgba(226, 230, 236, 0.08); }
[data-theme="dark"] .system-section { background: rgba(20, 24, 32, 0.38); }
[data-theme="dark"] .capability-item { background: rgba(20, 24, 32, 0.68); }
[data-theme="dark"] .contact-card { background: rgba(20, 24, 32, 0.68); }
[data-theme="dark"] .project-links a { background: rgba(20, 24, 32, 0.52); }
[data-theme="dark"] .contact-actions a,
[data-theme="dark"] .contact-actions button { background: rgba(20, 24, 32, 0.7); }
[data-theme="dark"] .filter-button { background: rgba(20, 24, 32, 0.58); }
[data-theme="dark"] .button-secondary { background: rgba(20, 24, 32, 0.62); }
[data-theme="dark"] .hero::after { background: linear-gradient(90deg, transparent, rgba(61, 184, 224, 0.3), transparent); }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
