/* ==========================================================================
   Letterhead-style landing page: one ink colour, one serif, one sans.
   Mobile-first. Spacing and type scale fluidly between phone and desktop.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --soft: #f5f5f4;
  --ink: #1c2024;
  --ink-hover: #3a4148;
  --on-ink: #ffffff;
  --muted: #5b6269;
  --line: #d8dbde;
  --silhouette: #cdd1d4;

  --font-body: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;

  /* Fluid spacing: min, preferred, max */
  --space-page: clamp(1.25rem, 4vw, 2rem);
  --space-section: clamp(2.25rem, 6vw, 4rem);
  --space-gap: clamp(2rem, 6vw, 4.5rem);

  --radius: 4px;
  --max-width: 960px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Keeps content clear of notches and rounded corners on phones */
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

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

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* ---------- Layout container ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--max-width) + (var(--space-page) * 2));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 var(--space-page);
  display: flex;
  flex-direction: column;
}

/* ---------- Letterhead ---------- */
.letterhead {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: calc(clamp(1.75rem, 5vw, 3.25rem) + env(safe-area-inset-top, 0)) 0 1.75rem;
  border-bottom: 1px solid var(--ink);
}

.letterhead h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.4rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.letterhead .title {
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0;
}

.letterhead .number {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.contact {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-variant-numeric: tabular-nums;
}

.contact a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
.contact a:hover { text-decoration-thickness: 2px; }

/* ---------- Body: statement and photo ---------- */
.body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "photo"
    "text";
  gap: var(--space-gap);
  align-items: start;
  padding: var(--space-section) 0;
}

.statement { grid-area: text; }

.statement p {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.15rem);
  line-height: 1.3;
  max-width: 22em;
  margin: 0 0 2rem;
  text-wrap: balance;
}

/* ---------- Button ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.75rem;
  background: var(--ink);
  color: var(--on-ink);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.button:hover { background: var(--ink-hover); }

/* ---------- Photo ---------- */
.photo {
  grid-area: photo;
  margin: 0;
  width: 100%;
  max-width: 19rem;
  aspect-ratio: 1 / 1;              /* matches the square headshot, so nothing is cropped */
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--soft);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 100'><circle cx='40' cy='38' r='14' fill='%23cdd1d4'/><path d='M12 100c0-22 12-34 28-34s28 12 28 34z' fill='%23cdd1d4'/></svg>");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 65%;
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ==========================================================================
   Breakpoints (min-width, so phones get the base styles above)
   ========================================================================== */

/* Tablets and up: details move to the right of the name, photo sits left of the statement */
@media (min-width: 720px) {
  .letterhead {
    grid-template-columns: 1fr auto;
    align-items: end;
    column-gap: 3rem;
  }
  .contact { text-align: right; }

  .body {
    grid-template-columns: minmax(14rem, 19rem) 1fr;
    grid-template-areas: "photo text";
    column-gap: var(--space-gap);
  }
  .photo { max-width: none; }
}

/* Large desktop screens */
@media (min-width: 1400px) {
  :root { --max-width: 1040px; }
  body { font-size: 1.125rem; }
}

/* Phones: button full width, easy to tap */
@media (max-width: 480px) {
  .button { width: 100%; }
}

/* ==========================================================================
   User preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media (prefers-contrast: more) {
  :root { --muted: #3d4248; --line: #8f959b; }
}

/* ==========================================================================
   Print (clients sometimes print contact details)
   ========================================================================== */
@media print {
  body { font-size: 12pt; }
  .button { display: none; }
  .letterhead { grid-template-columns: 1fr auto; }
  .contact { text-align: right; }
  .body { grid-template-columns: 6cm 1fr; grid-template-areas: "photo text"; }
  .photo { max-width: 6cm; }
  a { text-decoration: none; }
}
