/* ---- Fonts (self-hosted, latin) ---- */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700; /* variable */
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
}
/* ---- Design tokens (Baltic night: sea-chart palette, dark theme) ---- */
:root {
  --bg: #0c1a22; /* deep water */
  --surface: #16262e; /* raised panel */
  --line: #47707f; /* control borders; 3.3:1 on --bg */
  --text: #eaf0f1; /* cold white */
  --muted: #8fa6ae; /* sea grey-blue; 6.9:1 on --bg */
  --mark: #e85d9b; /* chart magenta: every interactive thing */
  --mark-hover: #f47fb0;

  --font-sans:
    "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono:
    "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    monospace;

  --radius-md: 0.375rem;

  /* type scale: four sizes, nothing in between */
  --fs-label: 0.75rem; /* 12px, mono labels and buttons */
  --fs-body: 1.1875rem; /* 19px */
  --fs-lede: 1.375rem; /* 22px, mobile */
  --fs-lede-lg: 1.5rem; /* 24px */

  --measure: 42rem; /* ~672px: 65-78 characters at 19px */

  /* spacing: one unit, used in multiples. no gap is tuned by eye */
  --u: 0.5rem;
  --u2: 1rem;
  --u3: 1.5rem;
  --u5: 2.5rem;
  --u8: 4rem;
  --u10: 5rem;
  --u12: 6rem;
  --u20: 10rem;
  --fs-h1: 1.75rem; /* 28px, mobile */
  --fs-h1-lg: 2rem; /* 32px */
  --fs-h1-error: 2.25rem;
  --fs-h1-error-lg: 2.75rem;
}

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

html {
  background-color: var(--bg);
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
}

a {
  color: inherit;
}

/* prose links: the accent's main job, and previously invisible */
.lead a,
.contact__body p a,
.error__aside a {
  color: var(--mark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}

.lead a:hover,
.contact__body p a:hover,
.error__aside a:hover {
  color: var(--mark-hover);
}

img {
  max-width: 100%;
  height: auto;
}

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

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: 65rem; /* 1040px */
  margin-inline: auto;
  padding-inline: var(--u2);
}

@media (min-width: 640px) {
  .container {
    padding-inline: var(--u5);
  }
}

@media (max-width: 640px) {
  .container {
    overflow-x: hidden;
  }
}

/* ---- Arrival ----
   screen 1 arrives as one unit, not a choreographed queue.
   screen 2 reveals as you scroll into it, so it reads as the page
   meeting you rather than performing at you. no JS: CSS only, and the
   whole thing is gated behind no-preference */
@media (prefers-reduced-motion: no-preference) {
  @keyframes arrive {
    from {
      opacity: 0;
      transform: translateY(0.6rem);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .screen--intro .screen__inner,
  .cue {
    animation: arrive 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }

  .cue {
    animation-delay: 0.25s;
  }

  /* scroll-driven: supported in Chrome/Edge; everything else just shows */
  @supports (animation-timeline: view()) {
    .row__col,
    .contact__body {
      animation: arrive 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
      animation-timeline: view();
      animation-range: entry 10% cover 28%;
    }
  }
}

/* ---- Screens ----
   two full-height screens: the argument, then the offer.
   dvh first so mobile browser chrome can't hide the cue below the fold */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen__inner {
  width: 100%;
}

/* screen 1: content at the top, cue pinned to the bottom edge */
.screen--intro {
  padding-block: var(--u5) var(--u3);
}

/* screen 2: shallower water. the change of ground is the signal */
.screen--offer {
  justify-content: center;
  padding-block: var(--u10);
  background-color: var(--surface);
}

/* the section grows past the viewport rather than clipping, so the closing
   lines can never be pushed off a short laptop screen */
.screen--offer .screen__inner {
  max-height: none;
}

/* the cue says what is down there, and it scrolls when clicked */
.cue {
  align-self: flex-start;
  margin-top: auto;
  padding-top: var(--u5);
  padding-inline: var(--u2);
  width: 100%;
  max-width: 65rem;
  margin-inline: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  color: var(--mark);
  text-decoration: none;
  transition: color 0.15s ease;
}

.cue:hover {
  color: var(--mark-hover);
}

/* the cue sits outside .container, so it mirrors its gutter by hand */
@media (min-width: 640px) {
  .cue {
    padding-inline: var(--u5);
  }
}

/* ---- Hero ---- */
.hero {
  margin-bottom: 0;
}

/* identity on top, social row below; side by side once there is room */
.hero__head {
  display: block;
  margin-bottom: var(--u5);
}

.hero__social {
  display: flex;
  margin: var(--u3) 0 0;
}

/* on a phone the first screen is for the copy: the social row costs
   vertical space and pushes the cue out of sight */
@media (max-width: 640px) {
  .hero__social {
    display: none;
  }
}

@media (min-width: 860px) {
  .hero__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }

  .hero__social {
    margin: 0;
    flex: none;
  }
}

.hero__identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding-top: 0.5rem;
  text-decoration: none;
}

@media (min-width: 641px) {
  .hero__identity {
    flex-direction: row;
    align-items: center;
  }
}

.hero__avatar {
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.hero__name h1 {
  margin: 0 0 0.25rem;
  font-size: var(--fs-h1); /* mobile */
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
}

@media (min-width: 640px) {
  .hero__name h1 {
    font-size: var(--fs-h1-lg);
  }
}

.hero__name .muted {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.4;
  color: var(--muted);
}

/* ---- Social nav ---- */
.social {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 20rem;
}

@media (min-width: 641px) {
  .social {
    max-width: none;
  }
}

.social__link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--muted);
  background-color: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.social__link:hover {
  color: var(--mark);
  border-color: var(--mark);
  background-color: var(--surface);
}

.social__icon {
  width: 2rem;
  height: 2rem;
}

/* ---- Body copy ---- */
.lead {
  margin: var(--u3) 0 0;
  max-width: var(--measure);
  font-size: var(--fs-body);
  line-height: 1.45;
  color: var(--muted);
  text-wrap: pretty;
}

.lead--lede {
  font-size: var(--fs-lede);
  max-width: var(--measure);
  line-height: 1.4;
  color: var(--text);
}

@media (min-width: 640px) {
  .lead--lede {
    font-size: var(--fs-lede-lg);
  }
}

.lead strong {
  font-weight: 600;
  color: var(--text);
}

.muted {
  color: var(--muted);
}

/* ---- Two columns: separated by space, not by lines ---- */
.row {
  display: grid;
  gap: var(--u10);
  margin: 0 0 var(--u10);
}

@media (min-width: 860px) {
  .row {
    grid-template-columns: 1fr 1fr;
    gap: var(--u8);
    align-items: start;
  }
}

.row__label {
  margin: 0 0 var(--u3);
  font-family: var(--font-mono);
  font-size: 0.875rem; /* 14px: a label has to outrank the lines under it */
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--text);
}

.row__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row__item,
.row__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.row__item + .row__item {
  margin-top: var(--u);
}

.row__text + .row__text {
  margin-top: var(--u3);
}

.row .btn {
  margin-top: var(--u3);
  border-radius: 0;
}

/* ---- Contact ---- */
.contact {
  margin: 0;
}

.contact__body {
  max-width: none;
}

.contact__body p {
  margin: 0 0 var(--u3);
  max-width: var(--measure);
  line-height: 1.45;
}

/* the address closes the page: readable, copyable, not hidden in a button */
.contact__email {
  display: inline-block;
  margin-top: var(--u);
  font-family: var(--font-mono);
  font-size: var(--fs-body);
  color: var(--mark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease;
}

.contact__email:hover {
  color: var(--mark-hover);
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.02em;
  background-color: var(--mark);
  color: var(--bg);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

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

/* ---- 404 ---- */
/* the only page that centers: nothing else competes for the viewport */
.error {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* same display scale as the hero name, so the two pages share one voice */
.error__title {
  margin: 0;
  font-size: var(--fs-h1-error);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
}

@media (min-width: 640px) {
  .error__title {
    font-size: var(--fs-h1-error-lg);
  }
}

.error__action {
  margin: 2rem 0 0;
}

.error__aside {
  margin-top: 2rem;
}

/* ---- Footer / language switch ---- */
.footer {
  padding-bottom: 2rem;
}

.footer__lang {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer__lang:hover {
  color: var(--mark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

/* ---- Accessibility ---- */
a:focus-visible,
.btn:focus-visible,
.social__link:focus-visible {
  outline: 2px solid var(--mark);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
