/* ============================================
   Applied AI — Design Tokens
   Brand: void / graphite / ember / frost
   Aesthetic: engineering schematic, control room
   ============================================ */

:root {
  --color-void: #09090B;
  --color-graphite: #161618;
  --color-panel: #0D0D0F;
  --color-ember: #E8613C;
  --color-ember-deep: #C24B2C;
  --color-frost: #F0EFEB;
  --color-zinc: #85858E; /* AA 4.5:1 on both void and graphite */
  --color-terminal: #34D399;

  --font-space: 'Space Grotesk', sans-serif;
  --font-instrument: 'Instrument Serif', serif;
  --font-mono: 'JetBrains Mono', monospace;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.14);
  --hairline: rgba(255, 255, 255, 0.04);

  --radius: 4px;
  --easing-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ============================================
   Reset & Base
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-void);
  color: var(--color-frost);
  font-family: var(--font-space);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.7;
}

/* Blueprint dot grid — the drafting table the whole page sits on */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(240, 239, 235, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: 0;
}

main, .site-nav, .footer, .footer-funding, .subpage-nav, .page-hero {
  position: relative;
  z-index: 1;
}

::selection {
  background: var(--color-ember);
  color: var(--color-void);
}

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

img {
  max-width: 100%;
  display: block;
}


/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-void); }
::-webkit-scrollbar-thumb { background: var(--color-graphite); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-zinc); }


/* ============================================
   Keyframe Animations
   ============================================ */

@keyframes systemPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 25px) scale(1.06); }
}

@keyframes cursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}


/* ============================================
   Layout
   ============================================ */

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 3rem;
  }
}

.section {
  padding: 5rem 0;
  border-top: 1px solid var(--border-subtle);
  position: relative;
  scroll-margin-top: 4.5rem;
}

/* Crosshair tick where the section rule meets the margin */
.section::before {
  content: '+';
  position: absolute;
  top: -0.85rem;
  left: max(1rem, calc((100vw - 72rem) / 2 - 0.5rem));
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: rgba(240, 239, 235, 0.22);
  pointer-events: none;
}

@media (min-width: 1024px) {
  .section {
    padding: 7rem 0;
  }
}


/* ============================================
   Blueprint Rails
   ============================================ */

.rails {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  display: none;
}

.rails-inner {
  max-width: 72rem;
  height: 100%;
  margin: 0 auto;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
}

@media (min-width: 1280px) {
  .rails { display: block; }
}


/* ============================================
   Noise Overlay
   ============================================ */

.noise-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
}


/* ============================================
   Nav
   ============================================ */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--easing-smooth), border-color 0.4s var(--easing-smooth);
}

.site-nav.scrolled {
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.nav-brand {
  font-family: var(--font-space);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--color-frost);
}

.nav-brand span {
  color: var(--color-ember);
}

.nav-links {
  display: none;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

/* Phone menu: the section links drop down under the bar */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 36px;
  margin-left: 0.5rem;
  padding: 0 9px;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--color-frost);
  transition: transform 0.3s var(--easing-smooth);
}

.site-nav.open .nav-toggle span:first-child { transform: translateY(3.25px) rotate(45deg); }
.site-nav.open .nav-toggle span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.site-nav.open {
  background: var(--color-void);
  border-bottom-color: var(--border-subtle);
}

.site-nav.open .nav-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 0.5rem 1.5rem 1.25rem;
  background: var(--color-void);
  border-bottom: 1px solid var(--border-subtle);
}

.site-nav.open .nav-links a {
  padding: 0.85rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .site-nav.open .nav-links {
    position: static;
    flex-direction: row;
    gap: 2rem;
    padding: 0;
    background: none;
    border: 0;
  }
  .site-nav.open .nav-links a { padding: 0; font-size: 0.75rem; border: 0; }
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--color-zinc);
  position: relative;
  transition: color 0.3s var(--easing-smooth);
}

.nav-links a::before {
  content: '/';
  color: var(--color-ember);
  opacity: 0;
  margin-right: 0.3em;
  transition: opacity 0.3s var(--easing-smooth);
}

.nav-links a:hover {
  color: var(--color-frost);
}

.nav-links a:hover::before {
  opacity: 1;
}

.nav-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--color-zinc);
  font-variant-numeric: tabular-nums;
}

.lang-switch {
  margin-left: 0.75rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-zinc);
  transition: color 0.3s var(--easing-smooth), border-color 0.3s var(--easing-smooth);
}

.lang-switch:hover {
  color: var(--color-frost);
  border-color: var(--border-hover);
}


/* ============================================
   Hero
   ============================================ */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-top: 6rem;
  padding-bottom: 2.5rem;
}

.hero-orb {
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 97, 60, 0.08) 0%, transparent 70%);
  top: 30%;
  left: 18%;
  transform: translate(-50%, -50%);
  animation: floatOrb 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@media (min-width: 768px) {
  .hero-orb {
    width: 900px;
    height: 900px;
  }
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
  }
}

/* Hero loop (2026-10-05): a silent 12 s loop rendered as light on black and screened
   over the hero, so the black adds nothing and only the packets and faint product screens
   show. `main` is its own stacking context (z-index: 1), so the video cannot blend with the
   body::before dot grid; the hero repaints that grid (viewport-anchored like the original,
   so the dots line up) as the backdrop it blends with. Phones, tablets (iOS ignores
   background-attachment: fixed, so the repainted grid would slide against the real one)
   and reduced-motion users get the plain hero; js/main.js starts playback only where it
   is shown, so they never download it. From 1280px the fixed .rails sit under the hero too, so the backdrop
   repaints them (the +-0.5px offsets land the 1px lines on .rails-inner's borders).
   Source: ~/Desktop/AppliedAI-Promo (render-all.sh, cut=loop). */
.hero-video {
  display: none;
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hero {
    background-color: var(--color-void);
    background-image: radial-gradient(rgba(240, 239, 235, 0.05) 1px, transparent 1px);
    background-size: 36px 36px;
    background-attachment: fixed;
  }

  .hero-video {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 0;
  }
}

@media (min-width: 1280px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hero {
    background-image:
      linear-gradient(var(--hairline), var(--hairline)),
      linear-gradient(var(--hairline), var(--hairline)),
      radial-gradient(rgba(240, 239, 235, 0.05) 1px, transparent 1px);
    background-size: 1px 100%, 1px 100%, 36px 36px;
    background-position: calc(50% - 36rem + 0.5px) 0, calc(50% + 36rem - 0.5px) 0, 0 0;
    background-repeat: no-repeat, no-repeat, repeat;
  }
}

/* Hero entrance stagger */
.hero-stagger {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--easing-smooth), transform 0.8s var(--easing-smooth);
}

.mounted .hero-copy .hero-stagger:nth-child(1) { transition-delay: 0.1s; }
.mounted .hero-copy .hero-stagger:nth-child(2) { transition-delay: 0.25s; }
.mounted .hero-copy .hero-stagger:nth-child(3) { transition-delay: 0.4s; }
.mounted .hero-copy .hero-stagger:nth-child(4) { transition-delay: 0.55s; }
.mounted .hero-terminal { transition-delay: 0.7s; }
.mounted .hero-meta { transition-delay: 0.9s; }

.mounted .hero-stagger {
  opacity: 1;
  transform: translateY(0);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-terminal);
  margin-bottom: 2rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-terminal);
  animation: systemPulse 2s infinite;
  flex-shrink: 0;
}

.hero h1 {
  font-family: var(--font-space);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.5vw, 4.75rem);
  letter-spacing: -0.04em;
  line-height: 1.02;
  color: var(--color-frost);
  margin-bottom: 1.75rem;
}

.hero h1 em {
  font-family: var(--font-instrument);
  font-style: italic;
  font-weight: 400;
  color: var(--color-ember);
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
  color: var(--color-zinc);
  max-width: 32rem;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

/* Hero meta strip */
.hero-meta {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 4rem;
  padding-top: 1.5rem;
  width: 100%;
}

@media (min-width: 900px) {
  .hero-meta {
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
  }
}

.hero-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-meta-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-zinc);
}

.hero-meta-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-frost);
}


/* ============================================
   Terminal
   ============================================ */

.hero-terminal {
  width: 100%;
}

.terminal {
  background: var(--color-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(232, 97, 60, 0.05);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.terminal-dot:first-child { background: rgba(232, 97, 60, 0.55); }

.terminal-title {
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--color-zinc);
}

.terminal-body {
  padding: 1.25rem 1.4rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 2.05;
  min-height: 15rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.t-line { display: block; min-height: 1.6em; }
.t-line .t-prompt { color: var(--color-ember); }
.t-line .t-cmd { color: var(--color-frost); }
.t-line .t-dim { color: var(--color-zinc); }
.t-line .t-ok { color: var(--color-terminal); }

.t-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  background: var(--color-frost);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: cursorBlink 1.05s step-end infinite;
}


/* ============================================
   Buttons
   ============================================ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-ember);
  color: var(--color-void);
  font-family: var(--font-space);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--easing-smooth), box-shadow 0.3s var(--easing-smooth);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--easing-smooth);
}

.btn-primary:hover::before {
  transform: scaleX(1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(232, 97, 60, 0.25);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 3px;
}

.btn-arrow {
  transition: transform 0.3s var(--easing-smooth);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--color-zinc);
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  transition: color 0.3s var(--easing-smooth), border-color 0.3s var(--easing-smooth);
}

.btn-ghost:hover {
  color: var(--color-frost);
  border-color: var(--border-hover);
}


/* ============================================
   Section Heads
   ============================================ */

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-terminal);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.section-heading {
  font-family: var(--font-space);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--color-frost);
  margin-bottom: 3rem;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.section-head .section-heading {
  margin-bottom: 0;
}

/* Oversized ghost index — drafting sheet numbering */
.section-index {
  font-family: var(--font-space);
  font-weight: 700;
  font-size: clamp(4rem, 11vw, 8rem);
  line-height: 0.75;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(240, 239, 235, 0.1);
  user-select: none;
  flex-shrink: 0;
}


/* ============================================
   Layer Stack (What We Do)
   ============================================ */

@media (min-width: 1024px) {
  .what-we-do-layout {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 4rem;
    align-items: start;
  }

  .stack-intro {
    position: sticky;
    top: 7rem;
  }
}

.stack-intro {
  max-width: 28rem;
  color: var(--color-zinc);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 3rem;
}

.stack-intro-note {
  margin-top: 1.5rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--color-ember);
}

.stack-intro-note em {
  font-family: var(--font-instrument);
  font-style: italic;
  font-size: 1.15em;
  color: var(--color-frost);
}

.layer-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

/* Dashed spine connecting the layers — data flows down, value flows up */
.layer-stack::before {
  content: '';
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: -1.5rem;
  border-left: 1px dashed rgba(240, 239, 235, 0.12);
  display: none;
}

@media (min-width: 1280px) {
  .layer-stack::before { display: block; }
}

.layer-card {
  background: var(--color-graphite);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--easing-smooth), border-color 0.4s var(--easing-smooth);
}

.layer-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}

/* Stack perspective: AI on top, indented; infra at bottom, full width */
@media (min-width: 768px) {
  .layer-card--ai      { margin-left: 4.5rem; }
  .layer-card--backend { margin-left: 2.25rem; }
  .layer-card--infra   { margin-left: 0; }
}

.layer-card::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
}

.layer-card--infra::before   { background: var(--color-terminal); }
.layer-card--backend::before { background: var(--color-zinc); }
.layer-card--ai::before      { background: var(--color-ember); }

.layer-card--ai {
  box-shadow: 0 0 60px rgba(232, 97, 60, 0.07);
}

.layer-annotation {
  position: absolute;
  top: 1.4rem;
  right: 1.5rem;
  font-family: var(--font-instrument);
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(240, 239, 235, 0.28);
}

.layer-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.layer-card--infra .layer-number { color: var(--color-terminal); }
.layer-card--backend .layer-number { color: var(--color-zinc); }
.layer-card--ai .layer-number { color: var(--color-ember); }

.layer-title {
  font-family: var(--font-space);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--color-frost);
  margin-bottom: 0.75rem;
}

.layer-desc {
  color: var(--color-zinc);
  font-size: 0.925rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.layer-desc strong {
  color: var(--color-frost);
  font-weight: 600;
}

.layer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.03);
  color: #8E8E97; /* AA 4.5:1 on the translucent tag bg over graphite */
  letter-spacing: 0.02em;
  transition: color 0.3s var(--easing-smooth), border-color 0.3s var(--easing-smooth);
}

.layer-card:hover .tag {
  color: var(--color-frost);
  border-color: rgba(255, 255, 255, 0.1);
}


/* ============================================
   Track Record — ledger
   ============================================ */

.ledger {
  border-top: 1px solid var(--border-subtle);
}

.ledger-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 2rem;
  padding: 1.75rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  transition: background 0.3s var(--easing-smooth);
}

@media (min-width: 768px) {
  .ledger-row {
    grid-template-columns: 3.5rem 9rem 1fr;
    align-items: baseline;
    padding: 2rem 1rem;
  }
}

.ledger-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.ledger-row::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 0;
  background: var(--color-ember);
  transition: width 0.5s var(--easing-smooth);
}

.ledger-row:hover::after {
  width: 100%;
}

.ledger-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(240, 239, 235, 0.55);
}

.ledger-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-zinc);
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.ledger-name {
  font-family: var(--font-space);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--color-frost);
  margin-bottom: 0.5rem;
  transition: color 0.3s var(--easing-smooth);
}

.ledger-row:hover .ledger-name {
  color: var(--color-ember);
}

.ledger-desc {
  color: var(--color-zinc);
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: 38rem;
}

/* Product rows carry a screenshot: under the text on phones and tablets,
   in its own column on desktop. */
.ledger-thumb {
  display: block;
  width: 100%;
  max-width: 24rem;
  height: auto;
  margin-top: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  opacity: 0.88;
  transition: opacity 0.3s var(--easing-smooth), border-color 0.3s var(--easing-smooth);
}

.ledger-row:hover .ledger-thumb {
  opacity: 1;
  border-color: var(--border-hover);
}

@media (min-width: 768px) {
  .ledger-row--media .ledger-thumb { grid-column: 3; max-width: 20rem; }
}

@media (min-width: 1024px) {
  .ledger-row--media {
    grid-template-columns: 3.5rem 9rem 1fr 15rem;
  }
  .ledger-row--media .ledger-thumb {
    grid-column: 4;
    align-self: start;
    margin-top: 0;
  }
}


/* ============================================
   Team
   ============================================ */

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .team-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.team-card {
  background: var(--color-graphite);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
  transition: transform 0.4s var(--easing-smooth), border-color 0.4s var(--easing-smooth);
}

.team-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}

.team-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--color-terminal);
  margin-bottom: 1.25rem;
}

.team-name {
  font-family: var(--font-space);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--color-frost);
  margin-bottom: 0.15rem;
}

.team-role {
  font-family: var(--font-instrument);
  font-style: italic;
  color: var(--color-ember);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.team-bio {
  color: var(--color-zinc);
  font-size: 0.9rem;
  line-height: 1.7;
}


/* ============================================
   How We Work
   ============================================ */

.engage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .engage-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.engage-card {
  background: var(--color-graphite);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.4s var(--easing-smooth), border-color 0.4s var(--easing-smooth);
}

.engage-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}

.engage-step {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-ember);
  margin-bottom: 1rem;
}

.engage-title {
  font-family: var(--font-space);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--color-frost);
  margin-bottom: 0.6rem;
}

.engage-desc {
  color: var(--color-zinc);
  font-size: 0.9rem;
  line-height: 1.65;
}


/* ============================================
   404
   ============================================ */

.page-404 {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.page-404 .terminal {
  width: 100%;
  max-width: 38rem;
}

.page-404 .terminal-body {
  min-height: 0;
  white-space: normal; /* static markup — pre-wrap would render source indentation */
}

.t-line .t-err { color: var(--color-ember); }

.page-404 .btn-ghost {
  margin-top: 1.25rem;
}


/* ============================================
   Contact — the ember moment
   ============================================ */

.contact {
  padding: 6rem 0;
}

@media (min-width: 1024px) {
  .contact {
    padding: 8rem 0;
  }
}

.contact-panel {
  background: var(--color-ember);
  color: var(--color-void);
  border-radius: var(--radius);
  padding: 3rem 1.75rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

@media (min-width: 768px) {
  .contact-panel {
    padding: 5rem 3rem;
  }
}

/* Schematic corner ticks, dark-on-ember */
.contact-panel::before,
.contact-panel::after {
  content: '+';
  position: absolute;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: rgba(9, 9, 11, 0.45);
  pointer-events: none;
}

.contact-panel::before { top: 0.75rem; left: 1rem; }
.contact-panel::after { bottom: 0.65rem; right: 1rem; }

.contact-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(9, 9, 11, 0.65);
  margin-bottom: 1.25rem;
}

.contact-heading {
  font-family: var(--font-space);
  font-weight: 700;
  font-size: clamp(1.85rem, 4.5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 2.25rem;
}

.contact-heading em {
  font-family: var(--font-instrument);
  font-style: italic;
  font-weight: 400;
}

.contact-email {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(1.05rem, 3.2vw, 1.9rem);
  letter-spacing: -0.01em;
  color: var(--color-void);
  border-bottom: 3px solid rgba(9, 9, 11, 0.35);
  padding-bottom: 0.2rem;
  transition: border-color 0.3s var(--easing-smooth), transform 0.3s var(--easing-smooth);
  word-break: break-all;
}

.contact-email:hover {
  border-bottom-color: var(--color-void);
  transform: translateY(-2px);
}

.contact-email:focus-visible {
  outline: 2px solid var(--color-void);
  outline-offset: 6px;
  border-radius: 2px;
}

.contact-note {
  margin-top: 1.75rem;
  font-size: 0.88rem;
  color: rgba(9, 9, 11, 0.65);
}


/* ============================================
   Footer
   ============================================ */

.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-legal {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-zinc);
  line-height: 1.8;
}



/* ============================================
   Scroll Reveal
   ============================================ */

.reveal-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--easing-smooth), transform 0.8s var(--easing-smooth);
  will-change: opacity, transform;
}
.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s var(--easing-smooth), transform 0.8s var(--easing-smooth);
  will-change: opacity, transform;
}
.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.8s var(--easing-smooth), transform 0.8s var(--easing-smooth);
  will-change: opacity, transform;
}
.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}


/* ============================================
   Focus Styles
   ============================================ */

:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 3px;
}


/* ============================================
   Subpage (Funding / Dofinansowanie)
   ============================================ */

.subpage-nav {
  border-bottom: 1px solid var(--border-subtle);
}

.subpage-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.subpage-brand {
  font-family: var(--font-space);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--color-frost);
}

.subpage-brand span {
  color: var(--color-ember);
}

.subpage-back {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-zinc);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.3s var(--easing-smooth);
}

.subpage-back:hover {
  color: var(--color-ember);
}

.page-hero {
  padding: 4rem 0 1rem;
}

@media (min-width: 1024px) {
  .page-hero {
    padding: 6rem 0 1rem;
  }
}

.page-hero h1 {
  font-family: var(--font-space);
  font-weight: 700;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--color-frost);
  margin-bottom: 1.25rem;
}

.prose {
  max-width: 44rem;
  color: var(--color-zinc);
  font-size: 1.0rem;
  line-height: 1.8;
}

.prose p + p {
  margin-top: 1.25rem;
}

.prose strong {
  color: var(--color-frost);
  font-weight: 600;
}

/* Project facts */
.funding-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 44rem;
}

@media (min-width: 768px) {
  .funding-meta {
    grid-template-columns: 1fr 1fr;
  }
}

.meta-row {
  background: var(--color-graphite);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-terminal);
  margin-bottom: 0.4rem;
}

.meta-value {
  font-family: var(--font-space);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-frost);
  line-height: 1.4;
}

/* Three-mark lockup — must sit on a light field; never recolor the marks */
.lockup-card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.75rem 2rem;
  display: inline-block;
  max-width: 100%;
}

.lockup-card img {
  width: 100%;
  max-width: 620px;
  height: auto;
}

.funding-formula {
  max-width: 44rem;
  margin-top: 2rem;
  border-left: 3px solid var(--color-ember);
  padding: 0.5rem 0 0.5rem 1.5rem;
}

.funding-formula .formula-pl {
  font-family: var(--font-space);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--color-frost);
}

.funding-formula .formula-en {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--color-zinc);
  line-height: 1.6;
}


/* ============================================
   Footer Funding Strip (shared)
   ============================================ */

.footer-funding {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0;
}

.footer-funding .container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-funding .container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-funding-lockup {
  background: #ffffff;
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  flex-shrink: 0;
}

.footer-funding-lockup img {
  height: 42px;
  width: auto;
}

.footer-funding-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-zinc);
  line-height: 1.7;
  max-width: 40rem;
}

.footer-funding-text a {
  color: var(--color-ember);
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-stagger {
    opacity: 1;
    transform: none;
  }

  .reveal-item,
  .reveal-left,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }
}


/* ============================================
   Case study (FormFlow)
   ============================================ */

.page-tagline {
  font-family: var(--font-space);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
  color: var(--color-zinc);
  max-width: 38rem;
  margin-top: 1.25rem;
}

.page-tagline em {
  font-family: var(--font-instrument);
  font-style: italic;
  color: var(--color-frost);
}

.browser-frame {
  background: var(--color-graphite);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--color-panel);
}

.browser-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(240, 239, 235, 0.14);
}

.browser-dot:first-child { background: rgba(232, 97, 60, 0.55); }

.browser-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-zinc);
  margin-left: 0.4rem;
  letter-spacing: 0.04em;
}

.browser-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.shot-figure {
  margin: 0;
}

.shot-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--color-zinc);
  margin-top: 0.7rem;
}

.shot-caption .fig-index { color: var(--color-ember); }

.shot-stack {
  display: grid;
  gap: 3rem;
  margin-top: 3rem;
}

.shot-pair {
  display: grid;
  gap: 2.5rem;
  margin-top: 3rem;
  align-items: center;
}

@media (min-width: 900px) {
  .shot-pair {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}

.shot-pair .prose { max-width: none; }

.case-list {
  list-style: none;
  margin-top: 1.5rem;
  display: grid;
  gap: 0.85rem;
}

.case-list li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-zinc);
}

.case-list li::before {
  content: '//';
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-ember);
  top: 0.2em;
}

.case-list li strong {
  color: var(--color-frost);
  font-weight: 500;
}

.case-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--color-zinc);
  border-left: 2px solid var(--border-hover);
  padding-left: 1rem;
  margin-top: 3rem;
}

a.ledger-row {
  text-decoration: none;
  color: inherit;
}

.ledger-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--color-ember);
  white-space: nowrap;
}

a.team-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

a.team-card .team-name {
  transition: color 0.3s var(--easing-smooth);
}

a.team-card:hover .team-name {
  color: var(--color-ember);
}

.team-cta {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--color-ember);
  white-space: nowrap;
}

/* ===================== Product (FormFlow) ===================== */
.product-panel {
  background: var(--color-graphite);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2.5rem 1.75rem;
  display: grid;
  gap: 2.5rem;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .product-panel {
    grid-template-columns: 1.2fr 0.8fr;
    padding: 3rem 2.5rem;
    align-items: center;
  }
}

/* faint sky glow — FormFlow's accent, not ember, to mark it as its own brand */
.product-panel::after {
  content: '';
  position: absolute;
  right: -160px;
  top: -160px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.10) 0%, transparent 65%);
  pointer-events: none;
}

.product-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.product-head svg {
  width: 52px;
  height: 52px;
  flex: none;
}

.product-name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-frost);
}

.product-name span {
  color: #0EA5E9;
}

.product-desc {
  color: var(--color-zinc);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 56ch;
}

.product-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.product-spec {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  border-left: 1px solid var(--border-subtle);
  padding-left: 1.5rem;
  display: grid;
  gap: 0.9rem;
  position: relative;
  z-index: 1;
}

.product-spec .spec-row {
  display: grid;
  gap: 0.15rem;
}

.product-spec .spec-label {
  color: var(--color-ember);
}

.product-spec .spec-value {
  color: var(--color-zinc);
}


/* ============================================
   Contact pages (/pawel, /piotr) — opened from
   the NFC chips in the business cards, so
   phone-first: one column, big tap targets
   ============================================ */

.contact-card {
  min-height: 100dvh;
  max-width: 26rem;
  margin: 0 auto;
  padding: max(2rem, env(safe-area-inset-top)) 1.5rem max(2rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.contact-brand {
  align-self: flex-start;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--color-frost);
}

.contact-brand span {
  color: var(--color-ember);
}

.contact-head {
  margin-top: auto;
  padding-top: 3rem;
}

.contact-name {
  font-size: clamp(2.25rem, 11vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.contact-role {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ember);
}

.contact-company {
  margin-top: 0.15rem;
  font-size: 0.95rem;
  color: var(--color-zinc);
}

.contact-save {
  width: 100%;
  justify-content: center;
  margin-top: 2.25rem;
  padding: 1rem 1.5rem;
  font-size: 1rem;
}

.contact-save-icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-actions {
  list-style: none;
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.contact-actions a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.contact-actions a:focus-visible {
  outline: 2px solid var(--color-ember);
  outline-offset: 2px;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-zinc);
}

.contact-value {
  font-size: 1rem;
  text-align: right;
  overflow-wrap: anywhere;
  color: var(--color-frost);
  transition: color 0.3s var(--easing-smooth);
}

.contact-actions a:hover .contact-value,
.contact-actions a:focus-visible .contact-value {
  color: var(--color-ember);
}

.contact-tagline {
  margin-top: auto;
  padding-top: 3rem;
  font-size: 0.85rem;
  color: var(--color-zinc);
}

.contact-tagline em {
  font-family: var(--font-instrument);
  font-size: 1.1em;
  color: var(--color-ember);
}
