/* ---------- Tokens ---------- */

:root {
  /* Palette: "2025 Luxury with Pink" */
  --gold: #C59E40;
  --night: #000715;
  --khaki: #9E906F;
  --cream: #F2ECD8;
  --pink: #E02655;
  /* Derived for light mode: gold and khaki are too light to read on cream. */
  --antique-gold: #8A6F2D; /* gold at 70% brightness, 4:1 on cream */

  /* Roles (light mode) */
  --paper: var(--cream);
  --ink: var(--night);
  --title: var(--antique-gold); /* name and section titles */
  --heading: var(--night);      /* card titles */
  --icon: var(--antique-gold);
  --muted: #494C50;             /* night at 70% on cream */
  --line: #D5CCB3;              /* khaki at 35% on cream */
  --underline: var(--pink);
  --highlight: var(--gold);
  --on-highlight: var(--night);
  --focus: var(--pink);
  --email: var(--pink);
  --bar-1: var(--khaki);
  --bar-2: var(--gold);
  --bar-3: var(--pink);

  --max: 76rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-space: clamp(3.5rem, 8vw, 6rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: var(--night);
    --ink: var(--cream);
    --title: var(--gold);
    --heading: var(--cream);
    --icon: var(--gold);
    --muted: var(--khaki);
    --line: #2F3030;    /* khaki at 30% on night */
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  font-stretch: 100%;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul {
  margin: 0;
}

h1, h2, h3 {
  color: var(--heading);
}

h1, h2 {
  color: var(--title);
}

ul {
  list-style: none;
  padding: 0;
}

a {
  color: var(--ink);
  text-decoration-color: var(--underline);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.2em;
}

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

::selection {
  background: var(--highlight);
  color: var(--on-highlight);
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Page frame ---------- */

.masthead,
.section,
.footer {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* ---------- Header ---------- */

.masthead {
  padding-bottom: var(--section-space);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
}

.nav a:hover {
  text-decoration: underline;
}

.name {
  margin-block: clamp(1.5rem, 5vw, 3.5rem) clamp(1.5rem, 3vw, 2.25rem);
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 0.9;
  letter-spacing: -0.025em;
}

.name__line {
  display: block;
}

.photo {
  display: block;
  width: 9rem;
  height: auto;
  margin-bottom: 1.75rem;
  border-radius: 1rem;
  background: var(--line); /* shows while the image loads */
}

.summary {
  max-width: 34em;
  font-size: clamp(1.25rem, 1rem + 0.9vw, 1.625rem);
  line-height: 1.42;
}

.summary p + p {
  margin-top: 0.9em;
}

/* The one moment of motion: the name widens into place once the font is ready. */
@media (prefers-reduced-motion: no-preference) {
  .js .name {
    visibility: hidden;
  }

  .js.fonts-ready .name {
    visibility: visible;
  }

  .fonts-ready .name__line {
    animation: widen 1.2s cubic-bezier(0.16, 0.84, 0.2, 1) both;
  }

  .fonts-ready .name__line + .name__line {
    animation-delay: 90ms;
  }

  html {
    scroll-behavior: smooth;
  }
}

@keyframes widen {
  from {
    font-stretch: 62%;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section-space);
  border-top: 1px solid var(--line);
}

.section__title {
  margin-bottom: 2rem;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.3125rem;
  font-weight: 650;
  line-height: 1.25;
}

/* Services */

.services {
  display: grid;
  gap: 2.5rem 3rem;
}

.service__icon {
  display: block;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.875rem;
  color: var(--icon);
}

.service h3 {
  margin-bottom: 0.5rem;
}

.service p {
  max-width: 34em;
}

/* How I can help */

.section__intro {
  max-width: 34em;
  margin-bottom: 2.5rem;
  font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
}

.section__intro:last-child {
  margin-bottom: 0;
}

.formats {
  display: grid;
  gap: 2.5rem 2rem;
}

.format {
  padding-top: 1.125rem;
  border-top: 6px solid var(--bar-1);
}

/* Deeper colour = deeper commitment: advice → project → joining. */
.format:nth-child(2) {
  border-top-color: var(--bar-2);
}

.format:nth-child(3) {
  border-top-color: var(--bar-3);
}

.format__length {
  margin-block: 0.25rem 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Contact */

.contact {
  container-type: inline-size;
}

.contact__lead {
  max-width: 34em;
  margin-bottom: 1rem;
}

.contact__email {
  display: inline-block;
  color: var(--email);
  font-size: clamp(1.125rem, 5.5vw, 3rem);
  font-size: min(3.75rem, 6.8cqi); /* fits the address on one line; lower 6.8 for a longer one */
  font-weight: 700;
  font-stretch: 110%;
  line-height: 1.15;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

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

.footer {
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- Wider screens ---------- */

@media (min-width: 60rem) {
  .nav {
    justify-content: flex-end;
  }

  /* Headings sit in a narrow left column, content in the wide right one. */
  .masthead,
  .section {
    display: grid;
    grid-template-columns: minmax(11rem, 1fr) 2.6fr;
    column-gap: 4rem;
  }

  .nav,
  .name {
    grid-column: 1 / -1;
  }

  .summary,
  .section > :not(.section__title) {
    grid-column: 2;
  }

  /* Photo sits in the left column, beside the summary. */
  .photo {
    grid-column: 1;
    align-self: start;
    width: min(100%, 13rem);
    margin-bottom: 0;
  }

  .section__title {
    margin-bottom: 0;
  }
}

@media (min-width: 40rem) {
  .services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 68rem) {
  .formats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
