/* ============================================================
   gismazzotta.dev — Design System
   Palette: Warm white (#ede8db) base + Royal blue accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Inter:wght@400;500&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  --color-bg:       #ede8db;
  --color-surface:  #f5f1e8;
  --color-navy:     #0a1628;
  --color-border:   #1e3557;
  --color-muted:    #9aaec4;
  --color-blue:     #1a3a6b;
  --color-blue-lt:  #2d5fa0;
  --color-text:     #1e2c3a;
  --color-text-mid: #3a4e64;

  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --nav-h: 64px;
  --max-w: 1100px;
  --max-w-prose: 900px;
  --radius: 2px;
  --transition: 0.2s ease;
}

/* ── Skip link (keyboard navigation) ───────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--color-blue);
  color: var(--color-bg);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid var(--color-bg);
  outline-offset: -2px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
ul[role="list"] { list-style: none; }
a { color: var(--color-blue); text-decoration: none; }
a:hover { color: var(--color-blue-lt); }
a:focus-visible {
  outline: 2px solid var(--color-blue-lt);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ── Navigation ────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 200;
  border-bottom: 1px solid var(--color-border);
}

/* Nautical tick marks — nav bottom (ticks hang upward from neatline into nav margin) */
.site-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12px;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(to right,
      var(--color-muted) 0, var(--color-muted) 1px,
      transparent 1px, transparent 150px),
    repeating-linear-gradient(to right,
      var(--color-muted) 0, var(--color-muted) 1px,
      transparent 1px, transparent 30px);
  background-size: 150px 12px, 30px 6px;
  background-position: 0 0, 0 6px;
  background-repeat: repeat-x;
  opacity: 0.45;
}

/* Nautical tick marks — footer top (ticks hang downward from neatline into footer margin) */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(to right,
      var(--color-muted) 0, var(--color-muted) 1px,
      transparent 1px, transparent 150px),
    repeating-linear-gradient(to right,
      var(--color-muted) 0, var(--color-muted) 1px,
      transparent 1px, transparent 30px);
  background-size: 150px 12px, 30px 6px;
  background-position: 0 0, 0 0;
  background-repeat: repeat-x;
  opacity: 0.45;
}

.nav-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; }

.nav-brand__name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--color-bg);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}

.nav-brand__sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  letter-spacing: 0.12em;
  line-height: 1;
}

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

.nav-links a {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--color-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--transition);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links a[aria-current="page"] {
  color: var(--color-bg);
  border-bottom-color: var(--color-blue-lt);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-bg);
  padding: 0.5rem;
  line-height: 0;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  background-color: var(--color-navy);
  background-image: url('/assets/images/Lego_CraterLake_FinalDraft_JPEG.jpg');
  background-size: cover;
  background-position: center top;
  position: relative;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(10,22,40,0.82) 0%, rgba(10,22,40,0.68) 60%, rgba(10,22,40,0.78) 100%),
    repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(255,255,255,0.025) 60px),
    repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(255,255,255,0.025) 60px);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
}

.hero__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero__label::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--color-muted);
}

.hero__name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 6.5rem);
  color: var(--color-bg);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.hero__tagline {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(1rem, 2.5vw, 1.375rem);
  color: var(--color-muted);
  margin-bottom: 2.75rem;
  max-width: 52ch;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.875rem 1.875rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.btn:focus-visible { outline: 2px solid var(--color-blue-lt); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--color-blue);
  color: var(--color-bg);
  border-color: var(--color-blue);
}
.btn--primary:hover {
  background: var(--color-blue-lt);
  border-color: var(--color-blue-lt);
  color: var(--color-bg);
}

.btn--outline {
  background: transparent;
  color: var(--color-bg);
  border-color: rgba(237, 232, 219, 0.4);
}
.btn--outline:hover {
  border-color: var(--color-bg);
  color: var(--color-bg);
}

/* ── Stat Strip ────────────────────────────────────────────── */
.stat-strip {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 2rem;
}

.stat-strip__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.stat {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-blue);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.375rem 1.75rem;
  border-right: 1px solid var(--color-border);
  text-align: center;
}

.stat:last-child { border-right: none; }

/* ── Section Shell ─────────────────────────────────────────── */
.section {
  padding: 5rem 2rem;
}

.section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-mid); /* --color-muted fails AA on light bg; text-mid ~7:1 */
  margin-bottom: 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
  opacity: 0.5;
  max-width: 120px;
}

.section-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--color-navy);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 0.875rem;
}

.section-desc {
  font-size: 1.0625rem;
  color: var(--color-text-mid);
  max-width: 60ch;
  margin-bottom: 2.75rem;
  line-height: 1.65;
}

.section-footer {
  margin-top: 2.5rem;
  text-align: center;
}

/* ── Project Cards ─────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(10, 22, 40, 0.14);
  text-decoration: none;
  color: inherit;
}

.project-card__thumb {
  aspect-ratio: 16 / 9;
  background: var(--color-navy);
  position: relative;
  overflow: hidden;
}

.project-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--transition), transform 0.4s ease;
}

.project-card:hover .project-card__thumb img {
  transform: scale(1.03);
  opacity: 1;
}

.project-card__badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--color-blue);
  color: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 1px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.project-card__badge--progress {
  background: var(--color-border);
}

.project-card__body {
  padding: 1.375rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-mid); /* --color-muted fails AA on light card surface */
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.project-card__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--color-navy);
  line-height: 1.25;
  margin-bottom: 0.625rem;
}

.project-card__desc {
  font-size: 0.875rem;
  color: var(--color-text-mid);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-blue);
  background: rgba(26, 58, 107, 0.08);
  border: 1px solid rgba(26, 58, 107, 0.22);
  padding: 0.2rem 0.5rem;
  border-radius: 1px;
}

/* Tags on dark navy backgrounds — light-on-dark for WCAG AA contrast */
.project-header .tag,
.award-badge ~ .tag-list .tag {
  color: var(--color-muted);
  background: rgba(154, 174, 196, 0.12);
  border-color: rgba(154, 174, 196, 0.25);
}

.project-card__link {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-blue);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: auto;
  transition: gap var(--transition), color var(--transition);
}

.project-card:hover .project-card__link {
  gap: 0.625rem;
  color: var(--color-blue-lt);
}

/* ── About Teaser (Homepage) ────────────────────────────────── */
.about-teaser {
  background: var(--color-navy);
  padding: 5rem 2rem;
}

.about-teaser__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-teaser__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.625rem;
}

.about-teaser__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--color-bg);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.about-teaser__bio {
  font-size: 1rem;
  color: var(--color-muted);
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.about-teaser__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-bg);
  background: rgba(237, 232, 219, 0.08);
  border: 1px solid rgba(237, 232, 219, 0.2);
  padding: 0.25rem 0.625rem;
  border-radius: 1px;
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-navy);
  padding: 2rem 2rem;
  border-top: 1px solid var(--color-border);
  position: relative;
}

.site-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.footer-signet {
  height: 72px;
  width: auto;
  opacity: 0.65;
  filter: brightness(0) invert(1);
  transition: opacity var(--transition);
  flex-shrink: 0;
}
.footer-signet:hover { opacity: 1; }

.footer-coord {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  letter-spacing: 0.1em;
}

.footer-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--color-bg); }

/* ── Project Detail ────────────────────────────────────────── */
.project-article { padding-top: var(--nav-h); }

/* PDF overlay — mobile only */
.pdf-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  flex-direction: column;
  background: var(--color-navy);
}
.pdf-overlay.is-open { display: flex; }

.pdf-overlay__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--color-border);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.pdf-overlay__title {
  font-family: var(--font-head);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-bg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-overlay__close {
  background: none;
  border: none;
  color: var(--color-bg);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  flex-shrink: 0;
  margin-left: 1rem;
  line-height: 1;
}
.pdf-overlay__close:hover { color: var(--color-muted); }

.pdf-overlay__frame { flex: 1; border: none; width: 100%; display: block; }

/* Desktop: show PDF iframe, hide mobile thumbnail and View PDF button */
.project-hero--mobile-thumb { display: none; }
.pdf-open-btn { display: none; }

.project-hero {
  background: var(--color-navy);
  overflow: hidden;
  max-height: 520px;
}

.project-hero__img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.project-hero--pdf {
  max-height: none;
  height: 700px;
}

.project-hero__pdf {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.project-hero--tall {
  max-height: none;
  height: 600px;
}

.project-hero--tall model-viewer {
  width: 100%;
  height: 100%;
  display: block;
  background-color: var(--color-navy);
  --progress-bar-color: var(--color-blue-lt);
}

.project-hero__placeholder {
  width: 100%;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-border);
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
}

.project-header {
  background: var(--color-navy);
  padding: 2.5rem 2rem 3rem;
}

.project-header__inner {
  max-width: var(--max-w-prose);
  margin: 0 auto;
}

.project-header__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.project-header__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 3rem);
  color: var(--color-bg);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

.btn--header-action { margin-top: 1rem; }

.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(45, 95, 160, 0.25);
  border: 1px solid var(--color-blue-lt);
  border-radius: var(--radius);
  padding: 0.5rem 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-bg);
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 1px;
}

.status-badge--progress {
  color: var(--color-muted);
  border: 1px solid var(--color-border);
}

.project-content {
  max-width: var(--max-w-prose);
  margin: 0 auto;
  padding: 3.5rem 2rem;
}

.project-content h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3125rem;
  color: var(--color-navy);
  margin-top: 3rem;
  margin-bottom: 0.875rem;
  padding-top: 3rem;
  border-top: 1px solid var(--color-border);
  letter-spacing: -0.01em;
}

.project-content h2:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.project-content h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--color-navy);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.project-content p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-mid);
  margin-bottom: 1.125rem;
}

.project-content ul, .project-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.125rem;
}

.project-content li {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-mid);
  margin-bottom: 0.375rem;
}

.project-content strong { color: var(--color-text); font-weight: 600; }

.project-content a { color: var(--color-blue); border-bottom: 1px solid rgba(26,58,107,0.3); }
.project-content a:hover { color: var(--color-blue-lt); border-bottom-color: var(--color-blue-lt); }

.project-embed {
  margin: 2rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.project-embed iframe {
  width: 100%;
  height: 520px;
  border: none;
  display: block;
}

.embed-fallback {
  padding: 0.875rem 1.25rem;
  background: var(--color-surface);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-mid); /* --color-muted fails AA on light surface */
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.project-nav {
  max-width: var(--max-w-prose);
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
  border-top: 1px solid var(--color-border);
}

.back-link {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-blue);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap var(--transition), color var(--transition);
}

.back-link:hover {
  gap: 0.75rem;
  color: var(--color-blue-lt);
}

/* ── Inner Pages (About, Contact, Projects listing) ─────────── */
.page-hero {
  padding-top: calc(var(--nav-h) + 4rem);
  padding-bottom: 4rem;
  padding-left: 2rem;
  padding-right: 2rem;
  background: var(--color-navy);
}

.page-hero__inner {
  max-width: var(--max-w-prose);
  margin: 0 auto;
}

.page-hero--wide .page-hero__inner {
  max-width: var(--max-w);
}

.page-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.page-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  color: var(--color-bg);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.page-subtitle {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--color-muted);
  line-height: 1.6;
  max-width: 60ch;
}

.page-content {
  padding: 4rem 2rem 5rem;
}

.page-content__inner {
  max-width: var(--max-w-prose);
  margin: 0 auto;
}

.page-content__inner p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-mid);
  margin-bottom: 1.125rem;
}

.page-content__inner h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-navy);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

/* ── Skills / Tags ─────────────────────────────────────────── */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 2rem;
}

/* ── Contact Links ─────────────────────────────────────────── */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin: 2rem 0;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition);
  color: var(--color-text);
  text-decoration: none;
}

.contact-link:hover {
  border-color: var(--color-blue-lt);
  transform: translateX(4px);
  color: var(--color-text);
  text-decoration: none;
}

.contact-link__icon {
  width: 20px;
  flex-shrink: 0;
  color: var(--color-blue);
}

.contact-link__info { flex: 1; }

.contact-link__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-mid); /* --color-muted fails AA on light surface */
  margin-bottom: 0.125rem;
}

.contact-link__value {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-navy);
}

.contact-link__arrow {
  color: var(--color-muted);
  font-size: 1.25rem;
  transition: transform var(--transition), color var(--transition);
}

.contact-link:hover .contact-link__arrow {
  transform: translateX(4px);
  color: var(--color-blue);
}

/* ── Projects Gallery Page ─────────────────────────────────── */
.projects-section {
  padding: 4rem 2rem 6rem;
}

.projects-section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ── Home Tile Grid ─────────────────────────────────────────── */
/* no overflow lock — tile grid sizes itself, footer scrolls into view below */

/* Grid: left area | MeshCore right column spanning rows 1+2 */
.tile-grid {
  display: grid;
  height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
  grid-template-columns: 1fr 28%;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0 2px; /* no row gap — keeps column gap between left and right tiles */
  background: var(--color-border);
}

/* Flex rows for projects and dest */
.tile-row {
  display: flex;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}

/* Base tile */
.tile {
  position: relative;
  overflow: hidden;
  text-decoration: none;
  background-color: var(--color-navy);
}

/* Gradient overlay — sits above image, below content */
.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(10, 22, 40, 0.88) 0%,
    rgba(10, 22, 40, 0.3) 45%,
    rgba(10, 22, 40, 0.08) 100%
  );
  transition: background var(--transition);
}

.tile:hover::before {
  background: linear-gradient(
    to top,
    rgba(10, 22, 40, 0.95) 0%,
    rgba(10, 22, 40, 0.5) 55%,
    rgba(10, 22, 40, 0.2) 100%
  );
}

.tile:focus-visible {
  outline: 2px solid var(--color-blue-lt);
  outline-offset: -2px;
}

/* Crater Lake: top-left cell, row height driven by image natural size */
.tile--crater-lake {
  grid-column: 1;
  grid-row: 1;
  display: block;
}

.tile--crater-lake .tile__img-fill {
  width: 100%;
  height: auto;
  display: block;
}

/* MeshCore: right column, spans both content rows — portrait image fills tall tile */
.tile--meshcore-span {
  grid-column: 2;
  grid-row: 1 / 3;
}

.tile--meshcore-span .tile__img-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Projects row: left column, row 2 */
.tile-row--projects {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  gap: 2px;
  min-height: 0;
  overflow: hidden;
}

/* Dest row: spans full width */
.tile-row--dest {
  grid-column: 1 / -1;
  grid-row: 3;
}

/* Project tiles — flex: auto width driven by image aspect ratio at row height */
.tile--project {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
}

/* Image fills tile height; width = height × aspect ratio → no dead space */
.tile__img-fill {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
}

/* Prevent any image-driven tile from collapsing too narrow */
.tile--project { min-width: clamp(140px, 14vw, 220px); }

/* 3D model tile — expands to fill remaining row width */
.tile--model {
  flex: 1 1 0;
}

/* Live embed tile (iframe) — shares remaining width with model tile */
.tile--embed {
  flex: 1 1 0;
}

.tile--embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

.tile--model model-viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-color: var(--color-navy);
  --progress-bar-color: transparent;
  --progress-mask: transparent;
}

/* Project detail page model embed */
.project-embed--model model-viewer {
  width: 100%;
  height: 520px;
  display: block;
  background-color: var(--color-navy);
  --progress-bar-color: var(--color-blue-lt);
}

/* No-image tile takes remaining width equally */
.tile--no-img {
  flex: 1 1 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 29px, rgba(255,255,255,0.03) 30px),
    repeating-linear-gradient(90deg, transparent, transparent 29px, rgba(255,255,255,0.03) 30px);
}

/* Dest tiles (About/Contact) */
.tile--dest {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile--dest::before { background: none; }

.tile--dest:hover::before {
  background: rgba(45, 95, 160, 0.15);
  transition: background var(--transition);
}

/* Content overlay — pinned to bottom of tile, above gradient */
.tile__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 1.125rem 1.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  pointer-events: none;
}

/* Dest content is statically centered, not overlaid */
.tile--dest .tile__content {
  position: static;
  text-align: center;
  align-items: center;
  padding: 1rem;
}

.tile__award {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: #c8a96e;
  text-transform: uppercase;
}

.tile__title {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--color-bg);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.tile--feature .tile__title { font-size: clamp(1.125rem, 2.5vw, 1.75rem); }
.tile--project .tile__title  { font-size: clamp(0.8rem, 1.4vw, 1rem); }
.tile--dest    .tile__title  { font-size: clamp(1rem, 2vw, 1.375rem); }

.tile__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.tile__status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: 0.125rem;
}

.tile__arrow {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 1rem;
  color: rgba(237, 232, 219, 0.3);
  z-index: 2;
  line-height: 1;
  transition: transform var(--transition), color var(--transition);
}

.tile:hover .tile__arrow {
  transform: translate(2px, -2px);
  color: var(--color-bg);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .about-teaser__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--color-navy);
    flex-direction: column;
    padding: 1.5rem 2rem 2rem;
    border-bottom: 1px solid var(--color-border);
    gap: 0;
  }
  .nav-links li { border-bottom: 1px solid rgba(255,255,255,0.06); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a {
    display: block;
    padding: 0.875rem 0;
    border-bottom: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }

  .stat-strip__inner { gap: 0; flex-direction: column; }
  .stat { border-right: none; border-bottom: 1px solid var(--color-border); width: 100%; }
  .stat:last-child { border-bottom: none; }

  .site-footer__inner { flex-direction: column; align-items: flex-start; }
  .footer-signet { height: 48px; }

  /* Project pages: swap PDF iframe for thumbnail + overlay on mobile */
  .project-hero--pdf-desktop { display: none; }
  .project-hero--mobile-thumb { display: block; max-height: none; }
  .project-hero--mobile-thumb .project-hero__img {
    object-fit: contain;
    max-height: none;
    height: auto;
    width: 100%;
  }
  .pdf-open-btn { display: inline-flex; }

  /* Tile grid on mobile: equal 2-col, 4 rows */
  .tile-grid {
    height: auto;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 240px 220px 220px;
    gap: 2px;
  }

  /* Crater Lake: full width row 1 */
  .tile--crater-lake { grid-column: 1 / -1; grid-row: 1; }
  .tile--crater-lake .tile__img-fill { width: 100%; height: auto; }

  /* Dissolve tile-row so children become direct grid items */
  .tile-row--projects { display: contents; }

  /* Row 2: Papercraft left, MeshCore right */
  .tile--papercraft { grid-column: 1; grid-row: 2; flex: unset; width: 100%; }
  .tile--papercraft .tile__img-fill { width: 100%; height: 100%; object-fit: contain; }
  .tile--meshcore-span { grid-column: 2; grid-row: 2; min-height: 0; }

  /* Row 3: USGS left, Vineyard right */
  .tile--model   { grid-column: 1; grid-row: 3; }
  .tile--vineyard { grid-column: 2; grid-row: 3; }

  /* Row 4: Lumpy Potato full width */
  .tile--lumpy { grid-column: 1 / -1; grid-row: 4; }
}

@media (max-width: 600px) {
  .projects-grid { grid-template-columns: 1fr; }
  .hero__actions { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  :root { --nav-h: 60px; }
  .section { padding: 3.5rem 1.25rem; }
  .page-hero { padding-left: 1.25rem; padding-right: 1.25rem; }
  .project-content { padding: 2.5rem 1.25rem; }
  .page-content { padding: 2.5rem 1.25rem 4rem; }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
