/* ---------------------------------------------------
   Talia R. Bout — Personal Site
   Editorial / consulting-style design system
   --------------------------------------------------- */

:root {
  --bg: #f7f5ee;
  --bg-alt: #efece1;
  --surface: #ffffff;
  --text: #14201b;
  --text-muted: #4b5751;
  --text-faint: #656d66;
  --border: rgba(20, 32, 27, 0.12);
  --border-strong: rgba(20, 32, 27, 0.24);
  --link: #1f6f5c;
  --link-hover: #17513f;
  --navy: #24344f;
  --accent: #8f5a15;
  --accent-soft: rgba(143, 90, 21, 0.12);
  --badge-bg: rgba(31, 111, 92, 0.1);
  --shadow: 0 1px 2px rgba(20, 32, 27, 0.05), 0 8px 24px -12px rgba(20, 32, 27, 0.14);
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --header-h: 72px;
  --max-w: 880px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1210;
  --bg-alt: #141a17;
  --surface: #182019;
  --text: #ede8e0;
  --text-muted: #adb6ad;
  --text-faint: #8a938b;
  --border: rgba(237, 232, 224, 0.1);
  --border-strong: rgba(237, 232, 224, 0.2);
  --link: #57b79a;
  --link-hover: #7fcbb2;
  --navy: #93a8d6;
  --accent: #e0a94e;
  --accent-soft: rgba(224, 169, 78, 0.14);
  --badge-bg: rgba(87, 183, 154, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 28px -12px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1210;
    --bg-alt: #141a17;
    --surface: #182019;
    --text: #ede8e0;
    --text-muted: #adb6ad;
    --text-faint: #8a938b;
    --border: rgba(237, 232, 224, 0.1);
    --border-strong: rgba(237, 232, 224, 0.2);
    --link: #57b79a;
    --link-hover: #7fcbb2;
    --navy: #93a8d6;
    --accent: #e0a94e;
    --accent-soft: rgba(224, 169, 78, 0.14);
    --badge-bg: rgba(87, 183, 154, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 28px -12px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

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

a { color: var(--link); text-decoration-color: rgba(16, 59, 74, 0.35); text-underline-offset: 3px; }
:root[data-theme="dark"] a { text-decoration-color: rgba(143, 196, 201, 0.4); }
a:hover { color: var(--link-hover); }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

.prose { max-width: var(--max-w); }
.prose p { color: var(--text-muted); margin: 0 0 18px; font-size: 1.03rem; }
.prose a { font-weight: 500; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--text); opacity: 0.75; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  padding: 8px 13px;
  border-radius: 7px;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--text); background: var(--bg-alt); }
.main-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--badge-bg);
}

.header-actions { display: flex; align-items: center; gap: 6px; }

.theme-toggle {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Page header (non-home pages) ---------- */

.page-hero {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.page-kicker {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--link);
  margin: 0 0 12px;
}
.page-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 4.2vw, 3rem);
  line-height: 1.1;
  margin: 0 0 18px;
  color: var(--text);
}
.page-intro {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 720px;
  line-height: 1.7;
  margin: 0;
}

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

.home-hero { padding: 68px 0 56px; }
.home-hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  align-items: start;
}
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--link);
  margin: 0 0 16px;
}
.home-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 5.4vw, 4rem);
  line-height: 1.04;
  margin: 0 0 24px;
  color: var(--text);
}
.home-hero .prose p { font-size: 1.08rem; line-height: 1.75; }

.quote {
  margin: 22px 0 28px;
  padding-left: 18px;
  border-left: 3px solid var(--link);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
  color: var(--text);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.pillar { background: var(--surface); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.pillar h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0; }
.pillar p { color: var(--text-muted); font-size: 0.92rem; margin: 0; line-height: 1.55; }
@media (max-width: 620px) { .pillars { grid-template-columns: 1fr; } }

.section-title { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 36px; }

.seeking {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin: 26px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
}
.seeking-label {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.seeking p { margin: 0; color: var(--text); font-size: 0.96rem; line-height: 1.55; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.stat { background: var(--surface); padding: 26px 24px; display: flex; flex-direction: column; gap: 10px; }
.stat-num {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 3.4vw, 2.7rem);
  font-weight: 600;
  line-height: 1;
  color: var(--link);
  font-variant-numeric: tabular-nums;
}
.stat-what { color: var(--text); font-size: 0.93rem; line-height: 1.5; }
.stat-src {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.section-link { margin: 22px 0 0; font-weight: 600; font-size: 0.95rem; }

.outside {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: baseline;
  max-width: 760px;
}
.outside .section-label { margin: 0; }
.outside-text { margin: 0; color: var(--text-muted); font-size: 1.02rem; }

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .outside { grid-template-columns: 1fr; gap: 8px; }
  .seeking { flex-direction: column; gap: 6px; }
}

.photo-frame {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(150deg, var(--bg-alt), var(--surface));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.quick-facts-row {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}
.quick-facts-row-2 { grid-template-columns: 1.4fr 1fr; max-width: 620px; }
.qf-label {
  display: block;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 6px;
}
.qf-value { color: var(--text); font-size: 0.95rem; font-weight: 500; line-height: 1.5; }

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.01em;
  font-size: 0.86rem;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--text-faint); }
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
:root[data-theme="dark"] .btn-primary { color: var(--bg); }
.btn-primary:hover { opacity: 0.88; background: var(--text); }

/* ---------- Section shared ---------- */

.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--link);
  margin: 0 0 10px;
}

/* ---------- Case study cards ---------- */

.case-study {
  padding: 40px 0;
}
.case-study + .case-study { border-top: 1px solid var(--border); }
.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 20px;
  margin-bottom: 4px;
}
.case-role {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.case-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--navy);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.case-org {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.96rem;
  margin: 0 0 18px;
}
.case-body p { color: var(--text-muted); margin: 0 0 16px; line-height: 1.75; }
.case-highlights {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 11px;
}
.case-highlights li {
  position: relative;
  padding-left: 22px;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.98rem;
}
.case-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--badge-bg);
  color: var(--link);
  padding: 4px 9px;
  border-radius: 3px;
  margin-left: 10px;
  vertical-align: middle;
}
:root[data-theme="dark"] .badge { color: var(--link); }

/* ---------- Project cards ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
}
.proj-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 9px;
  border-radius: 3px;
}
.proj-card h3 {
  font-family: var(--font-serif);
  font-size: 1.14rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.proj-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--link);
}
.proj-card .proj-desc { color: var(--text-muted); font-size: 0.94rem; line-height: 1.65; margin: 0; }
.proj-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.proj-skills span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 3px;
}
.proj-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.proj-card .proj-link { font-size: 0.86rem; font-weight: 600; }


@media (max-width: 820px) {
  .project-grid { grid-template-columns: 1fr; }
}

/* ---------- Additional involvement list ---------- */

.involvement-list {
  display: grid;
  gap: 22px;
  margin-top: 8px;
}
.involvement-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.involvement-item:first-child { border-top: none; }
.inv-org { font-weight: 600; color: var(--text); font-size: 0.98rem; }
.inv-role { color: var(--text-faint); font-size: 0.85rem; margin-top: 3px; }
.inv-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin: 0; }

/* ---------- Coursework / skills chips ---------- */

.chip-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.chip {
  padding: 7px 13px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--text-muted);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.fact-block { margin-bottom: 36px; }
.fact-block:last-child { margin-bottom: 0; }
.fact-block h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}
.fact-block .fact-sub { color: var(--text-faint); font-size: 0.88rem; margin: 0 0 14px; }
.fact-line { color: var(--text-muted); margin: 0 0 6px; }
.fact-line-faint { color: var(--text-faint); margin: 0; }

/* ---------- Certifications ---------- */

.cert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cert-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.94rem;
  color: var(--text);
  font-weight: 500;
}
.cert-list li svg { flex-shrink: 0; width: 18px; height: 18px; color: var(--accent); }

/* ---------- Resume page ---------- */

.resume-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 32px;
}
.resume-embed {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
  height: 82vh;
  min-height: 520px;
}
.resume-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.contact-card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: block;
}
.contact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.contact-card .cc-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 8px;
}
.contact-card .cc-value { color: var(--text); font-weight: 600; font-size: 1.02rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.footer-inner a { color: var(--text-faint); }

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .home-hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .photo-frame { max-width: 320px; aspect-ratio: 1 / 1; }
  .two-col { grid-template-columns: 1fr; gap: 8px; }
  .quick-facts-row { grid-template-columns: 1fr 1fr; }
  .involvement-item { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 720px) {
  .resume-embed-section { display: none; }
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 20px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .main-nav.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav a { padding: 13px 4px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav-toggle { display: flex; }
  .quick-facts-row { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .page-hero { padding: 44px 0 32px; }
}
