/* Talking Ape site: one stylesheet for all six pages.
   Design B, "The study at night": the deep forest ground, Playfair Display and Newsreader,
   fine gold rules and arched portrait frames. Plain CSS, no build step, no script. */

:root {
  --ground: #0E2620;
  --panel: #12302A;
  --deep: #091B17;
  --line: #21433B;
  --text: #F7F1DE;
  --muted: #9FB3A8;
  --gold: #D8A94A;
  --gold-hover: #ECD08D;
  --gold-faint: rgba(216, 169, 74, 0.35);
  --display: 'Playfair Display', Georgia, serif;
  --body: 'Newsreader', Georgia, serif;
  --gutter: 24px;
  --page: calc(72rem + 2 * var(--gutter));
  --measure: 38rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.1875rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--gold); color: var(--ground); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 0.28em; }
a:hover { color: var(--text); }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0 0 0.5em; color: var(--text); }
h1 { font-size: clamp(2.125rem, 4vw, 3.25rem); letter-spacing: -0.005em; }
h2 { font-size: clamp(1.625rem, 2.4vw, 2rem); line-height: 1.25; font-style: italic; color: var(--gold); }
h3 { font-size: 1.5rem; line-height: 1.2; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.3em; }
li::marker { color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 1rem; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; padding: 0.5rem 1rem; background: var(--panel); color: var(--text); }

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

/* Ornaments: the gold rule with a hollow diamond, the kicker label, the status label */
.rule, .ornament { display: flex; align-items: center; gap: 12px; }
.rule { margin: 0 0 34px; }
.rule span { width: 44px; height: 1px; background: var(--gold); }
.ornament span { width: 32px; height: 1px; background: var(--gold); }
.rule i, .ornament i { width: 6px; height: 6px; border: 1px solid var(--gold); transform: rotate(45deg); }
.rule.small { margin-bottom: 20px; }
.rule.small span { width: 24px; }
.kicker {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  font-size: 0.75rem; line-height: 1.5; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text);
}
.kicker::before { content: ""; flex: none; width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg); }
.stage {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.72rem; line-height: 1.5; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text);
}
.stage::before, .stage::after { content: ""; flex: none; width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg); }

/* Buttons and the contact line */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 30px;
  background: var(--gold); color: var(--ground); font-family: var(--body); font-size: 1.0625rem; font-weight: 500;
  line-height: 1.2; letter-spacing: 0.02em; text-align: center; text-decoration: none; border-radius: 6px 16px 6px 16px;
}
.button:hover { background: var(--gold-hover); color: var(--ground); }
.contact-line { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin: 32px 0 20px; }
.address { font-size: 1rem; color: var(--muted); }

/* The framed panel */
.panel, .details, .ws-contact { background: var(--panel); border: 1px solid var(--line); outline: 1px solid var(--gold-faint); outline-offset: -12px; }

/* The arched portrait frame ("door") */
.door {
  width: 100%; height: auto; aspect-ratio: 336 / 432; object-fit: cover; object-position: 50% 0%;
  padding: 9px; border: 1px solid var(--gold); border-radius: 999px 999px 3px 3px; background: var(--ground);
}
.door-barnaby { object-position: 45% 0%; }
.door-arthur { object-position: 38% 0%; }

/* Header */
.topbar-inner {
  max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); min-height: 92px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 36px;
}
.brand {
  display: inline-flex; align-items: center; gap: 16px; color: var(--text); text-decoration: none;
  font-family: var(--display); font-weight: 600; font-size: 1.375rem; line-height: 1.35; letter-spacing: 0.02em;
}
.brand:hover { color: var(--gold); }
.brand img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--gold), 0 0 0 4px var(--ground), 0 0 0 5px rgba(216, 169, 74, 0.45); }
.menu { display: flex; flex-wrap: wrap; gap: 4px 36px; margin: 0; padding: 0; list-style: none; font-size: 0.96875rem; line-height: 1.5; letter-spacing: 0.02em; }
.menu a { color: var(--muted); text-decoration: none; }
.menu a:hover { color: var(--gold); }
.menu a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 6px; }

/* Footer */
.footer { margin-top: 120px; background: var(--deep); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }
.footer-inner { min-height: 96px; padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 36px; }
.footer p { margin: 0; }
.footer ul { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; list-style: none; }
.footer a { color: var(--text); text-decoration: none; }
.footer a:hover { color: var(--gold); }

/* Home: the portrait band */
.band { position: relative; max-width: 1440px; height: clamp(280px, 33.4vw, 480px); margin: 0 auto; overflow: hidden; }
.band img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 24%; }
.band::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, #0E2620 0%, rgba(14, 38, 32, 0) 11%, rgba(14, 38, 32, 0) 78%, #0E2620 100%),
    radial-gradient(ellipse 58% 95% at 50% 42%, rgba(14, 38, 32, 0) 56%, rgba(14, 38, 32, 0.5) 80%, rgba(14, 38, 32, 0.92) 100%);
}

/* Home: the opening */
.hero { padding-top: 56px; }
.hero h1 { max-width: 17.5em; margin: 0; font-size: clamp(2.125rem, 4.03vw, 3.625rem); line-height: 1.14; }
.for-whom { max-width: 38em; margin: 30px 0 0; font-size: clamp(1.125rem, 1.46vw, 1.3125rem); line-height: 1.45; color: var(--muted); }
.hero .contact-line { margin: 40px 0 0; }
.hero .small { margin: 20px 0 0; }

/* Home: the three parts */
.parts-section { margin-top: 112px; }
h2.lined { display: flex; align-items: center; gap: 28px; margin: 0; }
h2.lined::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 72px; margin-top: 60px; }
.part { display: flex; flex-direction: column; align-items: center; text-align: center; }
.part-figure { order: -1; width: 100%; margin: 0; }
.part-figure figcaption { margin-top: 14px; font-size: 0.9375rem; line-height: 22px; font-style: italic; color: var(--muted); }
.part-figure.no-caption { padding-bottom: 36px; }
.part-words { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; width: 100%; }
.part h3 { margin: 24px 0 0; font-size: 1.75rem; line-height: 1.2; }
.ape-name { margin: 10px 0 0; font-style: italic; font-size: 1.0625rem; line-height: 1.4; color: var(--gold); }
.part-desc { margin: 14px 0 0; font-size: 1.0625rem; line-height: 1.55; color: var(--muted); }
.part-status { margin: auto 0 0; padding-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* Home: who runs it, the tools, getting in touch */
.duo { display: grid; grid-template-columns: minmax(0, 720fr) minmax(0, 336fr); gap: 56px 96px; align-items: center; margin-top: 120px; }
.panel.who { padding: 56px 64px; }
.panel.who h2 { font-size: 1.625rem; margin-bottom: 0.4em; }
.panel.who .who-text { font-size: 1.375rem; line-height: 1.55; }
.signature { display: block; margin-bottom: 16px; font-family: var(--display); font-style: italic; font-size: 2.5rem; line-height: 1.15; color: var(--gold); }
.panel.who .links { margin: 0; font-size: 1.03rem; }
.tools .tools-text { margin: 0; font-size: 1.0625rem; line-height: 1.6; color: var(--muted); }
.touch { max-width: var(--measure); margin-top: 112px; }
.touch .contact-line { margin: 28px 0 18px; }

/* Plain pages: About, Contact, the missing page, Library */
.page-head { padding-top: 64px; }
.page-head h1 { margin-bottom: 0.4em; }
.lead { font-size: clamp(1.1875rem, 1.6vw, 1.375rem); line-height: 1.5; }
.page-head h1 + .ape-name { margin: -0.2em 0 1.2rem; font-size: 1.25rem; }
.stack > section + section { margin-top: 56px; padding-top: 56px; border-top: 1px solid var(--line); }
.plain-list li { margin: 0.25em 0; padding-left: 0.2em; }
.details { margin: 36px 0; padding: 36px 44px; }
.details dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 28px; margin: 0; }
.details dt { font-style: italic; color: var(--muted); }
.details dd { margin: 0; }
.beside { display: grid; grid-template-columns: minmax(0, 40rem) 300px; justify-content: space-between; gap: 48px 64px; align-items: start; }
.beside h2 { margin-top: 1.6em; }
.beside figure { margin: 0; }
.beside figcaption { margin-top: 14px; text-align: center; font-size: 0.9375rem; font-style: italic; color: var(--muted); }

/* Workshop Ape: a long page, set for reading (about 65 characters to the line) */
.ws-layout { display: flex; align-items: flex-start; max-width: 1440px; margin: 0 auto; }
.ws-layout + .footer { margin-top: 96px; }
.ws-side { display: none; }
.ws-side-brand { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.ws-side-name { font-family: var(--display); font-size: 1.5rem; font-weight: 600; letter-spacing: 0.04em; line-height: 1.3; }
.ws-side-name span { color: var(--gold); }
.ws-side-sub { margin-top: 6px; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.ws-side-nav { display: flex; flex-direction: column; gap: 2px; font-size: 1rem; line-height: 1.4; }
.ws-side-nav a { padding: 8px 0 8px 16px; color: var(--muted); text-decoration: none; border-left: 1px solid var(--line); }
.ws-side-nav a:hover { color: var(--text); border-left-color: var(--gold); }
.ws-side-nav a.is-current { color: var(--text); border-left-color: var(--gold); }
.ws-side-foot { padding-top: 24px; border-top: 1px solid var(--line); }
.ws-side-note { margin-bottom: 14px; font-size: 0.9375rem; color: var(--muted); }
.ws-side .button { width: 100%; min-height: 48px; padding: 0 16px; }
.ws-main { flex: 1 1 auto; min-width: 0; padding: 48px var(--gutter) 0; }
.ws-section { padding: 64px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.ws-section.is-first { padding-top: 0; }
.ws-section.is-last { padding-bottom: 0; border-bottom: 0; }
.ws-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: start; }
.ws-h1 { margin: 0; font-size: clamp(2.25rem, 4.2vw, 3.5rem); line-height: 1.08; }
.ws-h1 span { font-style: italic; color: var(--gold); }
.ws-ape { margin: 12px 0 0; font-style: italic; font-size: 1.25rem; color: var(--gold); }
.ws-lede { max-width: 31em; margin: 24px 0 0; font-size: 1.375rem; line-height: 1.5; }
.ws-sub { max-width: 27.5em; margin: 16px 0 0; color: var(--muted); }
.ws-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 32px; }
.ws-textlink { display: inline-flex; gap: 8px; text-decoration: none; }
.ws-textlink span:first-child { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.28em; }
.ws-portrait { max-width: 340px; margin: 0 auto; text-align: center; }
.ws-portrait .door { object-position: 50% 10%; }
.ws-portrait-caption { margin-top: 16px; }
.ws-portrait-caption .who { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.ws-portrait-caption .role { margin-top: 2px; font-family: var(--display); font-size: 1.375rem; line-height: 1.3; }
.ws-portrait-caption .line { margin-top: 4px; font-style: italic; font-size: 1rem; color: var(--muted); }
.ws-h2 { margin: 0 0 20px; }
.ws-h2.is-spaced { margin-bottom: 32px; }
.ws-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.ws-card { padding: 26px 28px; background: var(--panel); border: 1px solid var(--line); }
.ws-card h3 { margin: 0 0 8px; font-size: 1.375rem; line-height: 1.3; }
.ws-card p { margin: 0; font-size: 1.0625rem; line-height: 1.6; color: var(--muted); }
.ws-term { padding: 4px 0 4px 22px; border-left: 1px solid var(--gold-faint); }
.ws-term p { max-width: 27.5em; margin: 0; line-height: 1.7; }
.ws-contact { padding: 48px 56px; }
.ws-contact-inner { max-width: 36rem; }
.ws-contact-inner > p { margin-bottom: 28px; }
.ws-contact .ws-actions { margin-top: 0; }
.ws-contact .addr { font-size: 1rem; color: var(--muted); }
.ws-linkedin { margin-top: 20px; }

@media (min-width: 768px) {
  .ws-side { display: flex; flex-direction: column; gap: 32px; flex: none; width: 240px; position: sticky; top: 0; padding: 40px 24px; border-right: 1px solid var(--line); }
  .ws-main { padding: 48px 40px 0; }
  .ws-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-card.is-wide { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .ws-side { width: 280px; padding: 48px 32px; }
  .ws-main { padding: 56px 64px 0; }
  .ws-hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; }
}

/* Narrower screens */
@media (max-width: 1100px) {
  .duo { grid-template-columns: minmax(0, 1fr); }
  .panel.who { max-width: 48rem; }
  .parts { gap: 40px; }
}

/* Phones */
@media (max-width: 760px) {
  body { font-size: 1.125rem; }

  .topbar-inner { min-height: 0; padding-top: 12px; padding-bottom: 6px; gap: 2px 20px; }
  .brand { gap: 12px; min-height: 44px; font-size: 1.1875rem; }
  .brand img { width: 32px; height: 32px; box-shadow: 0 0 0 1px var(--gold), 0 0 0 3px var(--ground), 0 0 0 4px rgba(216, 169, 74, 0.45); }
  .topbar nav { width: 100%; }
  .menu { gap: 0 20px; font-size: 1rem; }
  .menu a { display: inline-block; padding: 9px 0; }

  .band { height: 280px; }
  .band img { object-position: 50% 30%; transform: scale(1.24); transform-origin: 50% 38%; }
  .band::after {
    background:
      linear-gradient(to bottom, #0E2620 0%, rgba(14, 38, 32, 0) 12%, rgba(14, 38, 32, 0) 72%, #0E2620 100%),
      radial-gradient(ellipse 70% 100% at 50% 40%, rgba(14, 38, 32, 0) 58%, rgba(14, 38, 32, 0.45) 84%, rgba(14, 38, 32, 0.85) 100%);
  }

  .hero { padding-top: 30px; }
  .rule { margin-bottom: 24px; }
  .rule span { width: 36px; }
  .hero h1 { line-height: 1.18; }
  .for-whom { margin-top: 20px; }
  .contact-line { flex-direction: column; align-items: stretch; gap: 14px; }
  .hero .contact-line { margin-top: 28px; }
  .button { width: 100%; }

  .parts-section { margin-top: 72px; }
  h2.lined { gap: 20px; }
  .parts { grid-template-columns: minmax(0, 1fr); gap: 44px; margin-top: 36px; }
  .part { display: grid; grid-template-columns: 128px minmax(0, 1fr); grid-template-rows: 1fr auto auto auto 1fr auto auto; column-gap: 20px; align-items: start; text-align: left; }
  .part-words, .part-status { display: contents; }
  .part-figure { grid-column: 1; grid-row: 1 / 6; }
  .part-figure.no-caption { padding-bottom: 0; }
  .part-figure figcaption { margin-top: 8px; font-size: 0.8125rem; line-height: 1.35; text-align: center; }
  .door { padding: 6px; }
  .part h3 { grid-column: 2; grid-row: 2; margin: 0; font-size: 1.4375rem; }
  .part .ape-name { grid-column: 2; grid-row: 3; margin-top: 6px; font-size: 0.96875rem; }
  .part .stage { grid-column: 2; grid-row: 4; justify-self: start; margin-top: 14px; font-size: 0.6875rem; letter-spacing: 0.12em; }
  .part .stage::after { display: none; }
  .part-desc { grid-column: 1 / -1; grid-row: 6; margin-top: 20px; }
  .part .more { grid-column: 1 / -1; grid-row: 7; justify-self: start; padding: 10px 0; }

  .duo { margin-top: 72px; }
  .panel.who { padding: 34px 24px; outline-offset: -9px; }
  .panel.who h2 { font-size: 1.5rem; }
  .panel.who .who-text { font-size: 1.125rem; }
  .signature { font-size: 2rem; }
  .touch { margin-top: 56px; }
  .touch .contact-line { margin-top: 22px; }

  .footer { margin-top: 64px; }
  .ws-layout + .footer { margin-top: 64px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer p { font-size: 0.8125rem; }

  .page-head { padding-top: 40px; }
  .stack > section + section { margin-top: 40px; padding-top: 40px; }
  .details { padding: 26px 24px; outline-offset: -9px; }
  .details dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .details dd { margin-bottom: 12px; }
  .beside { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .beside figure { max-width: 240px; }

  .ws-main { padding-top: 32px; }
  .ws-section { padding: 48px 0; }
  .ws-portrait { max-width: 280px; }
  .ws-contact { padding: 34px 24px; outline-offset: -9px; }
}
