/*
 * UncleBuik public design system.
 *
 * The interface uses strong contrast, visible borders, text labels,
 * and underlines. Important meaning never depends on colour alone.
 */

:root {
    --background: #f7f7f5;
    --surface: #ffffff;
    --surface-muted: #ecece8;
    --text: #171717;
    --text-muted: #555555;
    --border: #c8c8c2;
    --border-strong: #777770;
    --primary: #005fcc;
    --primary-hover: #004a9f;
    --primary-text: #ffffff;
    --header: #111111;
    --header-text: #ffffff;
    --focus: #ffbf47;
    --success-background: #edf7f0;
    --success-border: #18794e;
    --error-background: #fff1f0;
    --error-border: #b42318;
    --warning-background: #fff8e6;
    --warning-border: #9a6700;
    --content-width: 1120px;
    --reading-width: 760px;
    --radius-small: 6px;
    --radius-medium: 12px;
    --radius-large: 20px;
    --shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}


/* Predictable sizing throughout the interface. */
*,
*::before,
*::after {
    box-sizing: border-box;
}


/* Main document behaviour. */
html {
    scroll-behavior: smooth;
}


body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem;
    line-height: 1.65;
}


/* Prevent media from overflowing containers. */
img,
svg,
video {
    max-width: 100%;
    height: auto;
}


/* Headings. */
h1,
h2,
h3,
h4 {
    margin-top: 0;
    line-height: 1.2;
}


h1 {
    font-size: clamp( 2.4rem, 7vw, 5.5rem );
}


h2 {
    font-size: clamp( 1.8rem, 4vw, 3rem );
}


h3 {
    font-size: 1.25rem;
}


/* Links. */
a {
    color: var(--primary);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
}


    a:hover {
        color: var(--primary-hover);
    }


    /* Keyboard focus. */
    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    textarea:focus-visible,
    select:focus-visible {
        outline: 4px solid var(--focus);
        outline-offset: 3px;
    }


/* Skip navigation link. */
.skip-link {
    position: fixed;
    top: 0;
    left: 1rem;
    z-index: 1000;
    padding: 0.75rem 1rem;
    background: var(--focus);
    color: #111111;
    font-weight: 700;
    transform: translateY(-150%);
}


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


/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header);
    color: var(--header-text);
    border-bottom: 4px solid var(--primary);
}


.header-inner {
    width: min( var(--content-width), calc(100% - 2rem) );
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}


/* Main UncleBuik identity. */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--header-text);
    font-size: 1.2rem;
    font-weight: 800;
    text-decoration: none;
}


    .brand:hover {
        color: var(--header-text);
    }


.brand-logo {
    width: 42px;
    height: 42px;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: var(--radius-small);
}


/* Main navigation. */
.main-navigation {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.4rem;
}


    .main-navigation a {
        color: var(--header-text);
        font-weight: 700;
        text-decoration: none;
    }


        .main-navigation a:hover {
            color: var(--header-text);
            text-decoration: underline;
            text-decoration-thickness: 3px;
        }


/* Mobile menu button. */
.menu-button {
    display: none;
    width: auto;
    margin: 0;
    padding: 0.65rem 0.85rem;
    background: transparent;
    color: var(--header-text);
    border: 2px solid var(--header-text);
    border-radius: var(--radius-small);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}


/* ---------------------------------------------------------
   Main page
   --------------------------------------------------------- */

.page-shell {
    width: min( var(--content-width), calc(100% - 2rem) );
    min-height: 70vh;
    margin: 0 auto;
    padding: 3rem 0 5rem;
}


/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */

.hero {
    min-height: 68vh;
    display: grid;
    align-items: center;
    padding: 5rem 0;
}


.hero-content {
    max-width: 900px;
}


.hero-description {
    max-width: 720px;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: clamp( 1.1rem, 2vw, 1.4rem );
}


/* Small section labels. */
.eyebrow {
    margin-bottom: 0.65rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}


/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.button-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}


.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: auto;
    padding: 0.75rem 1.15rem;
    border: 2px solid transparent;
    border-radius: var(--radius-small);
    font: inherit;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}


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


    .button-primary:hover {
        background: var(--primary-hover);
        color: var(--primary-text);
        border-color: var(--primary-hover);
    }


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


    .button-secondary:hover {
        background: var(--text);
        color: var(--surface);
    }


/* ---------------------------------------------------------
   Content sections
   --------------------------------------------------------- */

.content-section {
    padding: 5rem 0;
    border-top: 1px solid var(--border);
}


.about-section {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) 2fr;
    gap: 3rem;
}


.reading-width {
    max-width: var(--reading-width);
}


.section-heading {
    margin-bottom: 2rem;
}


.section-heading-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}


.text-link {
    font-weight: 800;
}


/* ---------------------------------------------------------
   Cards
   --------------------------------------------------------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax(240px, 1fr) );
    gap: 1.25rem;
}


.project-card {
    min-height: 260px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 6px solid var(--primary);
    border-radius: var(--radius-medium);
}


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


.card-label {
    width: fit-content;
    margin-bottom: 1.25rem;
    padding: 0.25rem 0.55rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}


.card-link {
    margin-top: auto;
    font-weight: 800;
}


/* ---------------------------------------------------------
   Social profiles
   --------------------------------------------------------- */

.social-grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax(220px, 1fr) );
    gap: 1rem;
}


.social-link {
    display: grid;
    gap: 0.3rem;
    padding: 1.25rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    text-decoration: none;
}


    .social-link:hover {
        color: var(--text);
        border-color: var(--border-strong);
        box-shadow: var(--shadow);
    }


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


.helper-text,
.field-help {
    color: var(--text-muted);
    font-size: 0.9rem;
}


/* ---------------------------------------------------------
   Empty states
   --------------------------------------------------------- */

.empty-state {
    padding: 2rem;
    background: var(--surface-muted);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-medium);
}


/* ---------------------------------------------------------
   Story/article previews
   --------------------------------------------------------- */

.article-list {
    display: grid;
}


.article-row {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}


    .article-row h3 {
        margin-bottom: 0.4rem;
    }


/* ---------------------------------------------------------
   Homepage contact callout
   --------------------------------------------------------- */

.callout {
    margin-top: 3rem;
    padding: clamp( 1.5rem, 5vw, 3rem );
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    background: var(--header);
    color: var(--header-text);
    border-radius: var(--radius-large);
}


    .callout .eyebrow {
        color: #d4d4d4;
    }


    .callout h2 {
        color: var(--header-text);
    }


    .callout p {
        max-width: 650px;
    }


/* ---------------------------------------------------------
   Page introductions
   --------------------------------------------------------- */

.page-introduction {
    max-width: var(--reading-width);
    margin-bottom: 3rem;
}


    .page-introduction > p:not(.eyebrow) {
        color: var(--text-muted);
        font-size: 1.1rem;
    }


/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(250px, 0.7fr);
    gap: 2rem;
    align-items: start;
}


.form-panel,
.contact-information {
    padding: clamp( 1.25rem, 4vw, 2rem );
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
}


.message-form-panel {
    max-width: 760px;
}


form {
    width: 100%;
}


.form-field {
    margin-bottom: 1.25rem;
}


    .form-field label {
        display: block;
        margin-bottom: 0.4rem;
        font-weight: 800;
    }


input,
textarea,
select {
    width: 100%;
    min-height: 48px;
    padding: 0.8rem;
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-small);
    font: inherit;
}


textarea {
    min-height: 180px;
    resize: vertical;
}


    input:hover,
    textarea:hover,
    select:hover {
        border-color: var(--text);
    }


.field-error {
    margin: 0.4rem 0 0;
    padding-left: 0.6rem;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 800;
    border-left: 5px solid var(--error-border);
}


.honeypot-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}


.message-note {
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    background: var(--surface-muted);
    color: var(--text-muted);
    border-left: 4px solid var(--border-strong);
    border-radius: var(--radius-small);
    font-size: 0.9rem;
}


/* ---------------------------------------------------------
   Admin login
   --------------------------------------------------------- */

.admin-login {
    max-width: 620px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow);
}


    .admin-login form {
        margin-top: 2rem;
    }


    .admin-login input[type="submit"] {
        width: auto;
        padding: 0.75rem 1.15rem;
        background: var(--primary);
        color: var(--primary-text);
        border: 2px solid var(--primary);
        font-weight: 800;
        cursor: pointer;
    }


        .admin-login input[type="submit"]:hover {
            background: var(--primary-hover);
            border-color: var(--primary-hover);
        }


/* ---------------------------------------------------------
   System notices
   --------------------------------------------------------- */

.notice {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 2px solid var(--border-strong);
    border-left-width: 8px;
    border-radius: var(--radius-small);
}


.notice-success {
    background: var(--success-background);
    border-left-color: var(--success-border);
}


.notice-error {
    background: var(--error-background);
    border-left-color: var(--error-border);
}


.notice-warning {
    background: var(--warning-background);
    border-left-color: var(--warning-border);
}


/* ---------------------------------------------------------
   Error pages
   --------------------------------------------------------- */

.error-page {
    min-height: 62vh;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.error-code {
    margin: 0;
    color: var(--text-muted);
    font-size: clamp( 4rem, 15vw, 10rem );
    font-weight: 900;
    line-height: 0.9;
}


/* ---------------------------------------------------------
   Coming-soon page
   --------------------------------------------------------- */

.coming-soon-page {
    min-height: 60vh;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}


    .coming-soon-page > p:not(.eyebrow) {
        margin-bottom: 2rem;
        color: var(--text-muted);
        font-size: 1.15rem;
    }


/* ---------------------------------------------------------
   Legal pages
   --------------------------------------------------------- */

.legal-page {
    max-width: var(--reading-width);
}


    .legal-page section {
        padding: 1.5rem 0;
        border-top: 1px solid var(--border);
    }


/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.site-footer {
    background: var(--header);
    color: var(--header-text);
}


.footer-grid {
    width: min( var(--content-width), calc(100% - 2rem) );
    margin: 0 auto;
    padding: 4rem 0;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}


    .footer-grid h2 {
        font-size: 1.05rem;
    }


    .footer-grid p {
        max-width: 480px;
        color: #d4d4d4;
    }


    .footer-grid nav {
        display: grid;
        gap: 0.6rem;
    }


    .footer-grid a {
        color: var(--header-text);
    }


/* Footer brand identity. */
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
    color: var(--header-text);
    font-size: 1.1rem;
    font-weight: 800;
    text-decoration: none;
}


    .footer-brand:hover {
        color: var(--header-text);
    }


.footer-brand-logo {
    width: 38px;
    height: 38px;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: var(--radius-small);
}


/* Copyright area. */
.footer-bottom {
    width: min( var(--content-width), calc(100% - 2rem) );
    margin: 0 auto;
    padding: 1.5rem 0;
    border-top: 1px solid #444444;
}


.copyright-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    color: #d4d4d4;
}


.copyright-logo {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 3px;
}


/* ---------------------------------------------------------
   Tablet
   --------------------------------------------------------- */

@media (max-width: 850px) {

    .about-section,
    .contact-layout,
    .footer-grid {
        grid-template-columns: 1fr;
    }


    .about-section {
        gap: 1rem;
    }


    .footer-grid {
        gap: 2rem;
    }
}


/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media (max-width: 700px) {

    .header-inner {
        min-height: 68px;
        flex-wrap: wrap;
        padding: 0.7rem 0;
    }


    .menu-button {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
    }


    .main-navigation {
        display: none;
        width: 100%;
        padding: 1rem 0;
        align-items: stretch;
        flex-direction: column;
        border-top: 1px solid #444444;
    }


    .main-navigation-open {
        display: flex;
    }


    .main-navigation a {
        padding: 0.5rem 0;
    }


    .hero {
        min-height: auto;
        padding: 4rem 0;
    }


    .section-heading-row,
    .callout {
        align-items: flex-start;
        flex-direction: column;
    }


    .content-section {
        padding: 3.5rem 0;
    }
}


/* ---------------------------------------------------------
   Reduced motion
   --------------------------------------------------------- */

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}
