/* ============================================================
   Eoghan Collins, home page
   Dark editorial-tech. One accent (PCB emerald), pill buttons,
   16px container radius, Clash Display + Satoshi + mono labels.
   ============================================================ */

@font-face {
  font-family: 'Clash Display';
  src: url('../assets/fonts/clash-display-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Clash Display';
  src: url('../assets/fonts/clash-display-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../assets/fonts/satoshi-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../assets/fonts/satoshi-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../assets/fonts/satoshi-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #07080a;
  --surface: rgba(15, 18, 22, 0.82);
  --surface-solid: #0e1116;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f0f2f4;
  --text-2: rgba(226, 232, 238, 0.62);
  --text-3: rgba(226, 232, 238, 0.7);
  --accent: #4ce0a4;
  --accent-rgb: 76, 224, 164;
  --display: 'Clash Display', 'Helvetica Neue', sans-serif;
  --body: 'Satoshi', 'Helvetica Neue', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  --radius: 16px;
  --wrap: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: rgba(var(--accent-rgb), 0.28); }

/* ---------- background canvas ---------- */

.bg-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#fractalCanvas {
  position: absolute;
  inset: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  /* the set renders at low internal resolution; a soft blur reads as glow
     instead of pixels (Safari upscales especially harshly) */
  filter: blur(8px) saturate(1.15);
}

/* soften the fractal so type always wins */
.bg-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 10%, rgba(7, 8, 10, 0) 0%, rgba(7, 8, 10, 0.55) 70%),
    linear-gradient(rgba(7, 8, 10, 0.35), rgba(7, 8, 10, 0.55));
}

main { position: relative; z-index: 1; }

/* ---------- glass ---------- */

.glass {
  position: relative;
  isolation: isolate;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 22, 27, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 24px 70px rgba(0, 0, 0, 0.45);
}

/* sampled-backdrop canvas (WebKit/Gecko refraction pipeline) */
.glass-sample {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
}

/* lit rim, both pipelines */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(120% 70% at 18% 0%, rgba(255, 255, 255, 0.13), transparent 45%),
    radial-gradient(90% 50% at 85% 100%, rgba(76, 224, 164, 0.05), transparent 60%);
  pointer-events: none;
}

/* frosted: cheaper than refraction, used by the medium quality tier */
.glass-frosted {
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

/* flat: low tier, no per-frame compositing cost at all */
.glass-flat { background: rgba(15, 18, 22, 0.88); }

@media (prefers-reduced-transparency: reduce) {
  .glass, .glass-frosted {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(14, 17, 22, 0.96);
  }
}

/* ---------- nav ---------- */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  transition: background 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}

.site-nav.scrolled {
  background: rgba(7, 8, 10, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav-brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.25s;
}

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

.nav-cta {
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  transition: border-color 0.25s, background 0.25s;
}

.nav-cta:hover {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.08);
}

/* ---------- shared ---------- */

section { padding: clamp(4rem, 9vw, 7.5rem) clamp(1.25rem, 4vw, 3rem); }

.section-head {
  max-width: var(--wrap);
  margin: 0 auto clamp(2.25rem, 5vw, 3.5rem);
}

.section-head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.section-head p {
  margin-top: 0.5rem;
  color: var(--text-2);
  font-size: 1.02rem;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(var(--accent-rgb), 0.9);
}

.card-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(226, 232, 238, 0.78);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 0.78rem 1.7rem;
  border-radius: 100px;
  transition: transform 0.2s ease, background 0.25s, border-color 0.25s, color 0.25s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #06231a;
  border: 1px solid var(--accent);
}

.btn-primary:hover { background: #63e9b2; border-color: #63e9b2; }

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.07);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: gap 0.25s ease;
}

.card-link:hover { gap: 0.55rem; }

/* scroll reveals */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  padding-bottom: 3rem;
}

.hero-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}

.hero-copy h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 1.1rem 0 1.4rem;
  max-width: 16ch;
  text-wrap: balance;
}

.hero-sub {
  color: var(--text-2);
  font-size: clamp(1rem, 1.4vw, 1.13rem);
  max-width: 44ch;
  margin-bottom: 2.2rem;
}

.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

.hero-figure { min-width: 0; }

.hero-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.4);
  transform: rotate(1.2deg);
}

.hero-frame img { width: 100%; }

.hero-figure figcaption {
  margin-top: 1rem;
  padding-left: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-3);
  max-width: 40ch;
}

/* hero load-in (motion only when allowed) */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .hero-figure {
    opacity: 0;
    transform: translateY(22px);
    animation: heroUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .hero-copy .eyebrow { animation-delay: 0.05s; }
  .hero-copy h1 { animation-delay: 0.14s; }
  .hero-copy .hero-sub { animation-delay: 0.24s; }
  .hero-copy .hero-actions { animation-delay: 0.34s; }
  .hero-figure { animation-delay: 0.3s; }
}

@keyframes heroUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- stats strip ---------- */

.stats { padding-top: 0; padding-bottom: 0; }

.stats-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  padding: 2.2rem 0;
  gap: 2rem;
}

.stat dd {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  letter-spacing: -0.01em;
  color: var(--text);
}

.stat dt {
  font-size: 0.82rem;
  color: var(--text-2);
  margin-top: 0.2rem;
}

.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; }

/* ---------- recognition ---------- */

.recognition .award-featured,
.recognition .award-grid {
  max-width: var(--wrap);
  margin: 0 auto;
}

.award-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.award-card {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2.2rem 2.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.3s, transform 0.3s ease;
}

.award-card:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-2px);
}

.award-logo {
  width: 170px;
  max-height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.award-card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.award-card p {
  color: var(--text-2);
  font-size: 0.92rem;
  margin-top: 0.25rem;
}

.award-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.award-tile.span-3 { grid-column: span 3; }
.award-tile.span-4 { grid-column: span 4; }

.award-tile {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.5rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.3s, transform 0.3s ease;
}

.award-tile:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-2px);
}

.award-logo-sm.logo-crest { height: 42px; filter: none; opacity: 1; }

.award-logo-sm.logo-ndrc { height: 30px; }

.award-logo-text {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(240, 242, 244, 0.78);
  line-height: 26px;
}

.award-logo-sm {
  height: 26px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  object-position: left;
  filter: brightness(0) invert(1);
  opacity: 0.78;
}

.award-tile h3 {
  font-family: var(--body);
  font-weight: 700;
  font-size: 0.98rem;
}

.award-tile p {
  color: var(--text-3);
  font-size: 0.84rem;
  margin-top: 0.15rem;
}

/* carousel controls: only shown when the grid becomes a scroller */
.award-nav {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin-top: 1.2rem;
}

.award-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--text-2);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, opacity 0.25s;
}

.award-arrow:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
  color: var(--accent);
}

.award-arrow:disabled { opacity: 0.3; cursor: default; }

.award-dots { display: flex; gap: 7px; }

.award-dots button {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
}

.award-dots button.active {
  background: var(--accent);
  transform: scale(1.25);
}

/* ---------- work ---------- */

.feature-card {
  max-width: var(--wrap);
  margin: 0 auto 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s;
}

.feature-card:hover { border-color: rgba(var(--accent-rgb), 0.3); }

.feature-media {
  position: relative;
  min-height: 420px;
}

.feature-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-body {
  padding: clamp(2rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.feature-body h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.feature-body p { color: var(--text-2); font-size: 0.98rem; max-width: 56ch; }

.feature-body .card-link { margin-top: 0.5rem; }

.project-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}

.p-card { grid-column: span 2; }
.p-card.wide { grid-column: span 4; }
.p-card.tall { grid-column: span 2; grid-row: span 2; }
.p-card.half { grid-column: span 3; }

.p-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s ease, box-shadow 0.3s;
}

.p-card a:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-3px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.p-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
}

/* keep light screenshots from flashing white on the dark page */
.p-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 10, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.p-card.tall .p-media { aspect-ratio: auto; flex: 1; min-height: 260px; }

.p-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.p-card a:hover .p-media img { transform: scale(1.04); }

.p-body { padding: 1.4rem 1.5rem 1.6rem; }

.p-body h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin: 0.45rem 0 0.35rem;
}

.p-body p { color: var(--text-2); font-size: 0.9rem; }

/* ---------- open source ---------- */

.oss-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 3.5rem;
}

.oss-row {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.5rem 0.25rem;
  border-top: 1px solid var(--line);
  transition: background 0.25s, border-color 0.25s;
}

.oss-row:hover { border-top-color: rgba(var(--accent-rgb), 0.45); }

.oss-row:hover .oss-name span { color: var(--accent); }

.oss-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.oss-name span {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  transition: color 0.25s;
}

.oss-name em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.oss-row p {
  margin-top: 0.4rem;
  color: var(--text-2);
  font-size: 0.9rem;
  max-width: 52ch;
}

.oss-more {
  max-width: var(--wrap);
  margin: 2.5rem auto 0;
}

/* ---------- writing ---------- */

.writing-list {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.writing-row {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 1.6rem 0.5rem;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--line);
  transition: border-color 0.25s, background 0.25s;
}

.writing-row:hover { border-top-color: rgba(var(--accent-rgb), 0.45); }

.writing-row:hover h3 { color: var(--accent); }

.writing-row:hover .writing-arrow { transform: translateX(4px); color: var(--accent); }

.writing-kind {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--text-3);
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  padding: 0.3rem 0.75rem;
  flex-shrink: 0;
}

.writing-text h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  transition: color 0.25s;
}

.writing-text p {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-top: 0.3rem;
  max-width: 72ch;
}

.writing-arrow {
  margin-left: auto;
  color: var(--text-3);
  font-size: 1.3rem;
  transition: transform 0.25s ease, color 0.25s;
}

@media (max-width: 880px) {
  .writing-row { gap: 1rem; padding: 1.3rem 0.25rem; }

  .writing-text h3 { font-size: 1.02rem; }
}

/* ---------- about ---------- */

.about {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.about-figure img {
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  transform: rotate(-1.2deg);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5);
}

.about-figure figcaption {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--text-3);
}

.about-body h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  letter-spacing: -0.015em;
  margin-bottom: 1.25rem;
}

.about-body p {
  color: var(--text-2);
  font-size: 1.02rem;
  max-width: 58ch;
}

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

.about-loc {
  font-family: var(--mono);
  font-size: 0.78rem !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3) !important;
  margin-top: 1.6rem !important;
}

/* ---------- CTA ---------- */

.cta {
  max-width: var(--wrap);
  margin: 0 auto;
  text-align: center;
  padding-top: clamp(5rem, 10vw, 8rem);
  padding-bottom: clamp(5rem, 10vw, 8rem);
}

.cta h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.cta > p {
  color: var(--text-2);
  margin-top: 0.9rem;
  font-size: 1.05rem;
}

.cta-actions {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.2rem;
}

.cta-social {
  display: flex;
  gap: 1.4rem;
  justify-content: center;
  margin-top: 2.4rem;
}

.cta-social a {
  color: var(--text-2);
  transition: color 0.25s, transform 0.25s ease;
}

.cta-social a:hover { color: var(--accent); transform: translateY(-2px); }

.cta-social svg { width: 28px; height: 28px; }

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

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: rgba(7, 8, 10, 0.85);
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-signature {
  width: 150px;
  height: auto;
  filter: invert(1);
  opacity: 0.85;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 2rem;
  color: var(--text-3);
  font-size: 0.85rem;
}

.footer-meta nav { display: flex; gap: 1.4rem; }

.footer-meta a {
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.25s;
}

.footer-meta a:hover { color: var(--text); }

/* ---------- responsive ---------- */

@media (max-width: 1020px) {
  .award-tile.span-3 { grid-column: span 6; }
  .award-tile.span-4 { grid-column: span 6; }
  .award-tile:last-child { grid-column: 4 / span 6; }
}

@media (max-width: 880px) {
  /* keep Work and Tools reachable on phones; drop the rest */
  .nav-links { gap: 1.1rem; margin-left: auto; }
  .nav-links a { display: none; }
  .nav-links a[href$="#work"], .nav-links a[href$="tools/"] { display: inline; }

  .hero { padding-top: 6.5rem; }

  .hero-inner { grid-template-columns: 1fr; gap: 3rem; }

  .hero-copy h1 { max-width: none; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 1.6rem 2rem; padding: 1.8rem 0; }

  .award-featured { grid-template-columns: 1fr; }

  .award-card { gap: 1.1rem; padding: 1.25rem 1.3rem; align-items: center; }

  .award-card h3 { font-size: 1.08rem; }

  .award-logo { width: 84px; max-height: 44px; }

  .feature-card { grid-template-columns: 1fr; }

  .feature-media { min-height: 0; aspect-ratio: 4 / 3; }

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

  .p-card, .p-card.wide, .p-card.tall, .p-card.half { grid-column: span 1; grid-row: span 1; }

  .p-card.tall .p-media { aspect-ratio: 16 / 10; flex: none; min-height: 0; }

  .oss-grid { grid-template-columns: 1fr; gap: 0; }

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

  .about-figure { order: 2; }

  .about-body { order: 1; }
}

@media (max-width: 1020px) and (min-width: 881px) {
  .award-tile:nth-last-child(-n+3) { grid-column: span 4; }
  .award-tile:last-child { grid-column: span 4; }
}

@media (max-width: 880px) {
  /* compact tiles become a swipeable carousel; a stacked list is too tall.
     NOTE: no mask-image here, it breaks touch scrolling on iOS Safari */
  .award-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
    gap: 0.8rem;
    margin-left: calc(-1 * clamp(1.25rem, 4vw, 3rem));
    margin-right: calc(-1 * clamp(1.25rem, 4vw, 3rem));
    padding: 0.25rem clamp(1.25rem, 4vw, 3rem) 0.5rem;
  }

  .award-grid::-webkit-scrollbar { display: none; height: 0; }

  .award-tile,
  .award-tile.span-3,
  .award-tile.span-4 {
    flex: 0 0 72%;
    max-width: 290px;
    scroll-snap-align: start;
  }

  .award-nav { display: flex; }
}

@media (max-width: 880px) {
  /* compact award tiles so Recognition doesn't eat the scroll on phones */
  .award-tile { padding: 1.05rem 1.1rem; gap: 0.7rem; }

  .award-tile h3 { font-size: 0.88rem; }

  .award-tile p { font-size: 0.78rem; }

  .award-logo-sm { height: 20px; max-width: 110px; }

  .award-logo-sm.logo-ndrc { height: 24px; }

  .award-logo-sm.logo-crest { height: 30px; }

  .award-logo-text { font-size: 0.9rem; line-height: 20px; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }

  .hero-actions .btn { flex: 1; }

  .cta-actions .btn { width: 100%; }
}

/* ---------- reduced motion ---------- */

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

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

  .btn, .award-card, .award-tile, .p-card a, .p-media img, .cta-social a {
    transition: none;
  }
}

/* ---------- glass overrides for card surfaces (must follow card rules) ---------- */

.award-card.glass,
.award-tile.glass,
.feature-card.glass,
.p-card a.glass {
  background: rgba(18, 22, 27, 0.2);
}

.glass.glass-flat,
.p-card a.glass.glass-flat {
  background: rgba(15, 18, 22, 0.88);
}
