/* Charlotte Larson Freeman — Personal site
   Warm, readable, professional. */

/* Animatable theme variables so only these colors transition when switching theme */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #faf8f5; }
@property --bg-alt { syntax: "<color>"; inherits: true; initial-value: #f0ebe3; }
@property --text { syntax: "<color>"; inherits: true; initial-value: #1a1816; }
@property --text-muted { syntax: "<color>"; inherits: true; initial-value: #5c5650; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #2d6a6a; }
@property --accent-hover { syntax: "<color>"; inherits: true; initial-value: #245454; }
@property --accent-soft { syntax: "<color>"; inherits: true; initial-value: rgba(45, 106, 106, 0.12); }
@property --border { syntax: "<color>"; inherits: true; initial-value: #e2ddd6; }
@property --header-bg { syntax: "<color>"; inherits: true; initial-value: rgba(250, 248, 245, 0.92); }

:root {
  --bg: #faf8f5;
  --bg-alt: #f0ebe3;
  --text: #1a1816;
  --text-muted: #5c5650;
  --accent: #2d6a6a;
  --accent-hover: #245454;
  --accent-soft: rgba(45, 106, 106, 0.12);
  --border: #e2ddd6;
  --header-bg: rgba(250, 248, 245, 0.92);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
  --space: 1.25rem;
  --space-sm: 0.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --max-width: 52rem;
  --radius: 0.5rem;
}

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

html {
  scroll-behavior: smooth;
  /* Only the theme variables transition; all elements using them fade correctly */
  transition: --bg 2s ease, --bg-alt 2s ease, --text 2s ease, --text-muted 2s ease,
    --accent 2s ease, --accent-hover 2s ease, --accent-soft 2s ease, --border 2s ease,
    --header-bg 2s ease;
}

#about,
#education,
#experience,
#projects,
#looking-for,
#contact {
  scroll-margin-top: 2rem;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* Remove default focus outline so only :focus-visible (keyboard) shows our custom ring */
:focus {
  outline: none;
}

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

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

a:focus-visible {
  text-decoration: underline;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link: for keyboard/screen reader users, visible on focus */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-lg);
  z-index: 1000;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: var(--space);
}
.skip-link-footer {
  left: 12rem;
}
.skip-link:focus-visible {
  outline: 3px solid var(--accent-hover);
  outline-offset: 2px;
}

/* Screen reader only: live region for "Copied!" */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  width: 0%;
  z-index: 11;
  transition: width 0.1s ease-out;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space) var(--space-lg);
  position: relative;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
}

.site-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space);
}

.nav-menu-trigger {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0.5em 0.25em;
  min-height: 44px;
  cursor: pointer;
  position: relative;
}

.nav-menu-trigger:hover {
  color: var(--accent);
}

.nav-menu-trigger::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav-menu-trigger:hover::after {
  width: 100%;
}

.nav-menu-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: auto;
  right: 0;
  width: max-content;
  min-width: 8rem;
  margin-top: 2px;
  padding: var(--space);
  background: rgba(250, 248, 245, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  flex-direction: column;
  gap: var(--space-sm);
}

.nav.is-open .nav-menu {
  display: flex;
}

.nav-menu a {
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4em 0;
  position: relative;
  padding-bottom: 0.4em;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav-menu a:hover {
  color: var(--text-muted);
  text-decoration: none;
}

.nav-menu a:hover::after {
  width: 100%;
}

.nav .nav-resume {
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.6em 1.25em;
  padding-bottom: 0.6em;
}

.nav .nav-resume:hover {
  color: var(--accent-hover);
}

.nav .nav-resume::after {
  display: none;
}

.nav .nav-resume:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

.nav .nav-resume {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.theme-toggle {
  font-size: 1.1rem;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-xl);
}

/* Hero */
.hero {
  padding: var(--space-xl) 0;
  text-align: center;
  position: relative;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(45, 106, 106, 0.06) 0%, transparent 55%);
  pointer-events: none;
}

.hero-portrait {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 14rem;
  height: auto;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.hero-pitch-lead {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 0.35em;
}

.hero-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  margin: 0 0 0.25em;
  color: var(--text);
  text-align: center;
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin: 0 0 0.25em;
}

.hero-location {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 1.25em;
}

.hero-pitch {
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  font-size: 1.1rem;
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space);
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6em 1.25em;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-secondary:hover {
  background: rgba(45, 106, 106, 0.2);
  color: var(--accent-hover);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

/* Sections */
.section {
  padding: var(--space-xl) 0;
}

.section-alt {
  background: var(--bg-alt);
  margin: 0 calc(-50vw + 50%);
  padding-left: max(var(--space-lg), 50vw - var(--max-width) / 2);
  padding-right: max(var(--space-lg), 50vw - var(--max-width) / 2);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 var(--space-lg);
  color: var(--text);
  position: relative;
  padding-bottom: 0.35em;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.5rem;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.section-intro {
  color: var(--text-muted);
  margin: -0.75rem 0 var(--space-lg);
}

/* About */
.about-grid {
  display: grid;
  gap: var(--space-lg);
}

.about-main {
  min-width: 0;
  overflow-x: hidden;
}

@media (min-width: 50em) {
  .about-grid {
    grid-template-columns: 1fr 18rem;
  }
}

.about-main .lead {
  margin: 0 0 0.75em;
  font-size: 1.05rem;
}

.about-bullets {
  margin: 0;
  padding-left: 1.25em;
  list-style: disc;
}

.about-bullets li {
  margin-bottom: 0.4em;
}

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

.about-callout {
  margin: 1.25em 0 0;
  margin-left: 0;
  margin-right: 0;
  padding: 0.75em 1em;
  border-left: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-muted);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
  overflow-x: hidden;
}

.about-details h3 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.5em;
}

.about-details ul {
  margin: 0 0 1.25em;
  padding-left: 1.25em;
}

.about-details ul:last-child {
  margin-bottom: 0;
}

.beyond-code {
  margin-top: 1.25em;
  padding: 1rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.beyond-code h3 {
  margin-top: 0;
}

.beyond-code ul {
  margin-bottom: 0;
}

.about-details li {
  margin-bottom: 0.35em;
}

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

.job {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  align-items: flex-start;
  background: var(--bg);
  padding: var(--space-lg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.job-content {
  flex: 1;
  min-width: 0;
}

.job-header {
  margin-bottom: 0.75em;
}

.job h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25em;
}

.job-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.job-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.job-desc-list {
  margin: 0.35em 0 0;
  padding-left: 1.25em;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.lead {
  font-size: 1rem;
  margin: 0 0 0.5em;
}

.job ul {
  margin: 0;
  padding-left: 1.25em;
}

.job li {
  margin-bottom: 0.4em;
}

.job-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space);
  max-width: 28rem;
  flex-shrink: 0;
}

.job-photos-single {
  grid-template-columns: 1fr;
  max-width: 12rem;
}

.job-photos-stack {
  grid-template-columns: 1fr;
  max-width: 12rem;
}

.job-stack-photos {
  align-items: center;
}

.job-photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.experience-note {
  margin: var(--space-lg) 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Projects */
.project-cards {
  display: grid;
  gap: var(--space-lg);
}

.project-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card-link {
  background: var(--bg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.project-preview-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.project-preview-link:hover {
  text-decoration: none;
}

.project-preview {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--border) 0%, var(--bg) 100%);
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.project-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-body {
  padding: var(--space-lg);
}

.project-card-body .lead {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 0.5em;
}

/* LinkedIn-style link preview: URL + description block */
.project-card-link .project-url {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5em;
  word-break: break-all;
}

.project-card-link .project-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 0.75em;
}

.project-card-link .project-bullets {
  display: none;
}

.project-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5em;
}

.project-card:not(.project-card-link):not(.project-card-muted) .project-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 0.75em;
}

.project-bullets {
  margin: 0 0 0.75em;
  padding-left: 1.25em;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.project-bullets li {
  margin-bottom: 0.25em;
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.35em;
}

.project-card-muted .project-card-body {
  padding: var(--space-lg);
}

.project-card-muted {
  opacity: 0.95;
}

.project-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5em;
}

.project-links a {
  font-weight: 500;
}

/* What I'm Looking For */
.ideal-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.ideal-list li {
  padding: 0.5em 0;
  border-bottom: 1px solid var(--border);
  padding-left: 0;
}

.ideal-list li:last-child {
  border-bottom: none;
}

.ideal-cta {
  font-style: italic;
  color: var(--text-muted);
  margin: 0;
}

/* Contact */
.contact-pitch {
  margin: 0 0 0.5em;
  color: var(--text-muted);
}

.contact-extra {
  margin: 0 0 var(--space);
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.contact-resume {
  margin: 0 0 var(--space);
}

.contact-resume .btn {
  display: inline-block;
}

.resume-updated {
  margin: -0.5em 0 var(--space) 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.contact-links a {
  font-weight: 500;
}

.contact-email-wrap {
  position: relative;
}

.contact-email-trigger {
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.contact-email-trigger:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.contact-email-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact-email-menu {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 8rem;
  z-index: 10;
  display: none;
}

.contact-email-menu.is-open {
  display: block;
}

.contact-email-menu li {
  margin: 0;
}

.contact-email-action {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.contact-email-action:hover {
  background: var(--border);
}

.contact-email-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.contact-phone-wrap {
  position: relative;
}

.contact-phone-trigger {
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.contact-phone-trigger:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.contact-phone-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact-phone-menu {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 8rem;
  z-index: 10;
  display: none;
}

.contact-phone-menu.is-open {
  display: block;
}

.contact-phone-menu li {
  margin: 0;
}

.contact-phone-action {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.contact-phone-action:hover {
  background: var(--border);
}

.contact-phone-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

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

/* Footer */
.site-footer {
  text-align: center;
  padding: var(--space-lg);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.footer-tagline {
  margin-top: 0.35em;
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.9;
}

/* Back to top: bottom-right, visible after scrolling past hero */
.back-to-top {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.back-to-top:hover {
  color: var(--bg);
  background: var(--accent-hover);
  text-decoration: none;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--bg);
  outline-offset: 2px;
}

.back-to-top {
  min-width: 44px;
  min-height: 44px;
}

/* Back to top tooltip on hover */
.back-to-top-tooltip {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--accent-hover);
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.25rem);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.back-to-top:hover .back-to-top-tooltip,
.back-to-top:focus-visible .back-to-top-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile: compact header and hero, constrained card images so layout fits one screen */
@media (max-width: 36em) {
  .nav {
    padding: var(--space-sm) var(--space);
  }

  .nav-bar {
    gap: var(--space-sm);
    min-width: 0;
  }

  .site-title {
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    max-width: 60%;
  }

  .nav-actions {
    flex-shrink: 0;
    gap: var(--space-sm);
  }

  .nav .nav-resume {
    padding: 0.5em 0.75em;
    font-size: 0.9375rem;
  }

  .nav-menu-trigger {
    padding: 0.5em 0.15em;
    font-size: 0.9375rem;
  }

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

  .hero {
    padding: var(--space) 0 var(--space-lg);
  }

  .hero-portrait {
    max-width: 10rem;
    margin-bottom: 1rem;
  }

  .hero-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .hero-tagline {
    font-size: 1.05rem;
  }

  .hero-location {
    margin-bottom: 0.75em;
  }

  .hero-pitch {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .hero-cta {
    gap: var(--space-sm);
  }

  .section {
    padding: var(--space-lg) 0;
  }

  .section-alt {
    padding-left: var(--space);
    padding-right: var(--space);
  }

  .job {
    padding: var(--space);
    gap: var(--space);
  }

  .job-photos,
  .job-photos-single,
  .job-photos-stack {
    max-width: 100%;
    width: 100%;
  }

  .job-photos img {
    max-height: 10rem;
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .job-photos-single img,
  .job-photos-stack img {
    max-height: 8rem;
  }
}

/* Reduced motion: disable animations and theme transition */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .scroll-progress {
    display: none;
  }
  .back-to-top {
    transition: none;
  }
  html {
    scroll-behavior: auto;
    transition: none;
  }
}

/* Print: hide nav, progress, back-to-top; simplify layout */
@media print {
  .scroll-progress,
  .site-header,
  .back-to-top,
  .nav-menu,
  .theme-toggle {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .section-alt {
    background: #f5f5f5;
  }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: var(--text-muted);
  }
}

/* Dark mode (manual toggle or system preference applied via JS) */
[data-theme="dark"] {
  --bg: #1a1816;
  --bg-alt: #252220;
  --text: #f5f3f0;
  --text-muted: #a8a29e;
  --accent: #5cb5b5;
  --accent-hover: #7ac5c5;
  --accent-soft: rgba(92, 181, 181, 0.18);
  --border: #3d3935;
  --header-bg: rgba(26, 24, 22, 0.92);
}

[data-theme="dark"] .theme-toggle {
  color: var(--text-muted);
}

[data-theme="dark"] .theme-toggle:hover {
  color: var(--accent);
}

/* Dark: links on alternating sections use lighter accent for WCAG AA (pair 5 was 2.4:1) */
[data-theme="dark"] .section-alt a {
  color: var(--accent-hover);
}
[data-theme="dark"] .section-alt a:hover {
  color: #8ecfcf;
}

/* Dark: primary button and back-to-top use dark text on accent for WCAG AA (pair 6: white on accent was 2.4:1) */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover {
  color: var(--bg);
}
[data-theme="dark"] .back-to-top,
[data-theme="dark"] .back-to-top:hover {
  color: var(--bg);
}

/* Reduced motion: disable animation */
@media (prefers-reduced-motion: reduce) {
  .back-to-top-tooltip {
    transition: none;
  }
}
