/* About page styles (extracted from inline CSS) */
:root { color-scheme: dark light; }

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* About-only header override: disable fixed header and remove global top padding from portfolio.css */
body > header.site {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
  isolation: auto !important;
}
body {
  padding-top: 0 !important;
}

/* Page layout container */
.container { max-width: 1100px; margin: 0 auto; padding: clamp(1rem, 3vw, 1.5rem); }

/* ensure header spans full width and won't wrap under width constraints */
body > header.site {
  width: 100%;
  box-sizing: border-box;
  color: #eaeaea; /* make inline nav text white on dark header */

  /* Light-on-dark nav tokens scoped to About header to ensure contrast */
  --fd-nav-fg: #eaeaea;
  --fd-nav-fg-muted: #c8c8c8;
  --fd-nav-bg: rgba(255,255,255,0.06);
  --fd-nav-bg-hover: rgba(255,255,255,0.12);
  --fd-nav-border: rgba(255,255,255,0.18);
  --fd-nav-active-underline: #ffffff;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  padding: 1.25rem;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--card-glow, transparent);
}

h1, h2 { line-height: 1.2; margin: 0.5rem 0 0.75rem; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
footer { margin-top: 2rem; font-size: 0.9rem; color: var(--muted); }

/* --- About prose hierarchy and sectioning --- */
.card .prose {
  max-width: 68ch;
}
.card .prose p {
  margin: 0.7rem 0;
}
.card .prose .lead {
  font-size: 1.075rem;
  line-height: 1.7;
  color: var(--muted-2);
  margin-top: 0.25rem;
}

/* Subheads with a subtle hairline divider underneath */
.card h3 {
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--heading);
  line-height: 1.35;
  position: relative;
}
.card h3::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 0.4rem;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Optional gradient rule for explicit section breaks */
.card .rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  border: 0;
  margin: 1.1rem 0;
}

/* Scan-friendly lists */
.card .prose ul {
  margin: 0.6rem 0 0.2rem;
  padding-left: 1.2rem;
}
.card .prose li {
  margin: 0.3rem 0;
}

/* Link underline legibility */
.card a {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 2px;
}

/* Slightly stronger card separation and padding on larger screens */
@media (min-width: 720px) {
  .card {
    padding: 1.5rem;
    border-color: var(--border);
    background: var(--panel-2);
  }
}

/* About page light layout extensions */
.about-grid {
  display: grid;
  gap: var(--space-5, 1.25rem);
  margin-top: var(--space-5, 2rem);
}

/* About grid: remove extra margins on non-project cards to compress vertical spacing */
.about-grid > .card:not(.project) { margin: 0 !important; }

/* Grid area mapping (mobile first) */
@media (max-width: 899px) {
  .about-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "who"
      "headshot"
      "story"
      "skills"
      "projects"
      "fd"
      "hh"
      "tamu"
      "links";
  }
}
/* Area assignments */
.about-who { grid-area: who; }
.headshot { grid-area: headshot; }
.about-story { grid-area: story; }
.skills { grid-area: skills; }
.about-projects { grid-area: projects; }
.project--fd { grid-area: fd; }
.project--hh { grid-area: hh; }
.project--tamu { grid-area: tamu; }
.links { grid-area: links; }
@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr) clamp(280px, 22vw, 360px);
    grid-template-areas:
      "who      headshot"
      "story    skills"
      "projects fd"
      "projects hh"
      "projects tamu"
      "links    links";
    row-gap: 0.35rem; /* extra-tight vertical spacing for right column; left gets explicit margins */
    align-items: start;
  }
  .headshot {
    position: static;   /* non-sticky on About */
    top: auto;
    z-index: auto;
  }

  /* Ensure the links card spans full width under both columns on desktop */
  .links { grid-column: 1 / -1; }

  /* Restore generous spacing on left column only */
  .about-who,
  .about-story,
  .about-projects {
    margin-bottom: 1.25rem !important;
  }

  /* Increase spacing only between right-column project cards (raise specificity) */
  .about-grid > .project.project--fd {
    margin-top: 0 !important; /* flush with left Selected Projects */
  }
  .about-grid > .project.project--hh,
  .about-grid > .project.project--tamu {
    margin-top: 1.25rem !important; /* matches left column spacing */
  }
}

/* Left stack now has 3 independent cards */
.about-left { display: contents; }

/* Typography previously on .about-main now scoped to .about-left */
.about-left { color: var(--text); }
.about-left h2,
.about-left h3,
.skills h3 { color: var(--heading); }

.about-left h3::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 0.4rem;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.bullets { margin: 0.6rem 0 0.2rem; padding-left: 1.2rem; }
.projects { margin: 0.6rem 0 0.2rem; padding-left: 1.2rem; }

.badges { display: flex; flex-wrap: wrap; gap: .35rem .5rem; }
.badge { font: inherit; } /* badges.js applies category classes; visual styles come from portfolio.css */

@media (max-width: 899px) {
  /* Keep the headshot compact and readable */
  .headshot figure { max-width: clamp(180px, 42vw, 240px); }
  .headshot img {
    width: 100%;
    height: auto;        /* stop forcing tall crop */
    aspect-ratio: auto;  /* honor natural image ratio */
    object-fit: contain; /* show full portrait; avoids over-zoom */
    object-position: center;
    max-height: 52vh;    /* prevent image from dominating the page */
    background: var(--media-card-bg);
    border: 1px solid var(--border);
  }
}

/* Portrait framing */
.headshot figure { margin: 0 auto; } /* center; width governed by column */
.headshot img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;       /* fixed portrait frame */
  object-fit: cover;          /* crop to the frame */
  object-position: 50% 33%;   /* bias upward; adjust if needed */
  border-radius: var(--radius, 12px);
}
@media (min-width: 900px) {
  .headshot img {
    /* Make the portrait much smaller on desktop irrespective of column width */
    height: clamp(260px, 30vh, 340px);
    width: 100%;
    aspect-ratio: auto;          /* release strict 4:5 on desktop */
    object-fit: cover;
    object-position: 50% 33%;
    max-height: none;            /* keep explicit to document intent */
  }
}

/* Reduce padding around the headshot card on desktop so the image isn't constrained by large gutters */
@media (min-width: 900px) {
  .headshot.card,
  .card.headshot {
    padding: 0.75rem;
  }
}

.about-left p { font-size: 1rem; line-height: 1.7; }
.about-left ul { margin: 0.6rem 0 0.2rem 1.2rem; list-style: disc outside; }
.about-left li { margin: 0.35rem 0; }

.project .tile {
  display: grid;
  gap: .5rem;
  justify-items: center; /* center children (model + title) horizontally */
  color: inherit;
  text-decoration: none;
}
.project .tile h4 { text-align: center; } /* center the caption text */
.project model-viewer {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--media-card-bg);
  border: 1px solid var(--card-accent-bd);
  box-shadow: 0 0 0 1px var(--card-glow), 0 2px 8px rgba(0,0,0,0.08);
  border-radius: var(--radius, 12px);
}
/* Hover emphasis to match Portfolio media outline */
.project:hover model-viewer {
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 42%, white 58%), 0 2px 8px rgba(0,0,0,0.10);
}

.link-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.btn {
  display: inline-block;
  text-align: center;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius, 12px);
  text-decoration: none;
}

.btn.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--btn-text-on-primary);
}
.btn.btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Disable portfolio page reveal-on-scroll animation on About.
   Portfolio globally sets .card { opacity:0; transform:translateY(8px) }
   and toggles .is-visible via JS; About doesn't run that script. */
@media (prefers-reduced-motion: no-preference) {
  .about-grid .card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Ensure mobile overrides win in cascade (placed after default portrait rules) */
@media (max-width: 899px) {
  .about-grid .headshot figure { max-width: clamp(180px, 42vw, 240px); }
  .about-grid .headshot img {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
    max-height: 52vh;
    background: var(--media-card-bg);
    border: 1px solid var(--border);
  }
}
