/* ---------------------------------------------------------------
   Tokens
   --------------------------------------------------------------- */
:root {
  --blue: #2236c4;        /* ultramarine: the one strong color */
  --blue-deep: #1a2a9c;   /* pressed / hover */
  --tint: #dfe4ff;        /* blue-tinted white for text on blue */
  --paper: #f5f6f8;       /* cool off-white page */
  --surface: #ffffff;
  --ink: #171a22;
  --muted: #5b6071;
  --rule: #d8dbe3;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  /* type scale (perfect fourth, 1.333) */
  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.5rem;
  --step-2: 2rem;
  --step-3: clamp(2.125rem, 3.6vw, 2.75rem);

  --pad: clamp(1rem, 4vw, 3.5rem);
  --max: 76rem;
  --gap: clamp(2rem, 5vw, 4.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 600; line-height: 1.1; }
p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}
.hero :focus-visible,
.contact :focus-visible { outline-color: #fff; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: #fff;
  font-family: var(--display);
  text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------------------------------------------------------------
   Buttons & links
   --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--light { background: #fff; color: var(--blue); }
.btn--light:hover { background: var(--tint); }

.btn--blue { background: var(--blue); color: #fff; }
.btn--blue:hover { background: var(--blue-deep); }

.btn--sm { padding: 0.55rem 1.1rem; font-size: 0.9rem; }

/* underline that draws in from the left */
.textlink {
  position: relative;
  font-family: var(--display);
  font-weight: 500;
  text-decoration: none;
  padding-block: 0.2rem;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0% 1.5px no-repeat;
  transition: background-size 0.4s var(--ease);
}
.textlink:hover { background-size: 100% 1.5px; }
.textlink--light { color: #fff; }

/* ---------------------------------------------------------------
   Compact bar (appears after the hero)
   --------------------------------------------------------------- */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.7rem var(--pad);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-105%);
  transition: transform 0.5s var(--ease);
}
.bar.is-visible { transform: translateY(0); }

.bar__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.bar__nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  font-family: var(--display);
  font-size: 0.95rem;
}
.bar__nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.bar__nav a:hover,
.bar__nav a.is-active { color: var(--blue); }

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  min-height: 100vh;
  min-height: 100svh;
  background: var(--paper);
}

.hero__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--pad) clamp(2.5rem, 6vw, 5rem);
  background: var(--blue);
  color: #fff;
  animation: panel-in 1.1s var(--ease) both;
}

.hero__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--display);
  font-size: 0.95rem;
  animation: fade 0.8s var(--ease) 0.9s both;
}
.hero__place { color: var(--tint); }
.hero__links { display: flex; gap: 1.5rem; }
.hero__links a { text-decoration: none; opacity: 0.85; transition: opacity 0.2s; }
.hero__links a:hover { opacity: 1; }

.hero__body {
  margin-top: auto;
  padding-top: clamp(3rem, 8vh, 6rem);
  max-width: 40rem;
}

.hero__name {
  font-size: clamp(4.25rem, 11.5vw, 10.5rem);
  font-weight: 650;
  font-stretch: 85%;
  font-variation-settings: "opsz" 36;
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin-left: -0.04em;
}
.hero__name .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;  /* keep descenders from clipping */
}
.hero__name .line > span {
  display: inline-block;
  animation: rise 1.1s var(--ease) both;
}
.hero__name .line:nth-child(1) > span { animation-delay: 0.35s; }
.hero__name .line:nth-child(2) > span { animation-delay: 0.47s; }

.hero__role {
  margin-top: 1.75rem;
  font-family: var(--display);
  font-size: clamp(1.125rem, 1.7vw, 1.35rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--tint);
  max-width: 30ch;
  animation: lift 0.9s var(--ease) 0.75s both;
}

.hero__lede {
  margin-top: 1.25rem;
  font-size: clamp(1.0625rem, 1.3vw, 1.1875rem);
  line-height: 1.6;
  max-width: 34rem;
  color: rgb(255 255 255 / 0.9);
  animation: lift 0.9s var(--ease) 0.85s both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
  margin-top: 2.25rem;
  animation: lift 0.9s var(--ease) 0.95s both;
}

.hero__photo {
  position: relative;
  overflow: hidden;
  background: #c9c4a8;
  animation: unveil 1.3s var(--ease) 0.15s both;
}
.hero__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  animation: settle 2.2s var(--ease) 0.15s both;
}

@keyframes panel-in {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes unveil {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes settle {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}
@keyframes rise {
  from { transform: translateY(105%); }
  to   { transform: translateY(0); }
}
@keyframes lift {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------------------------------------------------------------
   Shared section layout
   --------------------------------------------------------------- */
.section-title {
  font-size: var(--step-3);
  font-weight: 600;
  font-stretch: 90%;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.intro,
.experience,
.skills {
  padding-block: clamp(4.5rem, 10vw, 8.5rem);
}

/* two-column split shared by intro, timeline and skills */
.intro__grid,
.skills__grid,
.org {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr);
  column-gap: var(--gap);
}

/* ---------------------------------------------------------------
   Intro / strengths
   --------------------------------------------------------------- */
.intro .section-title {
  position: sticky;
  top: 6rem;
  align-self: start;
}

.intro__lead {
  font-size: clamp(1.375rem, 2.3vw, 1.875rem);
  line-height: 1.42;
  letter-spacing: -0.005em;
  max-width: 36ch;
}

.strengths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3rem) var(--gap);
  margin-top: clamp(2.5rem, 5vw, 3.75rem);
}
.strength h3 {
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.015em;
  padding-left: 0.9rem;
  border-left: 3px solid var(--blue);
}
.strength p {
  margin-top: 0.75rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 40ch;
}

/* ---------------------------------------------------------------
   Experience timeline
   --------------------------------------------------------------- */
.experience {
  background: var(--surface);
  border-block: 1px solid var(--rule);
}

.timeline {
  --split: calc((100% - var(--gap)) * (1 / 3.1) + var(--gap) / 2);
  position: relative;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.timeline__track {
  position: absolute;
  top: 0.5rem;
  bottom: 0;
  left: var(--split);
  width: 2px;
  margin-left: -1px;
  background: var(--rule);
}
.timeline__fill {
  position: absolute;
  inset: 0;
  background: var(--blue);
  transform-origin: top;
  transform: scaleY(var(--progress, 0));
}

.org + .org { margin-top: clamp(3.5rem, 7vw, 5.5rem); }

.org__head {
  position: sticky;
  top: 6rem;
  align-self: start;
}
.org__name {
  font-size: var(--step-2);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.org__span {
  margin-top: 0.6rem;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.org__body { position: relative; }

/* marker that sits on the track and fills as the line reaches it */
.org__body::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: calc(var(--gap) / -2 - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--rule);
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.org__body.is-reached::before {
  background: var(--blue);
  border-color: var(--blue);
}

.org__summary {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  max-width: 54ch;
}

.titles {
  margin-top: 1.75rem;
  max-width: 34rem;
  border-top: 1px solid var(--rule);
}
.titles li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--display);
  font-size: 1rem;
}
.titles li span:first-child { font-weight: 500; }
.titles li span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   Skills
   --------------------------------------------------------------- */
.skills__groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.25rem, 4vw, 3.25rem) var(--gap);
}
.skillset h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: -0.005em;
}
.skillset ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.skillset li {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--display);
  font-size: 0.95rem;
  line-height: 1.4;
  transition: border-color 0.2s, color 0.2s;
}
.skillset li:hover { border-color: var(--blue); color: var(--blue); }
.skillset p {
  margin-top: 1rem;
  line-height: 1.5;
}
.skillset p span { color: var(--muted); }

/* ---------------------------------------------------------------
   Contact
   --------------------------------------------------------------- */
.contact {
  background: var(--blue);
  color: #fff;
}
.contact__inner {
  padding-block: clamp(5rem, 12vw, 9.5rem) clamp(4rem, 9vw, 7rem);
}
.contact__title {
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 650;
  font-stretch: 85%;
  font-variation-settings: "opsz" 36;
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.contact__email {
  display: inline-block;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  font-family: var(--display);
  font-size: clamp(1.5rem, 4.2vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow-wrap: anywhere;
  padding-bottom: 0.2rem;
  background: linear-gradient(#fff, #fff) 0 100% / 100% 2px no-repeat,
              linear-gradient(rgb(255 255 255 / 0.3), rgb(255 255 255 / 0.3)) 0 100% / 100% 2px no-repeat;
  background-size: 0% 2px, 100% 2px;
  transition: background-size 0.6s var(--ease);
}
.contact__email:hover { background-size: 100% 2px, 100% 2px; }

.contact__alt {
  margin-top: 1.75rem;
  font-family: var(--display);
  font-size: 1rem;
  color: var(--tint);
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem 2rem;
  background: linear-gradient(rgb(255 255 255 / 0.2), rgb(255 255 255 / 0.2)) top / 100% 1px no-repeat content-box;
  font-family: var(--display);
  font-size: 0.9rem;
  color: var(--tint);
}

/* ---------------------------------------------------------------
   Scroll reveal (only the intro lead uses it)
   --------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 1080px) {
  .bar__nav { display: none; }
  .bar { justify-content: space-between; }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .hero__photo {
    order: -1;
    height: 72svh;
    min-height: 26rem;
    max-height: 44rem;
  }
  .hero__photo img { object-position: 50% 22%; }
  .hero__panel { padding-top: 1.5rem; }
  .hero__nav { display: none; }
  .hero__body { padding-top: 0.75rem; }
  .hero__name { font-size: clamp(4rem, 21vw, 7.5rem); }

  .intro__grid,
  .skills__grid,
  .org {
    grid-template-columns: 1fr;
    row-gap: 2rem;
  }
  .intro .section-title,
  .org__head { position: static; }

  .timeline {
    --split: 0px;
    padding-left: 1.75rem;
  }
  .timeline__track { left: 1px; }
  .org__body::before { left: calc(-1.75rem - 5px); }
  .org { row-gap: 1rem; }
  .org__head { top: auto; }
  .org__name { font-size: 1.75rem; }
}

@media (max-width: 560px) {
  .strengths,
  .skills__groups { grid-template-columns: 1fr; }

  .foot { flex-direction: column; gap: 0.25rem; }
}

/* ---------------------------------------------------------------
   Reduced motion
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .timeline__fill { transform: scaleY(1); }
}
