/* ============================================================
   gunsul.studio - Translucent Frost Architectural Theme
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-deep: #0A0E1A;
    --bg-mid: #121A2E;
    --frost-white: #E8EDF5;
    --frost-glow: #7BA3D4;
    --steel-accent: #3D5A80;
    --warm-punctuation: #D4956A;
    --panel-surface: rgba(180, 200, 230, 0.06);
    --panel-border: rgba(255, 255, 255, 0.08);
    --skeleton-line: #2A3A52;
    --depth-layer: #1A2A44;
    --skeleton-frost: #C8D6E5;
    --body-text: #A8B8CC;
    --caption-color: #5A7A9A;
    --fallback-bg: #141E30;

    --anim-duration: 500ms;
    --anim-stagger: 100ms;
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 300;
    color: var(--body-text);
    background: var(--bg-deep);
    line-height: 1.9;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(123, 163, 212, 0.2);
    color: var(--frost-white);
}

/* --- Cursor Aura --- */
#cursor-aura {
    position: fixed;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(123, 163, 212, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform;
    transition: opacity 0.3s ease;
    opacity: 0;
}

#cursor-aura.active {
    opacity: 1;
}

/* --- Isometric Grid Background --- */
#isometric-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    will-change: transform;
}

#isometric-grid.visible {
    opacity: 1;
}

#iso-svg {
    width: 100%;
    height: 100%;
}

/* --- Scroll Progress Indicator --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 0%;
    background: var(--skeleton-line);
    z-index: 1000;
    transition: background-color 0.3s ease;
    will-change: height;
}

/* --- Inflated Form Silhouettes --- */
#inflated-forms {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.inflated-shape {
    position: absolute;
    opacity: 0.4;
    transition: transform 500ms ease-out;
    will-change: transform;
    color: #1A2A44;
}

.shape-1 {
    width: 35vw;
    top: 5vh;
    right: -5vw;
}

.shape-2 {
    width: 40vw;
    top: 35vh;
    left: -10vw;
}

.shape-3 {
    width: 25vw;
    top: 55vh;
    right: 10vw;
}

.shape-4 {
    width: 30vw;
    bottom: 20vh;
    left: 5vw;
}

.shape-5 {
    width: 20vw;
    bottom: -5vh;
    right: 25vw;
}

/* --- Brand Name --- */
#brand-name {
    position: fixed;
    top: 2rem;
    left: 2rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--caption-color);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#brand-name.visible {
    opacity: 1;
}

/* --- Sections --- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 4rem 2rem;
}

/* --- Panels (Frosted Glass) --- */
.panel {
    position: relative;
    background: var(--panel-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: clamp(2.5rem, 5vw, 5rem);
    max-width: 900px;
    width: 100%;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--anim-duration) var(--ease-out),
                transform var(--anim-duration) var(--ease-out),
                box-shadow 400ms ease;
}

.panel.in-view {
    opacity: 1;
    transform: translateY(0);
}

.panel.dimmed {
    opacity: 0.4;
    transform: translateY(-10px);
}

.panel:hover {
    transform: scale(1.005);
    box-shadow: 0 0 60px rgba(123, 163, 212, 0.04);
}

.panel.in-view:hover {
    transform: translateY(0) scale(1.005);
}

/* Panel noise texture overlay */
.panel-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.02;
    z-index: 0;
}

.panel-noise::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

.panel-content {
    position: relative;
    z-index: 2;
}

/* --- Z-Pattern Layout (lateral drift) --- */
.panel-philosophy {
    margin-left: 0;
    margin-right: auto;
}

.panel-process {
    margin-left: auto;
    margin-right: 0;
}

.panel-featured {
    margin-left: 0;
    margin-right: auto;
}

.panel-materiality {
    margin-left: auto;
    margin-right: 0;
}

.panel-contact {
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
}

/* --- Skeleton Reveal System --- */
.skeleton-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: clamp(2.5rem, 5vw, 5rem);
    z-index: 3;
    pointer-events: none;
}

.skeleton-line {
    height: 2px;
    background: #C8D6E5;
    border-radius: 1px;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
}

.panel.skeleton-active .skeleton-line {
    opacity: 1;
    transform: scaleX(1);
}

.skeleton-heading {
    width: 50%;
    height: 3px;
    align-self: flex-start;
}

.skeleton-body-1 {
    width: 80%;
    align-self: flex-start;
    transition-delay: 100ms;
}

.skeleton-body-2 {
    width: 65%;
    align-self: flex-start;
    transition-delay: 200ms;
}

.skeleton-col-1, .skeleton-col-2, .skeleton-col-3 {
    width: 28%;
    transition-delay: 0ms;
}

.skeleton-col-2 {
    transition-delay: 80ms;
}

.skeleton-col-3 {
    transition-delay: 160ms;
}

.skeleton-frame {
    width: 90%;
    height: 4px;
}

.skeleton-caption {
    width: 30%;
    transition-delay: 100ms;
}

.skeleton-quote-1 {
    width: 70%;
    align-self: center;
}

.skeleton-quote-2 {
    width: 60%;
    align-self: center;
    transition-delay: 100ms;
}

.skeleton-quote-3 {
    width: 55%;
    align-self: center;
    transition-delay: 200ms;
}

.skeleton-contact-1 {
    width: 40%;
}

.skeleton-contact-2 {
    width: 50%;
    transition-delay: 100ms;
}

.skeleton-contact-3 {
    width: 20%;
    transition-delay: 200ms;
}

.panel .panel-content {
    opacity: 0;
    transition: opacity 0.6s ease 0.6s;
}

.panel.content-revealed .panel-content {
    opacity: 1;
}

.panel.content-revealed .skeleton-container {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(2.8rem, 5.5vw, 5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FFFFFF;
    text-shadow: 0 0 40px rgba(120, 160, 220, 0.15);
    margin-bottom: 2rem;
    line-height: 1.1;
}

/* === HERO SECTION === */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 10;
}

#hero-title {
    display: inline-flex;
    gap: 0.05em;
    margin-bottom: 1.5rem;
}

.hero-letter {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(4rem, 10vw, 9rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: transparent;
    position: relative;
    display: inline-block;
    line-height: 1;
}

/* Skeleton wireframe state */
.hero-letter::before {
    content: attr(data-char);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: transparent;
    -webkit-text-stroke: 1px var(--frost-white);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-letter.wireframe::before {
    opacity: 0.4;
}

/* Fill animation */
.hero-letter.filling {
    color: var(--frost-white);
    text-shadow: 0 0 40px rgba(120, 160, 220, 0.15);
    animation: letterFill 0.8s var(--ease-out-expo) forwards;
}

@keyframes letterFill {
    0% {
        clip-path: inset(0 100% 0 0);
        color: var(--frost-white);
    }
    100% {
        clip-path: inset(0 0 0 0);
        color: var(--frost-white);
    }
}

.hero-letter.wireframe.filling::before {
    opacity: 0;
    transition: opacity 0.4s ease 0.3s;
}

/* Hero line */
#hero-line-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    margin-bottom: 1.2rem;
}

#hero-line {
    width: 0;
    height: 1px;
    background: var(--steel-accent);
    transition: width 0.8s var(--ease-out-expo);
}

#hero-line.drawn {
    width: 40vw;
}

#hero-dot {
    position: absolute;
    right: calc(50% - 20vw - 6px);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--warm-punctuation);
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.4s ease, transform 0.4s var(--ease-out-expo);
}

#hero-dot.visible {
    opacity: 1;
    transform: scale(1);
    animation: dotPulse 1.5s ease-in-out 1;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0.6; }
}

#hero-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--caption-color);
    opacity: 0;
    transition: opacity 0.6s ease;
}

#hero-subtitle.visible {
    opacity: 1;
}

/* === PHILOSOPHY SECTION === */
.philosophy-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    line-height: 1.7;
    color: var(--frost-white);
    text-shadow: 0 0 30px rgba(120, 160, 220, 0.08);
    max-width: 700px;
}

/* === PROCESS SECTION === */
.process-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 1rem;
}

.process-col {
    text-align: center;
}

.process-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
}

.process-icon svg {
    width: 100%;
    height: 100%;
}

.construct-line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s var(--ease-out);
}

.panel.content-revealed .construct-line {
    stroke-dashoffset: 0;
}

.process-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--caption-color);
    display: block;
    margin-bottom: 0.8rem;
}

.process-desc {
    font-size: clamp(0.85rem, 1vw, 1rem);
    color: var(--body-text);
    line-height: 1.8;
}

/* === FEATURED SECTION === */
.featured-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-mid), #0A0E1A);
    margin-bottom: 1.5rem;
}

.featured-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(123, 163, 212, 0.05), transparent);
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.featured-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.featured-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--frost-white);
}

.featured-year {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--caption-color);
}

/* === MATERIALITY SECTION === */
.materiality-quote {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    border: none;
}

.quote-line {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1.4;
    color: var(--frost-white);
    text-shadow: 0 0 30px rgba(120, 160, 220, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.panel.lines-revealed .quote-line {
    opacity: 1;
    transform: translateY(0);
}

.panel.lines-revealed .quote-line[data-line="0"] {
    transition-delay: 0ms;
}

.panel.lines-revealed .quote-line[data-line="1"] {
    transition-delay: 200ms;
}

.panel.lines-revealed .quote-line[data-line="2"] {
    transition-delay: 400ms;
}

/* === CONTACT SECTION === */
.panel-contact .panel-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.contact-studio {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--frost-white);
    text-shadow: 0 0 40px rgba(120, 160, 220, 0.15);
}

.contact-email {
    font-family: 'Libre Franklin', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    color: var(--body-text);
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

.contact-email::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--warm-punctuation);
    transition: width 0.5s var(--ease-out-expo);
}

.contact-email:hover {
    color: var(--frost-white);
}

.contact-email:hover::after {
    width: 100%;
}

.contact-city {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--caption-color);
}

/* === Responsive === */
@media (max-width: 768px) {
    .panel {
        padding: clamp(1.5rem, 4vw, 3rem);
    }

    .process-columns {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .panel-philosophy,
    .panel-process,
    .panel-featured,
    .panel-materiality {
        margin-left: auto;
        margin-right: auto;
    }

    #brand-name {
        top: 1rem;
        left: 1rem;
    }

    .hero-letter {
        font-size: clamp(3rem, 12vw, 6rem);
    }

    #hero-line.drawn {
        width: 60vw;
    }

    #hero-dot {
        right: calc(50% - 30vw - 6px);
    }

    .skeleton-container {
        padding: clamp(1.5rem, 4vw, 3rem);
    }
}

@media (max-width: 480px) {
    .section {
        padding: 3rem 1rem;
    }

    .hero-letter {
        font-size: clamp(2.5rem, 14vw, 4rem);
    }
}

/* === Fallback for no backdrop-filter === */
@supports not (backdrop-filter: blur(20px)) {
    .panel {
        background: var(--fallback-bg);
    }
}
