:root {
  --bg: #0d1016;
  --surface: #151a23;
  --text: #f3f5f7;
  --muted: #aab2bf;
  --line: #2a3240;
  --accent: #d6e2ff;
  --max: 1120px;
  --radius: 18px;
  --space: clamp(1rem, 2vw, 1.5rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--text);
  color: var(--bg);
  padding: .7rem 1rem;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }
.site-header,
main,
footer {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid transparent;
  transition: padding 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.site-header.is-scrolled {
  padding-block: .85rem;
  border-bottom-color: var(--line);
  background: rgba(13, 16, 22, .94);
  backdrop-filter: blur(8px);
}
.brand { text-decoration: none; font-weight: 800; letter-spacing: .16em; }
nav { display: flex; gap: 1rem; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }
main > section { scroll-margin-top: 6rem; }
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(5rem, 12vw, 10rem) 0 clamp(4rem, 8vw, 7rem);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 8% -18% 10% 34%;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(214, 226, 255, .34) 1px, transparent 1.5px);
  background-size: 30px 30px;
  opacity: .28;
  transform: rotate(-8deg) translate3d(0, 0, 0);
  animation: hero-ambient-drift 18s ease-in-out infinite alternate;
}
.hero > * {
  position: relative;
  z-index: 1;
}
@keyframes hero-ambient-drift {
  from { transform: rotate(-8deg) translate3d(-10px, -8px, 0); }
  to { transform: rotate(-8deg) translate3d(18px, 12px, 0); }
}
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; font-weight: 700; }
h1, h2, h3 { line-height: 1.1; margin-top: 0; }
h1 { font-size: clamp(2.8rem, 8vw, 6.7rem); max-width: 13ch; letter-spacing: -.045em; margin-bottom: 1.5rem; }
h2 { font-size: clamp(2rem, 5vw, 4rem); max-width: 15ch; letter-spacing: -.03em; }
h3 { font-size: 1.25rem; }
.lede { max-width: 62ch; color: var(--muted); font-size: clamp(1.1rem, 2vw, 1.35rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 2rem; }
.button {
  display: inline-block;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  padding: .85rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}
.button:hover {
  background: var(--accent);
  transform: translateY(-1px);
}
.button:active { transform: translateY(0); }
.button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  box-shadow: 0 0 0 2px var(--bg);
}
.text-link {
  color: var(--muted);
  text-underline-offset: .25em;
  transition: color 140ms ease, text-decoration-thickness 140ms ease;
}
.text-link:hover {
  color: var(--text);
  text-decoration-thickness: 2px;
}
.text-link:focus-visible {
  color: var(--text);
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.section { border-top: 1px solid var(--line); padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section.reveal-pending {
  opacity: 0;
  transform: translateY(18px);
}
.section.reveal-visible {
  animation: section-reveal 420ms ease-out both;
}
@keyframes section-reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.principles,
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space);
  margin-top: 2rem;
}
.principles article,
.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2.5vw, 2rem);
}
.principles article,
.project-card {
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.principles article:hover,
.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-2px);
  border-color: #3a4658;
  background: #171d27;
}
.project-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.project-card h3,
.project-card p,
.project-card span {
  transition: transform 160ms ease, color 160ms ease;
}
.project-card:hover h3,
.project-card:hover p,
.project-card:hover span,
.project-card:focus-visible h3,
.project-card:focus-visible p,
.project-card:focus-visible span {
  transform: translateX(2px);
}
.principles p,
.project-card p,
.contact p,
.note { color: var(--muted); }
.project-card span { display: inline-block; margin-top: .5rem; font-size: .82rem; color: var(--accent); }
.note { max-width: 70ch; margin-top: 1.5rem; font-size: .95rem; }
.contact p { max-width: 58ch; }
footer { border-top: 1px solid var(--line); color: var(--muted); padding: 2rem 0 3rem; font-size: .9rem; }

@media (max-width: 760px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .principles,
  .project-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-header,
  .hero::before { animation: none; }
  .site-header,
  .button,
  .text-link,
  .principles article,
  .project-card,
  .project-card h3,
  .project-card p,
  .project-card span { transition: none; }
  .principles article:hover,
  .project-card:hover,
  .project-card:focus-visible,
  .project-card:hover h3,
  .project-card:hover p,
  .project-card:hover span,
  .project-card:focus-visible h3,
  .project-card:focus-visible p,
  .project-card:focus-visible span { transform: none; }
  .section.reveal-pending,
  .section.reveal-visible {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
