/* ============================================================
   A Room for Intermedia Practices — styles
   Values follow web_design_oct2026.pdf (a 1280 px wide page).
   ============================================================ */

/* ---------- 1. Colours: change the whole scheme here ---------- */
:root {
  --paper: #aeb8a0;      /* background */
  --ink:   #44493a;      /* text, lines, buttons */
  --frame: #ffffff;      /* the white frame + X drawn on top of images */

  /* Duotone for images: black in the photo becomes --duo-dark,
     white becomes --duo-light, everything in between is blended. */
  --duo-dark:  #222e19;
  --duo-light: #e4e7df;
  --duo-curve: 1.4;      /* 1 = even blend; higher = darker midtones */

  --serif: "IBM Plex Serif", Georgia, serif;
  --mono:  "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --content: 980px;      /* width of the content column (lines, nav) */
  --pad: 18px;           /* text inset from the lines */
  --side: 313px;         /* right column: side note + images */
  --gutter: 24px;        /* space between text column and images */
  --small: 14px;         /* small text: menu, bios, contact details */
  --hair: 0.5px;         /* thin rule lines */
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;          /* keeps headings clear of the top bar */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(15px, 1.64vw, 21px);
  line-height: 1.34;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
p { margin: 0; }
img { display: block; max-width: 100%; }

/* links inside text: underlined, italic on hover (as before) */
.section a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.section a:hover { font-style: italic; }

/* ---------- 3. Top bar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
}
.nav-inner {
  max-width: var(--content);
  margin: 0 auto;
  height: 76px;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: var(--hair) solid var(--ink);
}
.logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
.menu {
  display: flex;
  align-items: center;
  gap: 48px;
  font-size: var(--small);
  white-space: nowrap;
}
.menu a { text-decoration: none; }
.menu a:hover { text-decoration: underline; text-underline-offset: 5px; }
.menu a.active {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1.2px;
}
.menu .sep { margin: 0 -12px; }

/* ---------- 4. Sections ---------- */
main, .footer {
  max-width: var(--content);
  margin: 0 auto;
}
.section {
  padding: 30px 7px 20px var(--pad);
  border-top: var(--hair) solid var(--ink);
}
.section:first-child { border-top: 0; padding-top: 48px; }

/* section titles (# in the .md files) */
.section h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(34px, 4.375vw, 56px);
  line-height: 1.2;
  margin: 0 0 24px;
}

/* ---------- 5. Home ---------- */
#home h1 {
  font-size: clamp(40px, 6.02vw, 77px);
  margin: 0;
  max-width: 11em;                     /* breaks as "A Room for / Intermedia Practices" */
}
#home .intro p {
  font-size: clamp(19px, 2.19vw, 28px);
  line-height: 1.5;
  max-width: 58ch;
}
#home sup { font-family: var(--serif); font-weight: 700; font-size: 0.73em; line-height: 0; }

/* bottom of home: side note right, then TOP button left on its own row,
   with the same space above it as at the end of the other sections */
#home .home-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  row-gap: 1.34em;
  margin-top: 12px;
}
#home .home-foot .note { grid-column: 2; grid-row: 1; }
#home .home-foot .top { grid-column: 1; grid-row: 2; justify-self: start; }

/* the side note (a line starting with > in home.md) */
.note {
  margin: 0;
  position: relative;
  padding-left: 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.53;
}
.note::before { content: "*"; position: absolute; left: 0; top: 0; }
.note p + p { margin-top: 0.8em; }

/* ---------- 6. Entries (## in the .md files) ---------- */
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  grid-template-areas:
    "head ."
    "body side";
  column-gap: var(--gutter);           /* keeps text away from the image frame */
  margin-bottom: 1.34em;               /* one blank line, like the PDF */
}
.entry h2 {
  grid-area: head;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1em;
  line-height: inherit;
  margin: 0;
}
.entry .body { grid-area: body; max-width: 50ch; }
.entry .body > * + * { margin-top: 1.34em; }
.entry .side { grid-area: side; display: flex; flex-direction: column; gap: 24px; }
.intro-text > * + * { margin-top: 1.34em; }
.intro-text { max-width: 50ch; margin-bottom: 2em; }
#about .intro-text { max-width: none; }   /* About intro uses the full width */

/* ### headings: small serif titles shown side by side (team, contact) */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.34em 48px;
  margin: 0.5em 0 1.34em;
}
.card h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1em;
  margin: 0 0 0.4em;
}
.card > * + * { margin-top: 1em; }
.card > :not(h3) { font-size: var(--small); line-height: 1.5; }   /* bios, email, location */

/* images among ### columns that are not inside a ## entry sit below them
   (inside an entry, e.g. Team, they go in the right column instead) */
.below-cards { display: flex; flex-direction: column; gap: 24px; margin-bottom: 1.34em; }
.below-cards .frame { width: fit-content; max-width: 642px; }   /* frame hugs the photo */
.below-cards .frame img { width: auto; max-height: 80vh; }          /* tall photos stay on screen */

/* ---------- 7. Images: duotone + white frame with X ---------- */
.frame {
  position: relative;
  margin: 0;
  padding: 10px;                       /* gap between frame and photo */
}
.frame img {
  width: 100%;
  height: auto;
  filter: url(#duotone);
}
.frame svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.frame svg * {
  stroke: var(--frame);
  stroke-width: 0.75;
  fill: none;
  vector-effect: non-scaling-stroke;
}

/* ---------- 8. "↑ TOP" button ---------- */
.top {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 15px;
  border: var(--hair) solid var(--ink);
  background: none;
  color: inherit;
  font: 14px/20px var(--mono);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.top:hover { background: var(--ink); color: var(--paper); font-style: normal; }
.section a.top { text-decoration: none; }

/* ---------- 9. Footer + messages ---------- */
.footer {
  padding: 32px var(--pad) 48px;
  border-top: var(--hair) solid var(--ink);
  font-size: 13px;
}
.load-error { font-size: 14px; font-style: italic; }

/* ---------- 10. Phones and narrow windows ---------- */
@media (max-width: 820px) {
  :root { --pad: 16px; }
  html { scroll-padding-top: 100px; }
  .nav-inner {
    height: auto;
    padding-top: 14px;
    padding-bottom: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .menu { gap: 18px; font-size: 13px; flex-wrap: wrap; row-gap: 4px; }
  .menu .sep { display: none; }
  .section { padding-right: var(--pad); }

  #home .home-foot,
  .entry { grid-template-columns: 1fr; }
  .entry { grid-template-areas: "head" "body" "side"; }
  .entry .side { margin-top: 1.34em; max-width: 420px; }
  #home .home-foot .note { grid-column: 1; grid-row: 1; margin: 1em 0 0 15%; }
  #home .home-foot .top  { grid-column: 1; grid-row: 2; margin-top: 32px; justify-self: start; }
  .cards { grid-template-columns: 1fr; }
}
