/*
 * Brand Guidelines - Custom Styles
 * Built on top of global-styles.css
 */

/* ===== Smooth Scrolling ===== */
html {
    scroll-behavior: smooth;
}

/* ===== Layout Structure ===== */
body {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Hamburger Menu (Mobile/Tablet) ===== */
.hamburger {
    display: none;
    position: fixed;
    top: var(--spacing-lg);
    left: var(--spacing-lg);
    z-index: var(--z-fixed);
    flex-direction: column;
    gap: 6px;
    padding: var(--spacing-sm);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.hamburger span {
    width: 20px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.hamburger:hover {
    border-color: var(--color-accent);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== Fixed Sidebar Navigation ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: var(--color-bg);
    border-right: 1px solid var(--color-border);
    padding: var(--spacing-lg) var(--spacing-sm);
    overflow-y: auto;
    z-index: var(--z-sticky);
    transition: transform var(--transition-slow);
    display: flex;
    flex-direction: column;
}

/* Sidebar Launch Animation */
@keyframes cascadeIn {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar-header,
.sidebar-nav > ul > li {
    opacity: 0;
    animation: cascadeIn 0.25s ease-out forwards;
}

.sidebar-header {
    animation-delay: 0s;
}

.sidebar-nav > ul > li:nth-child(1) {
    animation-delay: 0.07s;
}

.sidebar-nav > ul > li:nth-child(2) {
    animation-delay: 0.13s;
}

.sidebar-nav > ul > li:nth-child(3) {
    animation-delay: 0.18s;
}

.sidebar-nav > ul > li:nth-child(4) {
    animation-delay: 0.24s;
}

.sidebar-nav > ul > li:nth-child(5) {
    animation-delay: 0.29s;
}

.sidebar-nav > ul > li:nth-child(6) {
    animation-delay: 0.35s;
}

.sidebar-nav > ul > li:nth-child(7) {
    animation-delay: 0.40s;
}

.sidebar-nav > ul > li:nth-child(8) {
    animation-delay: 0.45s;
}

/* Sidebar Header */
.sidebar-header {
    margin-bottom: var(--spacing-2xl);
}

.sidebar-header a {
    position: relative;
    display: inline-block;
    margin-left: 16px;
}

.sidebar-header a::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    background-image: url('./_assets/GC logo-blue.svg');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-header a:hover::before {
    opacity: 1;
}

.logo {
    width: 40px !important;
    height: 40px !important;
    cursor: pointer;
    position: relative;
    transition: opacity 0.3s ease;
}

.sidebar-header a:hover .logo {
    opacity: 0;
}


/* Sidebar Footer */
.sidebar-footer {
    padding-top: var(--spacing-xl);
    margin-top: auto;
    display: flex;
    justify-content: flex-start;
    padding-left: var(--spacing-md);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--color-accent);
    background: var(--color-hover);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
    color: var(--color-text);
}

.theme-toggle:hover svg {
    color: var(--color-accent);
}

.theme-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle .moon-icon {
    opacity: 0;
    position: absolute;
    transform: rotate(90deg) scale(0);
}

[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-3px);
    }
}

.theme-toggle:hover .sun-icon,
.theme-toggle:hover .moon-icon {
    animation: float 1.5s ease-in-out infinite;
}

/* Sidebar Navigation */
.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav > ul > li {
    margin-bottom: 2px;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: block;
    padding: 5px var(--spacing-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
}

.nav-link:hover {
    color: var(--color-accent);
    background: var(--color-hover);
}

.nav-item.active > .nav-link {
    color: var(--color-text);
    font-weight: 500;
    background: var(--color-hover);
}

/* Arrow indicator for parent items with sub-navigation */
.nav-item > .nav-link::after {
    content: "→";
    position: absolute;
    right: var(--spacing-md);
    opacity: 0;
    transition: all var(--transition-base);
    color: var(--color-text);
}

.nav-item.active > .nav-link::after {
    opacity: 1;
    color: var(--color-accent);
}

/* Nav item numbers */
.nav-num {
    font-size: 14px;
    font-weight: 500;
    color: #0F1521;
    margin-right: var(--spacing-sm);
    font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .nav-num {
    color: var(--color-text);
}

/* Nested Sub-navigation */
.sub-nav {
    list-style: none;
    margin: 4px 0 4px 0;
    padding: 0 0 0 var(--spacing-xl);
    display: none;
}

.nav-item.active .sub-nav {
    display: block;
}

.sub-nav li {
    margin-bottom: 1px;
}

.sub-link {
    display: block;
    padding: 4px var(--spacing-md) 4px 24px;
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.sub-link:hover {
    color: var(--color-accent);
}

.sub-link.active {
    color: var(--color-accent);
    font-weight: 500;
}

/* ===== Main Content Area ===== */
.main-content {
    margin-left: 240px;
    width: calc(100% - 240px);
    min-height: 100vh;
}

/* Page Header */
.page-header {
    padding: var(--spacing-3xl) 0 var(--spacing-xl) 0;
    border-bottom: 1px solid var(--color-border);
}

.page-header .section-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-2xl);
}

.page-header .text-display {
    flex: 0 0 auto;
    margin-bottom: 0;
    align-self: flex-start;
    line-height: 0.9;
}

.page-header .text-secondary {
    color: var(--color-text);
    max-width: 500px;
    align-self: flex-start;
}

.page-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 0 0 500px;
    max-width: 500px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px var(--spacing-md);
    margin-top: var(--spacing-lg);
    background: var(--color-text);
    color: var(--color-bg);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.btn-download:hover {
    opacity: 0.8;
}

/* Content Sections */
.content-section {
    padding: calc(var(--spacing-unit) * 12) 0;
}

.content-section:last-child {
    padding-bottom: calc(var(--spacing-unit) * 16);
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-2xl);
}

.section-inner > p {
    max-width: 500px;
}

/* Supporting Text */
.supporting-text {
    max-width: 500px;
}

/* ===== Content Grid ===== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

/* ===== Logo Showcase ===== */
.logo-showcase-block {
    margin-top: 120px;
}

.logo-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
    background: #FFE500;
    border-radius: 24px;
    height: 600px;
}

.logo-showcase-dark {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
    background: #000;
    border-radius: 24px;
    height: 600px;
}

.logo-showcase-image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
    border-radius: 24px;
    height: 600px;
    position: relative;
    overflow: hidden;
}

.bg-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 24px;
    opacity: 0;
    animation: slideshow 15s ease-in-out infinite;
}

.bg-slide-1 {
    background-image: url('./_assets/photos/logo-lady-lookingoff.jpg');
    background-position: left top;
    animation-delay: 0s;
}

.bg-slide-2 {
    background-image: url('./_assets/photos/portrait_sutherland_6462.jpg');
    background-position: left center;
    animation-delay: 5s;
}

.bg-slide-3 {
    background-image: url('./_assets/photos/Stocksy_txp4da120757Ov300_OriginalDelivery_2161227.jpg');
    background-position: right center;
    animation-delay: 10s;
}


@keyframes slideshow {
    0% {
        opacity: 0;
    }
    6.67% {
        opacity: 1;
    }
    33.33% {
        opacity: 1;
    }
    40% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

.logo-overlay {
    position: relative;
    z-index: 2;
}

.showcase-logo {
    width: 80px;
    height: auto;
}


.showcase-logo-full {
    width: 100%;
    max-width: 384px;
    height: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.showcase-logo-full.fade-in {
    opacity: 1;
    transform: translateY(0);
}

#logo-variations .card:hover,
#tov-main .card:hover {
    border-color: var(--color-border);
    box-shadow: none;
}

/* Dash list style for brand voice page */
#tov-main ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#tov-main ul li {
    display: flex;
    gap: 0.5em;
    margin-bottom: var(--spacing-sm);
}

#tov-main ul li::before {
    content: "–";
    flex-shrink: 0;
    color: var(--color-text-secondary);
}

/* Icon lists — tick, cross, dot */
.tick-list,
.cross-list,
.dot-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.tick-list li,
.cross-list li,
.dot-list li {
    display: flex;
    gap: 1.2em;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.tick-list li::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    margin-top: 4px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M1.5 6L4.5 9L10.5 3' stroke='%231A88FF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 12px 12px;
}

.cross-list li::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    margin-top: 4px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 3L9 9M9 3L3 9' stroke='%23ef4444' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 12px 12px;
}

.dot-list li::before {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    flex-shrink: 0;
    margin-top: 9px;
    border-radius: 50%;
    background-color: #1A88FF;
}

/* Reusable dash list */
.dash-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.dash-list li {
    display: flex;
    gap: 0.5em;
    margin-bottom: var(--spacing-sm);
}

.dash-list li::before {
    content: "–";
    flex-shrink: 0;
    color: var(--color-text-secondary);
}

.symbol-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    background: var(--color-hover);
    border-radius: var(--radius-md);
    min-height: 160px;
}

.symbol-icon {
    width: 64px;
    height: 64px;
}

/* Symbol Hover Interaction Demo */
.symbol-hover-demo {
    margin-top: var(--spacing-3xl);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.symbol-hover-svg {
    width: 100%;
    display: block;
}

.symbol-hover-label {
    text-align: center;
    padding: var(--spacing-md) 0 var(--spacing-lg);
    background: #F9FAFB;
}

.sym-circle {
    fill: #FFE500;
    animation: symCircle 3.75s linear infinite;
}

@keyframes symCircle {
    0%        { fill: #FFE500; }
    23%       { fill: #FFE500; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
    38%       { fill: #1A88FF; }
    62%       { fill: #1A88FF; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
    78%       { fill: #FFE500; }
    100%      { fill: #FFE500; }
}

.sym-g {
    fill: #1C1B18;
    animation: symG 3.75s linear infinite;
}

@keyframes symG {
    0%        { fill: #1C1B18; }
    23%       { fill: #1C1B18; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
    38%       { fill: #FFFFFF; }
    62%       { fill: #FFFFFF; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
    78%       { fill: #1C1B18; }
    100%      { fill: #1C1B18; }
}

.sym-cursor {
    animation: symCursor 3.75s linear infinite;
}

@keyframes symCursor {
    0%    { transform: translate(462px, 248px); }
    10%   { transform: translate(462px, 248px); animation-timing-function: cubic-bezier(0.4, 0, 0.15, 1); }
    27%   { transform: translate(305px, 155px); }
    65%   { transform: translate(305px, 155px); animation-timing-function: cubic-bezier(0.4, 0, 0.15, 1); }
    80%   { transform: translate(462px, 248px); }
    100%  { transform: translate(462px, 248px); }
}


.symbol-intro-img {
    width: 100%;
    display: block;
    border-radius: 24px;
}


.g-symbol-row {
    display: flex;
    flex-direction: row;
    gap: 32px;
    margin-top: 64px;
    margin-bottom: 16px;
}

.g-symbol-img {
    flex: 1;
    min-width: 0;
    width: 100%;
    display: block;
    border-radius: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.g-symbol-img.fade-in {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 600px) {
    .g-symbol-row {
        flex-direction: column;
    }
}

/* ===== Clear Space Animation ===== */
.clear-space-animation {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-3xl);
    background: #000;
    border-radius: 24px;
    height: 600px;
}

.space-grid-svg {
    width: 100%;
    max-width: 1000px;
    height: auto;
}

/* Animation states - hidden by default */
.space-grid-svg .anim-logo,
.space-grid-svg .anim-outer-box,
.space-grid-svg .anim-verticals,
.space-grid-svg .anim-horizontals,
.space-grid-svg .anim-corners {
    opacity: 0;
}

/* Ensure strokes are visible */
.space-grid-svg .anim-outer-box,
.space-grid-svg .anim-verticals path,
.space-grid-svg .anim-horizontals path {
    stroke-width: 1;
}

.space-grid-svg .anim-corners path {
    stroke-width: 1;
}

/* Trigger animation when visible - Starting from corners */
.space-grid-svg.animate .anim-outer-box {
    animation: drawOuterBox 1.5s ease-in-out forwards;
}

.space-grid-svg.animate .anim-verticals {
    animation: drawLines 1.2s ease-in-out 1.2s forwards;
}

.space-grid-svg.animate .anim-horizontals {
    animation: drawLines 1.2s ease-in-out 1.6s forwards;
}

.space-grid-svg.animate .anim-logo {
    animation: fadeInLogo 0.8s ease-in-out 2.6s forwards;
}

.space-grid-svg.animate .anim-corners {
    animation: fadeInCorners 1s ease-in-out 3.2s forwards;
}

/* Corner Gs appear last - subtle movement */
@keyframes fadeInCorners {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Outer box draws from corners */
@keyframes drawOuterBox {
    0% {
        opacity: 0;
        stroke-dasharray: 2000;
        stroke-dashoffset: 2000;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
        stroke-dasharray: 2000;
        stroke-dashoffset: 0;
    }
}

/* Grid lines draw outward */
@keyframes drawLines {
    0% {
        opacity: 0;
        stroke-dasharray: 1000;
        stroke-dashoffset: 1000;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
        stroke-dasharray: 1000;
        stroke-dashoffset: 0;
    }
}

/* Center logo fades in - fast and very subtle */
@keyframes fadeInLogo {
    0% {
        opacity: 0;
        transform: translateY(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet adjustments for animation */
@media (max-width: 1024px) {
    .clear-space-animation {
        height: 400px;
    }
}

/* Mobile adjustments for animation */
@media (max-width: 768px) {
    .clear-space-animation {
        height: 280px;
        padding: var(--spacing-xl);
    }

    .space-grid-svg {
        max-width: 100%;
    }
}

/* ===== Clear Space Logo Grid Animation ===== */
.clear-space-animation--light {
    background: #F9FAFB;
}

.space-grid-logo-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.space-grid-logo-svg.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Vision Page Layout ===== */
.vision-intro {
    max-width: 800px;
}


.vision-detail-section {
    padding: calc(var(--spacing-3xl) * 2) 0;
}

.vision-detail-label .text-display-xl {
    color: #E5E7EB;
}

.vision-detail-grid {
    display: block;
}

.vision-detail-section .section-inner {
    display: flex;
    gap: 64px;
    align-items: flex-start;
}

.vision-detail-label {
    flex: 0 0 40%;
}

.vision-detail-label .text-display {
    color: var(--color-text);
    line-height: 1.2;
}

.vision-detail-content {
    flex: 1;
}

@media (min-width: 1025px) {
    .vision-detail-content .text-body-lg {
        max-width: 500px;
        margin-left: auto;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .vision-detail-section .section-inner {
        flex-direction: column;
    }

    .vision-detail-label {
        flex: none;
    }

    .vision-detail-section {
        padding: var(--spacing-3xl) 0;
    }
}

/* ===== Color Swatches ===== */
.color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: var(--spacing-xl);
}

.color-grid.grid-cols-6 {
    grid-template-columns: repeat(4, 1fr);
}

.color-grid + h4 {
    margin-top: calc(var(--spacing-3xl) * 1.5);
}

.color-swatch {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    min-height: 280px;
    opacity: 0;
    transform: translateY(20px);
}

.color-swatch.animate-in {
    animation: slideUp 0.6s ease forwards;
}

.color-swatch.large {
    min-height: 480px;
}

.color-swatch.small {
    min-height: 210px;
}


.swatch-color {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.color-swatch h4,
.color-swatch p {
    position: relative;
    z-index: 1;
    text-align: left;
    margin: 0;
    padding: 0 var(--spacing-md);
}

.color-swatch h4 {
    position: absolute;
    top: var(--spacing-md);
    left: 0;
    right: 0;
}

.color-swatch p:first-of-type {
    position: absolute;
    bottom: calc(var(--spacing-md) + 40px);
    left: 0;
    right: 0;
}

.color-swatch p:nth-of-type(2) {
    position: absolute;
    bottom: calc(var(--spacing-md) + 20px);
    left: 0;
    right: 0;
}

.color-swatch p:last-child {
    position: absolute;
    bottom: var(--spacing-md);
    left: 0;
    right: 0;
}

/* 4-stop gradient swatches */
.color-swatch:has(p:nth-of-type(4)) p:first-of-type {
    bottom: calc(var(--spacing-md) + 60px);
}

.color-swatch:has(p:nth-of-type(4)) p:nth-of-type(2) {
    bottom: calc(var(--spacing-md) + 40px);
}

.color-swatch:has(p:nth-of-type(4)) p:nth-of-type(3) {
    position: absolute;
    bottom: calc(var(--spacing-md) + 20px);
    left: 0;
    right: 0;
}

/* Copy-to-clipboard values */
.copy-value {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: opacity 0.15s ease;
}

.copy-value:hover {
    opacity: 0.7;
}

.copy-tag {
    font-size: 10px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid currentColor;
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
    font-family: inherit;
    letter-spacing: 0;
}

.copy-value:hover .copy-tag {
    opacity: 0.6;
}

.copy-value.copy-done .copy-tag {
    opacity: 1;
}

/* Text color variants */
.color-swatch.dark-bg h4,
.color-swatch.dark-bg p {
    color: #FFFFFF;
}

.color-swatch.light-bg h4,
.color-swatch.light-bg p {
    color: #0F1521;
}

/* ===== Typography Specimens ===== */
.type-specimen {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    background: var(--color-hover);
}

.type-example {
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--color-border);
}

.type-example:last-child {
    border-bottom: none;
}

/* ===== Guidelines Blocks ===== */
.guidelines-block {
    padding: var(--spacing-xl);
    background: var(--color-hover);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.guidelines-block ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.guidelines-block li {
    position: relative;
    padding-left: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.guidelines-block li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: bold;
}

.guidelines-block li:last-child {
    margin-bottom: 0;
}

/* ===== Responsive Design ===== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .hamburger {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .section-inner {
        padding: 0 var(--spacing-xl);
    }

    .content-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .color-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .color-grid.grid-cols-6 {
        grid-template-columns: repeat(3, 1fr);
    }

    .color-swatch.large {
        min-height: 400px;
    }

    .page-header .section-inner {
        flex-direction: column;
        gap: var(--spacing-lg);
    }

    .page-header .text-display {
        margin-bottom: var(--spacing-md);
    }

    .page-header .text-secondary {
        max-width: 100%;
    }

    .page-header-right {
        flex: 1 1 auto;
        max-width: 100%;
    }

    .logo-showcase,
    .logo-showcase-dark,
    .logo-showcase-image {
        height: 400px;
    }

    .logo-showcase-image .bg-slide {
        border-radius: 24px;
    }

    .logo-showcase-block {
        margin-top: 80px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    .content-section {
        padding: var(--spacing-xl) 0;
    }

    .content-section:first-child {
        padding-top: calc(var(--spacing-2xl) + var(--spacing-xl));
    }

    .section-inner {
        padding: 0 var(--spacing-lg);
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .color-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .color-grid.grid-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .color-swatch {
        min-height: 240px;
    }

    .color-swatch.large {
        min-height: 280px;
    }

    .type-specimen {
        padding: var(--spacing-lg);
    }

    .guidelines-block {
        padding: var(--spacing-lg);
    }

    /* Adjust text sizes for mobile */
    .text-heading-xl {
        font-size: 28px;
    }

    .text-heading-lg {
        font-size: 24px;
    }

    .text-heading-md {
        font-size: 18px;
    }

    .text-display {
        font-size: 48px;
    }

    .logo-showcase,
    .logo-showcase-dark,
    .logo-showcase-image {
        height: 280px;
        padding: var(--spacing-xl);
    }

    .logo-showcase-image .bg-slide {
        border-radius: 24px;
    }

    .logo-showcase-block {
        margin-top: 64px;
    }
}

/* Small Mobile (< 375px) */
@media (max-width: 375px) {
    .hamburger {
        top: var(--spacing-md);
        left: var(--spacing-md);
    }

    .section-inner {
        padding: 0 var(--spacing-md);
    }

    .color-grid,
    .color-grid.grid-cols-6 {
        grid-template-columns: 1fr;
    }

    .color-swatch {
        min-height: 220px;
    }

    .color-swatch.large {
        min-height: 240px;
    }
}

/* ===== Logo Background Playground ===== */
.logo-controls-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    padding: var(--spacing-md) var(--spacing-xl);
    z-index: 2;
}

.logo-panel-divider {
    width: 1px;
    height: 28px;
    align-self: center;
    flex-shrink: 0;
    background: var(--color-border);
    margin: 0 var(--spacing-lg);
}

.logo-bg-canvas {
    position: relative;
    width: 100%;
    min-height: 600px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 88px;
    transition: background-color 0.4s ease;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

/* Logo wordmark stacking */
.logo-wordmark-wrapper {
    position: relative;
    width: 44%;
    max-width: 384px;
    min-width: 128px;
}

.logo-wordmark {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.logo-wordmark.active {
    opacity: 1;
}

.logo-wordmark--overlay {
    position: absolute;
    top: 0;
    left: 0;
}

/* Variant badge */
.logo-bg-badge {
    position: absolute;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: 0;
    pointer-events: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.55);
    transition: color 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
}

.logo-bg-badge.is-dark {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* Control groups inside panel */
.logo-control-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.logo-control-group:last-child {
    flex: 1;
}

.logo-control-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
}

/* Preset swatches */
.logo-presets {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.logo-preset-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.logo-preset-btn:hover,
.logo-preset-btn.active {
    transform: scale(1.08);
    box-shadow: 0 0 0 2.5px var(--color-accent), var(--shadow-md);
}

/* Hex input */
.logo-hex-wrapper {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: fit-content;
}

.logo-hex-wrapper:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(26, 136, 255, 0.12);
}

.logo-hex-hash {
    display: flex;
    align-items: center;
    padding: 0 8px 0 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--color-text-secondary);
    background: var(--color-bg);
    border-right: 1px solid var(--color-border);
    user-select: none;
    pointer-events: none;
    flex-shrink: 0;
}

.logo-hex-wrapper .logo-hex-input {
    width: 84px;
    padding: 9px 12px 9px 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--color-text);
    background: var(--color-bg);
    border: none;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: none;
}

.logo-hex-wrapper .logo-hex-input:focus {
    border-color: transparent;
    box-shadow: none;
}

/* HSB Sliders */
.logo-slider-group {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-lg);
    flex: 1;
}

.logo-slider-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
}

.logo-slider-lbl {
    font-size: 11px;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--color-text-secondary);
    width: 10px;
    flex-shrink: 0;
    text-align: center;
}

.logo-slider-val {
    font-size: 11px;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--color-text-secondary);
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}

.logo-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    min-width: 0;
    height: 6px;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    border: none;
    padding: 0;
    width: auto;
    background: var(--track-bg, #e5e7eb);
}

.logo-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: inherit;
}

.logo-slider::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: var(--track-bg, #e5e7eb);
}

.logo-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 2px solid var(--color-accent);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease;
}

.logo-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.logo-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 2px solid var(--color-accent);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.logo-slider--hue {
    --track-bg: linear-gradient(to right,
        hsl(0,100%,50%), hsl(30,100%,50%), hsl(60,100%,50%),
        hsl(90,100%,50%), hsl(120,100%,50%), hsl(150,100%,50%),
        hsl(180,100%,50%), hsl(210,100%,50%), hsl(240,100%,50%),
        hsl(270,100%,50%), hsl(300,100%,50%), hsl(330,100%,50%),
        hsl(360,100%,50%)
    );
}

/* Logo playground responsive */
@media (max-width: 768px) {
    .logo-bg-canvas {
        min-height: 420px;
        padding-bottom: 120px;
    }

    .logo-controls-panel {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .logo-panel-divider {
        display: none;
    }

    .logo-slider-group {
        flex-direction: column;
        gap: 8px;
    }

    .logo-wordmark-wrapper {
        width: 62%;
    }

    .logo-bg-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
}

@media (max-width: 375px) {
    .logo-bg-canvas {
        min-height: 380px;
    }

    .logo-wordmark-wrapper {
        width: 75%;
    }
}

/* ===== Haffer Font ===== */
@font-face {
    font-family: 'HafferXH';
    src: url('./_assets/Haffer/HafferXH-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'HafferXH';
    src: url('./_assets/Haffer/HafferXH-RegularItalic.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'HafferXH';
    src: url('./_assets/Haffer/HafferXH-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'HafferXH';
    src: url('./_assets/Haffer/HafferXH-SemiBold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'HafferXH';
    src: url('./_assets/Haffer/HafferXH-SemiBoldItalic.otf') format('opentype');
    font-weight: 600;
    font-style: italic;
}

/* ===== Haffer Hero Showcase ===== */
.haffer-hero-section {
    --haffer-size: 72px;
    --haffer-lh: 1.15;

    position: relative;
    padding: var(--spacing-3xl) 0 calc(var(--spacing-3xl) + var(--spacing-lg)) 0;
    border-bottom: 1px solid var(--color-border);
    animation: none !important;
    opacity: 1 !important;
}

.haffer-hero-text {
    font-family: 'HafferXH', sans-serif;
    font-weight: 600;
    font-size: var(--haffer-size);
    line-height: var(--haffer-lh);
    color: #0F1521;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .haffer-hero-text {
    color: var(--color-text);
}

.haffer-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
}

.haffer-hero-section.is-animating .haffer-word {
    animation: hafferWordReveal 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

@media (max-width: 1024px) {
    .haffer-hero-section { --haffer-size: 52px; }
}

@media (max-width: 768px) {
    .haffer-hero-section {
        --haffer-size: 36px;
        padding: var(--spacing-2xl) 0 var(--spacing-3xl) 0;
    }
}

@media (max-width: 480px) {
    .haffer-hero-section { --haffer-size: 26px; }
}

/* ===== Typography Hero Showcase ===== */
.type-hero-section {
    /* Custom properties drive responsive line spacing */
    --type-size: 120px;
    --type-lh: 1.15;
    --line-spacing: calc(var(--type-size) * var(--type-lh)); /* 138px */

    position: relative;
    padding: var(--spacing-3xl) 0 calc(var(--spacing-3xl) + var(--spacing-lg)) 0;
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);

    /* Suppress the global section fadeIn so we own all animations */
    animation: none !important;
    opacity: 1 !important;
}

/* Lined-paper overlay — sits behind the text */
.type-hero-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* Individual baseline-aligned rule lines — created and positioned by JS */
.type-hero-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: #1A88FF;
    opacity: 0.5;
    transform: scaleX(0);
    transform-origin: left center;
}

.type-hero-section.is-animating .type-hero-line {
    animation: typeLineIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes typeLineIn {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* Display text */
.type-hero-text {
    color: #0F1521;
    position: relative;
    z-index: 1;
    line-height: var(--type-lh);
    font-size: var(--type-size);
}

[data-theme="dark"] .type-hero-text {
    color: var(--color-text);
}

/* Each word starts invisible and low */
.type-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(28px);
}

/* Delays are set per-word via JS; this keyframe fires on class toggle */
.type-hero-section.is-animating .type-word {
    animation: typeWordReveal 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Responsive scaling */
@media (max-width: 1024px) {
    .type-hero-section {
        --type-size: 88px;
    }
}

@media (max-width: 768px) {
    .type-hero-section {
        --type-size: 60px;
        padding: var(--spacing-2xl) 0 var(--spacing-3xl) 0;
    }
}

@media (max-width: 480px) {
    .type-hero-section {
        --type-size: 44px;
    }
}

/* ===== Colour Combinations Showcase ===== */
.combo-stage {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    height: 380px;
}

.combo-track {
    position: relative;
    height: 100%;
}

.combo-slide {
    position: absolute;
    inset: 0;
    display: flex;
    opacity: 0;
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.combo-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.combo-main {
    flex: 0 0 50%;
    padding: var(--spacing-2xl);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.combo-accent-panel {
    flex: 0 0 35%;
}

.combo-tertiary-panel {
    flex: 0 0 15%;
}

.combo-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.45;
    margin: 0 0 var(--spacing-sm) 0;
}

.combo-name {
    font-size: 40px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 var(--spacing-xs) 0;
}

.combo-theory {
    font-size: 14px;
    opacity: 0.5;
    margin: 0;
}

.combo-chips {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.combo-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.2);
}

/* Prev / Next buttons */
.combo-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.combo-nav-btn:hover {
    background: var(--color-hover);
    border-color: var(--color-text);
}

/* Progress bar + dot nav */
.combo-footer {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.combo-progress-bar {
    flex: 1;
    height: 2px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.combo-progress-fill {
    height: 100%;
    background: var(--color-text);
    border-radius: 2px;
    width: 0%;
}

.combo-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.combo-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: var(--color-border);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.combo-dot.is-active {
    background: var(--color-text);
    width: 20px;
}

@media (max-width: 768px) {
    .combo-stage {
        height: 420px;
    }

    .combo-slide {
        flex-direction: column;
    }

    .combo-main {
        flex: 0 0 50%;
        padding: var(--spacing-lg);
    }

    .combo-accent-panel {
        flex: 0 0 35%;
    }

    .combo-tertiary-panel {
        flex: 0 0 15%;
    }

    .combo-name {
        font-size: 28px;
    }
}

/* ===== Dark Mode Adjustments ===== */
[data-theme="dark"] .sidebar {
    background: var(--color-bg);
    border-right-color: var(--color-border);
}

[data-theme="dark"] .hamburger {
    background: var(--color-bg);
    border-color: var(--color-border);
}

[data-theme="dark"] .logo-showcase {
    background: var(--color-hover);
}

/* ===== Logo Don'ts Grid ===== */
.logo-donts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.logo-dont-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.logo-dont-example {
    height: 148px;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    overflow: hidden;
}

[data-theme="dark"] .logo-dont-example {
    background: #1e2330;
}

.dont-img {
    max-width: 160px;
    max-height: 44px;
    width: auto;
    height: auto;
}

.logo-dont-label {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.dont-x {
    color: #EF4444;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* 1. Distort — static stretch */
.dont-distort {
    transform-origin: center;
}

/* 2. Rainbow gradient via mask */
.dont-gradient-logo {
    width: 180px;
    height: 28px;
    background: linear-gradient(to right, #FF0000, #FF8800, #FFEE00, #00BB44, #0055FF, #AA00FF);
    -webkit-mask-image: url('./_assets/gocardless-wordmark-black.svg');
    mask-image: url('./_assets/gocardless-wordmark-black.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
}

/* 3. Single dark drop shadow */
.dont-shadow {
    filter: drop-shadow(5px 8px 6px rgba(0,0,0,0.85));
}

/* 4. Busy background */
.dont-busy-bg {
    background: linear-gradient(135deg,
        #e74c3c 0%, #f39c12 15%, #f1c40f 30%,
        #2ecc71 45%, #1abc9c 60%, #3498db 75%,
        #9b59b6 90%, #e74c3c 100%);
    background-size: 200% 200%;
}

/* 5. Tilt */
.dont-rotate {
    transform: rotate(10deg);
}

/* 6. Bumpy displacement */
.dont-bumpy {
    filter: url(#dont-bumpy);
}

/* 7. Separated elements */
.dont-separated {
    display: flex;
    align-items: center;
    gap: 48px;
}

/* 8. Arial */
.dont-arial {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--color-text);
}

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

@media (max-width: 560px) {
    .logo-donts-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Photography Grids ===== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    align-items: start;
}

.photo-item {
    overflow: hidden;
    border-radius: 12px;
    background: var(--color-surface);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.photo-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.photo-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-item:hover img {
    transform: scale(1.04);
}

.photo-item--wide { grid-column: span 2; }

/* Photography — Mobile Responsive */
@media (max-width: 640px) {
    /* 3-column text sections stack vertically */
    .photo-flex-columns {
        flex-direction: column !important;
        gap: 32px !important;
    }

    /* Asymmetric image grids become a single column */
    .photo-asymmetric-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        height: auto !important;
    }

    .photo-asymmetric-grid .photo-item {
        grid-column: 1 !important;
        grid-row: auto !important;
        height: 260px;
    }
}


/* ===== Page Footer ===== */
.back-to-top-wrap {
    display: flex;
    justify-content: flex-end;
    padding: var(--spacing-xl) var(--spacing-2xl);
}

.back-to-top-btn {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.back-to-top-btn:hover {
    border-color: var(--color-text);
}

.page-footer {
    background: #FFE500;
    padding: 96px var(--spacing-2xl) var(--spacing-2xl);
    width: 100%;
}

.footer-wordmark {
    display: block;
    width: 100%;
}


/* ===== Gradient Cards ===== */
.gradient-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.gradient-row {
    display: flex;
    gap: 1.25rem;
    align-items: stretch;
}

.gradient-swatch {
    flex: 1;
    opacity: 1;
    transform: none;
    animation: none;
    cursor: pointer;
    transition: flex 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Expanded state — only affects the clicked row */
.gradient-row.has-expanded .gradient-swatch {
    flex: 1 1 0%;
    min-width: 0;
    overflow: hidden;
    opacity: 0.55;
}

/* Base transition so text fades smoothly in both directions */
.gradient-swatch h4,
.gradient-swatch p {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pre-fade non-target text before expansion begins */
.gradient-row.text-hiding .gradient-swatch:not(.expanding) h4,
.gradient-row.text-hiding .gradient-swatch:not(.expanding) p {
    opacity: 0;
}

/* Keep non-expanded text hidden during expanded state */
.gradient-row.has-expanded .gradient-swatch:not(.is-expanded) h4,
.gradient-row.has-expanded .gradient-swatch:not(.is-expanded) p {
    opacity: 0;
    pointer-events: none;
}

/* Hold all text hidden during collapse so it doesn't jump */
.gradient-row.collapsing .gradient-swatch h4,
.gradient-row.collapsing .gradient-swatch p {
    opacity: 0;
    pointer-events: none;
}

.gradient-row.has-expanded .gradient-swatch.is-expanded {
    flex: 0 0 90%;
    opacity: 1;
}

/* Close button — only visible when expanded */
.gradient-close-btn {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 2;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.85);
    color: #0F1521;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    backdrop-filter: blur(4px);
}

.gradient-swatch.is-expanded .gradient-close-btn {
    display: flex;
}

.gradient-close-btn:hover {
    background: #fff;
}

/* ===== Colour Palette Header ===== */
.palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.palette-header h3 {
    margin-bottom: 0;
}

/* ===== Brand / Product Palette Toggle ===== */
.palette-toggle {
    display: inline-flex;
    background: var(--color-border);
    border-radius: 9999px;
    padding: 3px;
    margin-bottom: var(--spacing-xl);
}

.palette-toggle-btn {
    padding: 6px 20px;
    border-radius: 9999px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
}

.palette-toggle-btn.active {
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

/* ===== Print Styles ===== */
@media print {
    .sidebar,
    .hamburger {
        display: none;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-section {
        page-break-inside: avoid;
    }
}

/* ===== Brand Voice Scroll Animation ===== */
.brand-voice-row {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.brand-voice-row.visible {
    opacity: 1;
    transform: translateY(0);
}

.brand-voice-row--delay.visible {
    transition-delay: 0.12s;
}
