/* gabs.cx - Memphis Design Revival */

/* ============================
   CSS Custom Properties
   ============================ */
:root {
    --cream: #F0EBE3;
    --steel-blue: #7B8FA1;
    --dark-brown: #3A3530;
    --darkest: #2D2825;
    --mauve: #A8959E;
    --sage: #8FA68F;
    --gold: #C9A96E;
    --terracotta: #C4908A;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--cream);
    color: var(--dark-brown);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================
   Hero Section
   ============================ */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--cream);
}

.hero-letters {
    display: flex;
    align-items: baseline;
    gap: 0.02em;
    position: relative;
    z-index: 2;
}

.letter {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(64px, 15vw, 480px);
    letter-spacing: -0.04em;
    text-transform: lowercase;
    color: var(--darkest);
    display: inline-block;
    opacity: 0;
    will-change: transform, opacity;
}

.letter-g {
    color: var(--terracotta);
}

.letter-a {
    color: var(--sage);
}

.letter-b {
    color: var(--steel-blue);
}

.letter-s {
    color: var(--gold);
}

/* Letter slide-in animations */
@keyframes slide-from-left {
    0% { transform: translateX(-120vw); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slide-from-bottom {
    0% { transform: translateY(120vh); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes slide-from-right {
    0% { transform: translateX(120vw); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slide-from-top {
    0% { transform: translateY(-120vh); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.letter-g.animate {
    animation: slide-from-left 800ms cubic-bezier(0.16, 1, 0.3, 1) 200ms forwards;
}

.letter-a.animate {
    animation: slide-from-bottom 800ms cubic-bezier(0.16, 1, 0.3, 1) 350ms forwards;
}

.letter-b.animate {
    animation: slide-from-right 800ms cubic-bezier(0.16, 1, 0.3, 1) 500ms forwards;
}

.letter-s.animate {
    animation: slide-from-top 800ms cubic-bezier(0.16, 1, 0.3, 1) 650ms forwards;
}

.hero-subtitle {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.subtitle-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(24px, 4vw, 80px);
    color: var(--mauve);
    letter-spacing: 0.02em;
}

/* ============================
   Memphis Shape Library
   ============================ */

/* Spotted Circle */
.shape-spotted-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--terracotta);
    background-image: radial-gradient(circle, var(--cream) 4px, transparent 4px);
    background-size: 16px 16px;
}

/* Striped Triangle */
.shape-striped-triangle {
    width: 100px;
    height: 100px;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    background: repeating-linear-gradient(
        45deg,
        var(--sage),
        var(--sage) 4px,
        var(--cream) 4px,
        var(--cream) 8px
    );
}

/* Zigzag Bar */
.shape-zigzag {
    width: 160px;
    height: 24px;
    background: linear-gradient(135deg, var(--gold) 25%, transparent 25%) -12px 0,
                linear-gradient(225deg, var(--gold) 25%, transparent 25%) -12px 0,
                linear-gradient(315deg, var(--gold) 25%, transparent 25%),
                linear-gradient(45deg, var(--gold) 25%, transparent 25%);
    background-size: 24px 24px;
    background-color: transparent;
}

/* Gold Arc */
.shape-gold-arc {
    width: 100px;
    height: 50px;
    border: 6px solid var(--gold);
    border-bottom: none;
    border-radius: 100px 100px 0 0;
    background: transparent;
}

/* Dotted Square */
.shape-dotted-square {
    width: 80px;
    height: 80px;
    border: 4px dotted var(--steel-blue);
    background-color: transparent;
    transform: rotate(15deg);
}

/* Squiggle (SVG-based via CSS) */
.shape-squiggle {
    width: 120px;
    height: 40px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 40'%3E%3Cpath d='M0 20 Q15 0 30 20 Q45 40 60 20 Q75 0 90 20 Q105 40 120 20' fill='none' stroke='%23A8959E' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

/* ============================
   Hero Shape Positions
   ============================ */
.memphis-shape {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.shape-hero-1 {
    top: 12%;
    left: 8%;
    opacity: 0;
    transition: opacity 800ms ease 1.2s;
}

.shape-hero-2 {
    top: 18%;
    right: 10%;
    opacity: 0;
    transition: opacity 800ms ease 1.4s;
}

.shape-hero-3 {
    bottom: 22%;
    left: 12%;
    opacity: 0;
    transition: opacity 800ms ease 1.6s;
}

.shape-hero-4 {
    bottom: 30%;
    right: 15%;
    opacity: 0;
    transition: opacity 800ms ease 1.8s;
}

.shape-hero-5 {
    top: 55%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 800ms ease 2s;
}

.shapes-visible .shape-hero-1,
.shapes-visible .shape-hero-2,
.shapes-visible .shape-hero-3,
.shapes-visible .shape-hero-4,
.shapes-visible .shape-hero-5 {
    opacity: 0.7;
}

/* Floating animation for hero shapes */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-12px) rotate(2deg); }
    66% { transform: translateY(8px) rotate(-1deg); }
}

.shape-hero-1 { animation: float 8s ease-in-out infinite; }
.shape-hero-2 { animation: float 10s ease-in-out infinite 1s; }
.shape-hero-3 { animation: float 9s ease-in-out infinite 2s; }
.shape-hero-4 { animation: float 11s ease-in-out infinite 0.5s; }
.shape-hero-5 { animation: float 7s ease-in-out infinite 1.5s; }

/* ============================
   Sections
   ============================ */
.section {
    position: relative;
    padding: clamp(60px, 10vw, 160px) clamp(24px, 6vw, 120px);
    overflow: hidden;
}

.section-header {
    position: relative;
    margin-bottom: clamp(40px, 6vw, 80px);
    display: flex;
    align-items: center;
    gap: 24px;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(36px, 6vw, 96px);
    letter-spacing: 0em;
    text-transform: lowercase;
    color: var(--darkest);
    line-height: 1.1;
}

.shape-section-deco {
    position: relative;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
}

.shape-section-deco.shape-spotted-circle {
    width: 60px;
    height: 60px;
}

.shape-section-deco.shape-zigzag {
    width: 100px;
    height: 20px;
}

.shape-section-deco.shape-dotted-square {
    width: 50px;
    height: 50px;
}

/* ============================
   Card Grid
   ============================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    position: relative;
}

.card {
    background: white;
    border-radius: 12px;
    padding: clamp(24px, 3vw, 48px);
    position: relative;
    overflow: hidden;
    transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 400ms ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(45, 40, 37, 0.1);
}

.card-wide {
    grid-column: span 7;
}

.card-narrow {
    grid-column: span 5;
}

.card-inner {
    position: relative;
    z-index: 2;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 36px);
    text-transform: lowercase;
    color: var(--darkest);
    margin-bottom: 12px;
    line-height: 1.2;
}

.card-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(14px, 1.2vw, 18px);
    line-height: 1.7;
    color: var(--dark-brown);
    max-width: 48ch;
}

.card-shape {
    position: absolute;
    bottom: -10px;
    right: -10px;
    opacity: 0.3;
    z-index: 1;
}

.card-shape .shape-striped-triangle {
    width: 140px;
    height: 140px;
}

.grid-gap-shape {
    position: absolute;
    z-index: 0;
}

.section-about .grid-gap-shape {
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
}

/* ============================
   Work Section - Project Cards
   ============================ */
.card-grid-work {
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.card-project {
    border-radius: 16px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-span-5 {
    grid-column: span 5;
}

.card-span-3 {
    grid-column: span 3;
}

.card-span-4 {
    grid-column: span 4;
}

.project-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 14px;
    color: var(--mauve);
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.card-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 0 0 16px 16px;
}

.card-accent-terracotta {
    background: var(--terracotta);
}

.card-accent-sage {
    background: var(--sage);
}

.card-accent-blue {
    background: var(--steel-blue);
}

.card-accent-gold {
    background: var(--gold);
}

.grid-gap-shape-work {
    right: 0;
    bottom: -30px;
}

/* ============================
   Section Backgrounds
   ============================ */
.section-about {
    background-color: var(--cream);
}

.section-work {
    background-color: #F7F3ED;
}

.section-approach {
    background-color: var(--cream);
}

.section-contact {
    background-color: var(--darkest);
}

/* ============================
   Approach Section
   ============================ */
.approach-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(16px, 3vw, 48px);
}

.approach-col {
    padding: clamp(20px, 2vw, 32px);
    border-top: 3px solid var(--dark-brown);
}

.approach-number {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 14px;
    color: var(--mauve);
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.approach-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(18px, 2vw, 28px);
    text-transform: lowercase;
    color: var(--darkest);
    margin-bottom: 12px;
    line-height: 1.2;
}

.approach-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(13px, 1.1vw, 16px);
    line-height: 1.7;
    color: var(--dark-brown);
}

.approach-float-shape {
    position: absolute;
    bottom: 40px;
    right: 60px;
    opacity: 0.2;
    z-index: 0;
    width: 180px;
    height: 180px;
}

/* ============================
   Contact Section
   ============================ */
.section-contact {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

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

.contact-title {
    color: var(--cream);
}

.contact-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 22px);
    color: var(--mauve);
    margin-top: 16px;
    margin-bottom: 32px;
}

.contact-link {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(20px, 3vw, 48px);
    color: var(--gold);
    text-decoration: none;
    text-transform: lowercase;
    position: relative;
    transition: color 300ms ease;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.contact-link:hover {
    color: var(--terracotta);
}

.contact-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.contact-shape-1 {
    top: 15%;
    left: 10%;
    opacity: 0.15;
    width: 140px;
    height: 140px;
}

.contact-shape-2 {
    bottom: 20%;
    right: 8%;
    opacity: 0.15;
    width: 200px;
    height: 30px;
}

.contact-shape-3 {
    top: 60%;
    left: 70%;
    opacity: 0.12;
    width: 160px;
    height: 50px;
}

/* ============================
   Scroll Reveal Animation
   ============================ */
.reveal-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 1024px) {
    .card-wide,
    .card-narrow {
        grid-column: span 12;
    }

    .card-span-5,
    .card-span-3,
    .card-span-4 {
        grid-column: span 6;
    }

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

@media (max-width: 640px) {
    .card-span-5,
    .card-span-3,
    .card-span-4 {
        grid-column: span 12;
    }

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

    .hero-letters {
        gap: 0;
    }

    .grid-gap-shape,
    .approach-float-shape {
        display: none;
    }
}
