/* ============================
   DEMO 13: VINTAGE ANALOG / RETRO
   ============================ */

   :root {
    --bg-paper: #f4f1ea;  /* Warm cream/paper color */
    --text-ink: #2b2b2b;  /* Soft black ink */
    --accent-rust: #cb997e;
    --accent-olive: #6b705c;
    
    --font-heading: 'Abril Fatface', serif;
    --font-type: 'Courier Prime', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-paper);
    color: var(--text-ink);
    font-family: var(--font-type);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .logo, .retro-title {
    font-family: var(--font-heading);
    font-weight: 400;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

.text-center { text-align: center; }
.mb-5 { margin-bottom: 3rem; }

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 5%;
}

/* ============================
   FILM GRAIN EFFECT
   ============================ */
.film-grain {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.05;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

/* ============================
   PRELOADER
   ============================ */
#preloader {
    position: fixed;
    inset: 0;
    background: var(--text-ink);
    color: var(--bg-paper);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease, visibility 1s;
}

.loader-text {
    font-family: var(--font-type);
    font-size: 1.2rem;
    margin-bottom: 20px;
    animation: blink 1s infinite step-end;
}
@keyframes blink { 50% { opacity: 0; } }

.progress-bar {
    width: 200px;
    height: 2px;
    background: rgba(244, 241, 234, 0.2);
}
.progress {
    width: 0%;
    height: 100%;
    background: var(--bg-paper);
    animation: loadProgress 1.5s ease forwards;
}
@keyframes loadProgress { 100% { width: 100%; } }

/* ============================
   NAVIGATION
   ============================ */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 1000;
    transition: 0.3s;
}
.navbar.scrolled {
    background: var(--bg-paper);
    border-bottom: 2px solid var(--text-ink);
    padding: 15px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
}

.logo {
    font-size: 2rem;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    font-family: var(--font-type);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
}
.nav-links a:hover { color: var(--accent-rust); text-decoration: line-through; }

.btn-retro {
    background: var(--text-ink);
    color: var(--bg-paper) !important;
    padding: 10px 20px;
    border: 2px solid var(--text-ink);
    text-decoration: none !important;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    text-transform: uppercase;
    font-size: 0.85rem;
}
.btn-retro:hover {
    background: var(--accent-rust);
    border-color: var(--accent-rust);
    color: var(--bg-paper) !important;
}

.menu-toggle { display: none; font-size: 1.5rem; cursor: pointer; }

.demo-badge {
    position: fixed;
    top: 100px;
    right: 0;
    background: var(--accent-olive);
    color: var(--bg-paper);
    font-size: 0.7rem;
    padding: 5px 15px;
    z-index: 100;
    font-family: var(--font-type);
    font-weight: 700;
}

/* ============================
   HERO / POLAROID SCATTER
   ============================ */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 60px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    z-index: 10;
    background: rgba(244, 241, 234, 0.9);
    padding: 20px 40px;
    border: 3px solid var(--text-ink);
}

.glitch-text {
    font-size: 5rem;
    color: var(--text-ink);
    margin-bottom: 10px;
    position: relative;
}
/* Glitch effect on hover */
.glitch-text:hover::before, .glitch-text:hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}
.glitch-text:hover::before { left: 2px; text-shadow: -2px 0 red; animation: glitch-anim-1 2s infinite linear alternate-reverse; }
.glitch-text:hover::after { left: -2px; text-shadow: -2px 0 blue; animation: glitch-anim-2 3s infinite linear alternate-reverse; }

@keyframes glitch-anim-1 { 0% { clip: rect(20px, 900px, 50px, 0); } 100% { clip: rect(60px, 900px, 10px, 0); } }
@keyframes glitch-anim-2 { 0% { clip: rect(10px, 900px, 80px, 0); } 100% { clip: rect(40px, 900px, 30px, 0); } }

.typewriter-text { font-size: 1rem; font-weight: 700; }

/* Scatter Polaroids */
.polaroid-scatter {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.polaroid {
    position: absolute;
    background: #fff;
    padding: 10px 10px 40px 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
    transition: 0.3s;
}
.polaroid img {
    width: 250px;
    height: 300px;
    object-fit: cover;
    filter: sepia(0.4) contrast(1.2) brightness(0.9);
}
.polaroid span {
    position: absolute;
    bottom: 10px;
    left: 15px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: #444;
}
.polaroid:hover { z-index: 5; transform: scale(1.05) rotate(0deg) !important; box-shadow: 0 20px 30px rgba(0,0,0,0.3); }

.p1 { top: 15%; left: 10%; transform: rotate(-10deg); }
.p2 { top: 30%; right: 15%; transform: rotate(15deg); }
.p3 { bottom: 10%; left: 30%; transform: rotate(-5deg); }

/* ============================
   VIBE / INTRO
   ============================ */
.vibe-section {
    padding: 150px 0;
}

.retro-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.1;
}

.film-strip-divider {
    width: 100px;
    height: 15px;
    background: var(--text-ink);
    margin: 0 auto 30px;
    position: relative;
    background-image: repeating-linear-gradient(90deg, transparent, transparent 5px, var(--bg-paper) 5px, var(--bg-paper) 10px);
}

.body-text {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    font-weight: 700;
}

/* ============================
   ANALOG GALLERY (FILM FRAMES)
   ============================ */
.gallery-section {
    padding: 100px 0;
}

.type-sub {
    font-weight: 700;
    color: var(--accent-rust);
    margin-bottom: 50px;
}

.film-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.film-frame {
    background: #111;
    padding: 30px;
    position: relative;
    display: flex;
    justify-content: center;
}

.film-filter {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    filter: contrast(1.3) sepia(0.3) saturate(0.8);
    transition: 0.4s;
}
.film-frame:hover .film-filter { filter: none; }

.film-holes {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    background-image: radial-gradient(#fff 40%, transparent 45%);
    background-size: 20px 40px;
    background-position: center;
}
.film-holes.left { left: 5px; }
.film-holes.right { right: 5px; }

/* ============================
   SUPER 8 SECTION
   ============================ */
.super8-section {
    padding: 120px 0;
    background: var(--accent-olive);
    color: var(--bg-paper);
}

.super8-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.super8-box .retro-title { color: var(--bg-paper); }
.super8-box .body-text { font-weight: 400; margin-bottom: 30px; margin-left: 0; }

.btn-retro.inline {
    background: transparent;
    color: var(--bg-paper) !important;
    border-color: var(--bg-paper);
}
.btn-retro.inline:hover { background: var(--bg-paper); color: var(--accent-olive) !important; }

.tv-container {
    border: 20px solid #222;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #000;
}
.tv-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.5) sepia(0.5) blur(1px);
}
.tv-static {
    position: absolute;
    inset: 0;
    background: url('https://media.giphy.com/media/Y4WjEw9m3W3M2OmsN8/giphy.gif');
    opacity: 0.15;
    pointer-events: none;
}

/* ============================
   TAPE TESTIMONIAL
   ============================ */
.testimonial-section {
    padding: 120px 0;
}

.tape-note {
    background: #fff;
    padding: 60px 40px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    box-shadow: 2px 5px 15px rgba(0,0,0,0.1);
    transform: rotate(2deg);
}

.tape {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    width: 120px;
    height: 35px;
    background-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.tape-note .quote {
    font-size: 1.1rem;
    margin-bottom: 20px;
}
.tape-note .signature {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--accent-rust);
}

/* ============================
   CONTACT
   ============================ */
.contact-section {
    padding: 100px 0 150px;
}

.retro-form {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border: 3px solid var(--text-ink);
    box-shadow: 10px 10px 0px var(--text-ink);
}

.form-group { margin-bottom: 25px; }

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.retro-form input, .retro-form textarea {
    width: 100%;
    border: 2px solid var(--text-ink);
    background: var(--bg-paper);
    padding: 12px;
    font-family: var(--font-type);
    font-size: 1rem;
}
.retro-form input:focus, .retro-form textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--accent-rust);
}

.btn-retro.full-width { width: 100%; padding: 15px; font-size: 1rem; margin-top: 10px; }

/* ============================
   FOOTER
   ============================ */
.footer {
    border-top: 3px solid var(--text-ink);
    padding: 60px 0 20px;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.f-right p { font-weight: 700; }

.f-socials { margin-top: 10px; display: flex; gap: 15px; }
.f-socials a { font-weight: 700; text-decoration: underline; }
.f-socials a:hover { color: var(--accent-rust); }

.f-bottom { border-top: 1px solid #ccc; padding-top: 20px; font-size: 0.85rem; font-weight: 700; }
.f-bottom a { text-decoration: underline; }

.back-to-master {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--text-ink);
    padding: 10px 15px;
    color: var(--bg-paper);
    font-size: 0.8rem;
    border-radius: 0;
    font-weight: 700;
    z-index: 1000;
    text-transform: uppercase;
}
.back-to-master:hover { background: var(--accent-rust); }

/* SCROLL REVEAL */
.reveal { opacity: 0; transform: translateY(30px); transition: 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* Responsive */
@media (max-width: 992px) {
    .super8-box { grid-template-columns: 1fr; }
    .tv-container { max-width: 500px; margin: 0 auto; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    .glitch-text { font-size: 3rem; }
    .polaroid-scatter { display: none; }
    .retro-title { font-size: 2.5rem; }
    .footer .container { flex-direction: column; gap: 30px; text-align: center; }
    .f-socials { justify-content: center; }
    .retro-form { box-shadow: 5px 5px 0px var(--text-ink); padding: 20px; }
}
