@font-face {
  font-family: "Hanken Grotesk";
  src: url("./assets/hanken-grotesk.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #faf9f7;
  --ink: #1c1917;
  --petrol: #0b5e60;
  --charcoal: #161616;
  --font: "Hanken Grotesk", sans-serif;
  --gutter: clamp(20px, 3vw, 48px);
  --body: 18px;
  --small: 14px;
  --role: clamp(23px, 2.25vw, 30px);
  --display: clamp(44px, 5.3vw, 78px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
  font-family: var(--font);
  color: var(--ink);
  background: var(--charcoal);
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
body,
h1,
h2,
p {
  margin: 0;
}
body {
  font-size: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.06em;
  -webkit-tap-highlight-color: transparent;
}
a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 5px;
}
::selection {
  background: var(--petrol);
  color: var(--paper);
}
p {
  text-wrap: pretty;
}
h1,
h2 {
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.02;
}
nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.profile {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: 28px var(--gutter);
}
.profile-frame {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
}
.contact-card {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  min-height: min(680px, calc(100svh - 116px));
  background: var(--paper);
}
.card-content {
  padding: clamp(28px, 4.1vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
h1 {
  font-size: var(--display);
}
h1 span {
  display: block;
  white-space: nowrap;
}
.role {
  margin-top: 32px;
  font-size: var(--role);
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.intro {
  margin-top: 24px;
  max-width: 34ch;
}
.actions {
  margin-top: 36px;
  width: min(100%, 354px);
}
.button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 56px;
  padding: 14px 20px;
  background: var(--petrol);
  color: var(--paper);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}
.button span {
  font-size: var(--body);
  line-height: 1;
}
.secondary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  font-size: 16px;
}
.secondary-actions a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  text-decoration: none;
}
.portrait {
  position: relative;
  overflow: hidden;
}
.portrait img {
  position: absolute;
  display: block;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 12px;
  color: var(--paper);
  font-size: var(--small);
}
.profile-footer a {
  text-decoration: none;
}

/* Companion documents use the profile's paper panel and charcoal frame. */
.legal {
  --legal-gap: clamp(40px, 5vw, 72px);
  min-height: 100svh;
  display: grid;
  align-items: start;
  padding: 28px var(--gutter);
  background: var(--charcoal);
  color: var(--ink);
}
.legal-frame {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
}
.legal-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  align-items: start;
  gap: var(--legal-gap);
  padding: clamp(32px, 4.1vw, 64px);
  background: var(--paper);
}
.legal-card--compact {
  min-height: min(680px, calc(100svh - 116px));
}
.legal-heading {
  position: static;
}
.legal h1 {
  font-size: var(--display);
  line-height: 1.02;
}
.legal-back {
  max-width: 280px;
  margin-top: 36px;
}
.legal-index {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 36px;
  font-size: 16px;
}
.legal-index a {
  text-decoration: none;
}
.legal-copy {
  min-width: 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.legal-copy section + section {
  margin-top: 48px;
}
.legal h2 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  scroll-margin-top: 36px;
}
.legal-copy p,
.legal-copy address {
  margin-top: 20px;
  font-style: normal;
}
.legal-contact address,
.legal-contact address p {
  margin: 0;
}
.legal-contact address p:first-child {
  font-size: var(--role);
  line-height: 1.4;
  letter-spacing: -0.025em;
}
.legal-contact address p + p {
  margin-top: 12px;
}
.legal-contact > p {
  margin-top: 28px;
}
.legal-copy a:hover {
  color: var(--petrol);
}
.profile-footer [aria-current="page"] {
  text-decoration: underline;
}
/* Desktop legal documents scroll inside the card; the footer stays outside. */
@media screen and (min-width: 1001px) {
  @supports selector(::-webkit-scrollbar) {
    .legal {
      height: 100dvh;
      grid-template-rows: minmax(0, 1fr);
    }
    .legal-frame {
      display: grid;
      grid-template-rows: minmax(0, 1fr) auto;
      height: 100%;
      max-height: 736px;
      min-height: 0;
    }
    .legal-card {
      min-height: 0;
      overflow-y: auto;
      overscroll-behavior-y: contain;
      scrollbar-gutter: stable;
      scroll-padding-block: 24px;
    }
    .legal-card:focus-visible {
      outline: 3px solid var(--petrol);
      outline-offset: -3px;
    }
    /* An explicit width keeps native scrollbars visible, including on macOS. */
    .legal-card::-webkit-scrollbar {
      width: 16px;
    }
    .legal-card::-webkit-scrollbar-track {
      background: var(--paper);
    }
    .legal-card::-webkit-scrollbar-thumb {
      background: var(--petrol);
      border: 3px solid var(--paper);
    }
    .legal-card::-webkit-scrollbar-thumb:hover {
      background: var(--ink);
    }
  }
}

/* Keep the index in view only when there is room for the entire heading. */
@media screen and (min-width: 1001px) and (min-height: 700px) {
  @supports selector(::-webkit-scrollbar) {
    .legal-heading {
      position: sticky;
      top: 0;
    }
  }
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 8px;
  padding: 12px 20px;
  color: var(--ink);
  background: var(--paper);
  transform: translateY(-180%);
}
.skip-link:focus {
  transform: none;
}

@media (max-width: 1000px) and (min-width: 701px) {
  .card-content {
    padding: 32px;
  }
  .contact-card {
    grid-template-columns: 1.5fr 1fr;
    min-height: min(620px, calc(100svh - 116px));
  }
  .role {
    margin-top: 28px;
  }
}

@media (max-width: 700px) {
  :root {
    --gutter: 16px;
    --body: 16px;
    --role: 20px;
    --display: clamp(32px, 10.4vw, 54px);
    --card-gap: clamp(12px, calc((100svh - 540px) / 8), 24px);
    --card-pad: clamp(16px, calc((100svh - 520px) / 6), 28px);
  }
  .profile {
    padding-block: 12px;
  }
  .profile-frame {
    max-width: 460px;
  }
  .contact-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--card-gap) 16px;
    min-height: 0;
    padding: var(--card-pad);
  }
  .card-content {
    display: contents;
  }
  h1 {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .role {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    align-self: center;
  }
  .portrait {
    grid-column: 2;
    grid-row: 2;
    height: clamp(96px, calc(100svh - 550px), 150px);
    aspect-ratio: 2 / 3;
    align-self: end;
  }
  .intro {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 0;
    max-width: none;
  }
  .actions {
    grid-column: 1 / -1;
    grid-row: 4;
    margin: 0;
    width: 100%;
  }
  .button {
    min-height: 52px;
    padding: 12px 16px;
  }
  .secondary-actions {
    margin-top: 4px;
    gap: 12px;
  }
  .secondary-actions a {
    gap: 5px;
  }
  .profile-footer {
    padding-top: 4px;
    gap: 12px;
  }
  .profile-footer nav {
    gap: 16px;
  }
  .profile-footer p {
    font-size: 13px;
  }
}

/* Compact landscape windows keep the portrait beside the entire contact card. */
@media (min-width: 701px) and (max-height: 650px) {
  :root {
    --display: clamp(38px, 4.6vw, 60px);
    --body: 16px;
    --role: 22px;
  }
  .profile {
    padding-block: 12px;
  }
  .contact-card {
    min-height: calc(100svh - 76px);
    grid-template-columns: 1.5fr 1fr;
  }
  .card-content {
    padding: 24px 32px;
  }
  .role {
    margin-top: 16px;
  }
  .role br {
    display: none;
  }
  .intro {
    margin-top: 12px;
    max-width: 42ch;
  }
  .actions {
    margin-top: 20px;
  }
  .profile-footer {
    padding-top: 4px;
  }
}

@media (hover: hover) {
  nav a:hover,
  .secondary-actions a:hover {
    text-decoration: underline;
  }
  .button:hover span {
    transform: translate(2px, -2px);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .button span,
  .secondary-actions a {
    transition: transform 220ms var(--ease);
  }
  .button:active {
    transform: translateY(1px);
  }
  .contact-card {
    animation: card-arrive 800ms var(--ease) both;
  }
  .portrait img {
    animation: portrait-arrive 1200ms var(--ease) both;
  }
  @keyframes card-arrive {
    from {
      opacity: 0.5;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes portrait-arrive {
    from {
      transform: scale(1.035);
    }
    to {
      transform: scale(1);
    }
  }
}

/* On landscape phones the actions form one row beneath the portrait and bio. */
@media (min-width: 560px) and (max-height: 500px) {
  :root {
    --display: clamp(30px, 4.4vw, 40px);
    --role: 20px;
    --body: 16px;
  }
  .profile {
    padding-block: 8px;
  }
  .profile-frame {
    max-width: 1280px;
  }
  .contact-card {
    grid-template-columns: 1.6fr 1fr;
    gap: 8px 24px;
    min-height: calc(100svh - 64px);
    padding: 12px 24px;
  }
  .card-content {
    display: contents;
  }
  h1 {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
  }
  .role {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    align-self: center;
  }
  .role br {
    display: none;
  }
  .intro {
    grid-column: 1;
    grid-row: 3;
    margin: 0;
    line-height: 1.4;
    align-self: start;
  }
  .portrait {
    grid-column: 2;
    grid-row: 1 / 4;
    height: auto;
    aspect-ratio: auto;
    align-self: stretch;
  }
  .portrait img {
    object-position: center 25%;
  }
  .actions {
    grid-column: 1 / -1;
    grid-row: 4;
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
    margin: 0;
  }
  .button {
    flex: 1;
    min-height: 48px;
    padding: 12px 16px;
    gap: 16px;
  }
  .secondary-actions {
    flex: 1;
    margin: 0;
    gap: 16px;
    white-space: nowrap;
  }
  .profile-footer {
    padding-top: 4px;
  }
}

@media (max-width: 1000px) {
  .legal-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .legal-heading {
    position: static;
  }
  .legal-index {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 24px;
    margin-top: 24px;
  }
  .legal-back {
    margin-top: 28px;
  }
  .legal-copy {
    max-width: 68ch;
  }
  .legal-card--compact {
    align-content: start;
    gap: 48px;
  }
}

@media (max-width: 700px) {
  .legal {
    padding-block: 12px;
  }
  .legal-frame {
    max-width: 460px;
  }
  .legal-card {
    padding: 28px;
  }
  .legal-card--compact {
    min-height: 0;
  }
  .legal h1 {
    font-size: clamp(32px, 9.8vw, 48px);
  }
  .legal h2 {
    font-size: 24px;
  }
  .legal-back {
    max-width: none;
    margin-top: 24px;
  }
  .legal-index {
    display: grid;
    gap: 0;
  }
  .legal-contact address p:first-child {
    font-size: 24px;
  }
}
