/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  /* colour */
  --hl: #F1C40F;                 /* highlight: tagline, icons, close */
  --ink: #f5f7fb;                /* headings, button labels */
  --text: #e4e6e8;               /* body copy */
  --muted: rgba(255, 255, 255, .55);
  --page: #1d1d1d;               /* shows only if the photo fails */
  --footer-bg: #000;
  --footer-ink: #d9d9d9;

  /* type: swap the display family here if an Adobe kit is added
     (e.g. "proxima-nova-wide" for --font-wide, "proxima-nova" for --font-display) */
  --font-display: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-wide: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* hero scale */
  --name-size: clamp(1.6rem, 3.13vw, 3.7rem);
  --name-last-scale: 1.235;       /* with the tracking below, both name lines share a width */
  --tagline-size: clamp(.9rem, 1.22vw, 1.4rem);
  --body-size: 1.1rem;
  --body-lh: 1.7rem;
  --gutter: clamp(1.25rem, 4vw, 5rem);
  --indent: clamp(0rem, 3.3vw, 4rem);

  /* pill buttons (ported from the Squarespace secondary pill) */
  --pill-h: 56px;
  --pill-px: 57px;
  --pill-gap: 28px;
  --pill-bg-1: rgba(0, 0, 0, .1);
  --pill-bg-2: rgba(0, 0, 0, .9);
  --pill-rim-top: rgba(255, 255, 255, .32);
  --pill-rim-mid: rgba(255, 255, 255, .10);
  --pill-rim-bottom: rgba(0, 0, 0, .40);
  --pill-drop: rgba(0, 0, 0, .775);

  /* contact dialog */
  --dlg-width: clamp(min(92vw, 560px), 47vw, 940px);
  --dlg-radius: 28px;
  --dlg-border: rgba(255, 255, 255, .77);
  --field-line: rgba(255, 255, 255, .45);
  --submit-bg: #eceff0;
  --submit-ink: #111;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--footer-bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  background-color: var(--page);
  background-image: url("../images/bg-1400.jpg");
  background-image: image-set(url("../images/bg-1400.webp") type("image/webp"), url("../images/bg-1400.jpg") type("image/jpeg"));
  background-size: cover;
  background-position: 62% 50%;
  background-repeat: no-repeat;
}
@media (min-width: 1401px) {
  .hero {
    background-image: url("../images/bg-2560.jpg");
    background-image: image-set(url("../images/bg-2560.webp") type("image/webp"), url("../images/bg-2560.jpg") type("image/jpeg"));
  }
}

.hero__inner {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: clamp(3.5rem, 11vh, 9rem) var(--gutter);
}

/* name */
.name {
  margin: 0;
  color: var(--ink);
  text-transform: uppercase;
  line-height: 1;
}
.name__first,
.name__last { display: block; white-space: nowrap; }
.name__first {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--name-size);
  letter-spacing: .005em;
}
.name__last {
  margin-top: .06em;
  font-family: var(--font-wide);
  font-weight: 700;
  font-size: calc(var(--name-size) * var(--name-last-scale));
  letter-spacing: .07em;         /* widens Montserrat toward Proxima Nova Wide */
  margin-right: -.07em;
  color: #eef1f2;
}

/* tagline */
.tagline {
  margin: clamp(1.25rem, 2.3vw, 2.25rem) 0 0;
  font-family: var(--font-wide);
  font-weight: 700;
  font-size: var(--tagline-size);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--hl);
  display: flex;
  flex-wrap: wrap;
  row-gap: .3em;
}
.tagline span + span::before {
  content: "|";
  display: inline-block;
  margin: 0 .45em;
  font-weight: 300;
  transform: translateY(-.04em);
}

/* bio */
.bio {
  margin-top: clamp(2rem, 3.6vw, 3.5rem);
  padding-left: var(--indent);
  max-width: calc(min(41.5rem, 46vw) + var(--indent));
}
.bio p {
  margin: 0 0 1.1rem;
  font-size: var(--body-size);
  line-height: var(--body-lh);
  font-weight: 400;
  font-optical-sizing: auto;
  color: var(--text);
  white-space: pre-line;
}
.bio p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Pill buttons
   ========================================================================== */
.actions {
  margin-top: clamp(2.5rem, 4.8vw, 4.75rem);
  display: flex;
  flex-wrap: wrap;
  gap: var(--pill-gap);
}
.actions__links { display: contents; }

.pill {
  position: relative;
  isolation: isolate;
  height: var(--pill-h);
  padding: 0 var(--pill-px);
  border: 0;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  font: 500 18px/1 var(--font-ui);
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  background:
    radial-gradient(130% 160% at 20% 10%, #1b1e25 0%, transparent 40%),
    linear-gradient(160deg, var(--pill-bg-1) 0%, var(--pill-bg-2) 100%);
  box-shadow:
    0 18px 22px -14px var(--pill-drop),
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 -1px 0 rgba(0, 0, 0, .35),
    inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform .2s ease, box-shadow .2s ease;
}
.pill > span { transform: translateY(.5px); }

.pill__icon {
  flex: none;
  width: 26px;
  height: 26px;
  color: var(--hl);
}

/* light-catching rim */
.pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, var(--pill-rim-top) 0%, var(--pill-rim-mid) 40%, var(--pill-rim-bottom) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
/* soft inner glow */
.pill::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  box-shadow: inset 0 8px 18px rgba(255, 255, 255, .04);
  pointer-events: none;
}

@keyframes rim-sheen {
  0%   { background-position: 0 0, -200% 0; }
  50%  { background-position: 0 0, 0% 0; }
  100% { background-position: 0 0, 200% 0; }
}

@media (hover: hover) {
  .pill:hover {
    transform: translateY(-1px);
    box-shadow:
      0 22px 26px -16px var(--pill-drop),
      inset 0 1px 0 rgba(255, 255, 255, .18),
      inset 0 -1px 0 rgba(0, 0, 0, .40),
      inset 0 0 0 1px rgba(255, 255, 255, .10);
  }
  .pill:hover::after { box-shadow: inset 0 10px 22px rgba(255, 255, 255, .06); }
}
.pill:hover::before,
.pill:active::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .14) 40%, rgba(0, 0, 0, .45) 100%),
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .45) 50%, transparent 100%);
  background-size: 100% 100%, 300% 100%;
  animation: rim-sheen 2.5s ease-in-out infinite;
}
.pill:active {
  transform: translateY(0);
  box-shadow:
    0 12px 18px -16px var(--pill-drop),
    inset 0 2px 0 rgba(255, 255, 255, .10),
    inset 0 -2px 0 rgba(0, 0, 0, .55),
    inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.pill:focus { outline: none; }
.pill:focus-visible {
  box-shadow:
    0 0 0 2px var(--hl),
    0 18px 22px -14px var(--pill-drop),
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 -1px 0 rgba(0, 0, 0, .35);
}

@supports not ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  .pill::before { padding: 0; background: none; outline: 1px solid rgba(255, 255, 255, .08); }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-ink);
  text-align: center;
  padding: clamp(2rem, 3.6vw, 3.1rem) var(--gutter);
  padding-bottom: max(clamp(2rem, 3.6vw, 3.1rem), env(safe-area-inset-bottom));
}
.site-footer p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1rem, 1.2vw, 1.3rem);
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* ==========================================================================
   Contact dialog
   ========================================================================== */
.contact {
  width: var(--dlg-width);
  max-width: calc(100vw - 1.5rem);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 3.25rem 0 clamp(2rem, 4vh, 3rem);
  border: 2px solid var(--dlg-border);
  border-radius: var(--dlg-radius);
  background: #000;
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.contact::backdrop {
  background: rgba(0, 0, 0, .55);
}
.contact[open] { animation: dlg-in .28s var(--ease); }
.contact[open]::backdrop { animation: fade-in .28s ease; }
.contact.is-closing { animation: dlg-out .2s ease forwards; }
.contact.is-closing::backdrop { animation: fade-out .2s ease forwards; }

@keyframes dlg-in  { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes dlg-out { to   { opacity: 0; transform: translateY(8px) scale(.99); } }
@keyframes fade-in  { from { opacity: 0; } }
@keyframes fade-out { to   { opacity: 0; } }

/* stop the page scrolling under the dialog */
html:has(.contact[open]) { overflow: hidden; }

.contact__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--hl);
  border-radius: 50%;
  background: transparent;
  color: var(--hl);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.contact__close svg { width: 22px; height: 22px; }
.contact__close:hover { background: var(--hl); color: #000; }
.contact__close:focus { outline: none; }
.contact__close:focus-visible { box-shadow: 0 0 0 3px rgba(241, 196, 15, .45); }

.contact__header img {
  width: 100%;
}

.contact__form,
.contact__done {
  padding: clamp(2.25rem, 7%, 4.5rem) clamp(1.25rem, 15%, 10rem) 0;
}

/* fields */
.field-group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.field-group legend {
  padding: 0;
  margin-bottom: .9rem;
  font: 400 1.1rem/1.3 var(--font-ui);
  letter-spacing: .02em;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.field {
  display: block;
  min-width: 0;
  margin-bottom: 1.7rem;
}
.field__label {
  display: block;
  font: 400 .92rem/1.3 var(--font-ui);
  letter-spacing: .02em;
  color: var(--ink);
}
.field--lg .field__label { font-size: 1.1rem; }
.req {
  margin-left: .3em;
  font-size: .92rem;
  color: var(--muted);
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  margin-top: .35rem;
  padding: .7rem 0 .55rem;
  border: 0;
  border-bottom: 1px solid var(--field-line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 1rem/1.5 var(--font-ui);
  caret-color: var(--hl);
  transition: border-color .2s ease;
  -webkit-appearance: none;
          appearance: none;
}
.field textarea {
  min-height: 7.5rem;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--hl);
}
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 100px #000 inset;
  transition: background-color 9999s;
}
.field.is-invalid input,
.field.is-invalid textarea { border-bottom-color: #ff8a7a; }
.field__error {
  display: block;
  margin-top: .4rem;
  font: 400 .85rem/1.3 var(--font-ui);
  color: #ff9d90;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 1.3em;
  margin: 0 0 1rem;
  text-align: center;
  font: 400 .95rem/1.4 var(--font-ui);
  color: #ff9d90;
}
.form-status:empty { margin: 0; min-height: 0; }

.form-actions {
  display: flex;
  justify-content: center;
}
.submit {
  min-width: 250px;
  padding: 1.55rem 2.5rem;
  border: 0;
  border-radius: 0;
  background: var(--submit-bg);
  color: var(--submit-ink);
  font: 500 1.2rem/1 var(--font-ui);
  letter-spacing: .03em;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.submit:hover { background: #fff; }
.submit:active { transform: translateY(1px); }
.submit:focus { outline: none; }
.submit:focus-visible { box-shadow: 0 0 0 3px var(--hl); }
.submit[disabled] { opacity: .6; cursor: progress; }

.contact__done {
  text-align: center;
  padding-bottom: 1rem;
}
.contact__done:focus { outline: none; }
.contact__done p {
  margin: 0 auto 2.25rem;
  max-width: 28rem;
  font: 400 1.2rem/1.6 var(--font-ui);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  :root { --name-size: 3.6vw; --tagline-size: 1.35vw; }
  .hero { background-position: 78% 50%; }
  .bio { max-width: calc(min(38rem, 56vw) + var(--indent)); }
}

@media (max-width: 767px) {
  :root {
    --name-size: 6.9vw;
    --tagline-size: clamp(.8rem, 3.6vw, 1rem);
    --body-size: 1.02rem;
    --body-lh: 1.6rem;
    --pill-px: 32px;
    --pill-gap: 16px;
  }
  /* phones: the hands sit in a band at the top and fade into the page,
     with the copy starting over the lower, darkened part of the photo */
  .hero {
    --band: max(78svh, 560px);
    align-items: flex-start;
    background-color: #0a0a0a;
    background-size: auto var(--band);
    background-position: 84% 0;
  }
  .hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: var(--band);
    background: linear-gradient(180deg,
      rgba(10, 10, 10, 0) 0%,
      rgba(10, 10, 10, .35) 40%,
      rgba(10, 10, 10, .82) 70%,
      #0a0a0a 100%);
    pointer-events: none;
  }
  .hero__inner {
    max-width: none;
    padding-top: calc(var(--band) * .42);
    padding-bottom: 3rem;
  }
  .bio { padding-left: 0; max-width: 38rem; }
  .contact__form,
  .contact__done { padding-inline: 1.5rem; }
  .actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 22rem;
  }
  .pill { width: 100%; }

  .contact {
    --dlg-radius: 22px;
    width: calc(100vw - 1.5rem);
    padding-top: 2.75rem;
  }
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .submit { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
