/* ============================================================
   layout.css — canvas, header, sections, grids, footer
   ============================================================ */

#ascii-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* keep all real content above the canvas */
.site-header, main, .site-footer { position: relative; z-index: 2; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;                 /* above page content so the nav stays visible + clickable */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-nav { display: flex; gap: clamp(14px, 2.4vw, 32px); }
.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color var(--speed), border-color var(--speed);
}
.site-nav a:hover { color: var(--fg); }
.site-nav a.active { color: var(--fg-strong); border-bottom-color: var(--fg-strong); }

.header-controls { display: flex; align-items: center; gap: 10px; }

/* ---------- Sections ---------- */
main { display: block; }

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(72px, 12vh, 140px) var(--gutter);
  scroll-margin-top: 72px;
}

.section-head { margin-bottom: clamp(28px, 5vh, 52px); }
.section-title { font-size: var(--fs-h2); letter-spacing: -0.01em; }

/* ---------- Hero ---------- */
.hero {
  /* leave room for the sticky header + the brand marquee so the marquee
     is visible on first load without scrolling */
  min-height: calc(100svh - 150px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 48px;
  padding-bottom: 40px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.scroll-cue {
  margin-top: auto;
  padding-top: 48px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  align-self: flex-start;
}
.scroll-cue:hover { color: var(--fg); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.about-body { display: flex; flex-direction: column; gap: 18px; max-width: 60ch; }
.about-photo { border: 1px solid var(--line); padding: 10px; background: var(--bg-soft); }
.about-photo img { filter: grayscale(1) contrast(1.02); width: 100%; }
.about-photo figcaption { margin-top: 8px; color: var(--muted); text-align: center; }

/* ---------- Experience ---------- */
.exp-list { list-style: none; display: flex; flex-direction: column; }

/* ---------- Projects ---------- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

/* ---------- Contact ---------- */
.contact-body { max-width: 52ch; font-size: var(--fs-role); margin-bottom: 32px; }
.contact-links { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
/* On wide screens the 4 links sit in one row; give the email (first) box extra width so the address fits on one line. */
@media (min-width: 761px) {
  .contact-links { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px var(--gutter) 48px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .proj-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --gutter: 22px; }
  .site-header { padding: 13px 22px; }
  .site-nav { display: none; }          /* single-page: anchors via scroll */
  .hero { min-height: calc(100svh - 150px); padding-top: 64px; }
  .section { padding: clamp(56px, 9vh, 88px) var(--gutter); }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-photo { max-width: 260px; }
}

@media (max-width: 480px) {
  .brand { font-size: 1.45rem; }
  .hero-name { font-size: clamp(2.5rem, 13vw, 3.4rem); }
  .hero-hook { font-size: 1rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { text-align: center; }
  .exp-item { grid-template-columns: 1fr; gap: 8px; }
  .contact-links { grid-template-columns: 1fr; }
  .header-controls { gap: 7px; }
  .ctrl-btn { padding: 6px 9px; }
}
