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

html{
    scroll-behavior:smooth;
}

body{
    background: var(--col-bg);
    color: var(--col-text);
    font-family:'Inter',sans-serif;
    overflow-x:hidden;
    transition: background 0.6s ease, color 0.6s ease;
}

/* ---------------- PALETTE NAV BAR ---------------- */
#palette-bar{
    position:fixed;
    top:0;
    left:0;
    right:0;
    height:20px;
    display:flex;
    z-index:10000;
    cursor:pointer;
}

#palette-bar .swatch{
    flex:1;
    height:100%;
    transition: transform 0.15s ease, filter 0.15s ease;
    transform-origin: top;
}

#palette-bar .swatch:hover{
    transform: scaleY(1.6);
    filter: brightness(1.15);
}

#palette-bar .swatch.active-swatch {
    position: relative;
}

/* ---------------- SECTIONS & THEME STEPS ---------------- */
.section{
    padding:110px 8vw;
    transition: background 0.6s ease, color 0.6s ease;
}

/* Linear background assignment matching the updated 6-color schema */
.theme-step-1 { 
    background: var(--step-1); 
}

/* Intermediate zones leverage component-scoped variable rewrites for absolute legibility */
.theme-step-2 { 
    background: var(--step-2); 
    --col-heading: var(--hero-heading);
    --col-text: var(--hero-text);
    --col-muted: var(--hero-muted);
}

.theme-step-3 { 
    background: var(--step-3); 
}

.theme-step-4 { 
    background: var(--step-4); 
    --col-heading: var(--s5-heading);
    --col-text: var(--s5-text);
    --col-muted: var(--s5-muted);
}

.theme-step-5 { 
    background: var(--step-5); 
}

.hero{
    min-height:100vh;
    display:flex;
    flex-direction:column;
    justify-content:center;
    position:relative;
}

.hero-wordmark{
    display:flex;
    align-items:center;
    min-height:160px;
    padding-left:0;
    container-type: inline-size; 
    width: 100%;
}

#typewriter{
    font-size:clamp(2.8rem, 9cqw, 6.5rem);
    font-weight:900;
    letter-spacing:-0.02em;
    line-height:1;
    white-space: nowrap;
    transition: color 0.6s ease;
}

#cursor{
    font-size:clamp(2.8rem, 9cqw, 6.5rem);
    font-weight:100;
    line-height:1;
    margin-left:4px;
    vertical-align:baseline;
    animation:blink .8s infinite;
    transition: color 0.6s ease;
}

@keyframes blink{
    0%{opacity:1;}
    50%{opacity:0;}
    100%{opacity:1;}
}

.intro{
    margin-top:30px;
    max-width:800px;
    font-size:clamp(1.3rem,2vw,2rem);
    line-height:1.7;
    font-weight:300;
    margin-left:0;
    opacity:0;
    transform:translateY(20px);
    transition: color 0.6s ease, opacity 1s ease, transform 1s ease;
}

.intro.show{
    opacity:1;
    transform:translateY(0);
}

.section-number{
    font-size:.8rem;
    letter-spacing:4px;
    margin-bottom:20px;
    transition: color 0.6s ease;
}

.section h2{
    font-size:clamp(3rem,6vw,7rem);
    font-weight:900;
    margin-bottom:40px;
    line-height:0.95;
    transition: color 0.6s ease;
}

.section p{
    max-width:900px;
    font-size:clamp(1.1rem,1.8vw,1.6rem);
    line-height:1.8;
    font-weight:300;
    transition: color 0.6s ease;
}

.section h2                { color: var(--col-heading); }
.section p                 { color: var(--col-text); }
.section .section-number   { color: var(--col-accent); }

.theme-step-1 #typewriter { color: var(--hero-heading); }
.theme-step-1 #cursor     { color: var(--hero-accent); }
.theme-step-1 .intro      { color: var(--hero-muted); }

.theme-step-5 .section-number { color: var(--s5-accent) !important; }
.theme-step-5 h2             { color: var(--s5-heading) !important; }
.theme-step-5 p, 
.theme-step-5 .contact-lead  { color: var(--s5-text) !important; }
.theme-step-5 .contact-link  { color: var(--s5-heading) !important; }

/* ---------------- SECTION 5 DESIGN SYSTEM STRUCTURAL GRID ---------------- */
.contact{
    padding-bottom:160px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    margin-top: 40px;
    align-items: start;
}

.contact-lead {
    margin-bottom: 40px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-link {
    font-size: clamp(1.3rem, 2vw, 2.2rem);
    font-weight: 700;
    text-decoration: none;
    width: fit-content;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.contact-link:hover {
    opacity: 0.7;
    transform: translateX(4px);
}

.scheduler-widget {
    border: 1px solid var(--s5-border);
    padding: 30px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.scheduler-header {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--s5-heading);
}

.slots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.slot-option {
    position: relative;
}

.slot-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.slot-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border: 1px solid var(--s5-border);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    text-align: center;
}

.slot-card .day {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 4px;
}

.slot-card .time {
    font-size: 1rem;
    font-weight: 700;
    color: var(--s5-heading);
}

.slot-option:hover .slot-card {
    background: rgba(0, 0, 0, 0.03);
}

.slot-option input[type="radio"]:checked + .slot-card {
    background: var(--s5-heading);
    border-color: var(--s5-heading);
}

.slot-option input[type="radio"]:checked + .slot-card .day,
.slot-option input[type="radio"]:checked + .slot-card .time {
    color: var(--step-5) !important;
}

.scheduler-btn {
    width: 100%;
    padding: 16px;
    background: transparent;
    border: 1px solid var(--s5-heading);
    color: var(--s5-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.scheduler-btn:hover {
    background: var(--s5-heading);
    color: var(--step-5);
}

/* ---------------- REVEALS ---------------- */
.reveal{
    opacity:0;
    transform:translateY(80px);
    filter:blur(8px);
    transition: opacity 1.4s ease, transform 1.4s ease, filter 1.4s ease;
}

.reveal.active{
    opacity:1;
    transform:translateY(0);
    filter:blur(0);
}

/* ---------------- GRAIN LAYER ---------------- */
.grain{
    position:fixed;
    inset:0;
    pointer-events:none;
    opacity:.035;
    z-index:9999;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.08) 1px, transparent 1px),
        radial-gradient(circle at 80% 40%, rgba(255,255,255,.05) 1px, transparent 1px),
        radial-gradient(circle at 60% 80%, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 120px 120px, 180px 180px, 140px 140px;
    animation:grainMove 8s linear infinite;
}

@keyframes grainMove{
    0%  { transform:translate(0,0); }
    25% { transform:translate(-1%,1%); }
    50% { transform:translate(1%,-1%); }
    75% { transform:translate(-1%,2%); }
    100%{ transform:translate(0,0); }
}

/* ---------------- RESPONSIVE BREAKPOINTS ---------------- */
@media (max-width:968px){
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width:768px){
    .hero{
        min-height:100vh;
        padding:80px 50px;
    }
    .hero-wordmark {
        padding-left: 0;
        min-height: auto;
    }
    #typewriter {
        white-space: normal;
    }
    .intro{
        margin-top:40px;
        max-width:520px;
        font-size:1.15rem;
        line-height:1.7;
        margin-left:0;
    }
    .section{
        padding:100px 50px;
    }
}

/* ---------------------------------------------------------------- */
/* INVERTED SYSTEM FOOTER                       */
/* ---------------------------------------------------------------- */

.footer-bar {
    padding: 24px 8vw !important; /* Forces layout tracking with the 8vw guide rail */
    border-top: 1px solid var(--s5-border);
    transition: background 0.6s ease, border-color 0.6s ease;
}

/* Color Inversion Model tied to Section 5 context variables */
.footer-bar.theme-step-5 {
    background: var(--s5-heading) !important; /* Swaps background step to use the foreground heading color */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Inverts typography tokens cleanly against background container adjustments */
.footer-bar.theme-step-5 .copyright {
    color: var(--step-5);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 32px;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--step-5);
    user-select: none;
    transition: opacity 0.2s ease;
}

.language-selector:hover {
    opacity: 0.8;
}

/* Scaled inline vectors matching structural font layout dimensions */
.footer-icon {
    width: 18px;
    height: 18px;
}

.chevron-icon {
    width: 14px;
    height: 14px;
    margin-top: 1px;
}

.lang-text {
    font-weight: 700;
}

.footer-socials {
    display: flex;
    align-items: center;
    gap: 18px;
}

.social-link {
    color: var(--step-5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.social-link:hover {
    opacity: 0.7;
    transform: translateY(-1px);
}

/* ---------------- FOOTER MOBILE RESPONSIVENESS ---------------- */
@media (max-width: 768px) {
    .footer-bar {
        padding: 32px 50px !important; /* Tracks horizontal spacing alignment constraints */
    }
    
    .footer-content {
        flex-direction: column-reverse;
        gap: 24px;
        align-items: flex-start;
        line-height: 1.5;
    }
    
    .footer-right {
        width: 100%;
        justify-content: space-between;
        flex-direction: row;
    }
}