/* ==========================================================
   Rachel Spivey – site styles
   One stylesheet shared by all three pages.

   How this file is organised:
   1. Colours and fonts (variables) – change these to restyle the site
   2. Dark mode colours
   3. Base styles (body, links, headings)
   4. Header and navigation
   5. Page openings (home hero and inner-page headers)
   6. Sections and shared pieces
   7. About page pieces
   8. Agents page pieces
   9. Thought leadership page pieces
   10. Footer
   11. Phone and tablet layout
   ========================================================== */


/* ---------- 1. Colours and fonts ---------- */
:root {
  --bg: #F2F5F6;        /* page background */
  --surface: #FFFFFF;   /* cards and panels */
  --ink: #12232B;       /* main text */
  --muted: #51656E;     /* secondary text */
  --line: #CBD6DA;      /* borders and dividers */
  --accent: #0B5D6B;    /* teal: links, highlights */
  --accent-ink: #FFFFFF;/* text on top of the accent colour */
  --mark: #DDEBEE;      /* pale teal for tags */

  --display: "Bricolage Grotesque", "Segoe UI", Arial, sans-serif; /* headings */
  --body: "Source Sans 3", "Segoe UI", Arial, sans-serif;          /* paragraphs */
  --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;     /* labels */

  --max: 1040px;        /* widest the content gets */
}


/* ---------- 2. Dark mode ----------
   Used automatically when the visitor's device is set to dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E181C; --surface: #152329; --ink: #E6EEF0; --muted: #9BB0B8;
    --line: #2A3D45; --accent: #5CC4D2; --accent-ink: #06262C; --mark: #1B3138;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E181C; --surface: #152329; --ink: #E6EEF0; --muted: #9BB0B8;
  --line: #2A3D45; --accent: #5CC4D2; --accent-ink: #06262C; --mark: #1B3138;
  color-scheme: dark;
}


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

body {
  margin: 0;
  padding-inline: 20px;          /* side gutter on every screen size */
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

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

.wrap { max-width: var(--max); margin-inline: auto; }

h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
h1 { font-weight: 700; font-size: clamp(2.3rem, 6vw, 4rem); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 20px; }
h2 { font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 18px; }
h3 { font-weight: 500; font-size: 1.15rem; line-height: 1.25; margin: 0 0 6px; }

/* Small uppercase label used above headings */
.eyebrow {
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 14px;
}

/* Placeholder text you still need to replace. Search for "To add". */
.todo { color: var(--accent); font-family: var(--mono); font-size: 0.85rem; }


/* ---------- 4. Header and navigation ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  margin-inline: -20px; padding-inline: 20px;
}
.top .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 6px 24px; padding-block: 14px;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 24px; font-family: var(--mono); font-size: 0.85rem; }
.nav a { color: var(--muted); text-decoration: none; padding-block: 4px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--accent); }
/* The page you are on gets aria-current="page" in the HTML */
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }


/* ---------- 5. Page openings ---------- */
/* Home page hero: text on the left, three links on the right */
.hero { display: grid; grid-template-columns: 1fr 320px; gap: 48px; padding-block: 56px 32px; align-items: center; }
.hero > * { min-width: 0; }
.lede { font-size: 1.2rem; max-width: 34em; margin: 0; }

/* Your photo: a framed portrait with an offset teal block behind it */
.portrait { margin: 0; position: relative; max-width: 320px; }
.portrait::before {
  content: ""; position: absolute; inset: 16px -16px -16px 16px;
  background: var(--accent); border-radius: 4px; z-index: 0;
}
.portrait img {
  position: relative; z-index: 1; display: block; width: 100%;
  aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--line); background: var(--mark);
}

/* Photos are black and white; this keeps them crisp against the teal */
.portrait img, .about-photo img { filter: contrast(1.05); }

/* Second photo, beside the About text */
.about-grid { display: grid; grid-template-columns: 1fr 220px; gap: 32px; align-items: start; }
.about-grid > * { min-width: 0; }
.about-photo { margin: 0; }
.about-photo img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%; border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }

/* The three links under the hero */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-block: 16px 40px; }
.door { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 16px 18px; border-radius: 4px; }
.door:hover { border-color: var(--accent); }
.door span { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.door strong { display: block; font-family: var(--display); font-weight: 500; font-size: 1.15rem; margin-top: 2px; }

/* Inner pages (Agents, Thought leadership): a shorter opening */
.page-head { padding-block: 56px 40px; border-bottom: 1px solid var(--line); }
.page-head .lede { color: var(--muted); }

/* Source-to-pay strip: add class="on" to an <li> to highlight it */
.cycle { border-block: 1px solid var(--line); padding-block: 22px; }
.cycle p { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.stages { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; list-style: none; margin: 0; padding: 0; }
/* Each stage is cut into an arrow shape with clip-path, so they read as a flow */
.stages { gap: 2px; }
.stages li {
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
  background: var(--line); min-width: 0; overflow-wrap: anywhere;
  padding: 12px 18px 12px 24px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
}
.stages li:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 14px; }
.stages li.on { background: var(--accent); color: var(--accent-ink); }
.key { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; font-size: 0.9rem; color: var(--muted); }
.key i { display: inline-block; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; margin-right: 6px; }


/* ---------- 6. Sections and shared pieces ---------- */
/* Each section: a small label on the left, content on the right */
.block { display: grid; grid-template-columns: 180px 1fr; gap: 16px 40px; padding-block: 52px; border-bottom: 1px solid var(--line); }
.block > * { min-width: 0; }
.label { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 0; }

.prose p { max-width: 38em; margin: 0 0 14px; }
.intro { max-width: 38em; margin: 0 0 24px; color: var(--muted); }

/* Status tags, e.g. "In progress", "Coming soon" */
.tag {
  display: inline-block; justify-self: start;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 2px; background: var(--mark); color: var(--accent);
}
.tag.planned { background: transparent; border: 1px dashed var(--accent); }

.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.three > * { min-width: 0; }
.three p { margin: 0; color: var(--muted); }

/* Line icons in the Services section. Change the colour with "stroke". */
.icon { width: 44px; height: 44px; margin-bottom: 10px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Buttons */
.btn {
  display: inline-block; text-decoration: none;
  font-family: var(--mono); font-size: 0.82rem;
  padding: 8px 14px; border-radius: 3px;
  border: 1px solid var(--accent); color: var(--accent);
}
.btn:hover { background: var(--mark); }
.btn.solid { background: var(--accent); color: var(--accent-ink); }
.btn.solid:hover { opacity: 0.9; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }


/* ---------- 7. About page pieces ---------- */
/* Platforms and scale line */
.scale { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 24px; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.scale b { color: var(--ink); font-weight: 500; }

/* Implementation phases: numbered automatically */
.phases { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; list-style: none; margin: 0 0 28px; padding: 0; counter-reset: phase; }
.phases li { counter-increment: phase; min-width: 0; padding: 10px; border-top: 3px solid var(--accent); background: var(--surface); font-size: 0.92rem; line-height: 1.3; }
.phases li::before { content: "Phase " counter(phase); display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* Implementation case studies */
.case { display: grid; grid-template-columns: 220px 1fr; gap: 6px 28px; padding-block: 20px; border-top: 1px solid var(--line); }
.case > * { min-width: 0; }
.case .meta { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); display: grid; gap: 4px; align-content: start; }
.case .meta strong { font-family: var(--display); font-weight: 500; font-size: 1.05rem; color: var(--ink); }
.case ul { margin: 0; padding-left: 1.1em; color: var(--muted); max-width: 38em; }
.case li + li { margin-top: 4px; }
.case .figure { color: var(--ink); font-weight: 600; }

/* Work history */
.roles { list-style: none; margin: 0; padding: 0; }
.roles li { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; padding-block: 16px; border-top: 1px solid var(--line); }
.roles li:first-child { border-top: 0; padding-top: 0; }
.roles p { margin: 2px 0 0; color: var(--muted); grid-column: 1 / -1; max-width: 38em; }
.roles .when { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

/* Contact details */
.contact { display: grid; gap: 10px; }
.contact div { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.contact .k { font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); min-width: 90px; }


/* ---------- 8. Agents page pieces ---------- */
.agents { display: grid; gap: 20px; }
.agent {
  display: grid; grid-template-columns: 1fr 260px; gap: 16px 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 24px;
}
.agent > * { min-width: 0; }
.agent .main { display: grid; gap: 10px; align-content: start; }
.agent h2 { font-size: 1.5rem; margin: 0; }
.agent p { margin: 0; max-width: 38em; }
.agent .problem { color: var(--muted); }

/* In → Agent → Out diagram on the right of each agent */
.side { display: grid; gap: 14px; align-content: start; }
.flow { display: grid; gap: 22px; }
.node {
  position: relative; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); font-size: 0.92rem; line-height: 1.35;
}
.node span { display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
/* the arrow between boxes */
.node + .node::before {
  content: ""; position: absolute; left: 50%; top: -22px; width: 2px; height: 14px;
  background: var(--accent); transform: translateX(-50%);
}
.node + .node::after {
  content: ""; position: absolute; left: 50%; top: -10px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--accent); border-bottom-width: 0;
}
.agent-node { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.agent-node span { color: var(--accent-ink); opacity: 0.8; }
.built { margin: 0; font-size: 0.9rem; }
.built > span:first-child { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }

/* The spec panel on the right of each agent */
.spec { display: grid; gap: 12px; align-content: start; margin: 0; font-size: 0.92rem; }
.spec div { border-top: 1px solid var(--line); padding-top: 8px; }
.spec dt { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.spec dd { margin: 2px 0 0; }

/* The first agent is the featured one: accent border */
.agent.featured { border-color: var(--accent); border-width: 2px; }


/* ---------- 9. Thought leadership page pieces ---------- */
.papers { list-style: none; margin: 0; padding: 0; }
.paper { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; padding-block: 24px; border-top: 1px solid var(--line); }
.paper:first-child { border-top: 0; padding-top: 0; }
.paper > * { min-width: 0; }
.paper h2 { font-size: 1.45rem; margin: 0; }
.paper h2 a { color: var(--ink); text-decoration: none; }
.paper h2 a:hover { color: var(--accent); }
.paper p { margin: 0; color: var(--muted); max-width: 38em; grid-column: 1 / -1; }
.paper .info { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 20px; }


/* ---------- 10. Footer ---------- */
.site-footer { padding-block: 32px 44px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.site-footer a { color: var(--muted); }


/* ---------- 11. Phone and tablet layout ---------- */
@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr; padding-block: 36px 24px; gap: 36px; }
  .portrait { max-width: 240px; }
  .doors { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 180px; order: -1; }
  .page-head { padding-block: 36px 28px; }
  .block { grid-template-columns: 1fr; padding-block: 36px; }
  .three { grid-template-columns: 1fr; }
  .phases { grid-template-columns: repeat(2, 1fr); }
  /* on phones the stages stack, so the arrows point down */
  .stages { grid-template-columns: 1fr; }
  .stages li, .stages li:first-child { clip-path: none; padding: 10px 14px; border-radius: 3px; }
  .case, .agent { grid-template-columns: 1fr; }
  .roles li { grid-template-columns: 1fr; }
}
