/*
  styles.css: the stylesheet for the whole NicheTech AI website.

  WHAT IT IS    Rules that say how every page looks: colours, fonts, spacing,
                and how the layout changes on narrow screens. Every page loads
                this one file, so a change here shows on every page.
  READ BY       The browser. build.py copies it unchanged into public/.
  HOW TO READ   Each rule is: which things it applies to { what to set }.
                For example  h1 { font-size: 64px; }  sets the size of every
                main heading. "@media (max-width: 820px) { ... }" means "only
                on screens 820 pixels wide or narrower" (phones, small tablets).
                "var(--red)" uses a colour named once below, in :root.
  RULES         One light theme by design: every colour is set explicitly.
                Brand colours come from the project rules ("Brand").
*/

/* ---------------------------------------------------------------------------
   Brand colours and fonts, named once and used everywhere below.
   --------------------------------------------------------------------------- */
:root {
  --ink: #231F20;        /* brand black: text, bars, buttons */
  --paper: #ffffff;      /* white background */
  --mist: #f6f5f4;       /* quiet grey band behind some sections */
  --muted: #5f5b5c;      /* labels and secondary text (passes 4.5:1 contrast on white) */
  --line: #e3e0e0;       /* thin divider lines */
  --red: #e64c3c;        /* brand red */
  --amber: #f29c1f;      /* brand amber */
  --green: #81c891;      /* brand green */
  --go: #2e7d4f;         /* darker green that is readable as text on white */
  --cap-green: #367c46;  /* "The capability" label and "Ask about this capability" (D102, D105): brand green's own hue, darkened so small text
                            passes AA (5.1:1 on white, 4.8:1 on the light green card tint).
                            Brand green itself (#81c891) is only about 2:1 on white. */
  --display: Anton, Impact, "Arial Narrow", sans-serif;   /* headings; the others are backups if Anton doesn't load */
  --body: Rubik, "Segoe UI", Arial, sans-serif;           /* body text */
  --measure: 1280px;     /* the widest the content column gets */
  --text: 960px;         /* the widest a paragraph or list gets, so lines stay readable on very wide screens */
  color-scheme: light;   /* tells the browser this site has no dark mode */
}

/* ---------------------------------------------------------------------------
   Basics that apply to the whole page.
   --------------------------------------------------------------------------- */
/* Text for screen readers only: hidden on screen but still read out
   (for example the colon in "The capability: ..."). */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Anything marked "hidden" in the page stays hidden, even when a rule below
   gives it a layout (for example "form { display: flex }"). Without this, the
   Contact form stayed on screen after sending (D116). "!important" makes it
   win over every other rule. Only the Contact page uses "hidden" today. */
[hidden] { display: none !important; }
/* Count padding and borders inside an element's width, so sizes add up as expected. */
* { box-sizing: border-box; }
/* Stop phones enlarging text on their own when turned sideways. */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }
/* Images never overflow their space, and keep their shape when shrunk. */
img { max-width: 100%; height: auto; display: block; }
/* <picture> wraps an image that has alternative versions (animated or still). */
picture { display: block; }
a { color: var(--ink); }
/* Visible amber outline on whatever has keyboard focus (an accessibility rule for this site). */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------------------------------------------------------------------------
   Page structure.
   .wrap   the centred content column, with at least 16px either side.
           env(safe-area-inset-...) keeps text clear of phone screen notches.
   .band   a full-width horizontal section with space above and below.
   --------------------------------------------------------------------------- */
.wrap { max-width: var(--measure); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.band { padding-block: 72px; }
.band.mist { background: var(--mist); }

/* ---------------------------------------------------------------------------
   Text. clamp(min, preferred, max) lets headings shrink on small screens
   but never below the first size or above the last.
   --------------------------------------------------------------------------- */
h1, h2, h3 { text-wrap: balance; margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; line-height: 1.05; text-transform: uppercase; }
h1 { font-size: clamp(40px, 6vw, 64px); }
h2 { font-size: clamp(30px, 4vw, 42px); }
h3 { font-size: 21px; font-weight: 700; line-height: 1.3; }
/* Paragraphs run the full content width, up to --text (960px) on very wide
   screens so lines don't get too long (Josh, 9 November 2026; it was 65
   characters, about half the page). */
p { margin: 0; max-width: var(--text); }
.lead { font-size: 19px; color: var(--ink); }
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
/* .stack puts its contents in a column with an even gap between them. */
.stack { display: flex; flex-direction: column; gap: 16px; }
/* The short red to amber to green brand band under page headings. */
.underband { width: 220px; height: 6px; background: linear-gradient(90deg, var(--red), var(--amber), var(--green)); }

/* ---------------------------------------------------------------------------
   Buttons. .btn is black, .light is white (for dark bands), .ghost is an outline.
   min-height 48px gives a finger-sized target on phones.
   --------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border-radius: 6px; background: var(--ink); color: var(--paper); font-weight: 500; text-decoration: none; border: 0; font: inherit; font-weight: 500; cursor: pointer; }
.btn:hover { background: #000; }
.btn.light { background: var(--paper); color: var(--ink); }
.btn.light:hover { background: var(--mist); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
/* The mark on every link button (BUTTON_MARK in build.py, Build Log D98):
   the label, then a 26px mark at the end. Less padding on the right, where
   the mark sits, as in the reference ("Button Style - Mark", Option A).
   white-space: nowrap keeps each label on one line, down to 360px wide. */
.btn:has(.mark) { position: relative; overflow: hidden; gap: 12px; padding: 0 16px 0 30px; }
/* The brand bar down the left edge of every mark button (D100): 6px wide,
   the full height, red at the top through amber to green at the bottom, the
   same as the challenge cards. The button's rounded corners trim its ends
   (overflow: hidden), and the left padding (30px, was 24px) keeps the label
   clear of it. It shows the same way on white (.light) and outline (.ghost)
   buttons. */
.btn:has(.mark)::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 6px;
                          background: linear-gradient(180deg, var(--red), var(--amber), var(--green)); }
.btn-label { white-space: nowrap; }
/* Phones (600px and below, D110): every mark button in the page body (main)
   fills the content width inside the 16px gutters, the label on the left and
   the mark on the right (space-between keeps the 12px gap between them as
   the least). Buttons side by side (the Page not found page) stack. The
   header and footer "Get in touch" buttons are outside main, so they keep
   their own widths (D110 correction). Above 600px, buttons keep their own
   widths. */
@media (max-width: 600px) {
  main .btn:has(.mark) { display: flex; width: 100%; justify-content: space-between; text-align: left; }
  .buttons { flex-direction: column; }
}
.btn .mark { position: relative; width: 26px; height: 26px; flex: 0 0 26px; }
.btn .mark svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* Each part turns and grows about its own centre. */
.btn .mark path, .btn .mark circle { transform-origin: 50% 50%; transform-box: fill-box; }
/* At rest only the red star shows. */
.btn .m-amber, .btn .m-green { opacity: 0; }
/* On hover or keyboard focus, over 0.6 seconds: the red star spins out, the
   amber badge spins through, and the green circle settles in. "forwards"
   holds the last step, so the green circle stays while the pointer or focus
   is on the button; moving off ends the animation and the red star is back.
   Hover counts only on devices with a real pointer, (hover: hover): on
   touch screens a tapped button stays "hovered", which left the green circle
   showing after the Back button. There, js/buttons.js adds .is-tapped when a
   button is tapped, which plays the same morph before the next page opens. */
/* .is-sending: the Contact form's "Send enquiry" while it sends. It starts
   with the same morph (D103); the rules further down then show the amber
   badge turning slowly until sending ends (D116). */
.btn:focus-visible .m-red, .btn:is(.is-tapped, .is-sending) .m-red { animation: mark-red .6s forwards; }
.btn:focus-visible .m-amber, .btn:is(.is-tapped, .is-sending) .m-amber { animation: mark-amber .6s forwards; }
.btn:focus-visible .m-green, .btn:is(.is-tapped, .is-sending) .m-green { animation: mark-green .6s forwards; }
@media (hover: hover) {
  .btn:hover .m-red { animation: mark-red .6s forwards; }
  .btn:hover .m-amber { animation: mark-amber .6s forwards; }
  .btn:hover .m-green { animation: mark-green .6s forwards; }
}
@keyframes mark-red { 0% { opacity: 1; transform: rotate(0) scale(1); } 45% { opacity: 0; transform: rotate(120deg) scale(.7); } 100% { opacity: 0; transform: rotate(120deg) scale(.7); } }
@keyframes mark-amber { 0% { opacity: 0; transform: rotate(-60deg) scale(.7); } 30% { opacity: 1; } 55% { opacity: 1; transform: rotate(30deg) scale(.85); } 75% { opacity: 0; transform: rotate(60deg) scale(.8); } 100% { opacity: 0; } }
@keyframes mark-green { 0%, 50% { opacity: 0; transform: scale(.4); } 80% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(.82); } }
/* Reduced motion: no spinning. The red star at rest; the green circle on
   hover or focus. */
@media (prefers-reduced-motion: reduce) {
  .btn .mark * { animation: none !important; }
  .btn:is(:focus-visible, .is-tapped, .is-sending) .m-red { opacity: 0; }
  .btn:is(:focus-visible, .is-tapped, .is-sending) .m-green { opacity: 1; transform: scale(.82); }
}
/* While the Contact form sends (D116): "Sending..." with the amber badge
   turning slowly, one turn every 2.4 seconds, until the reply arrives. Amber
   is the middle colour, "in progress"; the green circle is round, so it
   wouldn't look as if it were turning. The button is switched off while it
   sends, so the pointer is a plain arrow. With reduced motion the badge
   shows but doesn't turn. These come after the hover rules so they win. */
.btn.is-sending { cursor: default; }
.btn.is-sending .m-red, .btn.is-sending .m-green { animation: none; opacity: 0; }
.btn.is-sending .m-amber { opacity: 1; animation: mark-turn 2.4s linear infinite; }
@keyframes mark-turn { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn.is-sending .m-red, .btn.is-sending .m-green { opacity: 0; }
  .btn.is-sending .m-amber { opacity: 1; transform: none; }
}
/* ":not(.is-sending)": while the form sends, the amber badge stays, even
   with the pointer resting on the button (D118 review). */
@media (prefers-reduced-motion: reduce) and (hover: hover) {
  .btn:not(.is-sending):hover .m-red { opacity: 0; }
  .btn:not(.is-sending):hover .m-green { opacity: 1; transform: scale(.82); }
}

/* ---------------------------------------------------------------------------
   The black bar at the top of every page (built in build.py, header()).
   "sticky" keeps it in view while the page scrolls. z-index keeps it on top.
   --------------------------------------------------------------------------- */
.bar { background: var(--ink); color: var(--paper); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
/* The logo: the white wordmark, about 30px high (24px on phones, below).
   flex-shrink: 0 stops it being squeezed when the menu needs room. */
.brand { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.brand img { height: 30px; width: auto; }
@media (max-width: 600px) { .brand img { height: 24px; } }
/* Wide screens: the menu is a row of links. */
.nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; align-items: center; }
.nav a { color: var(--paper); text-decoration: none; font-size: 15px; }
/* Underline the hovered link and the page you're on, in brand green. On an
   industry page, "Who we help" is underlined too, as the current section. */
.nav a:hover, .nav a[aria-current="page"], .nav a.is-section { text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 6px; text-decoration-thickness: 2px; }
/* "Who we help" with its drop-down (menu_items() in build.py, js/menu.js):
   the link, a small down arrow button beside it, and the three industry
   pages in a dark panel under it. The panel is in the header bar, which
   sits above everything on the page (z-index 20), so it is never under the
   brand line. */
.nav .has-sub { position: relative; display: flex; align-items: center; gap: 2px; }
.sub-toggle { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 32px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--paper); cursor: pointer; }
.sub-toggle svg { transition: transform .2s; }
.has-sub.is-open .sub-toggle svg { transform: rotate(180deg); }
.nav .nav-sub { display: none; position: absolute; top: 100%; left: -14px; z-index: 30; min-width: 270px; margin-top: 10px; padding: 8px; flex-direction: column; align-items: stretch; gap: 0;
                background: var(--ink); border: 1px solid #444; border-radius: 8px; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
/* An invisible strip above the panel, so the pointer can cross the gap
   between the link and the panel without it closing. */
.nav .nav-sub::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav .nav-sub a { display: block; padding: 10px 12px; border-radius: 6px; white-space: nowrap; }
.nav .nav-sub a:hover { background: rgba(255, 255, 255, .08); }
/* When it shows: with the script, only when the script says so (.is-open);
   without it, on hover and on keyboard focus. */
.nav.menu-js .has-sub.is-open .nav-sub,
.nav:not(.menu-js) .has-sub:is(:hover, :focus-within) .nav-sub { display: flex; }
@media (prefers-reduced-motion: reduce) { .sub-toggle svg { transition: none; } }
/* "Get in touch" in the header: the white mark button (bar and mark, as on
   every other button, D102), compact so it fits the 64px bar: 40px high,
   smaller text and mark. */
/* It's a button, so no menu underline, even on the Contact page itself. */
.nav a.btn.cta { text-decoration: none; }
.bar .btn.cta { min-height: 40px; font-size: 15px; padding: 0 12px 0 22px; gap: 10px; }
.bar .btn.cta .mark { width: 22px; height: 22px; flex-basis: 22px; }
/* Menu items never wrap onto two lines. Between 901 and 1100px wide the
   menu is tight, so the gaps between items narrow a little; between 901 and
   979px the button's mark is dropped too, so the label stays on one line
   (measured: with the mark, the menu needs about 980px). */
.nav > ul > li { white-space: nowrap; flex-shrink: 0; }
@media (min-width: 901px) and (max-width: 1100px) { .nav > ul { gap: 16px; } }
@media (min-width: 901px) and (max-width: 979px) { .nav .btn.cta .mark { display: none; } .nav .btn.cta { padding-right: 16px; } }
/* The fold-out "Menu" button is hidden on wide screens... */
.menu { display: none; }
.menu summary { list-style: none; cursor: pointer; color: var(--paper); border: 1.5px solid var(--paper); border-radius: 6px; padding: 8px 14px; font-size: 15px; }
.menu summary::-webkit-details-marker { display: none; }
/* ...and at 900px wide or narrower, the row of links is hidden and the Menu button shows instead. */
@media (max-width: 900px) {
  .nav { display: none; }
  .menu { display: block; position: relative; }
  .menu ul { list-style: none; margin: 0; padding: 12px; position: absolute; right: 0; top: 48px; background: var(--ink); border: 1px solid #444; border-radius: 8px; width: 240px; display: flex; flex-direction: column; gap: 4px; }
  .menu a { display: block; padding: 10px 8px; color: var(--paper); text-decoration: none; }
  /* The industry pages, listed under "Who we help" and indented. */
  .menu .menu-sub { position: static; width: auto; padding: 0 0 4px 16px; border: 0; gap: 0; }
  .menu .menu-sub a { padding: 8px; font-size: 15px; }
  .menu a[aria-current="page"], .menu a.is-section { text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 6px; text-decoration-thickness: 2px; }
  /* "Get in touch" at the bottom of the phone menu: the same white mark button. */
  .menu .menu-cta { margin-top: 8px; }
  .menu .btn.cta { display: flex; color: var(--ink); justify-content: space-between; text-decoration: none; }
}

/* ---------------------------------------------------------------------------
   Home page (pages/index.html).
   "grid" lays things out in columns; fr means "a share of the space", so
   1.1fr and .9fr make the left column slightly wider than the right.
   Below 820px wide, the columns stack into one.
   --------------------------------------------------------------------------- */
.banner { background: #fff; }
.banner img { width: 100%; max-width: 1600px; margin: 0 auto; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.hero .stack { gap: 22px; }
/* Under the banner: a normal section gap (24px, 16px on phones) between the
   banner and the hero heading, and the text starts at the top of its column
   instead of being centred against the taller picture beside it (that
   centring added about 47px). Josh, 9 November 2026 (D99). */
.banner + .hero { padding-top: 24px; }
.banner + .hero .wrap { align-items: start; }
/* Phones (D109): a little white space (12px) between the menu bar and the
   banner, which used to sit hard against it. The gap from the banner to the
   heading stays 24px, as on larger screens (it was 16px on phones).
   Phones also get their own banner file (D111, the "phone" version of the
   home.banner slot in data/media.json), shown inside the 16px page gutters
   rather than edge to edge, so the N of the lettering and the T of TRADE,
   both at the picture's left edge, line up with the header wordmark and the
   headings. */
@media (max-width: 600px) { .banner { padding: 12px 16px 0; } }
@media (max-width: 820px) { .hero .wrap { grid-template-columns: 1fr; } }
/* The Home hero heading has its own size (D109): its words are much longer
   than other pages' titles, so the shared h1 size (40 to 64px) was too loud
   on phones. About 30px on phones, rising with the screen width to 52px on
   desktop. Every other page's h1 is unchanged. */
.hero h1 { font-size: clamp(30px, 4.6vw, 52px); }
/* "Get in touch" in the hero (D109): the full-size mark button, a little
   taller (52px) and larger than the standard 48px, so it holds its own
   beside the picture. */
.hero .btn { min-height: 52px; font-size: 17px; }
.hero .btn .mark { width: 28px; height: 28px; flex-basis: 28px; }
/* Desktop (821px and wider, D109): the text gets more room (1.3 to 0.7),
   and the heavy load animation is never taller than the text column beside
   it (heading, paragraph and button). The picture's cell takes no height of
   its own (the picture is placed over it, "position: absolute"), so the row
   is as tall as the text; the picture then fits inside the cell, keeping its
   shape (object-fit: contain), centred top to bottom, and never larger than
   its real 600 x 525. */
@media (min-width: 821px) {
  .hero .wrap { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); }
  .hero .wrap > picture { position: relative; align-self: stretch; }
  .hero .wrap > picture img { position: absolute; inset: 0; margin: auto; width: 100%; height: 100%;
                              max-width: 600px; max-height: 525px; object-fit: contain; }
}

/* "Who we build for" on Home: one full-width row per industry, with its hero
   picture across the content width, then the heading, line and button under
   it. On phones the picture stays full width above the text. */
.industry-rows { display: flex; flex-direction: column; gap: 56px; margin-top: 36px; }
.industry-row { width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
/* The hero at exactly half its real size, 600 x 230, centred above the
   heading, line and button. On phones it shrinks to the screen width but
   never grows past 600. (Josh, 9 November 2026, D99; the industry pages
   keep their full-size heroes.) */
.industry-row .media { padding: 24px 24px 0; }
.industry-row .media img { width: 600px; max-width: 100%; }
@media (max-width: 600px) { .industry-row .media { padding: 0; } }
.industry-row .body { padding: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.industry-row h3 { font-family: var(--display); font-weight: 400; font-size: 28px; text-transform: uppercase; letter-spacing: .01em; }

/* Card grids (challenge cards): three across, one column on phones. */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 36px; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.col { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.col .body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
/* Four challenge cards (D106, "Industry Page Mock-up v1"): one row of four
   on desktop, two by two from 641 to 1100px, one column on phones. The
   cards are narrower, so the padding and type are a little smaller. */
.cols.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1100px) { .cols.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cols.cols-4 { grid-template-columns: 1fr; } }
.cols-4 .col.challenge .body { padding: 20px 18px 20px 24px; }
.cols-4 .col.challenge :is(h2, h3) { font-size: 19px; }
.cols-4 .col.challenge p:not(.capability) { font-size: 15.5px; }

/* Challenge cards (The Engine page, the industry pages and Who we
   help): the Home card box without a picture. The challenge is the heading, in the body font so long headings
   stay easy to read; the capability name is a small label under it. */
.col.challenge :is(h2, h3) { font-family: var(--body); font-weight: 700; font-size: 20px; line-height: 1.3; text-transform: none; letter-spacing: normal; }
.col.challenge .body { gap: 8px; padding-left: 28px; }
/* A thin brand bar down the left edge of each challenge card: red at the
   top, through amber, to green at the bottom, like the brand band. The card's
   rounded corners trim its ends (overflow: hidden on .col). The extra left
   padding above keeps the text clear of it. */
.col.challenge { position: relative; }
/* The green glow (D105, Option B in "Challenge Card Glow Mock-up v1"): a
   brand-green border with a soft green haze round it. A "box-shadow" draws
   both outside the card, so nothing inside moves. --card-glow is the full
   glow; the pulse below breathes between a smaller and a larger one. */
.col.challenge { --card-glow: 0 0 0 1px var(--green), 0 0 22px 5px rgba(129, 200, 145, .8); }
/* A link to a card (for example /manufacturers#ch-023, from Who we help)
   opens the page at that card. scroll-margin-top keeps it clear of the
   sticky header bar; the card then shows the green glow, fading over about
   2 seconds (:target is the card named in the address). With reduced motion
   the glow shows without fading. */
.col.challenge { scroll-margin-top: 88px; }
.col.challenge:target, .col.challenge.is-arriving { animation: card-arrive 2s ease-out; }
@keyframes card-arrive {
  0%, 25% { border-color: var(--green); box-shadow: var(--card-glow); }
  100% { border-color: var(--line); box-shadow: 0 0 0 1px rgba(129, 200, 145, 0), 0 0 22px 5px rgba(129, 200, 145, 0); }
}
@media (prefers-reduced-motion: reduce) { .col.challenge:is(:target, .is-arriving) { animation: none; border-color: var(--green); box-shadow: var(--card-glow); } }
/* The card under the pointer (D105): green border, a 3px lift and a slow
   pulse of the glow (1.8 seconds a breath) while the pointer is on it. Only
   on devices with a real pointer (hover: hover), so a tapped card on a
   phone doesn't stay lit. The bar down the left edge stays. */
.col.challenge { transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease; }
@media (hover: hover) {
  .col.challenge:hover { border-color: var(--green); transform: translateY(-3px); animation: card-pulse 1.8s ease-in-out infinite; }
}
@keyframes card-pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--green), 0 0 10px 1px rgba(129, 200, 145, .45); }
  50% { box-shadow: 0 0 0 1px var(--green), 0 0 24px 4px rgba(129, 200, 145, .75); }
}
/* Keyboard focus on the card's link: the same glow, still (no lift or
   pulse), plus the site's usual amber focus outline round the whole card.
   :has() means "a card that has a focused link inside it". Browsers without
   :has() show the amber outline round the link's own words instead. */
.col.challenge:has(.ask:focus-visible) { border-color: var(--green); box-shadow: var(--card-glow); transform: none; animation: none;
                                         outline: 3px solid var(--amber); outline-offset: 2px; }
@supports selector(:has(a)) { .col.challenge .ask:focus-visible { outline: none; } }
/* Phones and tablets (hover: none, D107): js/cards.js gives the card nearest
   the middle of the screen the class is-centred. It gets the same green
   border and glow, with no lift, fading in and out over 0.3 seconds. A
   tapped card (is-tapped) plays one quick pulse before Contact opens. */
@media (hover: none) {
  .col.challenge { transition: box-shadow .3s ease, border-color .3s ease; }
  .col.challenge.is-centred { border-color: var(--green); box-shadow: var(--card-glow); }
  .col.challenge.is-tapped { border-color: var(--green); animation: card-tap .45s ease-out forwards; }
}
@keyframes card-tap {
  0% { box-shadow: var(--card-glow); }
  45% { box-shadow: 0 0 0 1px var(--green), 0 0 32px 9px rgba(129, 200, 145, .95); }
  100% { box-shadow: var(--card-glow); }
}
/* Reduced motion: a steady glow on hover (or on the centred card on a
   phone), with no lift, fade or pulse. */
@media (prefers-reduced-motion: reduce) {
  .col.challenge { transition: none; }
  @media (hover: hover) { .col.challenge:hover { animation: none; transform: none; box-shadow: var(--card-glow); } }
  @media (hover: none) { .col.challenge.is-centred { transition: none; } }
}
/* "Ask about this capability →" at the foot of every card (D105), in the darker
   capability green, pinned to the bottom (margin-top: auto) so it lines up across
   a row of cards. The whole card is this link: its ::after (an invisible
   layer added by CSS) stretches over the card, so a click or tap anywhere on
   the card follows it. On hover or focus the words underline and the arrow
   nudges right. */
.col.challenge .ask { margin-top: auto; padding-top: 8px; align-self: flex-start; font-weight: 500; color: var(--cap-green); text-decoration: none; }
.col.challenge .ask::after { content: ""; position: absolute; inset: 0; }
.ask-arrow { display: inline-block; transition: transform .2s ease; }
@media (hover: hover) {
  .col.challenge:hover .ask { text-decoration: underline; text-underline-offset: 3px; }
  .col.challenge:hover .ask-arrow { transform: translateX(4px); }
}
.col.challenge .ask:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.col.challenge .ask:focus-visible .ask-arrow { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) { .ask-arrow { transition: none; } }
.col.challenge::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 5px;
                         background: linear-gradient(180deg, var(--red), var(--amber), var(--green)); }
/* When the cards are the first thing in a section, the section's own space
   above is enough, so the grid adds none. */
.wrap > .cols:first-child { margin-top: 0; }
.capability { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
/* "The capability" before each capability name (with_cap_label() in build.py):
   small letter-spaced capitals in the darker brand green, then a middle dot,
   then the capability name. The label and dot never split from each other;
   on phones a long capability name wraps after them cleanly. */
.cap { white-space: nowrap; }
.cap-label { font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--cap-green); white-space: nowrap; }
.cap-dot { margin-left: .45em; color: var(--cap-green); }
.col.challenge p:not(.capability) { color: #3d393a; }
/* The Engine page (D110): the three "See all ... challenges" mark
   buttons under the cards, the same buttons as on Who we help. Side by side
   in three equal columns across the card grid's width, with the same 20px
   gap; a label may wrap onto two lines. Stacked at 820px and below, where
   three across would squeeze the labels onto three lines. */
.see-all-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
@media (max-width: 820px) { .see-all-row { grid-template-columns: 1fr; gap: 12px; } }

/* "How an engine works" on Home: the four points across the full content width. */
.points.works { margin-top: 32px; }
/* .points: the Home lists ("How an engine works" and "Why work with
   NicheTech AI"), with a brand green dot before each item instead of a
   bullet. ::before adds the dot. */
.points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.points li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 14px; }
.points li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; margin-top: 8px; background: var(--green); }
.points strong { font-weight: 700; }
/* List text runs as wide as paragraphs (up to --text). */
.points li > div { max-width: var(--text); }

/* ---------------------------------------------------------------------------
   The dark closing band near the bottom of most pages (CLOSE in build.py):
   a heading and a line, no button (the footer's "Get in touch" is just below).
   --------------------------------------------------------------------------- */
.close { background: var(--ink); color: var(--paper); }
.close .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.close h2 { color: var(--paper); }
.close p { color: #e9e6e6; }

/* ---------------------------------------------------------------------------
   Page heading area on inner pages (Who we help, Contact). Plain white:
   the brand line behind the page does the job the map picture used to.
   --------------------------------------------------------------------------- */
.page-head { background: var(--paper); padding-block: 64px 48px; border-bottom: 1px solid var(--line); }
.page-head .stack { gap: 14px; max-width: var(--text); }
/* A row of buttons (the Page not found page): side by side, wrapping on phones. */
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
/* A hero picture under the heading and intro, across the content width up
   to its real width, centred (see "Image slots" below). */
.page-head .media-hero { margin-top: 36px; }
/* Industry pages (D106): the hero beside the heading, line and intro, at
   exactly half size, 600 x 230 (set by the build), never larger, so the
   dashes stay even. Text on the left, picture on the right, centred
   top to bottom. 900px and below: the heading, line and intro come first,
   then the picture, the full width up to 600 at its 600 x 230 shape, then
   the cards (D107). The heading area is a little shorter than on other
   pages so the four cards start within the first screen at 1280 x 800. */
.industry-head { padding-block: 40px 32px; }
/* The text column never gets narrower than 440px: on a narrower desktop
   (901 to about 1150px) the picture gives way and shrinks a little instead,
   as in the mock-up. From about 1150px wide it is exactly 600 x 230. */
.industry-head .wrap { display: grid; grid-template-columns: minmax(440px, 1fr) minmax(0, 600px); gap: 40px; align-items: center; }
.industry-head .media-hero { margin-top: 0; }
.industry-head .media-hero img { width: 600px; max-width: 100%; }
@media (max-width: 900px) {
  .industry-head .wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
/* The cards straight after the heading area: a little less space above;
   the More challenges band follows with no extra space of its own. */
.band.industry-cards { padding-top: 32px; }
.band.more-band { padding-top: 0; }
/* "More challenges we hear" (D106): the animation (600 x 500, never larger)
   on the left; the heading and a plain list on the right, centred top to
   bottom. Each item has a small brand-green dot and a thin line between
   items; they are not links or cards. Stacked on phones and tablets (900px
   and below): the animation first, then the list. */
.more { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: 40px; align-items: center; }
.more .media-animation { margin-top: 0; }
.more h2 { margin-bottom: 12px; }
.more-list { list-style: none; margin: 0; padding: 0; }
.more-list li { position: relative; padding: 8px 0 8px 26px; border-top: 1px solid var(--line); }
.more-list li:first-child { border-top: 0; }
.more-list li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
@media (max-width: 900px) { .more { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
/* A small picture beside the intro (Your data). Only
   when the slot is filled; on phones it goes under the intro. */
.page-head .wrap:has(> .media-aside) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 40px; align-items: center; }
@media (max-width: 820px) { .page-head .wrap:has(> .media-aside) { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------------------
   The brand line on every page except Home (BRAND_LINE in build.py).
   A faint dashed path from a large red mark at the top left to a green
   mark at the bottom right, behind the page content.

   Layers, bottom to top: section backgrounds, then the line, then the text.
   .brand-line-area  the box holding the page content and the line.
   .brand-line       fills that box exactly and hides anything that spills
                     past its edges (overflow: hidden).
   .brand-line-inner the box the path is stretched to fit: the full width,
                     less half a mark plus a little at the top and bottom,
                     so the marks at each end are never cut off.
   The content boxes (.wrap) are lifted one layer up (z-index: 1), so all
   text sits above the line.

   pointer-events: none  clicks and taps pass straight through the line.
   user-select: none     selecting text never picks up the line.
   --------------------------------------------------------------------------- */
:root {
  --brand-line-opacity: .15;            /* how strong the line looks: .15 is 15% (phones and tablets; .22 on desktop, below) */
  --brand-mark: clamp(72px, 10vw, 128px); /* red mark size: 10% of the screen width, between 72px and 128px */
  --brand-mark-small: calc(var(--brand-mark) * .88); /* amber and green marks, a little smaller, as in the Home banner */
  --brand-gap: calc(var(--brand-mark-small) / 2 + 14px); /* how far the line stops short of each mark's centre */
}
/* A little stronger on desktop, 901px and wider (D101). */
@media (min-width: 901px) { :root { --brand-line-opacity: .22; } }
.brand-line-area { position: relative; }
.brand-line-area .wrap { position: relative; z-index: 1; }
.brand-line { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; user-select: none; opacity: var(--brand-line-opacity); }
.brand-line-inner { position: absolute; inset: calc(var(--brand-mark) / 2 + 12px) 0; }
.brand-path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* The dashes match the Home banner: a 7px line, 30px of line then a 22px
   gap, with rounded ends. non-scaling-stroke keeps them the same size
   however much the drawing is stretched to fit the page. */
.brand-path .brand-dashes { fill: none; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 30 22; vector-effect: non-scaling-stroke; }
/* The line stops short of each mark, as in the banner. A "mask" hides the
   line inside a circle around each mark: three see-through circles at the
   marks' positions (10% 0%, 50% 50%, 90% 100%), everything else shown.
   "intersect" keeps only what all three layers show. The -webkit- lines
   are the same thing for Safari. */
.brand-path {
  -webkit-mask-image: radial-gradient(circle var(--brand-gap) at 10% 0%, transparent 99%, #000 100%), radial-gradient(circle var(--brand-gap) at 50% 50%, transparent 99%, #000 100%), radial-gradient(circle var(--brand-gap) at 90% 100%, transparent 99%, #000 100%);
  -webkit-mask-composite: source-in;
          mask-image: radial-gradient(circle var(--brand-gap) at 10% 0%, transparent 99%, #000 100%), radial-gradient(circle var(--brand-gap) at 50% 50%, transparent 99%, #000 100%), radial-gradient(circle var(--brand-gap) at 90% 100%, transparent 99%, #000 100%);
          mask-composite: intersect;
}
/* Each mark is centred on its point (translate -50%). */
.brand-mark { position: absolute; width: var(--brand-mark-small); height: var(--brand-mark-small); max-width: none; transform: translate(-50%, -50%); }
.brand-mark-start { width: var(--brand-mark); height: var(--brand-mark); }
/* Settling in as the visitor scrolls (js/brand-line.js). The script adds
   .is-scattering and draws each dash as its own piece (.brand-dash) in a
   second drawing (.brand-path-live), so the finished path is hidden. Each dash
   turns and moves about its own centre. The short transition smooths out
   quick scrolls. Without the script, or with reduced motion, none of this
   applies and the finished path shows. */
.brand-line.is-scattering .brand-path:not(.brand-path-live) { display: none; }
.brand-dash { fill: none; stroke-linecap: round; transform-box: fill-box; transform-origin: center; opacity: 0;
              transition: transform .35s ease-out, opacity .35s ease-out; }
/* While the dashes settle (.is-drawing), the amber and green marks start
   hidden and fade in when the dashes reach them (.is-reached). */
.brand-line.is-drawing .brand-mark-mid, .brand-line.is-drawing .brand-mark-end { opacity: 0; transition: opacity .5s ease; }
.brand-line.is-drawing .brand-mark.is-reached { opacity: 1; }
/* Phones: thinner, shorter dashes in the same proportions. */
@media (max-width: 600px) {
  .brand-path .brand-dashes { stroke-width: 5; stroke-dasharray: 21 15; }
}

/* ---------------------------------------------------------------------------
   Who we help (pages/who-we-help.html), D101, from the mock-up (Coded Site >
   Mock-ups > "Who We Help Mock-up v1.html"). Each industry is a column: its
   picture, its name, its three challenges as plain linked rows, and a
   "See all ... challenges" mark button.
   Desktop (901px and wider): three equal columns side by side. "subgrid"
   makes the four parts of every column share the same rows, so the
   headings, the lists and the buttons line up across the columns even when
   one heading or list is taller.
   Phones and tablets: one industry after another.
   --------------------------------------------------------------------------- */
.industries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
.industry-col { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
/* The picture at exactly half its real size (300 x 210), at the left. */
.industry-col .media { margin-bottom: 12px; }
.industry-col .media img { width: 300px; max-width: 100%; margin-inline: 0; }
.industry-col h2 { align-self: end; font-size: clamp(26px, 2.6vw, 30px); margin-bottom: 10px; }
/* The challenges: plain text with a thin divider between them. */
.row-links { list-style: none; margin: 0 0 20px; padding: 0; }
.row-links li + li { border-top: 1px solid var(--line); }
/* Each row is one link: the challenge (medium weight), the capability under
   it (small, grey), and the arrow on the right, centred on both lines. */
.row-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; padding: 11px 2px; color: var(--ink); text-decoration: none; }
.row-name { font-weight: 500; line-height: 1.35; }
.row-capability { grid-column: 1; margin-top: 2px; font-size: 14px; color: var(--muted); }
.row-arrow { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--muted); transition: transform .2s, color .2s; }
/* Hover and keyboard focus underline the challenge and nudge the arrow. */
.row-link:is(:hover, :focus-visible) .row-name { text-decoration: underline; text-underline-offset: 3px; }
.row-link:is(:hover, :focus-visible) .row-arrow { transform: translateX(4px); color: var(--ink); }
/* "See all ... challenges": a mark button across the full column width,
   label on the left and mark on the right. The label may wrap to two lines. */
.btn.see-all { align-self: stretch; width: 100%; justify-content: space-between; text-align: left; line-height: 1.3; padding-block: 12px; }
.btn.see-all .btn-label { white-space: normal; }
@media (max-width: 900px) {
  .industries { grid-template-columns: 1fr; row-gap: 48px; }
  .industry-col { grid-row: auto; display: flex; flex-direction: column; }
  .industry-col h2 { align-self: stretch; }
}
@media (prefers-reduced-motion: reduce) { .row-arrow { transition: none; } }

/* ---------------------------------------------------------------------------
   How it works (pages/how-it-works.html): the project timeline.
   The five phases are stops on a dashed brand line. Each phase is a row:
   its mark in a narrow column on the left (the "rail"), the title, text
   and "You get" line beside it. The line (timeline-line) is drawn in the
   rail, behind the marks; js/timeline.js draws it dash by dash as wide
   S-bends through every mark (D108). The rail is 180 px wide on desktop
   (64 on phones) so the bends stay inside it, clear of the text. */
/* Scattered dashes can drift past the right edge of a phone screen before
   they settle: clip them sideways so the page never scrolls sideways.
   --------------------------------------------------------------------------- */
/* The line above the timeline, with space before the first phase. */
.timeline-band { overflow-x: clip; }
.timeline-intro { margin-bottom: 40px; }
.timeline { --rail: 180px; --stop: 56px; position: relative; }
.timeline-line { position: absolute; top: 0; bottom: 0; left: 0; width: var(--rail); z-index: 0; pointer-events: none; user-select: none; }
.timeline-line svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* The line without the script (D108): 4 px thick, 14 px dashes, 10 px gaps,
   round ends; on phones 3 px, 10 and 8. */
.timeline-dashes { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 14 10; vector-effect: non-scaling-stroke; }
/* The script's line (.timeline-live, D108) replaces it. Each dash
   (.timeline-dash) has its own colour and settles from its scattered
   start; the shared js/dash-line.js moves it. */
.timeline.is-live .timeline-line > svg:not(.timeline-live) { display: none; }
.timeline-live { position: absolute; top: 0; left: 0; overflow: visible; }
.timeline-dash { fill: none; stroke-linecap: round; transform-box: fill-box; transform-origin: center;
                 transition: transform .35s ease-out, opacity .35s ease-out; }
.timeline.is-drawing .timeline-dash { opacity: 0; }
.phases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 56px; position: relative; z-index: 1; }
.phase { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); align-items: start; }
.phase-stop { display: flex; justify-content: center; }
/* The white ring round each mark makes the line stop just short of it. */
.phase-mark { width: var(--stop); height: var(--stop); padding: 7px; background: var(--paper); border-radius: 50%; }
.phase-body { padding-top: 4px; }
.phase-body h2 { font-size: clamp(24px, 3vw, 30px); }
.phase-body p { margin-top: 10px; }
/* While the script draws the timeline (.is-drawing), each phase starts
   hidden and draws in when the line reaches it (.is-reached): the mark
   grows in, the text fades up. Without the script, or with reduced motion,
   .is-drawing is never added and every phase simply shows. */
.timeline.is-drawing .phase-mark { opacity: 0; transform: scale(.4); transition: opacity .45s ease, transform .45s ease; }
.timeline.is-drawing .phase-body { opacity: 0; transform: translateY(14px); transition: opacity .5s ease .1s, transform .5s ease .1s; }
.timeline.is-drawing .phase.is-reached .phase-mark, .timeline.is-drawing .phase.is-reached .phase-body { opacity: 1; transform: none; }
@media (max-width: 600px) {
  .timeline { --rail: 64px; --stop: 44px; }
  .phases { gap: 40px; }
  .timeline-dashes { stroke-width: 3; stroke-dasharray: 10 8; }
}
/* The small note on a page or section whose wording isn't approved yet
   ({{placeholder}} in a page, or PLACEHOLDER_PAGES in build.py). */
.placeholder-note { display: inline-block; align-self: flex-start; width: fit-content; font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--ink); background: var(--mist); border: 1px dashed var(--muted); border-radius: 6px; padding: 4px 10px; margin-block: 8px; }
/* A visible placeholder where approved wording is still to come. */
/* About us: each team member has a photo space beside their name, title and
   paragraph (the photo above on phones). Until the photos arrive the space
   is a plain grey box with no text in it. */
.team { display: flex; flex-direction: column; gap: 48px; }
.member { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.member h2 { font-family: var(--body); font-weight: 700; font-size: 22px; line-height: 1.3; text-transform: none; letter-spacing: normal; }
.team-photo { width: 200px; aspect-ratio: 1 / 1; background: var(--mist); border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 600px) { .member { grid-template-columns: 1fr; gap: 16px; } .team-photo { width: 160px; } }
/* Until the team photos arrive (on hold, D115): an empty photo box (the
   grey placeholder div, with nothing in it) is hidden, and that member's
   text takes the full width. A real photo (<img class="team-photo">) shows
   as above. */
.team-photo:empty { display: none; }
.member:has(> .team-photo:empty) { grid-template-columns: minmax(0, 1fr); }
.todo-block { border: 2px dashed var(--muted); border-radius: 8px; padding: 20px 24px; font-weight: 500; }

/* ---------------------------------------------------------------------------
   Contact (pages/contact.html), D103: one centred column, about 640px wide
   on desktop and the full width (with the usual gutter) on phones. The
   heading, intro and email line are centred; the form's labels and fields
   stay left-aligned inside it.
   --------------------------------------------------------------------------- */
.contact-column { max-width: calc(640px + 32px); }
.contact-head { text-align: center; }
.contact-head .stack { align-items: center; }
.contact-head .underband { margin-inline: auto; }
/* "Prefer email? contact@nichetechai.com · Based in Australia": one line
   under the intro. The address is a link (it opens the visitor's email
   program) and can still be selected and copied. */
.contact-line { margin: 18px auto 0; color: var(--muted); }
.contact-line a { color: var(--ink); font-weight: 500; }
form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
/* .pair puts two fields side by side, stacked on narrow phones. */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 520px) { .pair { grid-template-columns: 1fr; } }
label { display: block; font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.opt, .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
/* font-size 16px on fields stops iPhones zooming in when a field is tapped. */
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1.5px solid #cfcbcb; border-radius: 6px; padding: 10px 12px; }
textarea { min-height: 130px; resize: vertical; }
/* The challenge picker (D105, challenge_picker() in build.py): "Which
   challenges sound like yours?" as the label (the fieldset's legend), then
   one box per industry that folds open and shut (details and summary), with
   its tick boxes in two columns, one on phones. scroll-margin-top keeps
   it clear of the header bar if a link ever scrolls to it (since D107,
   /contact?challenge=... scrolls to the Name field instead). */
.picker { border: 0; margin: 0; padding: 0; min-width: 0; scroll-margin-top: 88px; }
.picker legend { padding: 0; font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.pick-group { border: 1.5px solid #cfcbcb; border-radius: 6px; margin-top: 8px; }
.pick-group summary { cursor: pointer; padding: 10px 12px; font-weight: 500; }
.pick-group[open] summary { border-bottom: 1px solid var(--line); }
.ticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; padding: 12px; }
@media (max-width: 600px) { .ticks { grid-template-columns: 1fr; } }
label.tick { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-weight: 400; font-size: 15px; line-height: 1.4; cursor: pointer; }
label.tick input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; padding: 0; accent-color: var(--cap-green); }
/* The spam-trap field is moved far off screen, so people never see it. */
.trap { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.privacy { color: var(--muted); font-size: 13px; }
.msg { font-size: 15px; }
.msg.err { color: #b3261e; }   /* error messages in red */
/* "Still sending, this can take a few seconds." under the button, shown only
   if sending takes more than 4 seconds (D116). Empty, it takes no space. */
.slow { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.slow:empty { display: none; }
/* Fields are switched off while the form sends, so nothing changes mid-send. */
input:disabled, select:disabled, textarea:disabled { background: #f4f3f3; color: var(--muted); }

/* ---------------------------------------------------------------------------
   Footer at the bottom of every page (FOOTER in build.py), with the
   red to amber to green brand band along its top edge.
   --------------------------------------------------------------------------- */
footer { background: var(--ink); color: var(--paper); border-top: 6px solid transparent; border-image: linear-gradient(90deg, var(--red), var(--amber), var(--green)) 1; }
/* Two columns on desktop (FOOTER in build.py): the wordmark and tagline on
   the left, the "Get in touch" button with the icons under it on the right.
   Stacked on phones (D99). */
.footer-cols { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px 40px; align-items: start; padding-block: 48px; }
footer .brand img { height: 36px; }
footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
footer a { color: var(--paper); }
footer .btn.light { color: var(--ink); }
/* The button is exactly as wide as the row of icons under it. The column is
   as wide as the wider of the two ("max-content"), and both stretch to fill
   it. If the button were ever the wider one, the icons would spread out
   evenly (space-between) to match it, rather than the label being shrunk. */
.footer-contact { width: max-content; display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
@media (max-width: 820px) { .footer-cols { grid-template-columns: 1fr; } }
/* The small "Privacy" text link under both footer columns (D120). It pulls
   up into the columns' bottom padding so the footer grows only a little.
   The 10px padding makes it at least 37px tall, an easy size to tap.
   Underlined, so it reads as a link. */
.footer-small { margin-top: -28px; padding-bottom: 20px; font-size: 14px; }
.footer-small a { display: inline-block; padding-block: 10px; text-decoration: underline; text-underline-offset: 3px; }
/* The row of icons under the footer's "Get in touch" button (footer_icons() in build.py).
   Desktop: 32px icons, 20px apart (6px padding each side of an icon plus an
   8px gap). Phones: 24px icons, still 20px apart (10px padding each side,
   no gap). Either way each link is a 44px square, a comfortable size to tap.
   Keyboard focus shows the amber outline set near the top of this file. */
footer .social { flex-direction: row; flex-wrap: nowrap; justify-content: space-between; gap: 8px; }
footer .social a { display: block; padding: 6px; border-radius: 6px; }
footer .social a:hover { background: rgba(255, 255, 255, .08); }
footer .social img { width: 32px; height: 32px; }
@media (max-width: 600px) {
  footer .social { gap: 0; }
  footer .social a { padding: 10px; }
  footer .social img { width: 24px; height: 24px; }
}

/* ---------------------------------------------------------------------------
   Image slots (data/media.json, "Image slots" in build.py). An empty slot
   isn't on the page at all, so none of this shows until a file is added.
   --------------------------------------------------------------------------- */
/* Every slot's picture fills its space but never goes past its real width
   (--real-width, set by build.py from data/media.json), so nothing is ever
   stretched or enlarged; if the space is wider, it is centred. The rules
   below can cap some slots smaller still. */
.media :is(img, video) { display: block; width: 100%; max-width: min(100%, var(--real-width, 100%)); height: auto; margin-inline: auto; }
/* An animation part-way down an industry page. */
.media-animation { margin-top: 48px; }
.media-animation :is(img, video) { max-width: min(100%, 600px); }
/* A video slot plays on a loop; its still image shows instead for visitors
   who ask their device for reduced motion. */
.media .media-still { display: none; }
@media (prefers-reduced-motion: reduce) {
  .media .media-motion { display: none; }
  .media .media-still { display: block; }
}

/* ---------------------------------------------------------------------------
   Footer tagline: "Trade chaos for clarity" under the footer wordmark (TAGLINE in
   build.py), matching the last line of the Home banner. TRADE and FOR in
   Rubik regular; CHAOS and CLARITY in Rubik bold on solid brand boxes, with
   even padding and square corners. Sizes are in "em" (times the text size),
   so the boxes and gaps keep the banner's proportions at any size.
   Contrast: white on brand green is below the usual 4.5:1 for text. This is
   brand lettering, like a logo, so it follows the banner and is left out of
   contrast warnings; screen readers get the words from its label.
   --------------------------------------------------------------------------- */
.tagline { display: flex; flex-wrap: wrap; align-items: center; gap: .35em .45em; margin-top: 20px; max-width: none;
           font-family: var(--body); font-size: clamp(15px, 4.6vw, 22px); line-height: 1; letter-spacing: .06em;
           text-transform: uppercase; color: var(--paper); }
/* Each group stays on one line; if the whole line doesn't fit, CLARITY moves
   to the next line (a break after FOR). */
.tagline-group { display: inline-flex; align-items: center; gap: .45em; white-space: nowrap; }
.tagline-box { font-weight: 700; padding: .2em .3em; color: var(--paper); }
.tagline-box.chaos { background: var(--red); }
.tagline-box.clarity { background: var(--green); }

