/*
Theme Name: Hidden Edge
Theme URI: https://hiddenedge.studio
Author: Lumbeta Holdings Ltd
Author URI: https://hiddenedge.studio
Description: Custom theme for Hidden Edge, the productised AI-native creative studio for UK professional services firms. Written by Claude Code via SSH. Not for redistribution.
Version: 0.2.0
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 8.0
License: Proprietary
License URI: https://hiddenedge.studio
Text Domain: hidden-edge
*/

/* === Design tokens === */
:root {
    --he-bg: #d3c6b2;
    --he-body: #1A1A1A;
    --he-heading: #000000;
    --he-accent: #1A1A1A;
    --he-hover: #4A4A4A;
    --he-emphasis: #5C1A1B;

    --he-font-heading: 'Gloock', Georgia, 'Times New Roman', serif;
    --he-font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;

    --he-max: 1280px;
    --he-pad-x: clamp(20px, 4vw, 48px);
    --he-header-h: 64px;
}

/* === Reset (light) === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding-top: var(--he-header-h); }
img, svg { display: block; max-width: 100%; height: auto; }

/* === Base typography === */
body {
    background: var(--he-bg);
    color: var(--he-body);
    font-family: var(--he-font-body);
    font-size: 18px;
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); }

p { margin: 0 0 1em; }

a {
    color: var(--he-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.15s ease;
}
a:hover { color: var(--he-hover); }

/* === Layout === */
.he-container {
    max-width: var(--he-max);
    margin: 0 auto;
    padding: 0 var(--he-pad-x);
}

.site-main {
    min-height: 60vh;
    padding: 4rem 0;
}

/* === Site header === */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 0;
    background: var(--he-bg);
    z-index: 200;
    transition: top 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.site-header.is-hidden {
    top: calc(-1 * var(--he-header-h) - 10px);
}

.site-header.is-menu-open {
    top: 0 !important;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 30;
}

.site-header__brand {
    display: inline-flex;
    align-items: center;
    color: var(--he-heading);
    text-decoration: none;
}

.site-header__brand:hover { color: var(--he-hover); }

.site-header__monogram {
    width: auto;
    height: 40px;
    color: currentColor;
}

.site-header__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem;
    align-items: center;
}

.site-header__nav a {
    text-decoration: none;
    font-family: var(--he-font-body);
    font-size: 0.95rem;
    color: var(--he-body);
}

.site-header__nav a:hover { color: var(--he-hover); }

.site-header__nav .menu-item-cta a {
    border: 1px solid var(--he-accent);
    padding: 0.6rem 1.1rem;
    border-radius: 9999px;
    color: var(--he-accent);
}

.site-header__nav .menu-item-cta a:hover {
    background: var(--he-accent);
    color: var(--he-bg);
}

/* === Site footer === */
.site-footer {
    padding: 3rem 0;
    border-top: 1px solid rgba(26, 26, 26, 0.08);
    font-size: 0.9rem;
    color: var(--he-body);
}

.site-footer p { margin: 0 0 0.4em; }
.site-footer p:last-child { margin: 0; }

/* === Hero (front page above the fold) === */
.he-hero {
    padding: 5rem 0 6rem;
}

.he-hero__headline {
    max-width: 22ch;
    margin: 0 0 1.5rem;
}

.he-hero__sub {
    max-width: 50ch;
    font-size: 1.15rem;
    margin: 0 0 2.5rem;
    color: var(--he-body);
}

.he-hero__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: center;
}

.he-btn {
    display: inline-block;
    padding: 0.85rem 1.5rem;
    font-family: var(--he-font-body);
    font-size: 1rem;
    text-decoration: none;
    border: 1px solid var(--he-accent);
    border-radius: 9999px;
    transition: background 0.15s ease, color 0.15s ease;
}

.he-btn--primary {
    background: var(--he-accent);
    color: var(--he-bg);
}
.he-btn--primary:hover { background: var(--he-hover); border-color: var(--he-hover); color: var(--he-bg); }

.he-btn--secondary {
    background: transparent;
    color: var(--he-accent);
}
.he-btn--secondary:hover { background: var(--he-accent); color: var(--he-bg); }

/* === Utility === */
.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
    height: 1px; width: 1px; margin: -1px; overflow: hidden;
    padding: 0; position: absolute; word-wrap: normal !important;
}

/* === Standard page layout === */
.he-page {
    padding: 5rem 0 6rem;
}

.he-page__header {
    margin-bottom: 3rem;
}

.he-page__title {
    margin: 0;
}

.he-page__content {
    max-width: 65ch;
    font-size: 1.05rem;
}

.he-page__content > * + * {
    margin-top: 1.25em;
}

/* === Mobile nav (hamburger icon) === */
.site-header__toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 0.5rem;
    margin: 0;
    cursor: pointer;
    color: var(--he-heading);
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    z-index: 30;
}

.site-header__toggle-icon {
    display: block;
    width: 28px;
    height: 2px;
    background: currentColor;
    position: relative;
    transition: background 0.2s ease;
}

.site-header__toggle-icon::before,
.site-header__toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 28px;
    height: 2px;
    background: currentColor;
}

/* Three lines: close state (fast to slow / ease-out) */
.site-header__toggle-icon::before {
    top: -9px;
    transition: top 0.15s 0.15s ease-out, transform 0.15s ease-out;
}
.site-header__toggle-icon::after {
    top: 9px;
    transition: top 0.15s 0.15s ease-out, transform 0.15s ease-out;
}

/* X animation: open state (slow to quick / ease-in) */
.site-header__toggle[aria-expanded="true"] .site-header__toggle-icon {
    background: transparent;
}
.site-header__toggle[aria-expanded="true"] .site-header__toggle-icon::before {
    top: 0;
    transform: rotate(45deg);
    transition: top 0.15s ease-in, transform 0.15s 0.15s ease-in;
}
.site-header__toggle[aria-expanded="true"] .site-header__toggle-icon::after {
    top: 0;
    transform: rotate(-45deg);
    transition: top 0.15s ease-in, transform 0.15s 0.15s ease-in;
}

/* === Overlay (appended inside header via JS, covers full viewport) === */
.site-header__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.site-header__overlay.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease, visibility 0s 0s;
}

/* === Mobile nav (slide panel, appended inside header via JS) === */
@media (max-width: 720px) {
    .site-header__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .site-header__toggle {
        display: inline-flex;
        align-items: center;
    }

    /* Panel: slides from right, pops quick then decelerates */
    .site-header__nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 80vw;
        max-width: 360px;
        background: var(--he-bg);
        border-left: 1px solid rgba(26, 26, 26, 0.08);
        padding: 4.5rem var(--he-pad-x) 2rem;
        z-index: 20;
        overflow-y: auto;

        /* Closed: off-screen right */
        transform: translateX(100%);
        visibility: hidden;

        /* Close: quick start, gentle landing */
        transition: transform 0.3s cubic-bezier(0.4, 0, 1, 1),
                    visibility 0s 0.3s;
    }

    /* Open: pops quick then decelerates (ease-out curve) */
    .site-header__nav.is-open {
        transform: translateX(0);
        visibility: visible;

        transition: transform 0.35s cubic-bezier(0.0, 0.0, 0.2, 1),
                    visibility 0s 0s;
    }

    .site-header__nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    /* Menu items: fade in from bottom */
    .site-header__nav li {
        width: 100%;
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.01s ease, transform 0.01s ease;
    }

    .site-header__nav.is-open li {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.25s ease-out, transform 0.25s ease-out;
    }

    /* Staggered delay per item */
    .site-header__nav.is-open li:nth-child(1) { transition-delay: 0.08s; }
    .site-header__nav.is-open li:nth-child(2) { transition-delay: 0.14s; }
    .site-header__nav.is-open li:nth-child(3) { transition-delay: 0.20s; }
    .site-header__nav.is-open li:nth-child(4) { transition-delay: 0.26s; }
    .site-header__nav.is-open li:nth-child(5) { transition-delay: 0.32s; }
    .site-header__nav.is-open li:nth-child(6) { transition-delay: 0.38s; }

    .site-header__nav a {
        display: block;
        font-size: 1.3rem;
        padding: 0.6rem 0;
        border-bottom: 1px solid rgba(26, 26, 26, 0.06);
    }

    .site-header__nav li:last-child a {
        border-bottom: 0;
    }
}

/* === Section base === */
.he-section {
    padding: 5rem 0;
    border-top: 1px solid rgba(26, 26, 26, 0.08);
}

.he-section__eyebrow {
    display: inline-block;
    font-family: var(--he-font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--he-hover);
    margin-bottom: 1rem;
}

.he-section__title {
    margin: 0 0 1.5rem;
    max-width: 24ch;
}

.he-section__lede {
    max-width: 60ch;
    font-size: 1.15rem;
    margin: 0 0 3rem;
    color: var(--he-body);
}

/* === Pain === */
.he-pain__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
}

.he-pain__col p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
}

@media (max-width: 900px) {
    .he-pain__grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* === Cards (shared) === */
.he-cards {
    display: grid;
    gap: 1.5rem;
    margin-top: 1rem;
}

.he-cards--two { grid-template-columns: repeat(2, 1fr); }
.he-cards--five { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1100px) {
    .he-cards--five { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .he-cards--two { grid-template-columns: 1fr; }
    .he-cards--five { grid-template-columns: 1fr; }
}

.he-card {
    background: var(--he-bg);
    border: 1px solid rgba(26, 26, 26, 0.12);
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.he-card:hover {
    border-color: var(--he-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 26, 26, 0.06);
}

.he-card__media {
    aspect-ratio: 16 / 10;
    background: rgba(26, 26, 26, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(26, 26, 26, 0.08);
}

.he-card__placeholder {
    font-family: var(--he-font-body);
    font-size: 0.85rem;
    color: var(--he-hover);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.he-card__body { padding: 1.75rem; flex: 1; display: flex; flex-direction: column; }
.he-card__eyebrow {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--he-hover);
    margin-bottom: 0.5rem;
}
.he-card__title { font-size: 1.4rem; margin: 0 0 0.75rem; }
.he-card__copy { margin: 0 0 1.25rem; }
.he-card__link {
    margin-top: auto;
    font-family: var(--he-font-body);
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--he-accent);
    border-bottom: 1px solid var(--he-accent);
    padding-bottom: 2px;
    align-self: flex-start;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.he-card__link:hover { color: var(--he-hover); border-color: var(--he-hover); }

/* === Foundation component cards === */
.he-card--component {
    padding: 1.75rem;
}
.he-card--component .he-card__num {
    display: inline-block;
    font-family: var(--he-font-heading);
    font-size: 1rem;
    color: var(--he-emphasis);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}
.he-card--component .he-card__title { font-size: 1.2rem; }
.he-card--component .he-card__copy { font-size: 0.95rem; }

.he-foundation__cta { margin-top: 3rem; }

/* === Featured work === */
.he-feature {
    margin-top: 1rem;
    border: 1px solid rgba(26, 26, 26, 0.12);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.he-feature:hover {
    border-color: var(--he-accent);
    box-shadow: 0 8px 24px rgba(26, 26, 26, 0.06);
}

.he-feature__link {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    text-decoration: none;
    color: inherit;
}
.he-feature__media {
    aspect-ratio: 4 / 3;
    background: rgba(26, 26, 26, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}
.he-feature__body { padding: 3rem; display: flex; flex-direction: column; justify-content: center; }
.he-feature__eyebrow {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--he-hover);
    margin-bottom: 1rem;
}
.he-feature__title { font-size: clamp(1.6rem, 2.5vw, 2.2rem); margin: 0 0 1rem; }
.he-feature__copy { font-size: 1.05rem; margin: 0 0 1.5rem; }
.he-feature__cta {
    font-family: var(--he-font-body);
    font-size: 0.95rem;
    color: var(--he-accent);
    border-bottom: 1px solid var(--he-accent);
    align-self: flex-start;
    padding-bottom: 2px;
}

@media (max-width: 900px) {
    .he-feature__link { grid-template-columns: 1fr; }
    .he-feature__body { padding: 2rem; }
}

.he-work__future {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}
@media (max-width: 720px) { .he-work__future { grid-template-columns: 1fr; } }

.he-card--placeholder {
    opacity: 0.7;
}
.he-card--placeholder:hover { transform: none; box-shadow: none; }

/* === eco section === */
.he-eco__inner {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 4rem;
    align-items: start;
}
.he-eco__col p { margin: 0 0 1em; font-size: 1.05rem; }
.he-eco__col .he-card__link { margin-top: 0.5rem; }

@media (max-width: 900px) {
    .he-eco__inner { grid-template-columns: 1fr; gap: 2rem; }
}

/* === Founder === */
.he-founder__inner {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 4rem;
    align-items: center;
}
.he-founder__photo {
    aspect-ratio: 4 / 5;
    background: rgba(26, 26, 26, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}
.he-founder__body p { font-size: 1.05rem; margin: 0 0 1em; }

@media (max-width: 900px) {
    .he-founder__inner { grid-template-columns: 1fr; gap: 2rem; }
}

/* === Final CTA === */
.he-final {
    text-align: center;
    padding: 6rem 0;
}
.he-final__inner { max-width: 60ch; margin: 0 auto; }
.he-final__title { margin: 0 0 1rem; }
.he-final__sub { font-size: 1.15rem; margin: 0 0 2.5rem; }

.he-btn--lg {
    padding: 1.1rem 2rem;
    font-size: 1.05rem;
}
