/* Emma Dawson — personal brand site
   Six colours only. Garnet leads, bone breathes.
   Fraunces for headings, Archivo for body (fallbacks Cambria / Calibri). */

:root {
  --garnet: #5A1312;
  --scarlet: #A11F1E;
  --clay: #B65A45;
  --camel: #CBA17E;
  --bone: #F4EEE6;
  --espresso: #271814;

  /* tints of the six, not new colours */
  --bone-soft: #EEE3D7; /* bone with a touch of camel */
  --line: rgba(39, 24, 20, 0.14);
  --muted: rgba(39, 24, 20, 0.72);

  --serif: "Fraunces", Cambria, Georgia, serif;
  --sans: "Archivo", Calibri, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(3.5rem, 8vw, 6.5rem);
  --radius: 4px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--espresso);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--garnet); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--scarlet); }

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

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--garnet);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  font-variation-settings: "opsz" 144;
}
h1 { font-size: clamp(2.8rem, 1.6rem + 6vw, 6.4rem); font-weight: 350; }
h2 { font-size: clamp(1.8rem, 1.3rem + 2.2vw, 3rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem); line-height: 1.2; }

p { margin: 0 0 1.1rem; max-width: 62ch; }
p:last-child { margin-bottom: 0; }

.lede {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.45;
  font-weight: 350;
  color: var(--espresso);
}

.serif-italic { font-family: var(--serif); font-style: italic; }

.eyebrow, .tagline, .group-label {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--scarlet);
  margin: 0 0 1rem;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

section { padding: var(--section) 0; }

.rule { border: 0; height: 1px; background: var(--line); margin: 0 auto; max-width: calc(var(--wrap) - 2 * var(--pad)); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.split.flip { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); }
.split.flip > :first-child { order: 2; }
.split.flip > :last-child { order: 1; }

.section-head h2 { max-width: 16ch; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 238, 230, 0.94);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 1.5rem; }

.wordmark {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 450;
  color: var(--garnet);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wordmark:hover { color: var(--garnet); }
.wordmark .dot { color: var(--scarlet); }

.nav { display: flex; gap: clamp(1rem, 2vw, 1.9rem); align-items: center; }
.nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--espresso);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--garnet); border-bottom-color: var(--camel); }
.nav a[aria-current="page"] { color: var(--garnet); border-bottom-color: var(--scarlet); }

.nav-toggle {
  display: none;
  background: none; border: 0; padding: 10px; margin-right: -10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block; width: 24px; height: 1.5px; background: var(--garnet);
  margin: 5px 0; transition: transform 0.25s ease, opacity 0.2s 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); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(4rem, 10vw, 8rem); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
}
.hero h1 { margin-bottom: 0; }
.hero .lede { margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans);
  font-size: 0.92rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.95rem 1.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--garnet);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--garnet); color: var(--bone); }
.btn-primary:hover { background: var(--scarlet); border-color: var(--scarlet); color: var(--bone); }
.btn-ghost { background: transparent; color: var(--garnet); }
.btn-ghost:hover { background: var(--garnet); color: var(--bone); }

/* ---------- Pillars / cards ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.pillar { background: var(--bone); padding: clamp(1.6rem, 3vw, 2.4rem); }
.pillar .num {
  display: block;
  font-family: var(--serif); font-style: italic;
  font-size: 1rem; color: var(--scarlet);
  margin-bottom: 1.2rem;
}
.pillars + .btn-row { margin-top: 2.4rem; }

/* ---------- Panel (garnet call-out) ---------- */
.panel {
  background: var(--garnet);
  color: var(--bone);
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: var(--radius);
}
.panel h2, .panel h3 { color: var(--bone); }
.panel .lede { color: rgba(244, 238, 230, 0.88); }
.panel p { color: rgba(244, 238, 230, 0.88); }
.panel a:not(.btn) { color: var(--bone); }
.panel .btn-ghost { color: var(--bone); border-color: rgba(244, 238, 230, 0.6); }
.panel .btn-ghost:hover { background: var(--bone); color: var(--garnet); border-color: var(--bone); }
.panel .btn-primary:hover { background: var(--camel) !important; border-color: var(--camel); color: var(--espresso) !important; }

/* ---------- Timeline (experience + journal) ---------- */
.group-label { margin-top: clamp(2.5rem, 5vw, 4rem); padding-bottom: 0.8rem; border-bottom: 1px solid var(--garnet); }
.group-label:first-child { margin-top: 0; }

.timeline { display: grid; }
.entry {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}
.entry .yr {
  font-family: var(--serif); font-style: italic;
  color: var(--clay); font-size: 1.05rem; padding-top: 0.15rem;
}
.entry h3 { margin-bottom: 0.3rem; }
.entry .place {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.6rem;
}

/* ---------- Qualifications ---------- */
.quals { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.quals li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.85rem 0; border-bottom: 1px solid var(--line);
}
.quals .y { font-family: var(--serif); font-style: italic; color: var(--clay); white-space: nowrap; }

.chips { list-style: none; margin: 0.8rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li {
  font-size: 0.85rem; padding: 0.4rem 0.85rem;
  border: 1px solid var(--camel); border-radius: 999px; color: var(--espresso);
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 6vw, 5rem); }
.detail { padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.detail:first-child { border-top: 1px solid var(--line); }
.detail .k {
  display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem;
}
.detail a { font-family: var(--serif); font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem); text-decoration: none; }
.detail a:hover { text-decoration: underline; }

.social-row { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; margin-top: 0.7rem; }
.social-row a { font-weight: 500; }

/* ---------- Footer ---------- */
footer {
  background: var(--espresso);
  color: var(--bone);
  padding: clamp(3rem, 6vw, 4.5rem) 0 2rem;
}
footer > .wrap:first-child {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
}
footer .wordmark { color: var(--bone); }
footer .wordmark .dot { color: var(--camel); }
.fnav { display: flex; flex-direction: column; gap: 0.45rem; }
.fnav a { color: rgba(244, 238, 230, 0.8); text-decoration: none; font-size: 0.92rem; }
.fnav a:hover { color: var(--camel); }
footer small { color: rgba(244, 238, 230, 0.55); font-size: 0.8rem; }

/* ---------- Reveal (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.8s ease, transform 0.8s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: 0.1s; }
.js .reveal.d2 { transition-delay: 0.2s; }
.js .reveal.d3 { transition-delay: 0.3s; }

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

/* ---------- Tablet / phone ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bone);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--pad) 1.2rem;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { font-size: 1.05rem; padding: 0.75rem 0; width: 100%; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .nav a[aria-current="page"] { border-bottom-color: var(--line); color: var(--scarlet); }

  .split, .split.flip, .hero-grid, .contact-grid { grid-template-columns: 1fr; }
  .split.flip > :first-child { order: 1; }
  .split.flip > :last-child { order: 0; }
  .pillars, .pillars[style] { grid-template-columns: 1fr !important; }
  footer > .wrap:first-child { grid-template-columns: 1fr 1fr; }
  footer > .wrap:first-child > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .entry { grid-template-columns: 1fr; gap: 0.4rem; }
  .btn { width: 100%; }
  .quals li { flex-direction: column; gap: 0.1rem; }
}

/* ---------- Journal post ---------- */
.post { max-width: 760px; }
.post h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); margin: 2.8rem 0 1rem; }
.post p { max-width: none; }
.post .lede { margin-bottom: 2rem; }
.entry h3 a { color: var(--garnet); }
.entry h3 a:hover { color: var(--scarlet); }
