/* Global styles. Tokens from design/tokens.md. */
:root {
  --bg: #1f1f1f;
  --bg-alt: #262626;
  --panel: #292929;
  --panel-2: #3a3a3a;
  --footer: #111214;
  --text: #ffffff;
  --text-muted: #d0d0d0;
  --text-dim: #b8b8b8;
  --border: #4a4a4a;
  --accent-tab: #9fb4ff;
  --tag-bg: #cfe8fb;
  --tag-fg: #12486d;
  --success: #12b76a;
  --danger: #ff8a80;
  --focus: #9fb4ff;

  --font: "Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --maxw: 1280px;
  --gutter: clamp(16px, 5vw, 80px);
  --radius: 4px;
  --header-h: 80px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; color: inherit; }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: #fff; color: #111; padding: 10px 16px; border-radius: var(--radius); font-weight: 600;
}
.skip-link:focus { top: 16px; }
.muted { color: var(--text-muted); }

/* Visibly marked placeholder text, e.g. [COMPANY NAME] */
.ph {
  background: rgba(255, 196, 0, .14);
  color: #ffd666;
  outline: 1px dashed rgba(255, 214, 102, .7);
  outline-offset: 1px;
  border-radius: 2px;
  padding: 0 .15em;
}

.preview-bar {
  position: sticky; top: 0; z-index: 60;
  background: #ffd666; color: #111; text-align: center; font-weight: 600; padding: 6px 16px; font-size: 14px;
}

.container { max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(820px + 2 * var(--gutter)); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  border: 1px solid #fff; border-radius: var(--radius);
  background: transparent; color: #fff;
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s;
  white-space: nowrap;
}
.btn-outline:hover { background: #fff; color: #111; }
.btn-solid { background: #fff; color: #111; }
.btn-solid:hover { background: #d9d9d9; border-color: #d9d9d9; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 50;
  background: linear-gradient(to bottom, rgba(0,0,0,.6), rgba(0,0,0,0));
}
.preview-bar + .site-header { top: 34px; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.brand { text-decoration: none; display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { max-height: 40px; width: auto; }
.brand-text { font-weight: 700; font-size: 22px; letter-spacing: .14em; text-transform: uppercase; }
.site-nav { flex: 1; display: flex; align-items: center; gap: 24px; }
.nav-list { list-style: none; margin: 0 auto; padding: 0; display: flex; gap: 4px; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px;
  background: none; border: 0; border-radius: var(--radius);
  font-size: 16px; text-decoration: none; cursor: pointer;
}
.nav-link:hover, .nav-link[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.caret {
  width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s;
}
.dd-toggle[aria-expanded="true"] .caret { transform: translateY(2px) rotate(225deg); }
.dropdown {
  list-style: none; margin: 0; padding: 8px 0;
  position: absolute; top: 100%; left: 0; min-width: 220px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  display: none;
}
.has-dd.open .dropdown { display: block; }
.dropdown a { display: block; padding: 10px 18px; text-decoration: none; min-height: 44px; }
.dropdown a:hover, .dropdown a:focus-visible, .dropdown a[aria-current="page"] { background: var(--panel-2); }
.header-cta { position: relative; }
.quote-count {
  position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: #fff; color: #111; font-size: 12px; line-height: 20px; text-align: center;
}
.btn-outline:hover .quote-count { background: #111; color: #fff; }

.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px;
  background: none; border: 1px solid rgba(255,255,255,.5); border-radius: var(--radius); cursor: pointer;
  position: relative;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  position: absolute; left: 11px; width: 20px; height: 2px; background: #fff; content: ""; transition: transform .2s, opacity .2s;
}
.nav-toggle-bars { top: 21px; }
.nav-toggle-bars::before { left: 0; top: -6px; }
.nav-toggle-bars::after { left: 0; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 16px;
    padding: 16px var(--gutter) 24px; background: var(--footer); border-top: 1px solid var(--border);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .site-header.nav-open { background: var(--footer); }
  .site-header.nav-open .site-nav { display: flex; }
  .nav-list { flex-direction: column; margin: 0; }
  .nav-link { width: 100%; justify-content: space-between; padding: 0 4px; }
  .dropdown { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 8px 16px; }
  .header-cta { align-self: flex-start; }
}

/* ---------- Hero / banner ---------- */
.hero, .banner {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: flex-end;
  min-height: 420px;
  padding: calc(var(--header-h) + 40px) 0 56px;
}
.hero-tall { min-height: min(100vh, 760px); }
.banner { min-height: 480px; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after, .banner::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,.25) 40%, rgba(0,0,0,.8) 100%);
}
.hero-noimg { background: radial-gradient(120% 90% at 70% 10%, #3a3a3a 0%, #262626 45%, #1a1a1a 100%); }
.hero-content, .banner-content { width: 100%; }
.hero h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 700; max-width: 900px; }
.hero-text { max-width: 720px; font-size: 18px; color: var(--text-muted); }
.hero .btn-row { margin-top: 24px; }
.banner-content .prose { max-width: 680px; color: var(--text-muted); }
.banner-content .btn { margin-top: 8px; }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: clamp(28px, 3.2vw, 40px); font-weight: 600; }
.lead { max-width: 760px; color: var(--text-muted); margin-bottom: 32px; }
.prose { color: var(--text-muted); }
.prose h2, .prose h3 { color: var(--text); margin-top: 1.4em; }
.prose a { color: var(--text); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { border-left: 3px solid var(--border); margin: 0 0 1em; padding-left: 16px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.row-reverse .row-media { order: 2; }
.row-img, .row-media .img-ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.row-text .btn { margin-top: 8px; }
@media (max-width: 800px) {
  .row { grid-template-columns: 1fr; }
  .row-reverse .row-media { order: 0; }
}

.img-ph {
  display: grid; place-items: center;
  background: repeating-linear-gradient(135deg, var(--panel-2) 0 12px, #353535 12px 24px);
  color: var(--text-dim); font-size: 14px; letter-spacing: .08em;
  min-height: 120px;
}

/* Cards (values / team) */
.cards { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--panel-2); border-radius: var(--radius); padding: 28px; }
.card h3 { font-size: 22px; font-weight: 600; }
.card p { color: var(--text-muted); font-size: 16px; }
.team-photo, .team-card .img-ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); margin-bottom: 18px; }
.team-role { color: var(--text-dim); margin-top: -.4em; font-weight: 600; }
.team-link { font-weight: 600; text-underline-offset: 3px; }

/* Tiles */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.tile a, .tile > .tile-img, .tile > .img-ph { text-decoration: none; }
.tile a, .tile { display: block; }
.tile-img, .tile .img-ph { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: var(--panel-2); border-radius: var(--radius); }
.tile-title { display: block; padding: 14px 4px 0; font-size: 22px; font-weight: 600; }
.tile a:hover .tile-title { text-decoration: underline; text-underline-offset: 5px; }

/* ---------- Item list (catalog / quote) ---------- */
.list-title { font-size: 24px; font-weight: 600; margin-bottom: 20px; }
.item-list { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 12px; }
.item-row {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 24px; align-items: center;
  background: var(--panel); border-radius: var(--radius); padding: 16px;
}
.item-row[hidden] { display: none; }
.item-img, .item-row .img-ph { width: 120px; height: 90px; min-height: 0; object-fit: cover; border-radius: var(--radius); font-size: 11px; }
.item-title { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.item-desc { color: var(--text-muted); font-size: 15px; margin-bottom: 8px; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--tag-bg); color: var(--tag-fg); border-radius: 999px; padding: 2px 12px; font-size: 13px; font-weight: 600; }
.tag .ph { color: var(--tag-fg); background: transparent; outline-color: var(--tag-fg); }
.quote-toggle .when-on { display: none; }
.quote-toggle[aria-pressed="true"] { background: #fff; color: #111; }
.quote-toggle[aria-pressed="true"] .when-on { display: inline; }
.quote-toggle[aria-pressed="true"] .when-off { display: none; }
@media (max-width: 640px) {
  .item-row { grid-template-columns: 88px 1fr; gap: 14px; }
  .item-img, .item-row .img-ph { width: 88px; height: 72px; }
  .item-action { grid-column: 1 / -1; }
  .item-action .btn { width: 100%; }
}

.sticky-bar { position: sticky; bottom: 0; z-index: 40; background: rgba(17,18,20,.96); border-top: 1px solid var(--border); }
.sticky-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.sticky-inner p { margin: 0; }

/* ---------- Contact ---------- */
.offices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.office-name { font-size: 24px; font-weight: 600; }
.office dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.office dt { color: var(--text-dim); }
.office dd { margin: 0; }

/* ---------- Forms ---------- */
.form-panel { background: var(--panel-2); border-radius: var(--radius); padding: clamp(20px, 4vw, 40px); }
.quote-form { max-width: 820px; }
.form-title { font-size: 28px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 15px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--panel); border: 1px solid #6a6a6a; border-radius: var(--radius); color: var(--text);
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--focus); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.form-error { color: var(--danger); font-weight: 600; }
.form-ok { color: var(--success); font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }


/* ---------- Tabs ---------- */
.tabs-wrap { background: var(--bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs [role=tab] {
  flex-shrink: 0; min-height: 56px; padding: 0 18px; background: none; border: 0; cursor: pointer;
  color: var(--text-muted); font-size: 16px; font-weight: 600; border-bottom: 3px solid transparent;
}
.tabs [role=tab][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-tab); }
.tabs [role=tab]:hover { color: var(--text); }
.tab-panel:focus { outline: none; }
.tab-panel[hidden] { display: none; }

/* ---------- Specifications ---------- */
.spec-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 24px; }
.spec-table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.spec-table caption { text-align: left; font-size: 22px; font-weight: 600; padding: 0 0 12px; }
.spec-table th, .spec-table td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.spec-table th { text-align: left; font-weight: 400; color: var(--text-muted); width: 50%; }
.spec-table td { font-weight: 700; text-align: right; }
.spec-img { width: 100%; max-height: 520px; object-fit: contain; margin: 0 auto 32px; }
.colours-title { font-size: 20px; font-weight: 600; }
.colours { list-style: none; margin: 0 0 32px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.colours li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; }
.swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); }
.closing { max-width: 860px; margin-bottom: 24px; }

/* ---------- Investors ---------- */
.stock-strip { background: var(--bg-alt); padding: 24px 0; }
.stock-card { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; background: var(--panel); border-radius: var(--radius); padding: 18px 24px; }
.stock-ticker { font-weight: 600; }
.stock-price { font-size: 28px; font-weight: 700; }
.stock-change { font-weight: 600; }
.report-row { grid-template-columns: 64px 1fr auto; }
.report-icon { width: 56px; height: 64px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius); font-weight: 700; font-size: 13px; color: var(--text-muted); }
.report-meta { font-size: 14px; margin: 0; }
@media (max-width: 640px) { .report-row { grid-template-columns: 48px 1fr; } .report-icon { width: 44px; height: 52px; } }
.group-title { font-size: 26px; font-weight: 600; margin: 8px 0 16px; }
.article-row { list-style: none; margin: 0 0 48px; padding: 0 0 8px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; }
.article-card { scroll-snap-align: start; position: relative; }
.article-card a { display: block; text-decoration: none; background: var(--panel); border-radius: var(--radius); overflow: hidden; height: 100%; }
.article-img, .article-card .img-ph { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.article-title { display: block; padding: 14px 16px 4px; font-size: 19px; font-weight: 600; line-height: 1.3; }
.article-by { display: block; padding: 0 16px 16px; font-size: 14px; }
.article-card a:hover .article-title { text-decoration: underline; text-underline-offset: 4px; }
.pill { position: absolute; top: 12px; left: 12px; background: #fff; color: #111; border-radius: 999px; padding: 2px 12px; font-size: 13px; font-weight: 700; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 12px;
  background: #fff; color: #111; border-radius: var(--radius); padding: 14px 20px;
  box-shadow: 0 12px 32px rgba(0,0,0,.5); font-weight: 600; width: max-content; max-width: calc(100vw - 32px);
}
.toast[hidden] { display: none; }
.toast::before {
  content: "✓"; display: grid; place-items: center; width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 50%; background: var(--success); color: #fff; font-size: 14px;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--footer); padding: 64px 0 24px; }
.footer-inner { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; }
.footer-brand .brand { margin-bottom: 24px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 32px; }
.footer-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col a { display: inline-block; padding: 6px 0; color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid #2a2b2e; color: var(--text-dim); font-size: 14px;
}
.footer-bottom p { margin: 0; }
.social { display: inline-grid; place-items: center; width: 44px; height: 44px; color: var(--text-muted); }
.social:hover { color: #fff; }
@media (max-width: 800px) { .footer-inner { grid-template-columns: 1fr; } }

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