/* ==========================================================================
   Chris Vaughan — CV
   Minimal editorial single page. Serif throughout. Scrolls backwards in time,
   with a light parallax on the year markers.
   Palette: #35627A primary, #E5AEA9 #A6A9D0 #B46258 #8E9A98 accents,
   #F5F5F5 ground.
   ========================================================================== */

:root {
  --bg:          #F5F5F5;
  --ink:         #1B262C;
  --ink-soft:    #5E6E75;
  --primary:     #35627A;
  --rule:        #DCDEDD;
  --accent:      #35627A;          /* overridden per section */

  --serif: "Fraunces", Georgia, "Times New Roman", serif;

  --gutter: clamp(1.5rem, 6vw, 5rem);
  --content: 44rem;
  --measure: 38rem;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(1.05rem, 0.96rem + 0.42vw, 1.22rem);
  line-height: 1.72;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-weight: 400; margin: 0; }

a { color: var(--primary); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

::selection { background: #35627A; color: #F5F5F5; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--primary); color: #fff; padding: .7rem 1.1rem;
  font-size: .85rem; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

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

/* --------------------------------------------------------------------------
   Scroll progress (left edge)
   -------------------------------------------------------------------------- */

.progress {
  position: fixed; inset: 0 auto 0 0;
  width: 2px; height: 100vh;
  background: var(--rule);
  z-index: 60;
}
.progress__bar {
  display: block; width: 100%; height: 100%;
  background: var(--primary);
  transform: scaleY(0);
  transform-origin: top;
}

/* --------------------------------------------------------------------------
   Fixed top bar (fades in after the hero)
   -------------------------------------------------------------------------- */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.15rem var(--gutter);
  font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(var(--bg) 55%, rgba(245,245,245,0));
  opacity: 0; pointer-events: none;
  transition: opacity .45s ease;
}
.topbar.is-visible { opacity: 1; }
.topbar__era { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.topbar__arrow { color: var(--primary); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 11vh var(--gutter) 10vh;
}
.hero__inner { width: 100%; max-width: var(--content); margin: 0 auto; }

.hero__kicker,
.era__range {
  font-size: .78rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.6rem;
  display: flex; align-items: center; gap: .85rem;
}
.hero__kicker { color: var(--primary); }
.hero__kicker::before,
.era__range::before {
  content: ""; width: 1.7rem; height: 1px;
  background: currentColor; flex: none;
}

.hero__name {
  font-size: clamp(3.1rem, 1.6rem + 8vw, 8.5rem);
  font-weight: 330;
  line-height: 0.96;
  letter-spacing: -0.025em;
  color: var(--primary);
  margin: 0 0 .5em;
}

.hero__pitch {
  font-size: clamp(1.35rem, 1rem + 1.7vw, 2.3rem);
  font-weight: 350;
  line-height: 1.34;
  letter-spacing: -0.01em;
  max-width: 22ch;
  margin: 0 0 1.4em;
}

.hero__note {
  max-width: 42ch;
  color: var(--ink-soft);
  margin: 0;
}

.hero__recommendations {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 1.2rem;
  padding: 0.7rem 1rem;
  border: 1px solid #E5AEA9;
  border-radius: 999px;
  background: #E5AEA9;
  color: #1B262C;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .2s ease, filter .2s ease;
}
.hero__recommendations:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.spectrum { display: flex; gap: 6px; margin: 2.6rem 0 0; }
.spectrum span { width: clamp(28px, 7vw, 48px); height: 6px; border-radius: 3px; }
.spectrum span:nth-child(1) { background: #35627A; }
.spectrum span:nth-child(2) { background: #A6A9D0; }
.spectrum span:nth-child(3) { background: #E5AEA9; }
.spectrum span:nth-child(4) { background: #B46258; }
.spectrum span:nth-child(5) { background: #8E9A98; }

.hero__cue {
  display: inline-flex; align-items: center; gap: 1rem;
  margin-top: 2.6rem;
  font-size: .8rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none;
}
.hero__cue-line {
  width: 3.5rem; height: 1px; background: currentColor; position: relative;
}
.hero__cue-line::after {
  content: ""; position: absolute; right: 0; top: -3px;
  width: 7px; height: 7px; border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor; transform: rotate(45deg);
}
.hero__cue:hover { color: var(--primary); }

/* --------------------------------------------------------------------------
   Era sections
   -------------------------------------------------------------------------- */

.era {
  position: relative;
  padding-block: clamp(15vh, 9rem + 10vw, 26vh);
  overflow: clip;
}
.era::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(var(--content), calc(100vw - 2 * var(--gutter)));
  height: 1px; background: var(--rule);
}
.era:first-of-type::before { display: none; }

.era__bg {
  position: absolute; top: 50%; left: 50%;
  transform: translate3d(-50%, -50%, 0);
  font-size: clamp(8rem, 28vw, 24rem);
  font-weight: 300; line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
  opacity: .22;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.era__inner {
  position: relative; z-index: 1;
  max-width: var(--content); margin: 0 auto;
  padding-inline: var(--gutter);
}

.era__range { margin-bottom: 1.5rem; }

.era__role {
  font-size: clamp(1.9rem, 1.2rem + 3vw, 3.4rem);
  font-weight: 370;
  line-height: 1.08;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0 0 .18em;
}

.era__org {
  font-style: italic;
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  color: var(--ink-soft);
  margin: 0 0 1.9rem;
}

.era__body { max-width: var(--measure); }
.era__body p { margin: 0; }
.era__body p + p { margin-top: 1.1em; }

.era__tags {
  list-style: none; padding: 0;
  margin: 2.1rem 0 0;
  max-width: var(--measure);
  font-size: .76rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 2.1;
}
.era__tags li { display: inline; }
.era__tags li:not(:last-child)::after {
  content: "·"; margin: 0 .7em; color: var(--accent); font-weight: 600;
}

.era__subhead {
  font-size: .78rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
  margin: 1.8rem 0 1.1rem;
}

.era__achievements {
  list-style: none; padding: 0 0 0 1.8rem;
  margin: 0;
  max-width: var(--measure);
  font-size: .98rem; line-height: 1.65;
}
.era__achievements li {
  margin: 0 0 .8rem;
  position: relative;
}
.era__achievements li::before {
  content: "•"; position: absolute; left: -1.2rem;
  color: var(--accent); font-weight: 600;
}

.era--quiet .era__role { color: var(--primary); margin-bottom: .9rem; }

/* Foundations */
.foundations {
  display: grid; gap: 1.6rem 3rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  max-width: var(--measure);
  margin: 1.8rem 0 2.6rem;
}
.foundation__degree { font-style: italic; font-size: 1.15rem; margin: 0; }
.foundation__place { color: var(--ink-soft); margin: 0; font-size: .95rem; }

.foundation__degree + .foundation__place,
.foundation p + p,
.constants__list .foundation p + p {
  margin-top: 0;
}

.constants__list .foundation p {
  margin: 0;
}

/* Constants */
.constants {
  display: grid; gap: 2.6rem 3rem;
  grid-template-columns: 1fr;
  margin-top: 2rem;
}
.constants__head {
  font-size: .78rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
.constants__list { list-style: none; padding: 0; margin: 0; }
.constants__list li {
  padding: .7rem 0;
  border-top: 1px solid var(--rule);
  font-size: .98rem; line-height: 1.55;
}
.constants__list li:last-child { border-bottom: 1px solid var(--rule); }

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

.contact {
  padding: clamp(16vh, 12rem, 30vh) var(--gutter) clamp(10vh, 8rem, 16vh);
  border-top: 1px solid var(--rule);
}
.contact__inner { max-width: var(--content); margin: 0 auto; }
.contact__head {
  font-size: clamp(2.4rem, 1.4rem + 4vw, 4.4rem);
  font-weight: 340; letter-spacing: -0.02em;
  color: var(--primary);
  margin: 0 0 .5em;
}
.contact__body { max-width: 40ch; color: var(--ink-soft); margin: 0; }

.contact__links {
  display: flex; flex-wrap: wrap; gap: .9rem;
  margin-top: 2.6rem;
}
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .8em 1.35em;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: var(--primary);
  font-family: inherit;
  font-size: .92rem; letter-spacing: .02em;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease;
}
.btn span { color: inherit; opacity: .6; }
.btn:hover { background: var(--primary); color: var(--bg); }
.btn--solid { background: var(--primary); color: var(--bg); }
.btn--solid:hover { background: #2a5165; }

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

.foot {
  padding: 2.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--rule);
  font-size: .82rem;
  color: var(--ink-soft);
}
.foot__inner {
  max-width: var(--content); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: .4rem 2rem; justify-content: space-between;
}
.foot a { color: var(--ink-soft); }
.foot a:hover { color: var(--primary); }

/* --------------------------------------------------------------------------
   Narrow screens
   -------------------------------------------------------------------------- */

@media (max-width: 40rem) {
  .hero__pitch { max-width: none; }
  .era__tags { line-height: 1.9; }
  .foot__inner { flex-direction: column; gap: .5rem; }
  .topbar__name { max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* --------------------------------------------------------------------------
   Reveal on scroll (only when JS is on)
   -------------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.4s cubic-bezier(.18,.7,.12,1), transform 1.4s cubic-bezier(.18,.7,.12,1);
}
.js [data-reveal].in { opacity: 1; transform: none; }

/* Hero: a one-off entrance on load rather than a scroll reveal */
@keyframes cv-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.js .hero__inner > * { animation: cv-rise 1.4s cubic-bezier(.18,.7,.12,1) both; }
.js .hero__inner > :nth-child(2) { animation-delay: .12s; }
.js .hero__inner > :nth-child(3) { animation-delay: .24s; }
.js .hero__inner > :nth-child(4) { animation-delay: .36s; }
.js .hero__inner > :nth-child(5) { animation-delay: .48s; }
.js .hero__inner > :nth-child(6) { animation-delay: .60s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .js .hero__inner > * { animation: none; }
  .era__bg { display: none; }
  .progress { display: none; }
}

/* --------------------------------------------------------------------------
   Print — a clean fallback CV
   -------------------------------------------------------------------------- */

@media print {
  .progress, .topbar, .hero__cue, .spectrum, .era__bg { display: none !important; }
  body { font-size: 11pt; line-height: 1.5; color: #000; background: #fff; }
  .hero { min-height: 0; padding: 0 0 1.5rem; }
  .hero__name { color: #000; font-size: 26pt; }
  .hero__pitch { font-size: 13pt; }
  .era { padding-block: 1.2rem; overflow: visible; }
  .era::before { position: static; transform: none; width: 100%; }
  .era__inner, .hero__inner, .contact__inner, .foot__inner { padding-inline: 0; max-width: none; }
  .era__role, .contact__head, .era--quiet .era__role { color: #000; }
  a { color: #000; text-decoration: underline; }
}
