/*
 * Shared theme for every page: Ghana flag colours over shea, laterite and
 * soot, a woven kente strip, adinkra symbols and Sirigu-style zigzags.
 * Page-specific layout lives in each page's own <style> block.
 */

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

:root {
    --ink: #17120d;
    --earth: #2b1e15;
    --cream: #f6eedf;
    --paper: #fffaf0;
    --gold: #f2b01e;
    --red: #c0272d;
    --green: #0b6b3f;
    --clay: #a8451f;
    --muted: #6b5a4a;
    --line: rgba(23, 18, 13, 0.14);
    --cream-dim: rgba(246, 238, 223, 0.75);

    /* Chunky poster face for headlines, after hand-painted shop signs and tro-tro slogans */
    --sign: 'Bowlby One', 'Arial Black', Impact, sans-serif;
    --display: 'Bricolage Grotesque', 'Segoe UI', Tahoma, sans-serif;
    --body: 'DM Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* Woven kente strip: warp stripes, diamond, weft bars, checks */
    --kente: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='24' viewBox='0 0 120 24'%3E%3Crect width='120' height='24' fill='%23f2b01e'/%3E%3Crect x='4' width='3' height='24' fill='%230b6b3f'/%3E%3Crect x='10' width='3' height='24' fill='%23c0272d'/%3E%3Crect x='16' width='3' height='24' fill='%2317120d'/%3E%3Crect x='22' width='3' height='24' fill='%230b6b3f'/%3E%3Crect x='30' width='30' height='24' fill='%2317120d'/%3E%3Cpath d='M45 3 57 12 45 21 33 12z' fill='%23f2b01e'/%3E%3Cpath d='M45 8 50 12 45 16 40 12z' fill='%23c0272d'/%3E%3Crect x='60' width='30' height='24' fill='%230b6b3f'/%3E%3Cpath d='M64 4h22v3H64zM64 10.5h22v3H64zM64 17h22v3H64z' fill='%23f2b01e'/%3E%3Crect x='90' width='30' height='24' fill='%23c0272d'/%3E%3Cpath d='M93 0h6v6h-6zM105 0h6v6h-6zM99 6h6v6h-6zM111 6h6v6h-6zM93 12h6v6h-6zM105 12h6v6h-6zM99 18h6v6h-6zM111 18h6v6h-6z' fill='%2317120d'/%3E%3C/svg%3E");

    /* Adinkra cloth: real symbols stamped faintly in gold inside comb-lined squares */
    --cloth: url("images/adinkra/cloth.png");

    /* Ghana's black star, used as a mask or as an ink-coloured image */
    --star: url("images/black-star.png");
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body);
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--cream);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--green);
}

::selection {
    background: var(--gold);
    color: var(--ink);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.kente {
    height: 12px;
    background: var(--kente) repeat-x left center / auto 100%;
}

/* Painted triangle bands, after the wall murals of Sirigu */
.zigzag {
    --a: var(--ink);
    --b: var(--gold);
    background:
        linear-gradient(135deg, var(--a) 25%, transparent 25%) -20px 0 / 40px 40px,
        linear-gradient(225deg, var(--a) 25%, transparent 25%) -20px 0 / 40px 40px,
        linear-gradient(315deg, var(--a) 25%, transparent 25%) 0 0 / 40px 40px,
        linear-gradient(45deg, var(--a) 25%, transparent 25%) 0 0 / 40px 40px,
        var(--b);
}

/* ===== Navigation ===== */
nav {
    background: var(--ink);
    color: var(--cream);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.9rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
}

.nav-logo {
    font-family: var(--display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cream);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-logo:hover {
    color: var(--gold);
}

.nav-logo::before {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.5rem;
    vertical-align: -0.12em;
    background: var(--gold);
    -webkit-mask: var(--star) center / contain no-repeat;
    mask: var(--star) center / contain no-repeat;
}

.mobile-toggle {
    display: none;
    background: none;
    border: 1.5px solid var(--cream);
    padding: 0.3rem 0.8rem;
    color: var(--cream);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.75rem;
}

nav ul a {
    color: var(--cream);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

nav ul a:hover,
nav ul a[aria-current="page"] {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

nav .kente {
    height: 8px;
}

/* ===== Hero and page headers ===== */
.hero,
.page-header {
    background:
        radial-gradient(60rem 30rem at 85% 0%, rgba(242, 176, 30, 0.2), transparent 60%),
        linear-gradient(90deg, var(--ink) 30%, rgba(23, 18, 13, 0.55)),
        var(--cloth),
        var(--ink);
    color: var(--cream);
}

.hero-inner,
.page-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 7rem 2rem 6rem;
}

.page-header-inner {
    padding: 4.5rem 2rem 4rem;
}

.eyebrow {
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.25rem;
    animation: fadeInUp 0.8s ease both;
}

.hero h1,
.page-header h1 {
    font-family: var(--sign);
    font-size: clamp(2.1rem, 4.6vw, 3.6rem);
    font-weight: 400;
    line-height: 1.1;
    text-shadow: 0.06em 0.06em 0 var(--red);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease 0.1s both;
}

.page-header h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 0.9rem;
}

.hero em {
    font-style: normal;
    color: var(--gold);
}

.hero p,
.page-header p {
    font-size: 1.2rem;
    max-width: 40rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.page-header p:not(.eyebrow) {
    color: var(--cream-dim);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.cta {
    display: inline-block;
    padding: 0.95rem 1.9rem;
    background: var(--gold);
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    border: 2px solid var(--gold);
    box-shadow: 5px 5px 0 var(--red);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--red);
}

.cta.ghost {
    background: transparent;
    color: var(--cream);
    border-color: var(--cream);
    box-shadow: 5px 5px 0 var(--green);
}

.cta.ghost:hover {
    box-shadow: 7px 7px 0 var(--green);
}

.hero > .kente,
.page-header > .kente {
    height: 18px;
}

/* ===== "TBD" sticker, slapped over pages that are still being worked on ===== */
.page-header-inner {
    position: relative;
}

.tbd-sticker {
    position: absolute;
    right: 2rem;
    bottom: -5rem;
    z-index: 5;
    width: 9.5rem;
    transform: rotate(12deg);
    /* the shadow lives on the wrapper because the burst shape below is clipped */
    filter: drop-shadow(5px 5px 0 var(--ink));
}

.tbd-sticker span {
    aspect-ratio: 1;
    display: grid;
    place-content: center;
    justify-items: center;
    text-align: center;
    background: var(--gold);
    color: var(--ink);
    clip-path: polygon(50.0% 0.0%, 56.8% 7.0%, 65.5% 2.4%, 69.7% 11.2%, 79.4% 9.5%, 80.8% 19.2%, 90.5% 20.6%, 88.8% 30.3%, 97.6% 34.5%, 93.0% 43.2%, 100.0% 50.0%, 93.0% 56.8%, 97.6% 65.5%, 88.8% 69.7%, 90.5% 79.4%, 80.8% 80.8%, 79.4% 90.5%, 69.7% 88.8%, 65.5% 97.6%, 56.8% 93.0%, 50.0% 100.0%, 43.2% 93.0%, 34.5% 97.6%, 30.3% 88.8%, 20.6% 90.5%, 19.2% 80.8%, 9.5% 79.4%, 11.2% 69.7%, 2.4% 65.5%, 7.0% 56.8%, 0.0% 50.0%, 7.0% 43.2%, 2.4% 34.5%, 11.2% 30.3%, 9.5% 20.6%, 19.2% 19.2%, 20.6% 9.5%, 30.3% 11.2%, 34.5% 2.4%, 43.2% 7.0%);
}

.tbd-sticker strong {
    font-family: var(--sign);
    font-size: 2.5rem;
    font-weight: 400;
    line-height: 1;
    text-shadow: 2px 2px 0 var(--cream);
}

.tbd-sticker small {
    max-width: 6.2rem;
    margin-top: 0.25rem;
    font-family: var(--display);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ===== Layout ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container > section {
    padding: 5rem 0 1rem;
    scroll-margin-top: 4.5rem;
}

/* Pages have no footer, so the content carries its own bottom space */
main.container {
    padding-bottom: 5rem;
}

/* ===== Section headings with adinkra symbols ===== */
.section-head {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1.25rem;
    align-items: center;
    margin-bottom: 2.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--ink);
}

.adinkra {
    grid-row: span 2;
    position: relative;
    width: 64px;
    height: 64px;
    background: var(--ink);
}

.section-head.has-kicker .adinkra {
    grid-row: span 3;
}

.adinkra::before {
    content: "";
    position: absolute;
    inset: 8px;
    background: var(--gold);
    -webkit-mask: var(--sym) center / contain no-repeat;
    mask: var(--sym) center / contain no-repeat;
}

/* The symbols themselves: images in images/adinkra/, used as masks so they take the gold */
.adk-dwennimmen { --sym: url("images/adinkra/dwennimmen.png"); }
.adk-akofena { --sym: url("images/adinkra/akofena.png"); }
.adk-duafe { --sym: url("images/adinkra/duafe.png"); }
.adk-gye-nyame { --sym: url("images/adinkra/gye-nyame.png"); }
.adk-sankofa { --sym: url("images/adinkra/sankofa.png"); }
.adk-sankofa-bird { --sym: url("images/adinkra/sankofa-bird.png"); }
.adk-akoma { --sym: url("images/adinkra/akoma.png"); }

.section-head h2,
.section-head h3 {
    font-family: var(--display);
    font-size: clamp(2rem, 4.5vw, 2.9rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.section-head h3 {
    font-size: 1.7rem;
}

.section-head em {
    font-style: normal;
    color: var(--clay);
}

.kicker {
    font-family: var(--display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--green);
}

.symbol-note {
    font-size: 0.9rem;
    color: var(--muted);
}

.symbol-note i {
    font-style: normal;
    font-weight: 700;
    color: var(--clay);
}

.section-desc {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 560px;
    margin: -1.25rem 0 2.5rem;
}

/* Shown on pages that have no content yet; steps aside once a README appears before it */
.empty-note {
    padding: 6rem 0 3rem;
    font-family: var(--display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--muted);
}

.readme:not([hidden]) + .empty-note {
    display: none;
}

/* Links onward at the foot of a page */
.next-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 4rem;
}

/* ===== Forms and buttons ===== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group > label,
legend {
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.contact-form :where(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
    padding: 0.8rem;
    border: 2px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--ink);
    font: inherit;
    transition: border-color 0.2s;
}

.contact-form :where(input, textarea, select):focus {
    border-color: var(--ink);
}

/* Inline validation, set by src/contact-form.ts */
.contact-form [aria-invalid="true"] {
    border-color: var(--red);
}

.field-error {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--red);
}

.form-status {
    padding: 0.9rem 1rem;
    background: var(--cream);
    border-left: 6px solid var(--green);
}

.form-status[data-kind="error"] {
    border-left-color: var(--red);
}

.form-status a {
    font-weight: 700;
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-form input[type="checkbox"],
.contact-form input[type="radio"] {
    accent-color: var(--green);
    cursor: pointer;
}

.submit-btn,
.btn {
    display: inline-block;
    align-self: flex-start;
    padding: 0.95rem 1.9rem;
    background: var(--ink);
    color: var(--gold);
    border: 2px solid var(--ink);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.submit-btn:hover,
.btn:hover {
    background: var(--gold);
    color: var(--ink);
}

.social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
    padding: 0.5rem 1.1rem;
    border: 2px solid var(--ink);
    transition: background 0.2s, color 0.2s;
}

.social-links a:hover {
    background: var(--ink);
    color: var(--gold);
}

/* ===== Motion ===== */
/* src/reveal.ts adds .reveal-pending to below-the-fold elements, then removes it on scroll */
.reveal {
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.reveal-pending {
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-inner,
    .hero-inner,
    .page-header-inner,
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .hero-inner {
        padding-top: 4.5rem;
        padding-bottom: 4rem;
    }

    .page-header-inner {
        padding-top: 3rem;
        padding-bottom: 2.75rem;
    }

    .hero p,
    .page-header p {
        font-size: 1.05rem;
    }

    .tbd-sticker {
        right: 1rem;
        bottom: -3.75rem;
        width: 7.25rem;
    }

    .tbd-sticker strong {
        font-size: 1.9rem;
    }

    .tbd-sticker small {
        max-width: 4.8rem;
        font-size: 0.55rem;
    }

    /* keep the header text clear of the sticker */
    .page-header-inner:has(.tbd-sticker) p:not(.eyebrow) {
        max-width: calc(100% - 7rem);
    }

    .container > section {
        padding-top: 3.5rem;
    }

    .adinkra {
        width: 52px;
        height: 52px;
    }

    .adinkra::before {
        inset: 7px;
    }
}

/* Below this width the menu collapses behind the toggle (see src/nav.ts) */
@media (max-width: 760px) {
    .mobile-toggle {
        display: inline-block;
    }

    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--ink);
        border-bottom: 4px solid var(--gold);
        padding: 0.5rem 1.25rem 1rem;
    }

    nav ul.show {
        display: flex;
    }

    nav ul a {
        display: block;
        padding: 0.6rem 0;
        border-bottom: none;
    }
}
