/* OlympusWorks. Shares its colours and typefaces with jtwastronomy.com, the workshop's other site:
   night background, one orange, Space Grotesk for headings and Work Sans for text. */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("fonts/work-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #16191e;
  --ink: #ecedef;
  --muted: #adafb3;
  --line: rgba(236, 237, 239, .14);
  --line-strong: rgba(236, 237, 239, .32);
  --accent: #f47a20;       /* fills: buttons, markers */
  --accent-ink: #f47a20;   /* the same orange where it is text on the page background */
  --on-accent: #0b0d10;
  --field: #0f1216;
  --error: #ff9d8a;
  --radius: 12px;
  --stage-centre: #232830; /* behind the 3D view of a quoted part */
  --stage-edge: #0f1216;
  --radius-l: 20px;
  --width: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --body: "Work Sans", "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f6;
  --surface: #fff;
  --ink: #0b0d10;
  --muted: #4c5158;
  --line: rgba(11, 13, 16, .14);
  --line-strong: rgba(11, 13, 16, .36);
  --accent-ink: #a94a06;
  --field: #fff;
  --error: #a12612;
  --stage-centre: #f6f7f8;
  --stage-edge: #d8dce1;
}

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
}
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.06;
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.75rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3.25rem); }
h3 { font-size: 1.375rem; line-height: 1.2; }
p { color: var(--muted); }
strong, b { font-weight: 600; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: min(100% - var(--gutter) * 2, var(--width)); margin-inline: auto; }
.label {
  color: var(--accent-ink);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.text-link { color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.text-link:hover { text-decoration-thickness: 2px; }
.after { margin-top: 1.5rem; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 1.4rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  transition: background-color .2s, border-color .2s, transform .12s;
}
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.primary:hover { background: #ff8d38; border-color: #ff8d38; }
.button:active { transform: scale(.98); }
button[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.75rem; }
.skip { position: absolute; top: -6rem; left: 1rem; z-index: 9; background: var(--bg); }
.skip:focus { top: .5rem; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); min-height: 72px; }
.brand { font: 600 1.45rem/1 var(--display); letter-spacing: -.03em; white-space: nowrap; }
.brand b { color: var(--accent-ink); }
.nav { display: flex; align-items: center; gap: clamp(12px, 1.5vw, 22px); margin-left: auto; font-size: .97rem; font-weight: 500; }
.nav a { padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--accent-ink); }
.nav [aria-current="page"] { border-bottom-color: var(--accent); }
.nav .nav-urgent { padding: .35rem .8rem; border: 1px solid var(--accent); border-radius: 10px; color: var(--accent-ink); font-weight: 600; }
.nav .nav-urgent:hover, .nav .nav-urgent[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.theme, .menu {
  min-height: 36px;
  padding: 0 .75rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 500;
}
.theme:hover, .menu:hover { border-color: var(--accent); }
.menu { display: none; }
.langs { display: flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; font-size: .88rem; font-weight: 500; }
.langs a { padding: .32rem .6rem; }
.langs [aria-current] { background: var(--ink); color: var(--bg); }

/* Home: the opening photograph. It keeps its night colours in both themes. */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: min(88vh, 860px);
  overflow: hidden;
  background: #0b0d10;
  color: #ecedef;
}
.hero-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 13, 16, .1), rgba(11, 13, 16, .2) 45%, #0b0d10),
    linear-gradient(90deg, rgba(11, 13, 16, .86), rgba(11, 13, 16, .5) 40%, rgba(11, 13, 16, 0) 70%);
}
.hero-copy { padding-block: clamp(110px, 18vh, 200px) clamp(44px, 8vh, 88px); }
.hero .label { color: #f47a20; }
.hero h1 { max-width: 12ch; font-size: clamp(2.9rem, 7.6vw, 6.5rem); line-height: 1; }
.hero .lede { max-width: 34rem; margin-top: 1.5rem; color: rgba(236, 237, 239, .86); font-size: clamp(1.08rem, 1.5vw, 1.25rem); }
.hero .button:not(.primary) { border-color: rgba(236, 237, 239, .36); background: rgba(11, 13, 16, .5); color: #ecedef; backdrop-filter: blur(8px); }
.hero .button:not(.primary):hover { border-color: #f47a20; }
.hero-urgent { margin-top: 1.6rem; color: rgba(236, 237, 239, .86); }
.hero-urgent a { color: #f47a20; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.hero-urgent a:hover { text-decoration-thickness: 2px; }

/* Home: full-width bands */
.band { padding-block: clamp(56px, 9vw, 118px); }
.band.alt { background: var(--surface); border-block: 1px solid var(--line); }
.band-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(28px, 4vw, 52px); }
.band-head p { max-width: 40rem; margin-top: 1rem; }
.band-row { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; gap: 2rem 4rem; }
.band-row p { max-width: 36rem; margin-top: 1rem; font-size: 1.12rem; }
.band-row .actions { margin-top: 0; justify-content: flex-end; }
.split { display: grid; grid-template-columns: 1fr 1fr; }
.split > section { padding-right: clamp(20px, 5vw, 72px); }
.split > section + section { padding: 0 0 0 clamp(20px, 5vw, 72px); border-left: 1px solid var(--line); }
.split h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
.split p { max-width: 32rem; margin-top: 1rem; }
.showcase { position: relative; border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.showcase img { width: 100%; max-height: 640px; object-fit: cover; }
.showcase figcaption { padding: 1rem 1.4rem; color: var(--muted); font-size: .98rem; }
.faq-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 2rem clamp(32px, 6vw, 96px); align-items: start; }

/* Lead times: one row per service speed */
.ledger { border-top: 1px solid var(--line); }
.tier {
  display: grid;
  grid-template-columns: minmax(150px, 230px) minmax(0, 1fr);
  gap: 1rem clamp(20px, 4vw, 60px);
  align-items: start;
  padding-block: clamp(24px, 3.4vw, 40px);
  border-bottom: 1px solid var(--line);
}
.tier-days { color: var(--muted); font-size: 1rem; font-weight: 500; line-height: 1.3; }
.tier-days b {
  display: block;
  color: var(--ink);
  font: 600 clamp(3.2rem, 6.4vw, 5.25rem)/.95 var(--display);
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.tier-urgent .tier-days b { color: var(--accent-ink); }
.tier h3 { font-size: 1.5rem; }
.tier h3 + p { max-width: 34rem; margin-top: .6rem; }
.speed-call { margin-top: .7rem; }
.speed-phone { color: var(--ink); font: 600 clamp(1.4rem, 2.4vw, 1.85rem)/1.2 var(--display); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .2em; white-space: nowrap; }

/* Services: photographs you can step into */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(250px, 27vw, 360px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: #16191e;
  color: #ecedef;
}
.tile img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.32, .72, 0, 1); }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11, 13, 16, .05) 25%, rgba(11, 13, 16, .93)); }
.tile-body { padding: clamp(18px, 2.2vw, 28px); }
.tile h2, .tile h3 { font-size: 1.5rem; line-height: 1.2; }
.tile p { margin-top: .4rem; color: rgba(236, 237, 239, .82); font-size: .98rem; line-height: 1.5; }
.tile:hover { border-color: var(--accent); }
.tile img[src$="/fabricated-piers.jpg"] { object-position: center 80%; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .tile:hover img { transform: scale(1.05); } }

/* Guides */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 36px); }
.card { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 16px; background: var(--surface); }
.card h2, .card h3 { font-size: 1.25rem; line-height: 1.2; }
.card p { margin-top: .5rem; font-size: .98rem; line-height: 1.55; }
a.card:hover :is(h2, h3) { color: var(--accent-ink); }

/* Questions */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { position: relative; padding: 1.1rem 2.6rem 1.1rem 0; cursor: pointer; list-style: none; color: var(--ink); font-size: 1.1rem; font-weight: 600; line-height: 1.35; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; top: .85rem; right: .2rem; color: var(--accent-ink); font: 500 1.6rem/1 var(--display); }
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { color: var(--accent-ink); }
.faq details p { max-width: 70ch; padding-bottom: 1.3rem; }

/* Inner pages */
.intro { padding-block: clamp(36px, 6vw, 84px) clamp(20px, 3vw, 36px); }
.intro h1 { max-width: 18ch; }
.intro > p { max-width: 62ch; margin-top: 1.25rem; font-size: 1.15rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.5rem; padding: 0; list-style: none; color: var(--muted); font-size: .9rem; }
.crumbs li + li::before { content: "/"; margin-right: .45rem; color: var(--line-strong); }
.crumbs a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.crumbs a:hover { color: var(--accent-ink); }
.section { margin-block: clamp(36px, 5.5vw, 76px); }
.section-heading { margin-bottom: clamp(20px, 3vw, 36px); }
.panel { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.feature { padding: clamp(22px, 3.2vw, 44px); }
.feature h2 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); }
.feature p { max-width: 62ch; margin-top: .9rem; }
.feature > .actions:first-child { margin-top: 0; }
.urgent-call { border-color: var(--accent); }
.subgrid { display: grid; grid-template-columns: 1.45fr 1fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.prose h2 { margin: 1.7em 0 .5em; font-size: clamp(1.45rem, 2.4vw, 1.9rem); }
.prose > h2:first-child { margin-top: 0; }
.prose p, .prose li { max-width: 70ch; }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .55em; color: var(--muted); }
.prose li::marker { color: var(--accent-ink); }
.prose strong { color: var(--ink); }
.page-photo, .batch-photo { width: 100%; max-height: 600px; margin: clamp(24px, 4vw, 48px) auto; object-fit: cover; border-radius: var(--radius-l); background: var(--surface); }
.service-example { width: 100%; border-radius: var(--radius-l); background: var(--surface); }
.example-note { margin-top: .75rem; }

/* Tables and lists of facts */
.mill-limits, .tolerances, .guide-story table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mill-limits { margin-bottom: 1.75rem; }
.mill-limits caption, .tolerances caption, .guide-story caption { padding-bottom: .8rem; text-align: left; color: var(--muted); }
.mill-limits caption strong { display: block; margin-bottom: .4rem; color: var(--ink); font: 600 1.6rem/1.15 var(--display); letter-spacing: -.02em; }
.mill-limits th, .mill-limits td, .tolerances th, .tolerances td { padding: .7rem 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
.mill-limits td { text-align: right; white-space: nowrap; color: var(--ink); font-weight: 600; }
.workshop-kit th { padding-right: 1rem; color: var(--ink); font-weight: 600; vertical-align: top; }
.workshop-kit td { white-space: normal; color: var(--muted); font-weight: 400; }
.tolerances { max-width: 40rem; margin: 1rem 0; }
.tolerances caption { color: var(--ink); font-weight: 600; }
.tolerances th + th, .tolerances td { padding-left: 1rem; }
.tolerances thead th { color: var(--ink); font-weight: 600; }
.materials { display: grid; margin-top: 1rem; border-top: 1px solid var(--line); }
.materials > div { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.materials dt { color: var(--ink); font-weight: 600; }
.materials dd { color: var(--muted); }
.related { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.related h2 { margin-bottom: .8rem; font-size: 1.3rem; }
.related ul { margin: 0; padding-left: 1.2rem; }
.related li { margin-bottom: .45rem; }
.related li::marker { color: var(--accent-ink); }

/* Forms */
.form, .side { padding: clamp(20px, 3vw, 36px); }
.form h2, .side h2 { margin-bottom: 1.1rem; font-size: 1.6rem; }
.form p, .side p { margin-bottom: 1rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-full { grid-column: 1 / -1; }
label { display: grid; gap: .4rem; color: var(--ink); font-size: .95rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: .6rem .8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  font-weight: 400;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input[type="file"] { padding: .5rem; }
textarea { min-height: 150px; resize: vertical; }
::placeholder { color: var(--muted); opacity: .8; }
.hint { margin: .4rem 0 0 !important; color: var(--muted); font-size: .9rem; font-weight: 400; }
.picked, .file-state { color: var(--muted); overflow-wrap: anywhere; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { padding-top: .8rem; color: var(--accent-ink); font-weight: 500; }
.status:empty { display: none; }
.status.error { color: var(--error); }
.drawing-picker { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: .4rem; }
.drawing-picker input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; clip-path: inset(50%); overflow: hidden; }
.drawing-picker input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; }
.drawing-picker .button { display: inline-flex; min-height: 44px; cursor: pointer; }

/* Price calculator */
.quote-layout .side { position: sticky; top: 92px; }
.quote-layout [hidden] { display: none !important; }
.quote-layout form > .button.primary { margin-top: 1.4rem; }
.part-view { min-width: 0; margin: 0 0 1.2rem; }
.part-stage { position: relative; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: radial-gradient(circle at 50% 42%, var(--stage-centre), var(--stage-edge) 78%); }
/* Absolutely placed, so the drawing buffer's size can never feed back into the layout. */
.part-view canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.part-view canvas:active { cursor: grabbing; }
.part-view canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: var(--radius); }
.part-view figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; margin-top: .5rem; color: var(--muted); font-size: .88rem; }
.view-reset { padding: 0; border: 0; background: none; color: var(--accent-ink); font: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.quote-summary { display: grid; grid-template-columns: 1fr auto; gap: .75rem 1rem; margin-bottom: 1.2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.quote-summary dt { color: var(--muted); }
.quote-summary dd { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.quote-summary [data-total] { font: 600 2.1rem/1 var(--display); letter-spacing: -.02em; }
.stock-catalogue { margin: 1.2rem 0; }
.stock-catalogue summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; }
.stock-catalogue ul { max-height: 16rem; overflow: auto; padding-inline-start: 1.4rem; color: var(--muted); }
.add-cart { display: grid; gap: .9rem; margin-top: 1.5rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.add-cart h3 { font-size: 1.3rem; }
.add-cart .hint, .add-cart .status { margin: 0 !important; }
.add-cart .button[hidden] { display: none; }

/* Cart: header link, the list of quoted parts and the order form */
.cart-link { position: relative; display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 .6rem; border: 1px solid var(--accent); border-radius: 10px; color: var(--accent-ink); font-size: .95rem; font-weight: 600; white-space: nowrap; }
.cart-link[hidden] { display: none; }
@media (min-width: 1291px) { .cart-link, .theme, .langs { flex-shrink: 0; } }
.cart-link:hover, .cart-link[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.cart-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cart-count:not(:empty) { min-width: 1.5em; padding: 0 .35em; border-radius: 99px; background: var(--ink); color: var(--bg); font-size: .8rem; line-height: 1.5; text-align: center; }
.cart-items { display: grid; gap: 1rem; margin: 0 0 1.2rem; padding: 0; list-style: none; }
.cart-item { padding: clamp(18px, 2.4vw, 28px); border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.cart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1.2rem; align-items: baseline; }
.cart-head h3 { font-size: 1.25rem; overflow-wrap: anywhere; }
.cart-price { margin: 0; color: var(--ink); font: 600 1.15rem/1.3 var(--display); }
.cart-spec { margin: .5rem 0 0; }
.cart-note { margin: .4rem 0 0; color: var(--accent-ink); font-size: .95rem; }
.cart-note:empty { display: none; }
.cart-controls { display: grid; grid-template-columns: 110px auto 1fr auto; gap: .8rem 1rem; align-items: end; margin-top: 1.1rem; }
.cart-controls .button { min-height: 46px; }
.cart-remove { align-self: center; padding: .4rem 0; border: 0; background: none; cursor: pointer; font: inherit; }
.cart-summary dl { margin: 0 0 1.2rem; }
.cart-summary dt { color: var(--muted); font-size: .95rem; }
.cart-summary dd { margin: .15rem 0 1rem; color: var(--ink); font: 600 1.35rem/1.3 var(--display); }
.cart-summary dd small { display: block; color: var(--muted); font: 500 .95rem/1.4 var(--body); }
.cart-summary dd small:empty { display: none; }
.cart-empty { padding: clamp(20px, 3vw, 36px); }
.cart-empty h2 { margin-bottom: .8rem; font-size: 1.6rem; }
[data-cart-order] textarea { min-height: 96px; }
[data-cart-order] h2 + .fields { margin-bottom: 1rem; }
[data-cart-order] h2:not(:first-child) { margin-top: 1.6rem; }
.cart-shipping { display: grid; gap: .5rem; margin: 0 0 .4rem; padding: 0; border: 0; }
.cart-shipping legend { margin-bottom: .5rem; color: var(--ink); font-size: .95rem; font-weight: 600; }
.cart-ship-option { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; padding: .75rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius); font-weight: 500; cursor: pointer; }
.cart-ship-option:has(input:checked) { border-color: var(--accent); }
.cart-ship-option input { width: auto; min-height: 0; accent-color: var(--accent); }
.cart-ship-option b { color: var(--ink); }
.cart-notice { margin: 0 0 1.5rem; padding: 1rem 1.3rem; border-color: var(--accent); color: var(--ink); font-weight: 500; }
.cart-notice[hidden] { display: none; }
.result { margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.result pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Guides */
.guide-story { max-width: 52rem; padding-bottom: clamp(2rem, 6vw, 5rem); }
.guide-story .intro { padding-bottom: 1.5rem; }
.guide-story .intro h1 { max-width: none; font-size: clamp(2.1rem, 4.8vw, 3.75rem); }
.guide-byline { margin-bottom: 1.75rem; font-size: .95rem; }
.guide-story > p { max-width: 70ch; margin: 1em 0; color: var(--ink); font-size: 1.1rem; line-height: 1.75; }
.guide-story > p.guide-byline { color: var(--muted); font-size: .95rem; }
.guide-story > h2 { margin: 1.8em 0 .5em; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.guide-story > ul, .guide-story > ol { max-width: 70ch; padding-left: 1.3rem; font-size: 1.1rem; line-height: 1.7; }
.guide-story li { margin-bottom: .5em; }
.guide-story li::marker { color: var(--accent-ink); }
.guide-story figure { margin: 2.2rem 0; }
.guide-story figure img { width: 100%; max-height: 32rem; object-fit: cover; border-radius: 16px; background: var(--surface); }
.guide-story figcaption { max-width: 76ch; margin-top: .7rem; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.guide-story table { margin: 1.6rem 0; font-size: 1rem; }
.guide-story caption { color: var(--ink); font-weight: 600; }
.guide-story th, .guide-story td { padding: .7em .8em .7em 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.guide-story thead th { color: var(--ink); border-bottom-color: var(--line-strong); }
.guide-story tbody th { color: var(--ink); font-weight: 600; }
.guide-sources { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.guide-sources h2 { font-size: 1.2rem; }
.guide-sources ul { padding-inline-start: 1.25rem; }
.guide-sources a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: .2em; }
.guide-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }

/* Portfolio */
#gallery { max-width: 1000px; margin: auto; scroll-margin-top: 96px; }
#gallery figure { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
#gallery img { width: 100%; height: min(60vh, 600px); object-fit: contain; }
#gallery figcaption { padding: .9rem 1.3rem; color: var(--muted); }
.gallery-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-top: 1rem; color: var(--muted); }
[data-pages] a { display: inline-block; margin: .4rem 1rem .4rem 0; text-decoration: underline; }

/* Legal text */
.legal-text h2 { font-size: 1.45rem; }

/* Footer */
.foot { margin-top: clamp(48px, 8vw, 110px); padding: clamp(40px, 6vw, 72px) 0 28px; border-top: 1px solid var(--line); background: var(--surface); }
main:has(> .band:last-child) + .foot { margin-top: 0; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; }
.foot h2 { margin-bottom: .9rem; font: 600 1rem/1.3 var(--body); letter-spacing: 0; }
.foot p, .foot a:not(.brand) { font-size: .95rem; }
.foot .brand + p { margin-top: .9rem; }
.foot section a { display: block; width: fit-content; margin-bottom: .45rem; color: var(--muted); }
.foot section a:hover { color: var(--accent-ink); }
.foot section p { margin-bottom: .7rem; }
.company { margin-top: 1rem; font-size: .88rem !important; line-height: 1.6; }
.legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1.5rem; margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .9rem; }
.legal-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.legal-links a { color: var(--muted); }
.legal-links a:hover { color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 1290px) {
  .menu { display: block; margin-left: auto; }
  .nav { display: none; position: absolute; inset: 100% 0 auto; flex-direction: column; align-items: flex-start; gap: .3rem; margin: 0; padding: 1rem var(--gutter) 1.4rem; border-bottom: 1px solid var(--line); background: var(--bg); font-size: 1.1rem; }
  .nav.open { display: flex; }
  .nav a { padding: .55rem 0; }
  .nav .nav-urgent { margin-top: .4rem; padding: .55rem .9rem; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tier { grid-template-columns: minmax(130px, 180px) 1fr; }
}
@media (max-width: 860px) {
  .band-row, .split, .subgrid, .faq-layout { grid-template-columns: 1fr; }
  .band-row .actions { justify-content: flex-start; }
  .split > section { padding: 0; }
  .split > section + section { margin-top: 2.5rem; padding: 2.5rem 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .cards { grid-template-columns: 1fr 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .quote-layout .side { position: static; }
}
@media (max-width: 760px) {
  .cart-controls { grid-template-columns: 1fr 1fr; }
  .cart-drawing { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .langs [aria-current] { display: none; }   /* the cart link needs the room; the other language stays one tap away */
  /* Icon buttons on phones so the cart fits; the words stay as the accessible names. */
  .theme, .menu { position: relative; width: 40px; padding: 0 !important; font-size: 0; }
  .theme::before { content: ""; position: absolute; inset: 0; width: 16px; height: 16px; margin: auto; border: 1.6px solid currentColor; border-radius: 50%; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
  .menu::before { content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 2px; margin: -1px 0 0 -9px; border-radius: 1px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
  .cart-link { gap: .3rem; padding: 0 .5rem; }
  h1 { font-size: clamp(1.7rem, .6rem + 7.6vw, 2.5rem); }
  .top-inner { min-height: 62px; gap: 8px; }
  .brand { font-size: 1.25rem; }
  .hero { min-height: 620px; }
  .hero-photo { object-position: 64% 50%; }
  .hero::after { background: linear-gradient(180deg, rgba(11, 13, 16, .45), rgba(11, 13, 16, .7) 45%, #0b0d10 92%); }
  .tiles, .cards, .fields, .related { grid-template-columns: 1fr; }
  .tile { min-height: 230px; }
  .tier { grid-template-columns: 1fr; gap: .8rem; }
  .materials > div { grid-template-columns: 1fr; gap: .2rem; }
  .actions .button { flex: 1 1 100%; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .wrap.top-inner { width: calc(100% - 24px); gap: 6px; }
  .brand { font-size: 1.15rem; }
  .theme, .menu { padding: 0 .55rem; }
  .langs a { padding: .32rem .45rem; }
}
@media (max-width: 360px) {
  .brand { font-size: 1.05rem; }
  .wrap.top-inner { width: calc(100% - 20px); gap: 4px; }
  .cart-link { padding: 0 .4rem; gap: .2rem; }
  .langs [aria-current] { display: none; }
}

