/*
Theme Name: ChitterWorks
Description: Custom Astra child theme for ChitterWorks.
Author: ChitterWorks
Template: astra
Text Domain: chitterworks
*/

/* ========================================
   DESIGN TOKENS
======================================== */

:root {
    --cw-bg: #0d1117;
    --cw-bg-soft: #151a22;
    --cw-surface: #1b222c;
    --cw-surface-hover: #222b37;
    --cw-border: rgba(255, 255, 255, 0.09);
    --cw-text: #f4f1ea;
    --cw-muted: #a5adba;
    --cw-accent: #d98b3a;
    --cw-accent-hover: #eda34f;
    --cw-shadow: 0 20px 55px rgba(0, 0, 0, 0.28);
    --cw-radius: 18px;
    --cw-content: 1200px;
    --cw-reading: 700px;
}

/* ========================================
   GLOBAL
======================================== */

html {
    scroll-behavior: smooth;
}

html,
body,
body.ast-separate-container,
body.ast-plain-container,
body.ast-page-builder-template {
    margin: 0;
    background: var(--cw-bg) !important;
    color: var(--cw-text) !important;
}

body {
    min-height: 100vh;
}

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

img {
    max-width: 100%;
}

body h1,
body h2,
body h3,
body h4,
body h5,
body h6 {
    color: var(--cw-text) !important;
}

body p {
    color: var(--cw-muted);
}

body a {
    color: inherit;
}

section[id] {
    scroll-margin-top: 20px;
}

/* ========================================
   NAVBAR
======================================== */

.navbar {
    position: relative;
    z-index: 1000;
    background: rgba(17, 18, 20, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.navbar .container {
    position: relative;
    display: flex;
    align-items: center;
    width: min(var(--cw-content), calc(100% - 48px));
    min-height: 78px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo img {
    display: block;
    width: auto;
    height: 52px;
    transition: transform 250ms ease;
}

.logo:hover img {
    transform: scale(1.04);
}

.nav-links {
    position: absolute;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 34px;
    margin: 0;
    padding: 0;
    list-style: none;
    transform: translateX(-50%);
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    position: relative;
    color: var(--cw-muted) !important;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 180ms ease;
}

.nav-links a:hover {
    color: var(--cw-text) !important;
}

.nav-links a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -8px;
    left: 0;
    height: 2px;
    background: var(--cw-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 180ms ease;
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 10px;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 5px auto;
    background: var(--cw-text);
    border-radius: 999px;
    transition: transform 250ms ease, opacity 250ms ease;
}

/* ========================================
   HERO
======================================== */

.hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: calc(100vh - 78px);
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(217, 139, 58, 0.18), transparent 32%),
        linear-gradient(135deg, #0d1117 0%, #111722 55%, #0d1117 100%);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.18;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 40px 40px;
}

.hero-content {
    position: relative;
    z-index: 1;
    width: min(850px, calc(100% - 48px));
    padding: 120px 0;
    text-align: center;
}

.hero .eyebrow {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--cw-accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.hero h1 {
    margin: 0 0 24px;
    color: var(--cw-text) !important;
    font-size: clamp(3.5rem, 9vw, 7rem);
    line-height: 0.92;
    letter-spacing: -0.06em;
}

.hero p {
    max-width: 680px;
    margin: 0 auto 36px;
    color: var(--cw-muted) !important;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.8;
}

/* ========================================
   BUTTONS
======================================== */

.button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 28px;
    border: 1px solid var(--cw-accent);
    border-radius: 8px;
    background: var(--cw-accent);
    color: #111 !important;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 12px 35px rgba(217, 139, 58, 0.22);
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button:hover,
a.button:hover {
    background: var(--cw-accent-hover);
    color: #111 !important;
    transform: translateY(-2px);
    box-shadow: 0 16px 42px rgba(217, 139, 58, 0.3);
}

/* ========================================
   CONTENT SECTIONS
======================================== */

.section {
    padding: 110px 0;
    background: var(--cw-bg);
}

.section:nth-of-type(even) {
    background: var(--cw-bg-soft);
}

.section > .container {
    width: min(var(--cw-content), calc(100% - 48px));
    margin: 0 auto;
}

.section h2 {
    margin: 0 0 56px;
    color: var(--cw-text) !important;
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
}

.section-heading {
    max-width: 720px;
    margin: 0 auto 56px;
    text-align: center;
}

.section-heading h2 {
    margin-bottom: 0;
}

.section-kicker,
.project-label {
    display: block;
    margin-bottom: 12px;
    color: var(--cw-accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* ========================================
   WORKBENCH CARDS
======================================== */

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.card {
    min-height: 240px;
    padding: 32px;
    border: 1px solid var(--cw-border);
    border-radius: 16px;
    background: var(--cw-surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.card:hover {
    background: var(--cw-surface-hover);
    border-color: rgba(217, 139, 58, 0.55);
    transform: translateY(-6px);
}

.card .emoji {
    margin-bottom: 24px;
    font-size: 2.5rem;
}

.card h3 {
    margin: 0 0 12px;
}

.card p {
    margin: 0;
    color: var(--cw-muted) !important;
}

/* ========================================
   FEATURED PROJECT
======================================== */

.featured {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: clamp(40px, 7vw, 90px);
    align-items: center;
}

.featured-image {
    position: relative;
    display: block;
    min-height: 460px;
    overflow: hidden;
    border: 1px solid var(--cw-border);
    border-radius: 20px;
    background: var(--cw-surface);
    text-decoration: none;
}

.featured-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 460px;
    object-fit: cover;
    transition: transform 400ms ease;
}

.featured-image:hover img {
    transform: scale(1.035);
}

.featured-placeholder {
    display: grid;
    place-items: center;
    min-height: 460px;
    padding: 32px;
    background:
        radial-gradient(circle at 30% 25%, rgba(217, 139, 58, 0.18), transparent 35%),
        var(--cw-surface);
    color: var(--cw-muted);
    text-align: center;
}

.featured-text h3 {
    margin: 0 0 20px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.05;
}

.featured-text h3 a {
    color: var(--cw-text) !important;
    text-decoration: none;
}

.featured-text h3 a:hover {
    color: var(--cw-accent) !important;
}

.project-summary {
    margin-bottom: 32px;
}

.project-summary p {
    margin: 0;
    color: var(--cw-muted) !important;
    font-size: 1.05rem;
    line-height: 1.8;
}

.empty-project-state {
    max-width: 680px;
    margin: 0 auto;
    padding: 64px 40px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
    text-align: center;
}

.empty-project-icon {
    display: block;
    margin-bottom: 20px;
    font-size: 3rem;
}

.empty-project-state h3 {
    margin-bottom: 12px;
}

.empty-project-state p {
    max-width: 480px;
    margin: 0 auto;
}

/* ========================================
   GALLERY
======================================== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid var(--cw-border);
    border-radius: 18px;
    background: var(--cw-surface);
    text-decoration: none;
    transition: transform 250ms ease, border-color 250ms ease, box-shadow 250ms ease;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 450ms ease, filter 350ms ease;
}

.gallery-item:hover {
    border-color: rgba(217, 139, 58, 0.5);
    transform: translateY(-6px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
    transform: scale(1.05);
    filter: brightness(0.55);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: end;
    padding: 26px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    opacity: 0;
    transition: opacity 250ms ease;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h3 {
    margin: 0;
    color: #fff !important;
    font-size: 1.4rem;
}

.gallery-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle, rgba(217, 139, 58, 0.15), transparent),
        var(--cw-surface);
    font-size: 4rem;
}

.gallery-footer {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

/* ========================================
   SINGLE PROJECT
======================================== */

/*
 * A quiet editorial layout: one continuous canvas, no stacked cards or
 * coloured panels. Typography, imagery and spacing create the hierarchy.
 */

body.project-main-image {
	transition: transform .35s ease;
}

body.project-main-image:hover {
	transform: scale(1.01);
}
 
body.single-project,
body.single-project.ast-separate-container,
body.single-project.ast-two-container {
    background: var(--cw-bg) !important;
}

body.single-project .project-page,
body.single-project .single-project-entry {
    width: 100%;
    margin: 0;
    padding: 0;
    background: var(--cw-bg);
}

body.single-project .project-shell {
    width: min(1100px, calc(100% - 48px));
    margin: 0 auto;
    padding: clamp(21px, 2vw, 21px) 0 clamp(21px, 2vw, 21px);
}

body.single-project .project-back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: min(760px, 100%);
    margin: 0 auto 24px;
    padding: 0;
    color: var(--cw-muted) !important;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: color 180ms ease, transform 180ms ease;
}

body.single-project .project-back-link:hover,
body.single-project .project-back-link:focus-visible {
    color: var(--cw-accent) !important;
    transform: translateX(-3px);
}

body.single-project .project-hero {
    width: min(760px, 100%);
    margin: 0 auto clamp(30px, 4vw, 42px);
    padding: 0;
    background: transparent;
    border: 0;
}

body.single-project .project-title {
    max-width: 760px;
    margin: 0 auto;
    color: var(--cw-accent) !important;
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 800;
    line-height: 0.94;
    letter-spacing: -0.06em;
    text-align: center;
    text-wrap: balance;
}

body.single-project .project-intro {
    max-width: 680px;
    margin: 22px auto 0;
    color: var(--cw-muted) !important;
    font-size: clamp(1.05rem, 2vw, 1.24rem);
    line-height: 1.65;
    text-align: center;
    text-wrap: pretty;
}

body.single-project .project-media,
body.single-project .project-featured-media {
    width: min(80%, 1000px);
    margin: 0 auto clamp(42px, 6vw, 64px);
    padding: 0;
}

body.single-project .project-main-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 620px;
    margin: 0;
    border: 0;
    border-radius: 12px;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

body.single-project .project-content {
    width: min(760px, 80%);
    margin: 0 auto;
    padding: 36px 0 0;
    border-top: 2px solid var(--cw-accent);
    text-align: center;
}

body.single-project .project-content > *:first-child {
    margin-top: 0;
}

body.single-project .project-content > *:last-child {
    margin-bottom: 0;
}

body.single-project .project-content p {
    margin: 0 0 1em;
    color: var(--cw-muted) !important;
    font-size: 1.08rem;
    line-height: 1.72;
    text-align: center;
}

body.single-project .project-content h2 {
    margin: 58px 0 18px;
    color: var(--cw-text) !important;
    font-size: clamp(1.9rem, 4vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
    text-align: center;
}

body.single-project .project-content h2::before {
    content: "";
    display: block;
    width: 34px;
    height: 2px;
    margin: 0 auto 16px;
    background: var(--cw-accent);
}

body.single-project .project-content h3 {
    margin: 40px 0 14px;
    color: var(--cw-text) !important;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-align: center;
}

body.single-project .project-content ul,
body.single-project .project-content ol {
    margin: 0 0 1.5em;
    padding-left: 1.35em;
}

body.single-project .project-content li {
    margin-bottom: 0.55em;
    color: var(--cw-muted);
    font-size: 1.04rem;
    line-height: 1.7;
}

body.single-project .project-content a {
    color: var(--cw-accent) !important;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

body.single-project .project-content figure {
    margin: 42px 0;
}

body.single-project .project-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 36px 0;
    border-radius: 10px;
}

body.single-project .project-content figcaption {
    margin-top: 10px;
    color: var(--cw-muted);
    font-size: 0.86rem;
    line-height: 1.5;
    text-align: center;
}

body.single-project .project-content blockquote {
    margin: 42px 0;
    padding: 3px 0 3px 24px;
    border: 0;
    border-left: 3px solid var(--cw-accent);
    background: transparent;
}

body.single-project .project-content blockquote p {
    margin: 0;
    color: var(--cw-text) !important;
    font-size: 1.2rem;
    line-height: 1.6;
}

body.single-project .project-pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    width: min(760px, 100%);
    margin: clamp(64px, 8vw, 96px) auto 0;
    padding-top: 30px;
    border-top: 1px solid var(--cw-border);
}

body.single-project .project-pagination-item {
    min-width: 0;
}

body.single-project .project-pagination-next {
    text-align: right;
}

body.single-project .project-pagination-label {
    display: block;
    margin-bottom: 8px;
    color: var(--cw-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body.single-project .project-pagination a {
    color: var(--cw-text) !important;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 750;
    line-height: 1.3;
    text-decoration: none;
    transition: color 180ms ease;
}

body.single-project .project-pagination a:hover,
body.single-project .project-pagination a:focus-visible {
    color: var(--cw-accent) !important;
}

@media (max-width: 700px) {
    body.single-project .project-shell {
        width: min(100% - 32px, 1100px);
        padding-top: 34px;
        padding-bottom: 72px;
    }

    body.single-project .project-back-link {
        margin-bottom: 20px;
    }

    body.single-project .project-title {
        font-size: clamp(2.8rem, 15vw, 4.5rem);
    }

    body.single-project .project-intro {
        margin-top: 16px;
        font-size: 1rem;
    }

    body.single-project .project-hero {
        margin-bottom: 28px;
    }

    body.single-project .project-media,
    body.single-project .project-featured-media {
        width: 100%;
        margin-bottom: 42px;
    }

    body.single-project .project-main-image {
        max-height: 460px;
        border-radius: 9px;
    }

    body.single-project .project-content {
        width: 100%;
        padding-top: 28px;
    }

    body.single-project .project-content p {
        font-size: 1rem;
        line-height: 1.68;
    }

    body.single-project .project-content h2 {
        margin-top: 48px;
    }

    body.single-project .project-pagination {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-top: 68px;
    }

    body.single-project .project-pagination-next {
        text-align: left;
    }
}

/* ========================================
   FOOTER
======================================== */

footer.site-footer {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 52px 24px 38px !important;
    background: #0b1017;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    text-align: center !important;
}

footer.site-footer .container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    width: min(900px, 100%) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    text-align: center !important;
}

footer.site-footer .footer-logo {
    display: block;
    width: 72px;
    height: auto;
    margin: 0 auto 18px;
}

footer.site-footer h2 {
    margin: 0 0 10px;
    color: var(--cw-text) !important;
    font-size: 1.8rem;
    line-height: 1.1;
}

footer.site-footer .footer-tagline {
    margin: 0 0 10px;
    color: var(--cw-text) !important;
    font-size: 1.05rem;
}

footer.site-footer .footer-topics {
    margin: 0;
    color: var(--cw-muted) !important;
    line-height: 1.7;
}

footer.site-footer .footer-divider {
    display: block !important;
    width: 72px !important;
    height: 2px !important;
    min-height: 2px;
    margin: 24px auto !important;
    background: var(--cw-accent) !important;
    border: 0 !important;
}

footer.site-footer .footer-copyright {
    width: 100%;
    margin: 0 0 7px;
    color: var(--cw-text) !important;
    text-align: center !important;
}

footer.site-footer .footer-small {
    width: 100%;
    margin: 0;
    color: var(--cw-muted) !important;
    font-size: 0.9rem;
    text-align: center !important;
}

/* ========================================
   TABLET
======================================== */

@media (max-width: 900px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .featured {
        grid-template-columns: 1fr;
    }

    .featured-image,
    .featured-image img,
    .featured-placeholder {
        min-height: 360px;
    }
}

/* ========================================
   MOBILE
======================================== */

@media (max-width: 760px) {
    .navbar .container {
        width: min(100% - 32px, var(--cw-content));
        min-height: 68px;
        flex-wrap: wrap;
    }

    .logo img {
        height: 44px;
    }

    .menu-toggle {
        position: relative;
        z-index: 2;
        display: block;
    }

    .nav-links {
        position: static;
        display: flex;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        max-height: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background: rgba(17, 18, 20, 0.98);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: none;
        transition: max-height 250ms ease, padding 250ms ease, opacity 200ms ease, visibility 200ms ease;
    }

    .nav-links.is-open {
        max-height: 320px;
        padding: 18px 0 24px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-links li {
        width: 100%;
        margin: 0;
        text-align: center;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 12px 16px;
        color: var(--cw-text) !important;
        font-size: 1rem;
    }

    .nav-links a::after {
        display: none;
    }

    .navbar.menu-open .menu-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .navbar.menu-open .menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    .navbar.menu-open .menu-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .hero {
        min-height: calc(100vh - 68px);
    }

    .hero-content {
        width: min(100% - 32px, 850px);
        padding: 90px 0;
    }

    .section {
        padding: 78px 0;
    }

    .section > .container {
        width: min(100% - 32px, var(--cw-content));
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-overlay {
        opacity: 1;
    }

    .gallery-item img {
        filter: brightness(0.7);
    }


    footer.site-footer {
        padding: 46px 20px 34px !important;
    }

    footer.site-footer .footer-logo {
        width: 60px;
    }
}

@media (max-width: 540px) {
    .featured-image,
    .featured-image img,
    .featured-placeholder {
        min-height: 280px;
    }

    .empty-project-state {
        padding: 48px 24px;
    }
}