/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Homemade Apple";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/homemade-apple-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/inter-latin-var.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --grey: #6b6b6b;
  --grey-light: #a3a3a3;
  --line: #e8e8e8;

  --font-hand: "Homemade Apple", cursive;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.45, 0, 0.55, 1); /* easy ease (in-out) */
  --dur: 0.8s;

  --max: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --section: clamp(96px, 14vw, 168px);
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }

::selection { background: var(--black); color: var(--white); }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background-color 0.5s var(--ease), border-color 0.5s var(--ease), backdrop-filter 0.5s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__logo {
  font-family: var(--font-hand);
  font-size: 20px;
  line-height: 1;
  padding-top: 6px;
}

.nav__links {
  display: flex;
  gap: clamp(18px, 3vw, 36px);
  font-size: 14px;
  font-weight: 500;
}

.nav__links a {
  position: relative;
  color: var(--grey);
  transition: color 0.4s var(--ease);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}

.nav__links a:hover,
.nav__links a.is-active { color: var(--black); }

.nav__links a:hover::after,
.nav__links a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 112px 0 96px;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

.hero__name {
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: clamp(34px, 5.6vw, 84px);
  line-height: 1.55;
  white-space: nowrap;
  letter-spacing: 0;
  /* room for the swashes so the write-on clip never cuts them */
  padding: 0.15em 0.2em 0.1em 0;
}

.hero__name span {
  display: inline-block;
  clip-path: inset(-30% 100% -30% -15%);
  animation: write 1.8s var(--ease) 0.5s forwards;
}

@keyframes write {
  to { clip-path: inset(-30% -10% -30% -15%); }
}

.hero__role {
  margin-top: 20px;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--grey);
}

.hero__role .role { white-space: nowrap; }
.hero__role .dot { margin: 0 0.6em; color: var(--grey-light); }

.hero__cta { margin-top: 40px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--black);
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease), transform 0.5s var(--ease);
}

.btn:hover {
  background: var(--white);
  color: var(--black);
}

.btn:active { transform: scale(0.98); }

.hero__portrait {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 520px;
}

.hero__portrait img {
  width: 100%;
  filter: grayscale(1) contrast(1.05);
  /* soft fade at the bottom so the cut-off torso melts into the page */
  -webkit-mask-image:
    linear-gradient(to bottom, #000 70%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 14%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, #000 70%, transparent 100%),
    linear-gradient(to right, transparent 0%, #000 14%, #000 88%, transparent 100%);
  mask-composite: intersect;
  transition: filter 1.2s var(--ease);
}

.hero__portrait:hover img { filter: grayscale(0) contrast(1); }

/* Scroll cue */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--grey);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.scroll-cue__track {
  position: relative;
  width: 1px;
  height: 48px;
  background: var(--line);
  overflow: hidden;
}

.scroll-cue__dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 16px;
  background: var(--black);
  animation: cue 2.4s var(--ease) infinite;
}

@keyframes cue {
  0%   { transform: translateY(-16px); }
  60%  { transform: translateY(48px); }
  100% { transform: translateY(48px); }
}

/* ---------- Sections ---------- */
.section { padding: var(--section) 0 0; }
.section--tight { padding-top: calc(var(--section) * 0.8); }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2.4fr);
  gap: clamp(24px, 6vw, 96px);
}

.heading {
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.6;
  align-self: start;
}

.grid-2 > .heading {
  position: sticky;
  top: 104px;
}

.lead {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.body {
  margin-top: 28px;
  color: var(--grey);
  max-width: 40em;
}

/* Facts */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.facts dt {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.facts dd {
  margin-top: 4px;
  font-size: 14px;
  color: var(--grey);
}

/* Focus */
.focus {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 40px;
  background: var(--line);
  border: 1px solid var(--line);
}

.focus__item {
  background: var(--white);
  padding: clamp(28px, 3.5vw, 44px);
  transition: background-color 0.6s var(--ease), color 0.6s var(--ease);
}

.focus__item:hover {
  background: var(--black);
  color: var(--white);
}

.focus__item:hover p,
.focus__item:hover .focus__num { color: #bdbdbd; }

.focus__num {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--grey-light);
  transition: color 0.6s var(--ease);
}

.focus__item h3 {
  margin-top: 28px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.focus__item p {
  margin-top: 12px;
  font-size: 15px;
  color: var(--grey);
  transition: color 0.6s var(--ease);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 36px;
  --progress: 0;
}

.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--line);
}

.timeline::after {
  background: var(--black);
  transform-origin: top;
  transform: scaleY(var(--progress));
}

.timeline__item {
  position: relative;
  padding-bottom: 56px;
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__item::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--black);
  z-index: 1;
  transition: background-color 0.6s var(--ease);
}

.timeline__item.is-passed::before { background: var(--black); }

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
}

.timeline__item h3 {
  margin-top: 10px;
  font-size: clamp(18px, 1.6vw, 20px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.timeline__item p {
  margin-top: 8px;
  max-width: 40em;
}

.timeline__item .context {
  color: var(--grey);
  font-size: 15px;
}

/* Testimonial slider (inside a timeline item) */
.reviews {
  position: relative;
  margin-top: 24px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
}

.reviews__track {
  display: flex;
  gap: 12px;
  width: max-content;
  will-change: transform;
}

.timeline__item .review p { max-width: none; }

.review {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  width: 240px;
  margin-right: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  transition: border-color 0.6s var(--ease);
}

.review:hover { border-color: var(--black); }

.review__stars {
  font-size: 10px;
  letter-spacing: 2px;
  line-height: 1;
}

.timeline__item .review__body {
  margin-top: 10px;
  flex-grow: 1;
  font-size: 13px;
  line-height: 1.55;
  color: var(--grey);
}

.review__author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.review__author img,
.review__initials {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1);
}

.review__initials {
  display: grid;
  place-items: center;
  background: #f2f2f2;
  font-size: 10px;
  font-weight: 600;
  color: var(--grey);
}

.review__author strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.review__author span {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: var(--grey);
}

/* Credentials */
.creds { border-top: 1px solid var(--line); }

.cred {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: baseline;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.6s var(--ease);
}

a.cred:hover { padding-left: 12px; }

.cred__stat {
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.cred h3 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.cred p {
  margin-top: 4px;
  font-size: 15px;
  color: var(--grey);
}

.cred__link {
  margin-left: 4px;
  color: var(--black);
  font-weight: 500;
  white-space: nowrap;
}

/* Education rows */
.rows { border-top: 1px solid var(--line); }

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.6s var(--ease);
}

.row:hover { padding-left: 12px; }

.row h3 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.row p {
  margin-top: 4px;
  font-size: 15px;
  color: var(--grey);
}

.row__date {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color 0.6s var(--ease), transform 0.6s var(--ease);
}

.card:hover {
  border-color: var(--black);
  transform: translateY(-4px);
}

.card__date {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
}

.card h3 {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.card p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--grey);
}

/* Contact */
.contact { padding-bottom: var(--section); }

.contact__title {
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 120px);
  line-height: 1.5;
}

.contact__text {
  margin-top: 16px;
  max-width: 32em;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--grey);
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
  margin-top: 48px;
}

.link-arrow {
  position: relative;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 500;
  letter-spacing: -0.01em;
  padding-bottom: 6px;
}

.link-arrow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--black);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}

.link-arrow:hover::after {
  transform: scaleX(0);
  transform-origin: right;
}

.link-arrow span {
  display: inline-block;
  transition: transform 0.6s var(--ease);
}

.link-arrow:hover span { transform: translateX(4px); }

/* Footer */
.footer {
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--grey);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.footer a { transition: color 0.4s var(--ease); }
.footer a:hover { color: var(--black); }

/* ---------- Motion ---------- */
.load {
  opacity: 0;
  animation: rise 1s var(--ease) var(--d, 0s) forwards;
}

.hero__portrait.load { animation-name: rise-soft; animation-duration: 1.4s; }
.scroll-cue.load { animation-name: fade; }

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

@keyframes rise-soft {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scroll reveals are only hidden once JS confirms it can show them again */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur) var(--ease) var(--d, 0s), transform var(--dur) var(--ease) var(--d, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Sticky heading keeps its own transform free */
.js .grid-2 > .heading.reveal { transform: translateY(16px); }
.js .grid-2 > .heading.reveal.is-visible { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .scroll-cue__dot { animation: none; }
  .reviews { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding-top: 104px; }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero__portrait {
    order: -1;
    justify-self: start;
    max-width: 320px;
  }

  .scroll-cue { display: none; }

  .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .grid-2 > .heading { position: static; }

  .focus { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }

  .nav__links { gap: 16px; font-size: 13px; }

  .hero__role .role { display: block; }
  .hero__role .dot { display: none; }
  .nav__links a[href="#education"] { display: none; }

  .facts { grid-template-columns: 1fr; gap: 20px; }

  .row { flex-direction: column; gap: 8px; }
  .row:hover { padding-left: 0; }

  .cred { grid-template-columns: 1fr; gap: 12px; }
  a.cred:hover { padding-left: 0; }


  .timeline { padding-left: 28px; }
  .timeline__item::before { left: -28px; }
  .meta { flex-direction: column; }
}
