/* =====================================================================
   Dragex Development
   Brand palette is taken directly from the logo:
     sage green  #95AE6C
     amber gold  #FFBE00
     white       #FFFFFF
   Darker/lighter steps are derived from those two hues so everything
   stays in family while meeting contrast requirements on text.
   ===================================================================== */

:root {
    /* --- Brand ------------------------------------------------------ */
    --sage-50:  #f3f7ed;
    --sage-100: #e3ecd6;
    --sage-200: #c9dbaf;
    --sage-300: #b0c78c;
    --sage-400: #95ae6c;  /* logo sage */
    --sage-500: #7d9556;
    --sage-600: #637745;
    --sage-700: #4c5c36;
    --sage-800: #374226;
    --sage-900: #232c18;

    --amber-100: #fff3cc;
    --amber-200: #ffe28c;
    --amber-300: #ffd04d;
    --amber-400: #ffbe00;  /* logo amber */
    --amber-500: #e0a500;
    --amber-600: #b88600;
    --amber-700: #8a6500;

    /* --- Semantic --------------------------------------------------- */
    /* Flat brand green used for the footer and the call-to-action band.
       It is light, so anything sitting on it must be dark: --color-on-brand
       is 5.9:1 and --color-on-brand-muted is 5.0:1. White is 2.5:1 and fails. */
    --brand-green:            #94ae6b;
    --color-on-brand:         var(--sage-900);
    --color-on-brand-muted:   #2f3821;
    --color-on-brand-rule:    rgb(35 44 24 / 0.22);

    --color-bg:          #ffffff;
    --color-bg-alt:      var(--sage-50);
    --color-bg-invert:   var(--sage-800);
    --color-text:        #22271d;
    --color-text-muted:  #5c6356;
    --color-heading:     var(--sage-900);
    --color-accent:      var(--amber-400);
    --color-accent-text: var(--amber-700);
    --color-link:        var(--sage-700);
    --color-link-hover:  var(--sage-900);
    --color-border:      var(--sage-200);
    --color-focus:       var(--amber-600);

    /* --- Type ------------------------------------------------------- */
    --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-display: Georgia, "Times New Roman", serif;

    --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
    --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
    --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
    --step-2:  clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
    --step-3:  clamp(1.9rem, 1.55rem + 1.6vw, 2.8rem);
    --step-4:  clamp(2.3rem, 1.75rem + 2.6vw, 3.8rem);

    /* --- Layout ----------------------------------------------------- */
    --wrap: 68rem;
    --wrap-narrow: 46rem;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --section-y: clamp(3.5rem, 8vw, 6.5rem);

    --radius: 0.5rem;
    --radius-lg: 1rem;
    --shadow-sm: 0 1px 2px rgb(35 44 24 / 0.06), 0 2px 8px rgb(35 44 24 / 0.05);
    --shadow-md: 0 4px 12px rgb(35 44 24 / 0.08), 0 12px 32px rgb(35 44 24 / 0.07);
}

/* =====================================================================
   Base
   ===================================================================== */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--step-0);
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1 0 auto; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--color-heading);
    line-height: 1.15;
    margin: 0 0 0.5em;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p, ul, ol { margin: 0 0 1.15em; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: 0.35em; }

a {
    color: var(--color-link);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}
a:hover { color: var(--color-link-hover); }

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

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

.muted { color: var(--color-text-muted); }

/* Text for screen readers only — used to append "(opens in a new tab)". */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--color-bg);
    color: var(--color-link);
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--radius) 0;
    font-weight: 600;
}
.skip-link:focus { left: 0; }

/* =====================================================================
   Layout helpers
   ===================================================================== */

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding-block: var(--section-y); }
.section--alt { background: var(--color-bg-alt); }
.section--invert { background: var(--color-bg-invert); color: var(--sage-100); }
.section--invert h2, .section--invert h3 { color: #fff; }
.section--invert a { color: var(--amber-300); }
.section--invert a:hover { color: var(--amber-200); }

.section__lead {
    max-width: 46ch;
    font-size: var(--step-1);
    color: var(--color-text-muted);
    line-height: 1.5;
}

.grid {
    display: grid;
    gap: clamp(1.25rem, 3vw, 2rem);
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }

/* =====================================================================
   Buttons
   ===================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
    background: var(--amber-400);
    border-color: var(--amber-400);
    color: var(--sage-900);
    box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
    background: var(--amber-300);
    border-color: var(--amber-300);
    color: var(--sage-900);
    box-shadow: var(--shadow-md);
}

.btn--secondary {
    background: transparent;
    border-color: var(--sage-400);
    color: var(--color-link);
}
.btn--secondary:hover {
    background: var(--sage-50);
    border-color: var(--sage-500);
    color: var(--color-link-hover);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2rem;
}

/* =====================================================================
   Header + nav
   ===================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgb(255 255 255 / 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.5rem;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
}
.brand__mark { width: 2.75rem; height: 2.75rem; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--sage-800);
    letter-spacing: -0.01em;
}
.brand__sub {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--amber-700);
    font-weight: 600;
}

.site-nav__list {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav__list li + li { margin-top: 0; }

.site-nav__link {
    display: block;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 550;
    position: relative;
}
.site-nav__link:hover { background: var(--sage-50); color: var(--sage-800); }
.site-nav__link.is-current { color: var(--sage-800); }
.site-nav__link.is-current::after {
    content: "";
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    bottom: 0.15rem;
    height: 3px;
    border-radius: 2px;
    background: var(--amber-400);
}

/* Checkbox-driven mobile menu — no JS needed. */
.nav-toggle__label { display: none; }

@media (max-width: 46rem) {
    .nav-toggle__label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        cursor: pointer;
    }
    .nav-toggle__bars,
    .nav-toggle__bars::before,
    .nav-toggle__bars::after {
        display: block;
        width: 1.25rem;
        height: 2px;
        background: var(--sage-800);
        border-radius: 2px;
    }
    .nav-toggle__bars { position: relative; }
    .nav-toggle__bars::before,
    .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
    .nav-toggle__bars::before { top: -6px; }
    .nav-toggle__bars::after  { top: 6px; }

    .nav-toggle:focus-visible + .nav-toggle__label {
        outline: 3px solid var(--color-focus);
        outline-offset: 2px;
    }

    .site-nav {
        flex-basis: 100%;
        display: none;
    }
    .nav-toggle:checked ~ .site-nav { display: block; }

    .site-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-bottom: 0.75rem;
    }
    .site-nav__link { padding: 0.75rem 0.5rem; border-radius: 0; }
    .site-nav__link.is-current::after { left: 0.5rem; right: auto; width: 1.5rem; }
}

/* =====================================================================
   Hero
   ===================================================================== */

.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(60rem 30rem at 85% -10%, var(--sage-100), transparent 70%),
        linear-gradient(180deg, var(--sage-50), var(--color-bg) 70%);
    padding-block: clamp(3.5rem, 9vw, 7rem);
}

.hero__inner {
    display: grid;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.hero__eyebrow {
    display: inline-block;
    font-size: var(--step--1);
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--amber-700);
    margin-bottom: 0.9rem;
}

.hero h1 { margin-bottom: 0.4em; }
.hero h1 em { font-style: normal; color: var(--sage-500); }

.hero__lead {
    font-size: var(--step-1);
    color: var(--color-text-muted);
    max-width: 34ch;
    line-height: 1.5;
}

/* The green-background logo is a solid square, so it gets a rounded card
   treatment rather than the drop-shadow glow a transparent silhouette wants. */
.hero__art {
    justify-self: center;
    width: 100%;
    max-width: 22rem;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgb(35 44 24 / 0.18), 0 2px 6px rgb(35 44 24 / 0.08);
}

/* =====================================================================
   Cards
   ===================================================================== */

.card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 3vw, 2rem);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--sage-300);
}
.card h3 { margin-bottom: 0.4em; }
.card p:last-child { margin-bottom: 0; }

.card__icon {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: 0.75rem;
    background: var(--amber-100);
    color: var(--amber-700);
    margin-bottom: 1.1rem;
}
.card__icon svg { width: 1.5rem; height: 1.5rem; }

.section--invert .card {
    background: rgb(255 255 255 / 0.05);
    border-color: rgb(255 255 255 / 0.14);
    box-shadow: none;
}

/* =====================================================================
   Portfolio cards
   ===================================================================== */

/* Wider minimum than .grid--3 so a screenshot is still legible. */
.work-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }

/* Padding moves to .work__body so the screenshot can go edge to edge. */
.work {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.work__shot {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top center;
    border-bottom: 1px solid var(--color-border);
    background: var(--sage-50);
}

/* Stand-in until a real screenshot is dropped into /images/work/. */
.work__shot--placeholder {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.35rem;
    padding: 1rem;
    text-align: center;
    background: repeating-linear-gradient(
        45deg,
        var(--sage-50) 0 10px,
        var(--sage-100) 10px 20px
    );
}
.work__shot-host {
    font-family: var(--font-display);
    font-size: var(--step-0);
    font-weight: 700;
    color: var(--sage-800);
    overflow-wrap: anywhere;
}
.work__shot-note {
    font-size: var(--step--1);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--sage-700);
}

.work__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: clamp(1.25rem, 3vw, 1.75rem);
}

.work__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.85rem;
}

.work__tag {
    background: var(--amber-100);
    color: var(--amber-700);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: var(--step--1);
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.work__place { font-size: var(--step--1); color: var(--color-text-muted); }

.work h3 { margin-bottom: 0.4em; }

/* Pins the site link to the bottom so cards of unequal text still line up. */
.work__link {
    margin-top: auto;
    padding-top: 1rem;
    margin-bottom: 0;
    font-weight: 600;
}
.work__link a { text-decoration: none; }
.work__link a:hover { text-decoration: underline; }
.work__link-icon { font-size: 0.9em; }

/* Numbered process list */
.steps {
    list-style: none;
    padding: 0;
    counter-reset: step;
}
.steps li {
    counter-increment: step;
    position: relative;
    padding-left: 3.25rem;
    margin-bottom: 1.75rem;
}
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--amber-400);
    color: var(--sage-900);
    font-weight: 700;
    font-family: var(--font-display);
}
.steps h3 { margin-bottom: 0.2em; }
.steps p { margin-bottom: 0; }

/* Feature list with amber ticks */
.ticks { list-style: none; padding: 0; }
.ticks li {
    position: relative;
    padding-left: 1.85rem;
    margin-bottom: 0.7rem;
}
.ticks li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 0.7rem;
    height: 0.4rem;
    border-left: 3px solid var(--amber-500);
    border-bottom: 3px solid var(--amber-500);
    transform: rotate(-45deg);
}

/* =====================================================================
   Page header (interior pages)
   ===================================================================== */

.page-header {
    background: linear-gradient(180deg, var(--sage-50), var(--color-bg));
    border-bottom: 1px solid var(--color-border);
    padding-block: clamp(3rem, 7vw, 4.5rem);
}
.page-header h1 { font-size: var(--step-3); margin-bottom: 0.3em; }
.page-header p { max-width: 52ch; color: var(--color-text-muted); margin-bottom: 0; }

/* =====================================================================
   Forms
   ===================================================================== */

.form { display: grid; gap: 1.25rem; max-width: 34rem; }

.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; font-size: var(--step--1); color: var(--sage-800); }
.field .hint { font-size: var(--step--1); color: var(--color-text-muted); }

.field input,
.field textarea,
.field select {
    font: inherit;
    color: inherit;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--sage-300);
    border-radius: var(--radius);
    background: #fff;
    width: 100%;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
    border-color: var(--sage-500);
}
.field--error input, .field--error textarea { border-color: #b3261e; }
.field__error { color: #b3261e; font-size: var(--step--1); }

/* Honeypot — hidden from people, visible to bots. */
.hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px;
    overflow: hidden;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border-left: 4px solid;
    margin-bottom: 1.5rem;
}
.alert--ok    { background: var(--sage-50);  border-color: var(--sage-500); }
.alert--error { background: #fdecea;         border-color: #b3261e; }
.alert p:last-child { margin-bottom: 0; }

/* =====================================================================
   Call to action band
   ===================================================================== */

/* Brand green is light enough that this band takes dark text, not white —
   white lands at 2.5:1 here. */
.cta {
    background: var(--brand-green);
    color: var(--color-on-brand);
    border-radius: var(--radius-lg);
    padding: clamp(2rem, 5vw, 3.25rem);
    text-align: center;
}
.cta h2 { color: var(--color-on-brand); }
.cta p { color: var(--color-on-brand-muted); max-width: 48ch; margin-inline: auto; }
.cta .btn-row { justify-content: center; }

/* Amber against brand green is only 1.5:1, so the button needs a dark edge to
   stay a discernible shape. */
.cta .btn--primary { border-color: var(--color-on-brand); }
.cta .btn--primary:hover { border-color: var(--color-on-brand); }

/* The default sage link colour is marginal on brand green — go to the same
   dark tone the rest of the band uses. */
.cta .btn--secondary {
    border-color: var(--color-on-brand);
    color: var(--color-on-brand);
}
.cta .btn--secondary:hover {
    background: rgb(255 255 255 / 0.22);
    border-color: var(--color-on-brand);
    color: var(--color-on-brand);
}

/* =====================================================================
   Footer
   ===================================================================== */

.site-footer {
    background: var(--brand-green);
    color: var(--color-on-brand);
    margin-top: auto;
    padding-top: clamp(2.5rem, 6vw, 4rem);
    font-size: var(--step--1);
}
/* The amber focus ring is invisible on brand green (1.3:1) — go dark instead. */
.site-footer :focus-visible,
.cta :focus-visible { outline-color: var(--color-on-brand); }

.site-footer a { color: var(--color-on-brand); text-decoration: none; }
.site-footer a:hover { color: var(--color-on-brand); text-decoration: underline; }
.site-footer .muted { color: var(--color-on-brand-muted); }

.site-footer__inner {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    padding-bottom: 2.5rem;
}

.site-footer__brand { display: flex; align-items: flex-start; gap: 0.85rem; }
.site-footer__brand p { margin: 0; font-weight: 600; color: var(--color-on-brand); }

.site-footer__nav ul { list-style: none; margin: 0; padding: 0; }
.site-footer__nav li { margin-bottom: 0.5rem; }

.site-footer__contact { display: grid; gap: 0.5rem; align-content: start; }

.site-footer__legal {
    border-top: 1px solid var(--color-on-brand-rule);
    padding-block: 1.25rem;
}
.site-footer__legal p { margin: 0; color: var(--color-on-brand-muted); }

/* =====================================================================
   404
   ===================================================================== */

.notfound { text-align: center; padding-block: clamp(4rem, 12vw, 8rem); }
.notfound__code {
    font-family: var(--font-display);
    font-size: clamp(4rem, 18vw, 9rem);
    line-height: 1;
    color: var(--amber-400);
    margin: 0 0 0.15em;
}

/* =====================================================================
   Print
   ===================================================================== */

@media print {
    .site-header, .site-footer__nav, .btn-row, .skip-link { display: none; }
    body { color: #000; }
    a::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
