/* ============================================================
   Nathan Coleman — personal site
   Plain CSS, no build step. Palette pulled from resume blues.
   ============================================================ */

:root {
  --bg-base: #f8f9fa;
  --bg-surface: #ffffff;
  --bg-glass: rgba(248, 249, 250, 0.7);

  --text-primary: #1a1d21;
  --text-secondary: #52585e;
  --text-tertiary: #868e96;
  --text-inverse: #ffffff;

  --accent: #1155cc;
  --accent-bright: #0096ff;
  --accent-hover: #0b3d99;
  --accent-soft: #e8f0fd;

  --border: rgba(0, 0, 0, 0.07);
  --border-strong: rgba(0, 0, 0, 0.13);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);

  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --radius-full: 999px;

  --space-xs: 0.375rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;
  --space-3xl: 8rem;

  --font-display: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.15s;
  --duration-normal: 0.3s;
  --duration-slow: 0.5s;

  --shell: 1080px;
}

/* --- reset ------------------------------------------------ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100dvh;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--text-primary);
  color: var(--text-inverse);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-sm);
}

/* --- ambient background ----------------------------------- */

.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
}

.blob-1 {
  width: 45vw;
  height: 45vw;
  top: -12vw;
  right: -8vw;
  background: radial-gradient(circle, rgba(0, 150, 255, 0.28), transparent 70%);
}

.blob-2 {
  width: 38vw;
  height: 38vw;
  top: 45vh;
  left: -12vw;
  background: radial-gradient(circle, rgba(17, 85, 204, 0.2), transparent 70%);
}

.blob-3 {
  width: 30vw;
  height: 30vw;
  bottom: -8vw;
  right: 15vw;
  background: radial-gradient(circle, rgba(0, 150, 255, 0.16), transparent 70%);
}

/* --- header ----------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-sm) 0;
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  position: relative;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

/* flex-basis + min-width, not just flex-shrink: as a flex item inside a
   shrinking nav the avatar otherwise gets squeezed into a sliver. */
.nav-logo .logo-img {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-pages {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

/* Hamburger — desktop hides it; the small-screen block below turns it on. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.nav-toggle:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.nav-toggle[aria-expanded="true"] {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.06);
}

.nav-link {
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
}

.nav-link--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem;
}

.nav-divider {
  width: 1px;
  height: 20px;
  margin: 0 0.4rem;
  background: var(--border-strong);
}

/* --- layout ----------------------------------------------- */

.page-shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

section {
  padding: var(--space-2xl) 0;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.section-label::before {
  content: "";
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section-header {
  margin-bottom: var(--space-xl);
}

.section-intro {
  margin-top: var(--space-md);
  max-width: 58ch;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

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

.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  align-items: center;
  gap: var(--space-2xl);
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  margin-bottom: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(0, 150, 255, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin-bottom: var(--space-md);
}

.hero-name {
  background: linear-gradient(100deg, var(--accent), var(--accent-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  max-width: 52ch;
  color: var(--text-secondary);
  font-size: 1.08rem;
  line-height: 1.65;
  margin-bottom: var(--space-lg);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--text-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: #000;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* hero visual — floating cards */

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-card-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  max-width: 300px;
}

.floating-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  font-weight: 600;
  animation: cardFloat 6s ease-in-out infinite;
}

.card-1 {
  margin-left: 0;
  animation-delay: 0s;
}
.card-2 {
  margin-left: 2.5rem;
  animation-delay: 1s;
}
.card-3 {
  margin-left: 1rem;
  animation-delay: 2s;
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

@keyframes cardFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

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

.about-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.about-copy p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  max-width: 60ch;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-copy strong {
  color: var(--text-primary);
  font-weight: 600;
}

.skill-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.skill-group h3 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.tag-accent {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-weight: 600;
}

/* --- quote ------------------------------------------------ */

.quote-card {
  position: relative;
  padding: var(--space-xl);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
  max-width: 720px;
}

.quote-card::before {
  content: "";
  position: absolute;
  top: var(--space-lg);
  bottom: var(--space-lg);
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--accent), var(--accent-bright));
}

.quote-card blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.quote-attrib {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--space-md);
  font-size: 0.88rem;
  color: var(--text-tertiary);
}

.quote-attrib .who {
  font-weight: 600;
  color: var(--text-primary);
}

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

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.timeline-org {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--border);
}

.timeline-org:last-child {
  border-bottom: 1px solid var(--border);
}

.org-head h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.org-head h3 a:hover {
  color: var(--accent);
}

.org-meta {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.org-blurb {
  margin-top: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.role-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.role {
  position: relative;
  padding-left: var(--space-md);
  border-left: 2px solid var(--border);
}

.role::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.55rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.role.current::before {
  background: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(0, 150, 255, 0.18);
}

.role-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
}

.role-title h4 {
  font-size: 1rem;
  font-weight: 600;
}

.role-years {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.role ul {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.role ul li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 62ch;
}

.role ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.role a,
.about-copy a,
.project-body a,
.edu-card a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(17, 85, 204, 0.3);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--duration-fast) var(--ease-out);
}

.role a:hover,
.about-copy a:hover,
.project-body a:hover,
.edu-card a:hover {
  text-decoration-color: var(--accent);
}

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

.project-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.project-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.project-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.project-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
}

.project-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

/* Real product/company marks. Square icons sit full-bleed; transparent
   wordmarks need a tile behind them, hence the --dark / --light variants. */
.project-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.project-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* For transparent-background marks that would otherwise bleed to the edge. */
.project-mark--pad {
  padding: 0.5rem;
  background: var(--bg-surface);
}

.project-mark--pad img {
  object-fit: contain;
}

/* Product screenshot in the projects-page aside column. */
.project-shot {
  width: 100%;
  max-width: 190px;
  height: auto;
  margin-top: var(--space-xs);
}

.project-body h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.project-role {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.project-body p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: var(--space-sm);
  max-width: 64ch;
}

.project-points {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: var(--space-md);
}

.project-points li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 64ch;
}

.project-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.project-link:hover {
  color: var(--accent-hover);
  gap: 0.55rem;
}

.project-link svg {
  transition: transform var(--duration-fast) var(--ease-out);
}

/* compact project grid used on the home page */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

/* Five cards in a three-up grid: the last two span wider so row two fills. */
.work-grid > :nth-last-child(2):nth-child(4) {
  grid-column: span 2;
}

.work-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.work-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.work-card .project-glyph {
  margin-bottom: var(--space-sm);
}

.work-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.work-card .project-kicker {
  margin-bottom: 0.5rem;
}

.work-card p:not(.project-kicker) {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex-grow: 1;
}

.work-card .tag-list {
  margin-top: var(--space-md);
}

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

.edu-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.edu-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.edu-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 62ch;
}

.edu-card p + p {
  margin-top: var(--space-sm);
}

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

.cta {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  margin: var(--space-2xl) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, var(--bg-surface), var(--accent-soft));
  box-shadow: var(--shadow-md);
}

.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.cta p {
  margin: var(--space-sm) auto var(--space-lg);
  max-width: 46ch;
  color: var(--text-secondary);
}

.cta .hero-actions {
  justify-content: center;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0;
  margin-top: var(--space-xl);
}

.footer-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  gap: var(--space-md);
}

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

/* --- entrance + reveal animations ------------------------- */

.entrance {
  opacity: 0;
  transform: translateY(16px);
  animation: entranceIn var(--duration-slow) var(--ease-out) forwards;
}

.entrance-d1 {
  animation-delay: 0.08s;
}
.entrance-d2 {
  animation-delay: 0.16s;
}
.entrance-d3 {
  animation-delay: 0.24s;
}
.entrance-d4 {
  animation-delay: 0.32s;
}

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

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

/* JS disabled — never leave content hidden */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    padding-bottom: var(--space-2xl);
  }

  .hero-visual {
    justify-content: flex-start;
  }

  .hero-card-stack {
    flex-direction: row;
    max-width: none;
    flex-wrap: wrap;
  }

  .card-1,
  .card-2,
  .card-3 {
    margin-left: 0;
  }

  .about-grid,
  .timeline-org,
  .project-card,
  .edu-card {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

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

  /* Otherwise the 3-up span rule conjures an implicit second column. */
  .work-grid > :nth-last-child(2):nth-child(4) {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  :root {
    --space-2xl: 3.5rem;
    --space-3xl: 5rem;
  }

  .page-shell,
  .nav-inner,
  .footer-inner {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .hero-title {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
  }

  /* Keep the mark, drop the wordmark — otherwise the nav wraps and clips. */
  .nav-logo span {
    display: none;
  }

  .nav-link {
    padding: 0.45rem 0.5rem;
  }

  .nav-divider {
    display: none;
  }

  /* Page links collapse into a dropdown; social icons stay inline. */
  .nav-toggle {
    display: inline-flex;
  }

  .nav-pages {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: var(--space-md);
    z-index: 110;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
    min-width: 168px;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
  }

  .nav-pages:not([data-open="true"]) {
    display: none;
  }

  .nav-pages .nav-link {
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
  }

  .nav-pages .nav-link.active {
    background: var(--accent-soft);
    color: var(--accent);
  }

  /* Without JS the toggle can't fire, so keep the links inline and reachable. */
  .no-js .nav-toggle {
    display: none;
  }

  .no-js .nav-pages {
    position: static;
    display: flex;
    flex-direction: row;
    min-width: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
  }

  .quote-card,
  .project-card,
  .edu-card {
    padding: var(--space-md);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .entrance,
  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .bg-ambient,
  .cta,
  .hero-visual {
    display: none;
  }

  body {
    background: #fff;
  }
}
