:root {
  color-scheme: dark;
  --bg: #10191f;
  --text: #edf2f3;
  --muted: #b0bec4;
  --accent: #85dbc6;
  --line: #354851;
  --ink: #20323b;
  --light: #f0f2ee;
  --gutter: clamp(20px, 4vw, 64px);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height, 110px) + 16px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.65; }
main { overflow: clip; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a, button { -webkit-tap-highlight-color: #85dbc626; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--accent); color: var(--ink); }
h1, h2, h3, p, figure { margin: 0; }
img { max-width: 100%; display: block; }
.container { width: min(calc(100% - var(--gutter) * 2), 1184px); margin-inline: auto; }
.accent { color: var(--accent); }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 40; padding: 10px 16px; background: var(--accent); color: var(--ink); }
.skip-link:focus { top: 12px; }

/* Navigation */
.site-header { position: sticky; top: 0; z-index: 20; background: #10191ff2; border-bottom: 1px solid #ffffff18; backdrop-filter: blur(14px); }
.header-inner { min-height: 84px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 13px; margin-right: auto; min-height: 44px; }
.brand-mark { position: relative; flex: none; display: grid; place-items: center; width: 62px; height: 41px; border: 1px solid var(--accent); border-radius: 50%; color: #e3f8f1; font: 700 16px/1 Consolas, monospace; letter-spacing: .05em; }
.brand-mark::before { content: ""; position: absolute; inset: 4px; border: 1px solid #85dbc635; border-radius: 50%; }
.brand-name { font-size: 13px; line-height: 1.25; font-weight: 650; }
.main-nav { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 32px); }
.main-nav a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: #c5d0d4; font-size: 14px; }
.main-nav a:hover { color: var(--accent); }
.lang-switch { display: flex; gap: 2px; }
.lang-switch button { border: 0; border-radius: 4px; background: none; color: #a6b6bc; min-width: 44px; min-height: 44px; cursor: pointer; font-size: 12px; }
.lang-switch button:hover { color: var(--text); background: #ffffff08; }
.lang-switch button[aria-pressed="true"] { color: var(--accent); background: #85dbc60a; font-weight: 700; }

/* Introduction */
.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 80px); align-items: center; padding-block: 84px 96px; }
.hero-main, .hero-panel { min-width: 0; }
.eyebrow, .section-kicker, .project-type { font: 600 11px/1.6 Consolas, ui-monospace, monospace; letter-spacing: .09em; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent); margin-bottom: 25px; }
.signal { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-size: clamp(2.7rem, 5.05vw, 4.8rem); line-height: 1.12; font-weight: 650; letter-spacing: -.045em; margin-bottom: 25px; }
.hero-copy { max-width: 53ch; color: #bdc8cd; font-size: 17px; line-height: 1.8; }
.hero-actions { display: flex; align-items: center; gap: 27px; flex-wrap: wrap; margin-top: 30px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 11px 24px; border-radius: 5px; font-size: 14px; font-weight: 650; transition: background .2s ease; }
.button-primary { background: var(--accent); color: #143029; }
.button-primary:hover { background: #a1e6d5; }
.text-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; border-bottom: 1px solid #637b84; font-size: 14px; }
.text-link:hover { border-color: var(--accent); }
.text-link span { color: var(--accent); }
.hero-panel { width: 100%; max-width: 420px; justify-self: end; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #16262e; }
.hero-photo { position: relative; height: 380px; overflow: hidden; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 43% center; }
.hero-photo::after, .expertise-images figure::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, #07141bbc); pointer-events: none; }
.hero-photo figcaption, .expertise-images figcaption { position: absolute; z-index: 1; bottom: 18px; left: 20px; right: 20px; color: #f0f6f4; font-size: 12px; font-weight: 600; }
.hero-photo-footer { border-top: 1px solid var(--line); padding: 16px 20px; }
.hero-photo-footer > div { display: flex; flex-wrap: wrap; gap: 8px 17px; }
.hero-photo-footer span { color: #c5d4d8; font-size: 11px; }
.ribbon { overflow: hidden; background: #85dbc6; color: #173b32; }
.ribbon-track { display: flex; width: max-content; animation: ribbon-scroll 35s linear infinite; }
.ribbon-set { flex: none; display: flex; align-items: center; justify-content: space-around; min-width: 100vw; gap: 34px; padding: 12px 28px; white-space: nowrap; font: 600 11px/1.5 Consolas, monospace; letter-spacing: .08em; }
.ribbon-set span { font-size: 5px; }
@keyframes ribbon-scroll { to { transform: translateX(-50%); } }

/* Projects */
.section { padding-block: 88px 96px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 35px; }
.section-heading > div { min-width: 0; }
.section-kicker { color: var(--accent); margin-bottom: 14px; }
.section-heading h2, .contact-inner h2 { font-size: clamp(2rem, 3.55vw, 3.25rem); line-height: 1.17; font-weight: 600; letter-spacing: -.035em; }
.section-heading > p { max-width: 37ch; color: var(--muted); font-size: 15px; line-height: 1.8; }
.featured-project { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); border: 1px solid #46606a; border-radius: 7px; overflow: hidden; background: #182b34; }
.featured-copy { padding: 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 27px; min-width: 0; }
.project-head, .card-top { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.project-head > span:first-child, .card-top > span:first-child { color: #a5b6be; font: 11px/1.5 Consolas, monospace; }
.status { color: #d5d2b2; font-size: 11px; line-height: 1.5; }
.status.live { display: inline-flex; align-items: center; gap: 7px; color: #a1e5d0; }
.status.live i { display: block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.project-type { color: #a4d9cc; font-size: 10px; margin-bottom: 10px; }
.featured-project h3 { font-size: clamp(2rem, 3.5vw, 3rem); line-height: 1.15; font-weight: 600; letter-spacing: -.03em; margin-bottom: 16px; }
.featured-project p:not(.project-type) { color: #c0cdd2; max-width: 55ch; }
.project-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.tags span { color: #abc0c7; font: 11px/1.6 Consolas, monospace; }
.project-link { display: inline-flex; gap: 15px; align-items: center; min-height: 44px; border-bottom: 1px solid #7fb9aa; font-size: 13px; font-weight: 600; }
.project-link:hover { color: var(--accent); }
.featured-visual { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 30px; background: #203941; border-left: 1px solid #46606a; min-width: 0; }
.featured-visual img { width: 100%; height: auto; border-radius: 5px; border: 1px solid #89aab0; box-shadow: 0 15px 35px #0003; }
.featured-visual > span { width: 100%; display: flex; justify-content: space-between; gap: 15px; color: #d6e8e9; font-size: 12px; }
.featured-visual:hover img { border-color: var(--accent); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 17px; margin-top: 17px; }
.project-card { min-width: 0; min-height: 280px; display: flex; flex-direction: column; justify-content: space-between; gap: 23px; padding: 24px; border: 1px solid var(--line); border-radius: 6px; background: #14232c; transition: border-color .2s ease; }
.project-card:hover, .project-card:focus-within { border-color: #718c91; }
.project-card h3 { font-size: 23px; line-height: 1.25; font-weight: 600; letter-spacing: -.025em; margin-bottom: 12px; overflow-wrap: anywhere; }
.project-card p:not(.project-type) { color: #afc0c7; font-size: 14px; line-height: 1.8; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #344a55; padding-top: 14px; color: #a5bbc4; font: 11px/1.65 Consolas, monospace; }
.card-bottom a { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid #5e7a85; border-radius: 4px; color: #b4e6d8; font: 20px/1 sans-serif; }
.card-bottom a:hover, .card-bottom a:focus-visible { background: var(--accent); color: #143029; }
.card-end { color: #839da8; }
.project-card.project-card-invite { border-color: #6f9e94; background: #1b363a; }
.invite-symbol { color: var(--accent); }

/* Skills and background */
.expertise-band { background: var(--light); color: var(--ink); padding-block: 88px 92px; }
.expertise-band .section-kicker { color: #226a59; }
.expertise-band .section-heading > p { color: #4b6069; }
.expertise-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 38px; }
.expertise-images figure { position: relative; height: 250px; border-radius: 5px; overflow: hidden; background: #182c39; }
.expertise-images img { width: 100%; height: 100%; object-fit: cover; }
.expertise-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 18px; }
.expertise-item { grid-column: span 2; min-width: 0; padding: clamp(20px, 2.35vw, 28px); border: 1px solid #bfc9c5; border-radius: 6px; background: #f8faf6; }
/* Half-width tracks keep incomplete rows centered without stretching cards. */
@media (min-width: 861px) {
  .expertise-item:nth-child(3n + 1):nth-last-child(2) { grid-column: 2 / span 2; }
}
@media (min-width: 661px) and (max-width: 860px) {
  .expertise-item:last-child:nth-child(odd) { grid-column: 2 / span 2; }
}
.expertise-index { display: block; color: #397c6b; font: 12px/1.5 Consolas, monospace; margin-bottom: 20px; }
.expertise-item h3 { font-size: 21px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; margin-bottom: 13px; }
.expertise-item p { font-size: 14px; line-height: 1.8; color: #4b6069; }
.security-feature { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: center; gap: 32px; padding-top: 35px; }
.security-art { width: 140px; height: 140px; border-radius: 50%; overflow: hidden; }
.security-art img { width: 100%; height: 100%; object-fit: cover; }
.security-copy .section-kicker { margin-bottom: 8px; }
.security-copy h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 600; line-height: 1.25; letter-spacing: -.025em; margin-bottom: 12px; }
.security-copy > p:last-child { max-width: 75ch; font-size: 15px; color: #4b6069; }
.about-section { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(36px, 8vw, 110px); padding-block: 92px 100px; }
.about-heading h2 { font-size: clamp(1.25rem, 1.8vw, 1.6rem); line-height: 1.45; font-weight: 600; letter-spacing: -.015em; max-width: 30ch; }
.systems-photo { margin-top: 23px; width: min(100%, 300px); aspect-ratio: 4200 / 2970; border-radius: 6px; overflow: hidden; border: 1px solid #46616f; }
.systems-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-content p { color: #b5c4cb; line-height: 1.85; }
.about-content p + p { margin-top: 20px; }
.about-content .about-lead { color: #e5ecee; font-size: 20px; line-height: 1.65; }
.about-meta { display: grid; grid-template-columns: .65fr 1.4fr .7fr; gap: 20px; border-top: 1px solid var(--line); margin-top: 30px; padding-top: 22px; }
.about-meta span { display: block; color: #a2b6bf; font-size: 12px; margin-bottom: 7px; }
.about-meta strong { display: block; color: #d2e0e5; font-size: 13px; line-height: 1.6; font-weight: 500; }
.contact-section { padding-block: 66px 72px; background: #193339; border-top: 1px solid #3c6166; }
.contact-inner { display: flex; justify-content: space-between; align-items: center; gap: 36px; }
.contact-inner h2 { max-width: 22ch; }
.contact-inner p:not(.section-kicker) { color: #c1d4d5; margin-top: 18px; }
.contact-actions { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 25px; }
.button-light { background: #e1eee8; color: #203c39; }
.button-light:hover { background: #fff; }
.contact-link { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }
.contact-link span { color: var(--accent); }
.site-footer { border-top: 1px solid #344a50; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; min-height: 82px; padding-block: 18px; color: #acbfc6; font-size: 12px; }
.footer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.footer-inner a, .motion-toggle { display: inline-flex; align-items: center; min-height: 44px; }
.motion-toggle { border: 0; background: none; color: inherit; padding: 0; font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.motion-toggle:hover, .footer-inner a:hover { color: var(--accent); }

/* The original binary map, Matrix cubes, and alternating entrances. */
.earth-dots, #cube-field { position: fixed; inset: 0; z-index: 0; pointer-events: none; width: 100%; height: 100%; }
.earth-dots { background: url("./assets/earth-binary.svg") no-repeat center 46%; background-size: max(1200px, 110vw) auto; opacity: .22; mask-image: linear-gradient(90deg, #0002, #0007 40%, #000 80%); }
#cube-field { display: block; opacity: .65; }
body > main, body > .site-footer { position: relative; z-index: 1; }
.scroll-reveal { opacity: 0; translate: var(--reveal-x) 0; transition: translate 1.3s cubic-bezier(.2,.72,.16,1), opacity 1.3s ease; transition-delay: var(--reveal-delay, 0ms); }
.project-card.scroll-reveal { transition-duration: 1.55s, 1.55s; }
.from-left { --reveal-x: -35px; }
.from-right { --reveal-x: 35px; }
.scroll-reveal.is-visible, .scroll-reveal:focus-within { opacity: 1; translate: 0 0; }
html[data-motion="paused"] { scroll-behavior: auto; }
html[data-motion="paused"] .ribbon-track { animation-play-state: paused; }
html[data-motion="paused"] .scroll-reveal { opacity: 1; translate: 0 0; transition: none; }

@media (max-width: 1100px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner { gap: 18px; }
  .main-nav { gap: 18px; }
  .hero-photo { height: 340px; }
  .contact-inner { align-items: start; flex-direction: column; gap: 28px; }
}
@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; column-gap: 10px; row-gap: 2px; padding-block: 12px 5px; }
  .main-nav { order: 3; width: 100%; justify-content: space-between; gap: 12px; }
  .hero { grid-template-columns: 1fr; gap: 35px; padding-block: 54px 64px; }
  .hero h1 { font-size: clamp(2.5rem, 6.6vw, 3.6rem); }
  .hero-copy { max-width: 58ch; }
  .hero-panel { max-width: none; }
  .hero-photo { height: 290px; }
  .hero-photo img { object-position: center 47%; }
  .section-heading { display: block; }
  .section-heading > p { max-width: 58ch; margin-top: 20px; }
  .featured-project { grid-template-columns: 1fr; }
  .featured-visual { border-left: 0; border-top: 1px solid #46606a; }
  .featured-visual img, .featured-visual > span { max-width: 580px; }
  .expertise-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .about-section { gap: 32px; }
  .about-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 660px) {
  .main-nav a { font-size: 12px; }
  .brand { gap: 10px; }
  .brand-mark { width: 54px; height: 36px; font-size: 15px; }
  .brand-name { font-size: 11px; }
  .hero { padding-block: 40px 52px; gap: 30px; }
  .eyebrow { font-size: 10px; letter-spacing: .035em; margin-bottom: 20px; gap: 8px; }
  .hero h1 { font-size: clamp(2rem, 9.2vw, 3rem); line-height: 1.16; letter-spacing: -.035em; margin-bottom: 20px; }
  .hero-copy { font-size: 16px; line-height: 1.8; }
  .hero-actions { margin-top: 23px; }
  .hero-photo { height: 240px; }
  .hero-photo-footer { padding: 14px 17px; }
  .hero-photo-footer > div { gap: 7px 14px; }
  .section, .expertise-band { padding-block: 58px 64px; }
  .section-heading h2, .contact-inner h2 { font-size: clamp(1.85rem, 7vw, 2.5rem); }
  .project-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
  .project-card { min-height: 250px; padding: 22px; }
  .featured-copy { padding: 23px; }
  .featured-visual { padding: 22px; }
  .expertise-images { grid-template-columns: 1fr; gap: 15px; margin-bottom: 28px; }
  .expertise-images figure { height: 205px; }
  .expertise-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .expertise-item { grid-column: auto; }
  .expertise-index { margin-bottom: 12px; }
  .security-feature { grid-template-columns: 95px minmax(0,1fr); gap: 20px; align-items: start; padding-top: 28px; }
  .security-art { width: 95px; height: 95px; }
  .security-copy .section-kicker { font-size: 9px; }
  .security-copy h3 { font-size: 21px; }
  .security-copy > p:last-child { font-size: 14px; }
  .about-section { display: block; padding-block: 60px 66px; }
  .about-heading h2 { font-size: 20px; max-width: 34ch; }
  .systems-photo { width: min(100%, 280px); margin-top: 20px; }
  .about-content { padding-top: 30px; }
  .about-content .about-lead { font-size: 19px; }
  .about-meta { grid-template-columns: 1fr 1fr; }
  .contact-section { padding-block: 50px 54px; }
  .footer-inner { align-items: start; flex-direction: column; gap: 4px; }
  .footer-actions { gap: 25px; }
  .earth-dots { background-size: 1200px auto; background-position: 48% 38%; opacity: .12; mask-image: none; }
  #cube-field { opacity: .5; }
  .from-left { --reveal-x: -20px; }
  .from-right { --reveal-x: 20px; }
}
@media (max-width: 380px) {
  .security-feature { grid-template-columns: 1fr; }
  .security-art { width: 110px; height: 110px; }
  .about-meta { gap: 20px 12px; }
  .main-nav { gap: 6px; }
  .hero-photo { height: 210px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .scroll-reveal { opacity: 1; translate: 0 0; }
  .motion-toggle { display: none; }
}
