/* ==========================================================================
   The Stone Family — stone-family.net
   Single stylesheet. No build step, no preprocessor.

   Contents
     1. Fonts
     2. Theme tokens (dark is the default; light is opt-in via the OS setting)
     3. Base + layout
     4. Hero
     5. "Who's here" section + member cards
     6. Responsive
   ========================================================================== */


/* 1. Fonts ================================================================= */
/* Self-hosted, subset to Latin + the punctuation this site uses.
   See README.md → "Fonts" for how these were generated. */

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/instrument-serif-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/instrument-serif-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/eb-garamond-400.woff2') format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/eb-garamond-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-400.woff2') format('woff2');
}


/* 2. Theme tokens ========================================================== */
/* Dark is defined on :root so it is what you get by default — including when a
   browser reports no preference at all. Light is applied only when the visitor
   has actively asked for it. Nothing here needs JavaScript. */

:root {
  color-scheme: dark;

  --bg:            #1b1714;
  --ink:           #f1e9db;
  --ink-lede:      rgba(241, 233, 219, 0.68);
  --ink-tagline:   rgba(241, 233, 219, 0.6);
  /* Mockup had these at .45 / .40; lifted to .55 to clear WCAG AA (4.5:1).
     See README → "A note on the colours". */
  --ink-muted:     rgba(241, 233, 219, 0.55);
  --ink-faint:     rgba(241, 233, 219, 0.55);
  --accent:        #d3936a;
  --rule:          rgba(241, 233, 219, 0.16);

  --card-bg:       #241e1a;
  --card-shadow:   0 8px 22px rgba(0, 0, 0, 0.4);
  --photo-shadow:  0 2px 0 rgba(0, 0, 0, 0.3);

  --serif-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --serif-text:    'EB Garamond', Georgia, 'Times New Roman', serif;
  --mono:          'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter:        44px;
  --measure:       1080px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;

    --bg:            #f6f0e4;
    --ink:           #2b2620;
    --ink-lede:      rgba(43, 38, 32, 0.72);
    /* Mockup had these at .62 / .50 / .45 and the accent at #b0603a. Light mode
       is where the muted greys fall short of WCAG AA, so each is lifted to the
       lowest value that clears 4.5:1. See README → "A note on the colours". */
    --ink-tagline:   rgba(43, 38, 32, 0.66);
    --ink-muted:     rgba(43, 38, 32, 0.66);
    --ink-faint:     rgba(43, 38, 32, 0.66);
    --accent:        #a05330;
    --rule:          rgba(43, 38, 32, 0.16);

    --card-bg:       #fffdf7;
    --card-shadow:   0 6px 18px rgba(43, 38, 32, 0.12);
    --photo-shadow:  0 2px 0 rgba(43, 38, 32, 0.1);
  }
}


/* 3. Base + layout ========================================================= */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 19px/1.55 var(--serif-text);
  overflow-x: clip;                 /* the cards are rotated a degree or two */
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: var(--accent); }

a:focus-visible,
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.page {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}


/* 4. Hero ================================================================== */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 52px;
  align-items: center;
  padding-block: 48px 32px;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-right: 64px;
}

.eyebrow {
  font: 400 12px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Mode label — states which theme is active. It is not a control: the site
   follows the OS setting, so there is nothing to click. Styled as plain text
   rather than a pill so it does not invite one. */
.mode {
  font: 400 10px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* Dark is the default, so show "dark mode" unless the visitor prefers light. */
.mode__light { display: none; }

@media (prefers-color-scheme: light) {
  .mode__light { display: inline; }
  .mode__dark  { display: none; }
}

.hero__title {
  font: 400 clamp(38px, 2.1rem + 2.6vw, 62px)/1.06 var(--serif-display);
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.hero__title em { font-style: italic; }

.hero__lede {
  max-width: 38ch;
  color: var(--ink-lede);
  text-wrap: pretty;
}

.hero__photo img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  box-shadow: var(--photo-shadow);
}


/* 5. "Who's here" ========================================================== */

.members { padding-block: 8px 48px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 27px;
}

.section-head__title {
  font: 400 30px/1 var(--serif-display);
}

.section-head__rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.section-head__note {
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

.member {
  background: var(--card-bg);
  padding: 12px 12px 18px;
  box-shadow: var(--card-shadow);
}

/* Each card sits at a slightly different angle, like photos on a table. */
.member:nth-child(1) { transform: rotate(-1.6deg); }
.member:nth-child(2) { transform: rotate(1.2deg); }
.member:nth-child(3) { transform: rotate(-0.8deg); }
.member:nth-child(4) { transform: rotate(2deg); }

.member__photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.member__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 4px 0;
}

.member__name {
  font: 400 24px/1 var(--serif-display);
}

.member__tagline {
  font: italic 400 15px/1.4 var(--serif-text);
  color: var(--ink-tagline);
}

.member__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  font: 400 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
  /* Cancels the padding the links add below, so the block still sits where the
     6px-gap version did. */
  margin-block: -5px;
}

.member__links a {
  color: var(--accent);
  text-decoration: none;
  /* 11px text gives a ~17px tall tap target. The padding brings it past the
     24px WCAG 2.5.8 minimum, without changing how it looks. */
  padding-block: 5px;
}

.member__links a::after { content: '\00a0→'; }

.member__links a:hover,
.member__links a:focus-visible { text-decoration: underline; }

/* No links to pad, so match the padding above and stay aligned with the cards
   that do have them. */
.member__links--none {
  color: var(--ink-faint);
  padding-block: 5px;
}


/* 6. Responsive ============================================================ */

@media (max-width: 1000px) {
  .member-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  :root { --gutter: 28px; }

  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-block: 32px 27px;
  }

  .hero__meta { padding-right: 0; }
  .hero__lede { max-width: 46ch; }
}

@media (max-width: 480px) {
  :root { --gutter: 22px; }

  body { font-size: 18px; }

  .member-grid { grid-template-columns: 1fr; gap: 22px; }
  .members { padding-bottom: 48px; }
  .section-head { padding-bottom: 26px; }
}

/* Honour a request for reduced motion by sitting the cards up straight. */
@media (prefers-reduced-motion: reduce) {
  .member { transform: none; }
}

@media print {
  body { background: #fff; color: #000; }
  .mode { display: none; }
}
