:root {
  --bg: #fbfaf7;
  --panel: #ffffff;
  --line: #e5e1d6;
  --line-soft: #eeebe2;
  --ink: #17191f;
  --muted: #626770;
  --faint: #6e727a;
  --blue: #2949d8;
  --blue-dim: rgba(41, 73, 216, 0.08);
  --sans: "Archivo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  overflow-x: hidden;
}

::selection { background: var(--blue); color: #fff; }

/* faint paper grain */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 999;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono { font-family: var(--mono); }

.micro {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  line-height: 1.7;
}

a { color: inherit; }

main > section {
  width: min(1120px, 100% - 3rem);
  margin-inline: auto;
}

/* ---------- top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.95rem clamp(1.5rem, 4vw, 3rem);
  background: rgba(251, 250, 247, 0.75);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--blue);
  flex: none;
}

.brand-name {
  font-weight: 700;
  font-stretch: 112%;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.top-nav { display: flex; gap: 1.6rem; }

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  background: linear-gradient(var(--blue), var(--blue)) bottom left / 0% 2px no-repeat;
  padding-bottom: 3px;
  transition: color 0.15s, background-size 0.25s;
}

.top-nav a:hover { color: var(--ink); background-size: 100% 2px; }

.top-nav a.active {
  color: var(--blue);
  background-size: 100% 2px;
}

.contact-link {
  color: #fff;
  background: var(--blue);
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  transition: filter 0.2s;
}

.contact-link:hover { filter: brightness(1.15); }

.contact-link:focus-visible, .cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

#pulse {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  width: min(1120px, 100% - 3rem);
  margin-inline: auto;
  padding-block: 5.5rem 2rem;
}

.eyebrow {
  color: var(--blue);
  animation: settle 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero h1 {
  font-weight: 850;
  font-stretch: 122%;
  font-size: clamp(3rem, 9vw, 6.8rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-top: 0.6rem;
  animation: settle 0.7s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero h1 .accent { color: var(--blue); }

.statement {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 54ch;
  margin-top: 1.4rem;
  text-wrap: balance;
  animation: settle 0.7s 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2.2rem;
  animation: settle 0.7s 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--blue);
  color: #fff;
  padding: 0.8rem 1.6rem;
  border-radius: 4px;
  transition: filter 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.cta:hover { filter: brightness(1.15); }

.cta-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.cta-ghost:hover {
  filter: none;
  color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--faint);
  margin-top: 4rem;
}

@keyframes settle {
  from { opacity: 0; transform: translateY(16px); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ---------- marquee ---------- */

.marquee {
  background: var(--ink);
  color: #f4f2ec;
  overflow: hidden;
  padding-block: 0.6rem;
  margin-bottom: 6rem;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 2.6rem;
  width: max-content;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  animation: tick 30s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-track span { white-space: nowrap; }

.marquee-track i { font-style: normal; font-size: 0.6rem; color: #7d92f0; }

@keyframes tick {
  to { transform: translateX(-50%); }
}

/* ---------- reveals ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in { opacity: 1; transform: none; }

/* ---------- section label ---------- */

.section-label {
  color: var(--muted);
  margin-bottom: 2.4rem;
}

.section-label i {
  font-style: normal;
  color: var(--blue);
  margin-right: 0.5rem;
  font-size: 0.62rem;
}

/* ---------- about + stats ---------- */

.about { padding-bottom: 6rem; }

.about-copy p {
  font-weight: 560;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  line-height: 1.45;
  max-width: 52ch;
  letter-spacing: -0.01em;
}

.about-copy p + p { margin-top: 1rem; }

.about-copy .dim { color: var(--muted); font-weight: 480; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 4rem;
}

.stat {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 1.4rem 1.3rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stat:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 30px -18px rgba(23, 25, 31, 0.25);
}

.stat:nth-child(2) { margin-top: 2.2rem; }
.stat:nth-child(3) { margin-top: 4.4rem; }
.stat:nth-child(4) { margin-top: 1.4rem; }

.stat-num {
  font-weight: 780;
  font-stretch: 118%;
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.stat .micro { color: var(--muted); }

/* ---------- services + process ---------- */

.services, .process { padding-bottom: 6rem; }

.service-grid, .process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--panel);
  border-radius: 0 0 6px 0;
}

.service, .step {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.6rem 1.5rem 1.8rem;
  transition: background 0.25s;
}

.service:hover, .step:hover { background: var(--blue-dim); }

.service > i {
  font-style: normal;
  color: var(--blue);
  font-size: 0.7rem;
}

.step-num { color: var(--blue); }

.service h3, .step h3 {
  font-weight: 700;
  font-stretch: 112%;
  font-size: 1.05rem;
  letter-spacing: -0.005em;
  margin: 0.9rem 0 0.45rem;
}

.step h3 { margin-top: 1.5rem; }

.service p, .step p { color: var(--muted); font-size: 0.9rem; }

/* ---------- education timeline ---------- */

.edu { padding-bottom: 6rem; }

.timeline {
  border-left: 1px solid var(--line);
  padding-left: 2.2rem;
  display: grid;
  gap: 2.6rem;
}

.tl-item { position: relative; }

.tl-item::before {
  content: "";
  position: absolute;
  left: calc(-2.2rem - 5px);
  top: 0.5rem;
  width: 9px;
  height: 9px;
  background: var(--blue);
  transform: rotate(45deg);
}

.tl-years { color: var(--faint); }

.tl-item h3 {
  font-weight: 740;
  font-stretch: 112%;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin: 0.35rem 0 0.2rem;
}

.tl-item p { color: var(--muted); font-size: 0.93rem; }

/* ---------- cards ---------- */

.work { padding-bottom: 6rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.2rem;
  align-items: stretch;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
              border-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
              box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--blue);
  box-shadow: 0 20px 38px -18px rgba(41, 73, 216, 0.15), 0 10px 20px -10px rgba(23, 25, 31, 0.15);
}

.card:hover .card-media img { transform: scale(1.05); }

.card-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #0a1020;
}

.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 1.6rem;
  flex: 1;
}

.card-body h2 {
  font-weight: 780;
  font-stretch: 116%;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
}

.card-tag { color: var(--blue); margin: 0.35rem 0 1rem; letter-spacing: 0.05em; }

.card-body > p { color: var(--muted); font-size: 0.92rem; }

.card-stats {
  color: var(--ink);
  border-block: 1px solid var(--line-soft);
  padding-block: 0.7rem;
  margin-top: 1.1rem;
  align-self: stretch;
  font-variant-numeric: tabular-nums;
}

.inline-code {
  color: var(--ink);
  background: var(--blue-dim);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  font-size: 0.86em;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.1rem;
}

.chips li {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.26rem 0.75rem;
  transition: border-color 0.2s, color 0.2s;
}

.chips li:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.card-links {
  display: flex;
  gap: 1.6rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.project-link {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--blue);
  padding-bottom: 2px;
}

.project-link span, .contact-link span {
  display: inline-block;
  transition: transform 0.25s;
}

.project-link:hover { color: var(--blue); }
.project-link:hover span, .contact-link:hover span { transform: translate(3px, -3px); }

.card-more {
  justify-content: center;
  align-items: center;
  flex-direction: row;
  gap: 1rem;
  min-height: 240px;
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  text-decoration: none;
}

.card-more:hover { color: var(--ink); }

.more-mark { color: var(--blue); font-size: 1.5rem; line-height: 1; }

.more-text {
  font-weight: 700;
  font-stretch: 112%;
  font-size: 1.15rem;
}

.more-sub { display: block; color: var(--faint); margin-top: 0.3rem; }

/* ---------- toolbox ---------- */

.toolbox { padding-bottom: 6rem; }

.tool-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.tool-cols > div {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 1.5rem 1.7rem;
}

.tool-cols h3 { color: var(--blue); margin-bottom: 0.7rem; font-weight: 500; }

.tool-cols p { color: var(--muted); font-size: 0.92rem; }

/* ---------- contact ---------- */

.contact { padding-bottom: 6rem; }

.contact-big {
  display: inline-block;
  font-weight: 850;
  font-stretch: 122%;
  font-size: clamp(2.6rem, 9vw, 6.2rem);
  line-height: 1;
  letter-spacing: -0.025em;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.25s;
}

.contact-big:hover { color: var(--blue); }

.contact-big span { display: inline-block; transition: transform 0.25s; }
.contact-big:hover span { transform: translate(6px, -6px); }

.contact-sub { color: var(--faint); margin-top: 1.2rem; }

.contact-sub a { color: var(--muted); text-decoration: none; }
.contact-sub a:hover { color: var(--blue); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  padding: 1.3rem clamp(1.5rem, 4vw, 3rem) 1.8rem;
}

.foot a { color: var(--faint); text-decoration: none; }
.foot a:hover { color: var(--blue); }

/* ---------- responsive + motion ---------- */

/* ---------- magnetic buttons ---------- */

.btn-magnetic {
  transition: transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1),
              filter 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
  will-change: transform;
}

@media (max-width: 900px) {
  .top-nav { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(n) { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .eyebrow, .hero h1, .statement, .hero-ctas { animation: none; }
  .marquee-track { animation: none; }
  .card, .card-media img, .reveal { transition: none; }
  .reveal { opacity: 1; transform: none; }
}
