/* ============================================================
   samuelproffitt.com — stylesheet
   Colours, fonts and proportions match the original Squarespace design.
   Most sizes use "vw" (percent of the window width) so the layout
   scales exactly like the original did.
   ============================================================ */

:root {
  --ink: #231b18;        /* main text colour */
  --cream: #fbf7ef;      /* light text / light sections */
  --warm: #f7eee0;       /* warm beige sections */
  --hero: #2f241b;       /* dark brown behind the banner */
  --olive: #777869;      /* footer headings */
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --edge: 3vw;           /* outer page margin */
  --inset: 10.9vw;       /* where headings and text start */
  --curve: 8vw;          /* height of the curved section edges */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--warm);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.024em;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.03em; }
h2 { font-size: calc(33.7px + 1.77vw); line-height: 1.08; }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 50;
  background: var(--cream); padding: 0.6rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; }
.anchor { position: absolute; top: 0; }

section { position: relative; }
.tone-warm  { background: var(--warm); }
.tone-light { background: var(--cream); }

/* ---------- curved edges between sections ----------
   A section with "divider" gets a curved bottom edge; the next
   section slides up underneath it by the height of the curve. */
.divider     { clip-path: polygon(0 0, 100% 0, 100.00% calc(100% - 8.000vw), 93.88% calc(100% - 7.041vw), 88.01% calc(100% - 6.162vw), 82.37% calc(100% - 5.359vw), 76.97% calc(100% - 4.630vw), 71.78% calc(100% - 3.969vw), 66.80% calc(100% - 3.375vw), 62.01% calc(100% - 2.843vw), 57.41% calc(100% - 2.370vw), 52.98% calc(100% - 1.953vw), 48.71% calc(100% - 1.588vw), 44.60% calc(100% - 1.271vw), 40.62% calc(100% - 1.000vw), 36.78% calc(100% - 0.770vw), 33.06% calc(100% - 0.579vw), 29.44% calc(100% - 0.422vw), 25.93% calc(100% - 0.296vw), 22.50% calc(100% - 0.198vw), 19.14% calc(100% - 0.125vw), 15.85% calc(100% - 0.072vw), 12.62% calc(100% - 0.037vw), 9.42% calc(100% - 0.016vw), 6.26% calc(100% - 0.005vw), 3.13% 100%, 0.00% 100%); }
.divider-rev { clip-path: polygon(0 0, 100% 0, 100.00% 100%, 96.87% 100%, 93.74% calc(100% - 0.005vw), 90.58% calc(100% - 0.016vw), 87.38% calc(100% - 0.037vw), 84.15% calc(100% - 0.072vw), 80.86% calc(100% - 0.125vw), 77.50% calc(100% - 0.198vw), 74.07% calc(100% - 0.296vw), 70.56% calc(100% - 0.422vw), 66.94% calc(100% - 0.579vw), 63.22% calc(100% - 0.770vw), 59.38% calc(100% - 1.000vw), 55.40% calc(100% - 1.271vw), 51.29% calc(100% - 1.588vw), 47.02% calc(100% - 1.953vw), 42.59% calc(100% - 2.370vw), 37.99% calc(100% - 2.843vw), 33.20% calc(100% - 3.375vw), 28.22% calc(100% - 3.969vw), 23.03% calc(100% - 4.630vw), 17.63% calc(100% - 5.359vw), 11.99% calc(100% - 6.162vw), 6.12% calc(100% - 7.041vw), 0.00% calc(100% - 8.000vw)); }
.divider + section, .divider + footer { margin-top: calc(-1 * var(--curve)); }
.education { z-index: 5; }
.pro       { z-index: 4; }
.lectures  { z-index: 3; }
.courses-section { z-index: 2; }
footer     { position: relative; z-index: 1; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem var(--edge);
  transition: transform 0.45s ease, background-color 0.3s ease, padding 0.3s ease;
}
.topbar.solid  { background: rgba(35, 27, 24, 0.95); padding-top: 0.8rem; padding-bottom: 0.8rem; }
.topbar.hidden { transform: translateY(-100%); }
.brand img { height: 45px; width: auto; }
.topbar nav a {
  color: var(--cream); text-decoration: none; margin-left: 1.5rem;
  font-size: clamp(16px, 1.35vw, 19.5px);
  text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.topbar nav a:hover, .topbar nav a:focus-visible { text-decoration: underline; }
.menu-toggle {
  display: none;
  background: none; border: 1px solid rgba(251, 247, 239, 0.5); border-radius: 2px;
  color: var(--cream); font: inherit; font-size: 0.9rem; letter-spacing: 0.04em;
  padding: 0.35rem 0.8rem; cursor: pointer;
}

/* ---------- hero ---------- */
.hero {
  overflow: hidden;
  min-height: max(82.5vh, 520px);
  display: flex; align-items: flex-end;
  background-color: var(--hero);
  background-size: cover; background-position: center;
}
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero.fx-on { background-image: none !important; }
.hero::before {               /* darkens the banner photo, as on the original */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: rgba(35, 27, 24, 0.62);
}
.hero-text { position: relative; z-index: 2; color: var(--cream); padding: 0 var(--edge) 2.6rem; }
.hero h1 { font-size: calc(55px + 4.5vw); line-height: 0.92; }
.roles {
  margin: 1.2rem 0 0;
  font-size: clamp(0.95rem, 1.15vw, 1.1rem);
  line-height: 1.5;
  color: rgba(251, 247, 239, 0.82);
  letter-spacing: -0.01em;
}
.roles span { display: block; }

/* ---------- about ---------- */
.about { padding: 2.85vw var(--edge) 2.6vw; }
.about-grid {
  display: grid;
  grid-template-columns: 30.56vw 1fr;
  column-gap: 4.88vw;
  align-items: start;
}
.headshot { width: 100%; height: auto; margin-top: 8.25vw; }
.bio p { font-size: calc(21px + 0.496vw); line-height: 1.25; margin: 0 0 0.55em; }
.bio p:last-child { margin-bottom: 0; }

/* ---------- education ---------- */
.education { min-height: 52.85vw; padding: 6.08vw 0 var(--curve); }
.edu-text { margin-left: var(--inset); width: 38.75vw; }
.education h2 { margin-bottom: 3.9vw; }
.degrees { font-size: 16px; line-height: 20px; }
.degrees li { margin-bottom: 16px; }
.education .logo-field { position: absolute; top: 0; left: 0; right: 0; }

/* ---------- logo layouts (positions copied from the original) ---------- */
.logo-field { position: relative; height: calc(var(--fh) * 1vw); }
.logo-field li {
  position: absolute;
  left: calc(var(--x) * 1vw); top: calc(var(--y) * 1vw);
  width: calc(var(--w) * 1vw); height: calc(var(--h) * 1vw);
}
.logo-field img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

.pro, .lectures { padding: 6.08vw 0 0; }
.pro h2, .lectures h2 { margin: 0 0 6.7vw var(--inset); max-width: 80vw; }
.pro      { padding-bottom: 12.65vw; }
.lectures { padding-bottom: 11.27vw; }
.divider + section { padding-top: calc(6.08vw + var(--curve)); }

/* ---------- courses ---------- */
.divider + .courses-section { padding: calc(6.6vw + var(--curve)) 6.94vw 14.44vw; }
.courses-section h2 { margin-bottom: 6.7vw; }
.courses {
  display: grid;
  grid-template-columns: repeat(3, 22.92vw);
  column-gap: 8.68vw;
}
.course { text-align: center; }
.course img {
  width: 100%; aspect-ratio: 22.92 / 27.08; object-fit: cover;
  border-radius: 20px; margin-bottom: 2.75vw;
}
.course h3 {
  font-size: 20.3px; line-height: 1.19;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
  margin-bottom: 0.9rem;
}
.course p { font-size: 16px; line-height: 20px; margin: 0; }

/* ---------- footer ---------- */
footer { background: var(--ink); color: var(--cream); }
.footer-photo { height: 28.6vw; background-size: cover; background-position: center; }
.contact { position: relative; padding: 58px var(--edge) 100px; }
.contact h2 { font-size: calc(26px + 1.45vw); color: var(--olive); margin-bottom: 1.6rem; }
.contact-rows {
  display: grid; grid-template-columns: calc(var(--inset) - var(--edge)) auto;
  row-gap: 0.9rem; margin: 0; align-items: center; justify-content: start;
}
.contact-rows dt { font-family: var(--serif); font-size: 20.3px; color: var(--olive); letter-spacing: -0.03em; }
.contact-rows dd { margin: 0; font-size: 19.5px; }
.contact-rows a { text-decoration: none; border-bottom: 1px solid rgba(251, 247, 239, 0.35); }
.contact-rows a:hover { border-color: var(--cream); }
.contact-rows a.icon-link { border: 0; display: inline-block; line-height: 0; opacity: 0.92; }
.contact-rows a.icon-link:hover { opacity: 1; }
.copyright {
  position: absolute; right: var(--edge); bottom: 47px;
  margin: 0; font-size: 16px; opacity: 0.7;
}

/* ---------- scroll animations ("flex" in) ---------- */
.js .flex {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}
.js .flex.in { opacity: 1; transform: none; }
.course img { transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1); }
.course:hover img { transform: scale(1.015); }

/* ---------- phones (layout copied from the original's mobile version) ---------- */
@media (max-width: 767px) {
  :root { --edge: 6.13vw; --inset: 6.13vw; }
  .menu-toggle { display: block; }
  .topbar nav { display: none; }
  .brand img { height: 36px; }
  .topbar.menu-open { background: var(--ink); transition: none; }
  .topbar.menu-open nav {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--ink);
    padding: 0.5rem var(--edge) 1.6rem;
  }
  .topbar.menu-open nav a {
    margin: 0; padding: 0.55rem 0;
    font-family: var(--serif); font-size: 1.6rem;
    border-bottom: 1px solid rgba(251, 247, 239, 0.12);
  }

  .hero { min-height: max(90vh, 520px); }
  .roles span + span { margin-top: 0.3rem; }

  .about { padding: 18.7vw var(--edge) 16vw; }
  .about-grid { grid-template-columns: 1fr; }
  .headshot { width: 57.3vw; margin: 0 auto 16.5vw; }

  .education { min-height: 0; padding: 16.5vw 0 calc(18.7vw + var(--curve)); }
  .edu-text { margin: 0 var(--edge); width: auto; }
  .education h2 { margin-bottom: 7vw; }
  .education .logo-field { position: relative; top: auto; margin-top: 22.7vw; }

  .logo-field { height: calc(var(--mfh) * 1vw); }
  .logo-field li {
    left: calc(var(--mx) * 1vw); top: calc(var(--my) * 1vw);
    width: calc(var(--mw) * 1vw); height: calc(var(--mh) * 1vw);
  }
  .pro h2, .lectures h2 { margin: 0 var(--edge) 15.7vw; max-width: none; }
  .lectures h2 { margin-bottom: 23.5vw; }
  .divider + section { padding-top: calc(25.9vw + var(--curve)); }
  .pro      { padding-bottom: 24.5vw; }
  .lectures { padding-bottom: 26.9vw; }

  .divider + .courses-section { padding: calc(14.4vw + var(--curve)) var(--edge) 27vw; }
  .courses-section h2 { margin-bottom: 7vw; }
  .courses { grid-template-columns: 1fr; row-gap: 22vw; }
  .course img { aspect-ratio: 330 / 374; margin-bottom: 9vw; }

  .footer-photo { height: 79.5vw; }
  .contact { padding: 23px var(--edge) 40px; }
  .contact-rows { grid-template-columns: 22.7vw auto; }
  .copyright { position: static; margin-top: 2.5rem; }
}

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