/* ─── TOKENS ─────────────────────────────────────────────────────────────────
   Geometry is measured off the Figma frame (1440px wide, 1280px content,
   80px gutter). Colour is the Figma layout rethemed from its Relume-default
   green (#0A6E4F) to the real Doit brand burgundy sampled from the logo.
   ──────────────────────────────────────────────────────────────────────────── */

:root {
    /* Brand */
    --clr-brand: #9c2c2b;
    --clr-brand-dark: #7c2322;
    --clr-brand-darker: #5e1a19;
    --clr-roof: #5a5a5a;

    /* Surfaces — three only, alternating down the page */
    --clr-surface: #ffffff;
    --clr-surface-alt: #f2f2f2;
    --clr-surface-tint: #f7eceb;

    /* Ink */
    --clr-text: #0b0502;
    --clr-muted: #484441;
    --clr-text-inverse: #ffffff;
    --clr-line: #dadad9;
    --clr-overlay: hsl(11 57% 6% / 55%);

    /* Legacy aliases — older stylesheets (bcrumb, tables) still read these */
    --clr-base: var(--clr-brand);
    --clr-bg: var(--clr-surface);
    --clr-dark: #1a1413;

    /* Type */
    --font-regular: Inter, system-ui, sans-serif;
    --font-display: "Playfair Display", Georgia, serif;
    --line-height-normal: 1.55;
    --line-height-tight: 1.15;

    --font-size-small: 0.875rem;
    --font-size-normal: 1rem;
    --font-size-mid: 1.5rem;
    --font-size-double: 2rem;

    /* Space */
    --space-quarter: 0.25rem;
    --space-half: 0.5rem;
    --space-normal: 1rem;
    --space-double: 2rem;
    --space-section: clamp(4rem, 7.5vw, 7rem);

    --size-quarter: 0.25rem;
    --size-half: 0.5rem;
    --size-normal: 1rem;
    --size-double: 2rem;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-pill: 100vmax;
    --border-radius-quarter: var(--radius-sm);
    --border-radius-half: var(--radius-md);

    /* Layering */
    --index-topbar: 400;
    --index-overlay: 500;
    --index-navigation: 600;
    --index-modal: 800;

    --content-width: 80rem;
    --gutter: clamp(1.25rem, 5.55vw, 5rem);
    --topbar-height: 4.5rem;
    --logo-size-topbar: 5.25rem;
    --topbar-border: 1px;
}

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

body {
    margin: 0;
    padding: 0;
    min-block-size: 100svh;
    display: grid;
    grid-template-rows: 1fr auto;
    font-family: var(--font-regular);
    font-size: var(--font-size-normal);
    line-height: var(--line-height-normal);
    font-weight: 400;
    color: var(--clr-text);
    background-color: var(--clr-surface);
    -webkit-font-smoothing: antialiased;
    padding-block-start: var(--topbar-height);
}

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

a {
    color: var(--clr-brand);
}

b,
strong {
    font-weight: 700;
}

i,
em {
    font-style: italic;
}

:where(a, button, input, textarea, select, summary, details):focus-visible {
    outline: 2px solid var(--clr-brand);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─── LAYOUT PRIMITIVES ─────────────────────────────────────────────────── */

.shell {
    width: 100%;
    max-width: calc(var(--content-width) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: absolute;
    left: var(--space-half);
    top: var(--space-half);
    z-index: var(--index-modal);
    background-color: var(--clr-surface);
    color: var(--clr-brand);
    font-weight: 700;
    padding: var(--space-half) var(--space-normal);
    border-radius: var(--radius-sm);
    transform: translateY(-250%);
    transition: transform 0.15s ease-out;
}

.skip-link:focus {
    transform: translateY(0);
}

/* ─── LOGO ───────────────────────────────────────────────────────────────── */

.logo {
    width: 2.75rem;
    aspect-ratio: 200 / 221;
    display: block;
}

/* ─── TOPBAR ─────────────────────────────────────────────────────────────── */

.topbar {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: var(--index-topbar);
    min-height: var(--topbar-height);
    display: grid;
    grid-template-columns: 1fr var(--logo-size-topbar) 1fr;
    align-items: center;
    gap: var(--space-normal);
    padding-inline: var(--gutter);
    padding-block: var(--space-half);
    background-color: var(--clr-surface-tint);
    border-block-end: var(--topbar-border) solid var(--clr-line);
}

/* The mark is lifted out of the grid flow and hung on the bar's bottom edge:
   its vertical centre sits on the border, so the lower half overflows below
   the bar while the bar's own height stays at --topbar-height. */
.topbar__brand {
    position: absolute;
    inset-block-start: calc(100% + var(--topbar-border));
    inset-inline-start: 50%;
    translate: -50% -50%;
    display: flex;
    align-items: center;
    line-height: 0;
}

.topbar .logo {
    width: var(--logo-size-topbar);
}

.topbar__links {
    grid-column: 1;
}

.topbar__actions {
    grid-column: 3;
    display: flex;
    align-items: center;
    gap: var(--space-normal);
    justify-self: end;
}

.topbar__phone {
    color: var(--clr-text);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-small);
    white-space: nowrap;
}

.topbar__phone:hover {
    color: var(--clr-brand);
    text-decoration: underline;
}

.topbar__links > ul {
    display: flex;
    align-items: center;
    gap: var(--space-double);
    margin: 0;
    padding: 0;
    list-style: none;
}

.topbar__links li {
    position: relative;
    list-style: none;
}

.topbar__links a,
.topbar__dropdown-btn {
    color: var(--clr-text);
    text-decoration: none;
    font-size: var(--font-size-small);
    font-weight: 500;
    background: none;
    border: none;
    padding: var(--space-half) 0;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: var(--space-quarter);
}

.topbar__links a:hover,
.topbar__dropdown-btn:hover {
    color: var(--clr-brand);
}

.topbar__links a[aria-current="page"] {
    color: var(--clr-brand);
    font-weight: 600;
}

.chevron {
    width: 0.5rem;
    height: 0.5rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    rotate: 45deg;
    translate: 0 -2px;
    transition: rotate 0.2s ease;
}

.topbar__dropdown-btn[aria-expanded="true"] .chevron {
    rotate: 225deg;
    translate: 0 2px;
}

.topbar__dropdown {
    position: absolute;
    inset-block-start: calc(100% + var(--space-half));
    inset-inline-start: calc(-1 * var(--space-normal));
    min-width: 12rem;
    margin: 0;
    padding: var(--space-half);
    list-style: none;
    background-color: var(--clr-surface);
    border: 1px solid var(--clr-line);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px hsl(11 57% 6% / 12%);
    display: grid;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    translate: 0 -6px;
    transition: opacity 0.18s ease, translate 0.18s ease, visibility 0.18s;
}

.topbar__dropdown-btn[aria-expanded="true"] + .topbar__dropdown {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
}

.topbar__dropdown a {
    display: block;
    padding: var(--space-half) var(--space-normal);
    border-radius: var(--radius-sm);
    width: 100%;
}

.topbar__dropdown a:hover {
    background-color: var(--clr-surface-tint);
}

.menu-button {
    font-family: inherit;
}

@media screen and (max-width: 60rem) {
    .topbar {
        grid-template-columns: var(--logo-size-topbar) 1fr;
    }

    .topbar__links {
        display: none;
    }

    .topbar__actions {
        grid-column: 2;
    }

    .topbar__brand {
        inset-inline-start: var(--gutter);
        translate: 0 -50%;
    }
}

@media screen and (max-width: 30rem) {
    .topbar__phone {
        display: none;
    }

    :root {
        --logo-size-topbar: 4rem;
    }
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-half);
    padding-inline: 1.25rem;
    padding-block: 0.6rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--font-size-small);
    font-weight: 500;
    line-height: var(--line-height-tight);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.button--primary {
    background-color: var(--clr-brand);
    color: var(--clr-text-inverse);
    border-color: var(--clr-brand);
}

.button--primary:hover {
    background-color: var(--clr-brand-dark);
    border-color: var(--clr-brand-dark);
}

.button--secondary {
    background-color: transparent;
    color: var(--clr-text);
    border-color: var(--clr-line);
}

.button--secondary:hover {
    background-color: var(--clr-text);
    color: var(--clr-text-inverse);
    border-color: var(--clr-text);
}

.button--inverse {
    background-color: var(--clr-text-inverse);
    color: var(--clr-brand);
    border-color: var(--clr-text-inverse);
}

.button--inverse:hover {
    background-color: var(--clr-surface-tint);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-normal);
    margin-block-start: var(--space-double);
}

.actions--center {
    justify-content: center;
}

/* Bare arrow link, as used after each advantage and feature */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-half);
    color: var(--clr-text);
    font-weight: 500;
    font-size: var(--font-size-small);
    text-decoration: none;
}

.link-arrow::after {
    content: "\2192";
    transition: translate 0.2s ease;
}

.link-arrow:hover {
    color: var(--clr-brand);
}

.link-arrow:hover::after {
    translate: 4px 0;
}

/* ─── SECTIONS ───────────────────────────────────────────────────────────── */

.section {
    padding-block: var(--space-section);
    background-color: var(--clr-surface);
}

.section--alt {
    background-color: var(--clr-surface-alt);
}

.section--tint {
    background-color: var(--clr-surface-tint);
}

.section--tight {
    padding-block: clamp(2.5rem, 4vw, 3.5rem);
}

.section__head {
    max-width: 48rem;
    margin-inline: auto;
    text-align: center;
    margin-block-end: var(--space-section);
}

.section__head > p {
    color: var(--clr-muted);
    margin-block-start: var(--space-normal);
}

/* Two-column text/media split, 1:1 with an 80px gap, as measured in Figma */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5.5vw, 5rem);
    align-items: center;
}

.split__copy > p {
    color: var(--clr-muted);
    margin-block-start: var(--space-normal);
}

@media screen and (max-width: 48rem) {
    .split {
        grid-template-columns: 1fr;
    }

    .split__figure {
        order: -1;
    }
}

/* ─── MEDIA ──────────────────────────────────────────────────────────────── */

.media {
    margin: 0;
    overflow: hidden;
    background-color: var(--clr-surface-alt);
}

.media img,
.media picture {
    width: 100%;
    display: block;
}

.media--wide img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.media--square img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* ─── PAGE CONTENT (inner pages) ─────────────────────────────────────────── */

.page-content {
    max-width: calc(var(--content-width) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
    padding-block: var(--space-section);
}

.page-content > * + * {
    margin-block-start: var(--space-normal);
}

.page-content :is(h2, h3, h4) {
    margin-block-start: var(--space-double);
}

.page-content ul,
.page-content ol {
    margin-inline-start: var(--space-double);
}

p {
    margin: 0;
}

p + p {
    margin-block-start: var(--space-normal);
}

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */

footer {
    background-color: var(--clr-surface);
    border-block-start: 1px solid var(--clr-line);
}

.footer_content {
    padding-block: var(--space-section);
}

.footer_content__inner {
    display: grid;
    grid-template-columns: 1.6fr repeat(5, 1fr);
    gap: var(--space-double);
    align-items: start;
}

.footer-brand .logo {
    width: 3.25rem;
    margin-block-end: var(--space-normal);
}

.footer-brand p {
    font-size: var(--font-size-small);
    color: var(--clr-muted);
    max-width: 28ch;
}

.footer-column h3 {
    font-family: var(--font-regular);
    font-size: var(--font-size-small);
    font-weight: 600;
    margin-block-end: var(--space-normal);
}

.footer-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-half);
}

.footer-column li {
    list-style: none;
    line-height: 1.4;
}

.footer-column a {
    color: var(--clr-text);
    text-decoration: none;
    font-size: var(--font-size-small);
}

.footer-column a:hover {
    color: var(--clr-brand);
    text-decoration: underline;
}

@media screen and (max-width: 64rem) {
    .footer_content__inner {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media screen and (max-width: 36rem) {
    .footer_content__inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

.footer_legal {
    border-block-start: 1px solid var(--clr-line);
    padding-block: var(--space-normal);
    font-size: var(--font-size-small);
    color: var(--clr-muted);
}

.footer_legal__inner {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-normal) var(--space-double);
    align-items: center;
}

.footer_legal__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-normal);
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer_legal__links li {
    list-style: none;
}

.footer_legal a {
    color: inherit;
    text-decoration: underline;
}

.footer_legal a:hover {
    color: var(--clr-brand);
}

.icon {
    width: 1.5rem;
    height: 1.5rem;
    display: block;
}
