/* ==========================================================================
   OMEIDA TRADING 105 — Base, typography, components
   Loaded after Bootstrap 5, which supplies the reset and grid only.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + var(--sp-5));
    -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    background: var(--white);
    color: var(--body);
    font-family: var(--sans);
    font-size: var(--fs-base);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--sp-4);
    font-family: var(--head);
    color: var(--ink);
    letter-spacing: -0.01em;
    text-wrap: balance;
}
h1 {
    font-size: var(--fs-h1);
    line-height: 1.06;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}
h2 { font-size: var(--fs-h2); line-height: 1.14; font-weight: 700; text-transform: uppercase; }
h3 { font-size: var(--fs-h3); line-height: 1.3;  font-weight: 700; text-transform: uppercase; letter-spacing: 0; }
h4 { font-size: var(--fs-h4); line-height: 1.35; font-weight: 700; }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--navy-2); text-underline-offset: 0.18em; transition: color var(--dur) var(--ease); }
a:hover { color: var(--navy); }

img { display: block; max-width: 100%; height: auto; }
strong, b { font-weight: 700; color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-7) 0; }

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.3em; }
li { margin-bottom: var(--sp-2); }
li:last-child { margin-bottom: 0; }

:focus-visible { outline: 3px solid var(--green-d); outline-offset: 2px; border-radius: var(--radius-sm); }
:focus:not(:focus-visible) { outline: none; }

/*
 * Normalisation previously inherited from Bootstrap, which was dropped: it cost
 * 226KB and the only class the site actually used from it was .mb-0.
 * Everything below is the part that was genuinely doing work.
 */

/* Form controls default to the UA font; make them inherit the page typography. */
button, input, optgroup, select, textarea {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}
button, [type="button"], [type="submit"] { -webkit-appearance: button; }

/* Browsers italicise <address> and indent <dd> by default. */
address { margin-bottom: var(--sp-4); font-style: normal; line-height: inherit; }
dl, dd { margin: 0; }
figure { margin: 0; }
img, svg { vertical-align: middle; }

/* The one Bootstrap utility that was in use. */
.mb-0 { margin-bottom: 0 !important; }

/* ── Layout utilities ──────────────────────────────────────────────────── */

.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--pad);
}
.wrap--flush { padding-inline: 0; }

.sec       { padding-block: var(--section-y); }
.sec-sm    { padding-block: var(--section-y-tight); }
.sec-grey  { background: var(--grey); }
.sec-tint  { background: var(--navy-tint); }

.sec-dark { background: var(--navy); color: rgba(255, 255, 255, 0.82); }
.sec-dark h1, .sec-dark h2, .sec-dark h3, .sec-dark h4, .sec-dark strong { color: #fff; }
.sec-dark a { color: var(--green); }
.sec-dark a:hover { color: #fff; }

.measure { max-width: var(--measure); }
.lead    { font-size: var(--fs-lead); line-height: 1.66; color: var(--muted); max-width: 58ch; }
.sec-dark .lead { color: rgba(255, 255, 255, 0.8); }
.muted   { color: var(--muted); }

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}

.skip-link {
    position: absolute;
    top: var(--sp-2); left: var(--sp-2);
    z-index: 2000;
    padding: var(--sp-3) var(--sp-5);
    background: var(--green);
    color: var(--green-ink);
    font-family: var(--head);
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius);
}

/* ── Eyebrow + section heads ───────────────────────────────────────────── */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin-bottom: var(--sp-4);
    font-family: var(--head);
    font-size: var(--fs-eyebrow);
    font-weight: 700;
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--olive);
}
.sec-dark .eyebrow, .hero .eyebrow, .cta-band .eyebrow { color: var(--green); }

/*
 * Zig-zag rule under the heading, replacing the straight dash that used to sit
 * before the eyebrow label.
 *
 * Targets a heading that directly follows an eyebrow, so every branded section
 * title picks it up automatically and plain headings (prose pages, form
 * headings) are left alone.
 *
 * The page-hero heading is listed explicitly: interior page headers carry no
 * eyebrow, so the sibling selector alone would drop the accent there.
 *
 * Deliberately a fixed short width — it is an accent under the title, never a
 * rule spanning the whole heading.
 */
.eyebrow + h1::after,
.eyebrow + h2::after,
.eyebrow + h3::after,
.hero--page h1::after {
    content: "";
    display: block;
    width: 72px;          /* exactly 6 repeats of the 12px tile */
    height: 8px;
    margin-top: 0.95rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M0 6 L3 2 L6 6 L9 2 L12 6' fill='none' stroke='%238AC24B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 12px 8px;
}

/* Centred section heads centre the accent too. */
.head--center .eyebrow + h1::after,
.head--center .eyebrow + h2::after { margin-inline: auto; }

/*
 * Section heads run the full container width. The old 58ch cap made titles wrap
 * early and left a long dead run to their right.
 *
 * The heading itself is NOT text-align: justify. Justification stretches every
 * line except the last, so a two-line display heading would have its first line
 * pulled apart into wide gaps. Removing the cap achieves the intent — the title
 * fills the width — without that side effect.
 */
.head { max-width: none; margin-bottom: clamp(2.2rem, 1.5rem + 2vw, 3.5rem); }

/* The supporting intro is body copy, so it justifies cleanly like a section note. */
.head .lead {
    max-width: none;
    text-align: justify;
    hyphens: auto;
}
@media (max-width: 639.98px) {
    .head .lead { text-align: left; hyphens: manual; }
}

/*
 * Centred heads: the title gets the full width too, so a short heading is not
 * forced onto two lines by a container narrower than the words themselves.
 * The intro keeps a measure — centred body copy needs a bound to stay readable.
 */
.head--center { max-width: none; margin-inline: auto; text-align: center; }
.head--center .lead {
    max-width: 62ch;
    margin-inline: auto;
    text-align: center;
    hyphens: manual;
}
.head--center .eyebrow { justify-content: center; }
.head--center .lead { margin-inline: auto; }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn, .btn-o, .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 2rem;
    font-family: var(--head);
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: var(--tracking-btn);
    text-transform: uppercase;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color var(--dur) var(--ease),
                border-color var(--dur) var(--ease),
                color var(--dur) var(--ease);
}
.btn { background: var(--green); color: var(--green-ink); }
.btn:hover { background: var(--green-d); color: var(--green-ink); }

.btn-o { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-o:hover { border-color: var(--navy); color: var(--navy); }

.sec-dark .btn-o, .hero .btn-o {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}
.sec-dark .btn-o:hover, .hero .btn-o:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
    color: #fff;
}
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--ink); color: #fff; }

.btns { display: flex; flex-wrap: wrap; gap: 13px; margin-top: var(--sp-6); }
.btns--flush { margin-top: 0; }
@media (max-width: 420px) {
    .btns { flex-direction: column; align-items: stretch; }
}

/* Small uppercase text link with an arrow. */
.more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--head);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--navy);
    text-decoration: none;
}
.more .arw { transition: transform var(--dur) var(--ease); }
.more:hover { color: var(--olive); }
.more:hover .arw { transform: translateX(4px); }

/* ── Cards ─────────────────────────────────────────────────────────────── */

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--dur) var(--ease),
                box-shadow var(--dur) var(--ease),
                border-color var(--dur) var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: transparent; box-shadow: var(--shadow-lg); }

.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--grey); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.card:hover .card-media img { transform: scale(1.06); }

.card-num {
    position: absolute;
    left: 0; bottom: 0;
    padding: 0.5rem 0.9rem;
    background: var(--green);
    color: var(--green-ink);
    font-family: var(--head);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}
.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.5rem 1.4rem 1.7rem; }
.card-body h3 { font-size: 1.02rem; margin-bottom: 0.6rem; }
.card-body p  { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--sp-4); }
.card-body .more { margin-top: auto; align-self: flex-start; }

/* Whole-card link: the ::after belongs to the anchor so the link text stays the
   accessible name while the full card surface is clickable. */
.card .more::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card:has(.more:focus-visible) { outline: 3px solid var(--green-d); outline-offset: 2px; }
.card .more:focus-visible { outline: none; }

/* ── Tick list ─────────────────────────────────────────────────────────── */

.ticks { list-style: none; margin: var(--sp-5) 0 0; padding: 0; }
.ticks li { position: relative; padding-left: 32px; margin-bottom: 0.75rem; font-size: 0.98rem; }
.ticks li::before {
    content: "";
    position: absolute;
    left: 0; top: 9px;
    width: 16px; height: 9px;
    border-left: 3px solid var(--green-d);
    border-bottom: 3px solid var(--green-d);
    transform: rotate(-45deg);
}
.sec-dark .ticks li::before { border-color: var(--green); }

/* Two-column capability list */
.cols-2 { columns: 2; column-gap: var(--sp-7); }
.cols-2 > li { break-inside: avoid; }
@media (max-width: 560px) { .cols-2 { columns: 1; } }

/* ── Placeholder ───────────────────────────────────────────────────────── */

.placeholder {
    display: grid;
    place-items: center;
    text-align: center;
    padding: var(--sp-5);
    border: 1px dashed var(--green-d);
    border-radius: var(--radius);
    background: repeating-linear-gradient(45deg, var(--grey) 0 12px, var(--white) 12px 24px);
    color: var(--olive);
    font-family: var(--head);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.8;
}
.placeholder--fill { position: absolute; inset: 0; }

/* ── Scroll reveal ─────────────────────────────────────────────────────── */
/* Hidden state is scoped to .js, added by an inline script before first paint,
   so a script failure can never leave content permanently invisible. */

.js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--dur-slow) var(--ease-out),
                transform var(--dur-slow) var(--ease-out);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; transform: none; }
    .card:hover { transform: none; }
    .card-media img { transition: none; }
}
