:root {
    --primary: #2c3e50;
    --primary-dark: #1a252f;
    --secondary: #e74c3c;
    --accent: #f1c40f;
    --bg-dark: #fdfbf7;
    --bg-card: #ffffff;
    --card-border: 2px solid #2c3e50;
    --text-light: #2c3e50;
    --text-dim: #7f8c8d;
    --font-main: 'Outfit', sans-serif;
    --font-heading: 'Patrick Hand', cursive;
    --gradient-main: none;
    --gradient-text: none;
    --glass-shadow: 4px 4px 0px #2c3e50;
    --border-radius-sketch: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    cursor: auto;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        linear-gradient(#e1e1e1 1px, transparent 1px),
        linear-gradient(90deg, #e1e1e1 1px, transparent 1px);
    background-size: 20px 20px;
    padding-bottom: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.2rem 0;
    background: rgba(253, 251, 247, 0.95);
    border-bottom: 2px solid var(--primary);
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-light);
    text-decoration: none;
    letter-spacing: 1px;
}

.dot {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--secondary);
    text-decoration: underline;
    text-decoration-style: wavy;
}

/* --- Buttons --- */
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius-sketch);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid var(--primary);
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px var(--secondary);
    background: var(--primary-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius-sketch);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px var(--text-light);
}

/* --- Hero Section --- */
.hero {
    padding: 8rem 0 4rem;
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content.centered {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge-container {
    margin-bottom: 1.5rem;
}

.badge {
    background: var(--accent);
    color: var(--primary);
    padding: 0.5rem 1.5rem;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--primary);
    display: inline-block;
    transform: rotate(-2deg);
}

.display-text {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    line-height: 1;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.gradient-text {
    background: none;
    -webkit-text-fill-color: var(--secondary);
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-color: var(--accent);
}

/* Typing Animation Cursor */
.cursor-blink {
    color: var(--secondary);
    animation: blink 1s infinite;
    font-weight: 100;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.lead-text {
    font-size: 1.3rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    max-width: 600px;
    font-family: var(--font-heading);
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stats-row {
    display: flex;
    gap: 3rem;
    border-top: 2px dashed var(--text-dim);
    padding-top: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Patrick Hand', cursive;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-main);
}

/* --- Services Section (Bento Grid) --- */
.section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 10px;
    background: var(--accent);
    z-index: -1;
    opacity: 0.6;
    transform: skewX(-10deg);
}

.section-subtitle {
    color: var(--text-dim);
    font-size: 1.2rem;
    font-family: var(--font-heading);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    grid-auto-rows: minmax(200px, auto);
    max-width: 900px;
    margin: 0 auto;
}

/* Sticky Note Card Style */
.spotlight-card {
    position: relative;
    background: #fef9c3;
    /* Pastel Yellow */
    color: var(--primary);
    border: none;
    border-radius: 2px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.15);
    font-family: 'Patrick Hand', cursive;
    display: flex;
    flex-direction: column;
}

.spotlight-card:hover {
    transform: scale(1.02) rotate(0deg) !important;
    box-shadow: 10px 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* Tape Effect */
.spotlight-card::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 120px;
    height: 35px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 5;
    backdrop-filter: blur(2px);
}

/* Individual Rotations for "Stuck" feel */
.bento-card:nth-child(1) {
    transform: rotate(-1.5deg);
}

.bento-card:nth-child(2) {
    transform: rotate(1.5deg);
}

.bento-card:nth-child(3) {
    transform: rotate(-1deg);
}

.bento-card.large {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: transparent;
    border: 2px dashed var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    align-self: center;
}

.bento-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-family: 'Patrick Hand', cursive;
    text-align: center;
}

.bento-card p {
    color: var(--primary);
    line-height: 1.4;
    margin-bottom: 1rem;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.3rem;
    text-align: center;
}

.feature-list {
    list-style: none;
    margin: 1rem 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.feature-list li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--primary);
    font-family: 'Patrick Hand', cursive;
    font-size: 1.3rem;
    width: 100%;
    justify-content: center;
}

.feature-list li i {
    color: var(--secondary);
    font-size: 1rem;
}

/* --- Skills Section --- */
.skills-section {
    padding: 2rem 0;
    border-top: 2px dashed var(--primary);
    border-bottom: 2px dashed var(--primary);
    background: rgba(255, 255, 255, 0.5);
}

.tech-label {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 1.2rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skills-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.skill-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    padding: 0.5rem 1.25rem;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    font-size: 1.1rem;
    color: var(--text-light);
    font-family: var(--font-heading);
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.skill-ico {
    width: 1.05em;
    height: 1.05em;
    flex-shrink: 0;
    object-fit: contain;
}

.skill-ico-fa {
    font-size: 1em;
    color: var(--primary);
    flex-shrink: 0;
}

.skill-pill:hover {
    transform: rotate(-2deg) scale(1.1);
    box-shadow: 4px 4px 0px var(--secondary);
    border-color: var(--secondary);
}

/* --- Experience Section --- */
.experience-section {
    background: rgba(255, 255, 255, 0.45);
    border-top: 2px dashed var(--primary);
    border-bottom: 2px dashed var(--primary);
}

.experience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.experience-card {
    min-height: 220px;
}

.experience-card.current {
    grid-column: 1 / -1;
    min-height: 0;
    background: #ede9fe !important;
}

.experience-card.current p:last-child {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.experience-card:nth-child(5) {
    background: #e0f2fe;
    transform: rotate(-1.2deg);
}

.live-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: .35rem;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
    animation: livePulse 1.8s ease-out infinite;
}

@keyframes livePulse {
    to { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
}

/* --- Footer --- */
.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 2rem 3rem;
    border-top: 2px dashed var(--primary);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-dim);
}

.footer-links {
    display: flex;
    gap: .8rem;
}

.footer-links a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    color: var(--primary);
    background: #fff;
    transition: transform .3s ease, background-color .3s ease;
}

.footer-links a:hover {
    background: var(--accent);
    transform: rotate(-10deg) scale(1.08);
}

.experience-card:nth-child(1) {
    background: #e0f2fe;
    transform: rotate(-1deg);
}

.experience-card:nth-child(2) {
    background: #dcfce7;
    transform: rotate(1deg);
}

.experience-card:nth-child(3) {
    background: #fef9c3;
    transform: rotate(-0.8deg);
}

.experience-card:nth-child(4) {
    background: #fee2e2;
    transform: rotate(1.2deg);
}

.experience-period {
    align-self: center;
    background: var(--accent);
    border: 2px solid var(--primary);
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    color: var(--primary);
    display: inline-block;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 1rem;
    padding: 0.35rem 0.8rem;
    text-transform: uppercase;
}

.experience-card h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    line-height: 1.1;
    margin-bottom: 0.25rem;
    text-align: center;
}

.experience-company {
    text-align: center;
    color: var(--secondary);
    font-family: var(--font-main) !important;
    font-size: 0.9rem !important;
    font-weight: 800;
    letter-spacing: 0.03em;
    margin-bottom: 1rem !important;
    text-transform: uppercase;
}

.achievement-strip {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 3rem auto 0;
    max-width: 1000px;
}

.achievement-strip span {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: var(--border-radius-sketch);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 1.25rem;
    padding: 1rem;
    text-align: center;
}

.achievement-strip strong {
    color: var(--secondary);
    display: block;
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1;
}

/* --- Work Grid --- */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    margin: 0 auto;
    max-width: 1120px;
    perspective: 1200px;
}

.work-card {
    background:
        linear-gradient(#ffffff55 1px, transparent 1px),
        linear-gradient(90deg, #ffffff55 1px, transparent 1px),
        #fef9c3;
    background-size: 18px 18px;
    border: 2px solid var(--primary);
    border-radius: var(--border-radius-sketch);
    box-shadow: 8px 8px 0 rgba(44, 62, 80, 0.22);
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: visible;
    padding: 1rem;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.work-card::before {
    content: '';
    position: absolute;
    top: -18px;
    left: 50%;
    width: 112px;
    height: 34px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(44, 62, 80, 0.12);
    box-shadow: 0 2px 5px rgba(44, 62, 80, 0.12);
    transform: translateX(-50%) rotate(-2deg);
    z-index: 4;
    backdrop-filter: blur(2px);
}

.work-card::after {
    content: '';
    position: absolute;
    inset: 12px;
    border: 2px dashed rgba(44, 62, 80, 0.15);
    border-radius: var(--border-radius-sketch);
    pointer-events: none;
}

.work-card:nth-child(3n + 1) {
    transform: rotate(-0.6deg);
}

.work-card:nth-child(3n + 2) {
    transform: rotate(0.5deg);
}

.work-card:nth-child(3n) {
    transform: rotate(-0.2deg);
}

.work-card:hover {
    box-shadow: 12px 12px 0 rgba(231, 76, 60, 0.28);
    transform: translate(-3px, -3px) rotate(0deg);
    z-index: 5;
}

.work-card:nth-child(2) {
    background-color: #e0f2fe;
}

.work-card:nth-child(3) {
    background-color: #dcfce7;
}

.work-card:nth-child(4) {
    background-color: #fee2e2;
}

.work-card:nth-child(5) {
    background-color: #fef9c3;
}

.work-card:nth-child(6) {
    background-color: #ede9fe;
}

.work-card:nth-child(7) {
    background-color: #ffedd5;
}

.work-card.featured {
    grid-column: span 3;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

.work-card.featured .work-media {
    min-height: 360px;
}

.work-media {
    align-items: center;
    aspect-ratio: 16 / 10;
    background: #dcedc1;
    border: 2px solid var(--primary);
    border-radius: 6px;
    box-shadow: 4px 4px 0 rgba(44, 62, 80, 0.18);
    display: flex;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.work-card.featured .work-media {
    border: 2px solid var(--primary);
}

.work-media img,
.work-media video {
    display: block;
    height: 100%;
    object-fit: cover;
    object-position: center;
    width: 100%;
}

.work-media.project-visual-carousel .carousel-container {
    height: 100%;
    min-height: 100%;
}

.work-media.project-visual-carousel .carousel-badge {
    top: 0.75rem;
    right: 0.75rem;
}

.work-media.project-visual-carousel .carousel-indicators {
    display: flex;
    bottom: 0.75rem;
}

.work-media.illustrated {
    background:
        linear-gradient(#ffffff66 1px, transparent 1px),
        linear-gradient(90deg, #ffffff66 1px, transparent 1px),
        #a8e6cf;
    background-size: 18px 18px;
    color: var(--primary);
    flex-direction: column;
    gap: 1rem;
    min-height: 190px;
    padding: 1.5rem;
    text-align: center;
}

.work-media.illustrated i {
    align-items: center;
    background: var(--accent);
    border: 2px solid var(--primary);
    border-radius: 50%;
    box-shadow: 4px 4px 0 rgba(44, 62, 80, 0.2);
    display: flex;
    font-size: 2rem;
    height: 74px;
    justify-content: center;
    width: 74px;
}

.work-media.illustrated span {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: var(--border-radius-sketch);
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.4rem 0.9rem;
}

.work-media.alt-1 {
    background-color: #e0f2fe;
}

.work-media.alt-2 {
    background-color: #fee2e2;
}

.work-media.alt-3 {
    background-color: #fef9c3;
}

.work-media.alt-4 {
    background-color: #dcfce7;
}

.work-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.4rem 0.5rem 0.4rem;
    position: relative;
    z-index: 2;
}

.work-content h3 {
    color: var(--primary);
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1.05;
    margin: 0.25rem 0 0.8rem;
}

.work-content p {
    color: var(--text-light);
    flex: 1;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1.45;
    margin-bottom: 1rem;
}

.work-impact {
    background: #fff7ed;
    border-left: 4px solid var(--secondary);
    color: var(--primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 1rem;
    padding: 0.75rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tech-tags span {
    background: #ffffff;
    border: 1px solid var(--primary);
    border-radius: 999px;
    color: var(--primary);
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
}

.muted-link {
    color: var(--text-dim);
    cursor: default;
}

/* --- Projects Section (Sketchbook Stack) --- */
.projects-stack-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 2rem auto 6rem;
    height: 450px;
    perspective: 1000px;
}

.project-card-stack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: 5px;
    padding: 2rem;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform-origin: center center;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.2);
    transform-style: preserve-3d;
}

.project-card-stack::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 20px;
    background: repeating-linear-gradient(90deg, var(--primary) 0, var(--primary) 10px, transparent 10px, transparent 30px);
    opacity: 0.2;
}

/* Interaction Hint */
.interaction-hint {
    position: absolute;
    top: -40px;
    right: 0;
    background: var(--accent);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.1);
    animation: bounce 2s infinite;
    z-index: 20;
    border: 2px solid var(--primary);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.stack-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    pointer-events: none;
    border-bottom: 2px dashed var(--text-dim);
    padding-bottom: 0.5rem;
}

.stack-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
    background: var(--accent);
    padding: 0 10px;
    border-radius: 50%;
    transform: rotate(-5deg);
    border: 2px solid var(--primary);
}

.project-card-stack h3 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text-light);
    font-family: var(--font-heading);
}

.stack-content {
    flex: 1;
    display: flex;
    gap: 2rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-card-stack.active .stack-content {
    opacity: 1;
    pointer-events: auto;
}

.project-visual {
    flex: 1;
    border: 2px solid var(--primary);
    border-radius: 5px;
    background-size: cover;
    background-position: center;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 300px;
}

.project-visual img,
.project-visual video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    min-width: 0;
    min-height: 0;
}

/* --- Carousel Styles --- */
.project-visual-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    cursor: pointer;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
    position: relative;
    z-index: 2;
}

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 3px;
}

.carousel-slide .image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(44, 62, 80, 0.85), transparent);
    color: white;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-heading);
    text-align: center;
    z-index: 3;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    color: var(--primary);
}

.carousel-btn:hover {
    background: var(--accent);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 3px 3px 0px var(--secondary);
}

.carousel-prev {
    left: 1rem;
}

.carousel-next {
    right: 1rem;
}

.carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 0.5rem;
    z-index: 10;
}

.carousel-indicators .indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicators .indicator.active {
    background: var(--accent);
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--primary);
}

.carousel-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-heading);
    border: 2px solid var(--primary);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 10;
    transform: rotate(-2deg);
}

.carousel-badge i {
    font-size: 0.9rem;
}

/* --- Modal Lightbox Styles --- */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content img,
.modal-content video {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--primary);
    background: #000000;
}

.modal-content img[hidden],
.modal-content video[hidden] {
    display: none;
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: var(--accent);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
    z-index: 10002;
}

.modal-close:hover {
    background: var(--secondary);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary);
    transition: all 0.3s ease;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.3);
    z-index: 10002;
}

.modal-nav:hover {
    background: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: -70px;
}

.modal-next {
    right: -70px;
}

.modal-caption {
    margin-top: 1rem;
    color: white;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-align: center;
    background: rgba(44, 62, 80, 0.8);
    padding: 0.75rem 1.5rem;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    border: 2px solid var(--accent);
}

.modal-indicators {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.modal-indicators .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-indicators .indicator.active {
    background: var(--accent);
    transform: scale(1.3);
}

.project-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.project-cat {
    color: var(--secondary);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-main);
}

.project-industry {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-main);
    background: var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    border: 1px solid var(--primary);
    transform: rotate(1deg);
}

.project-details p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1.1rem;
    font-family: var(--font-heading);
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.project-link:hover {
    gap: 1rem;
    text-decoration: underline;
}

.gradient-1 {
    background: #a8e6cf;
}

.gradient-2 {
    background: #dcedc1;
}

.gradient-3 {
    background: #ffd3b6;
}

/* Stack States - Top Peeking */
.project-card-stack.active {
    z-index: 10;
    transform: translateY(0) scale(1);
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.2);
}

/* --- Contact Section --- */
.contact-section {
    padding-bottom: 4rem;
}

.cta-box {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: var(--border-radius-sketch);
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 8px 8px 0px var(--primary);
}

.cta-box::before {
    display: none;
}

.cta-box h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    color: var(--primary);
}

.cta-box p {
    color: var(--text-dim);
    margin-bottom: 3rem;
    font-size: 1.3rem;
    font-family: var(--font-heading);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.large-btn {
    padding: 1rem 2.5rem;
    font-size: 1.3rem;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    padding: 1rem 2.5rem;
    border-radius: var(--border-radius-sketch);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid var(--primary);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

.btn-whatsapp:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.3);
}

/* --- Floating WhatsApp --- */
.floating-whatsapp {
    position: fixed;
    bottom: 5rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transition: transform 0.3s ease;
    border: 2px solid var(--primary);
}

.floating-whatsapp:hover {
    transform: scale(1.1) rotate(10deg);
}

/* --- Bottom Nav (Mobile) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-top: 2px solid var(--primary);
    display: none;
    justify-content: space-around;
    padding: 0.8rem 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    gap: 0.3rem;
    font-family: var(--font-heading);
    transition: color 0.3s ease;
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .navbar {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }

    body {
        padding-bottom: 60px;
    }

        .project-meta {
            display: flex;
            gap: 0.75rem;
            align-items: center;
            margin-bottom: 0.5rem;
            flex-wrap: wrap;
        }

        .project-cat {
            color: var(--secondary);
            font-size: 0.95rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-family: var(--font-main);
        }

        .project-industry {
            color: var(--primary);
            font-size: 0.85rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-family: var(--font-main);
            background: var(--accent);
            padding: 0.2rem 0.6rem;
            border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
            border: 1px solid var(--primary);
            transform: rotate(1deg);
        }

        .project-details p {
            color: var(--text-light);
            margin-bottom: 2rem;
            line-height: 1.6;
            font-size: 1.1rem;
            font-family: var(--font-heading);
        }

        .project-link {
            color: var(--primary);
            text-decoration: none;
            font-weight: 700;
            font-family: var(--font-heading);
            font-size: 1.2rem;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            transition: gap 0.3s ease;
        }

        .project-link:hover {
            gap: 1rem;
            text-decoration: underline;
        }

        .gradient-1 {
            background: #a8e6cf;
        }

        .gradient-2 {
            background: #dcedc1;
        }

        .gradient-3 {
            background: #ffd3b6;
        }

        /* Stack States - Top Peeking */
        .project-card-stack.active {
            z-index: 10;
            transform: translateY(0) scale(1);
            background: #ffffff;
            border-color: var(--primary);
            box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.2);
        }

        /* --- Contact Section --- */
        .contact-section {
            padding-bottom: 4rem;
        }

        .cta-box {
            background: var(--bg-card);
            border: 2px solid var(--primary);
            border-radius: var(--border-radius-sketch);
            padding: 4rem 2rem;
            text-align: center;
            position: relative;
            overflow: hidden;
            box-shadow: 8px 8px 0px var(--primary);
        }

        .cta-box::before {
            display: none;
        }

        .cta-box h2 {
            font-size: 3rem;
            margin-bottom: 1rem;
            font-family: var(--font-heading);
            color: var(--primary);
        }

        .cta-box p {
            color: var(--text-dim);
            margin-bottom: 3rem;
            font-size: 1.3rem;
            font-family: var(--font-heading);
        }

        .cta-buttons {
            display: flex;
            justify-content: center;
            gap: 1.5rem;
            flex-wrap: wrap;
        }

        .large-btn {
            padding: 1rem 2.5rem;
            font-size: 1.3rem;
        }

        .btn-whatsapp {
            background: #25D366;
            color: white;
            padding: 1rem 2.5rem;
            border-radius: var(--border-radius-sketch);
            text-decoration: none;
            font-weight: 600;
            font-family: var(--font-heading);
            font-size: 1.3rem;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            border: 2px solid var(--primary);
            box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
        }

        .btn-whatsapp:hover {
            transform: translate(-2px, -2px);
            box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.3);
        }

        /* --- Floating WhatsApp --- */
        .floating-whatsapp {
            position: fixed;
            bottom: 5rem;
            right: 2rem;
            width: 60px;
            height: 60px;
            background: #25D366;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
            z-index: 100;
            transition: transform 0.3s ease;
            border: 2px solid var(--primary);
        }

        .floating-whatsapp:hover {
            transform: scale(1.1) rotate(10deg);
        }

        /* --- Bottom Nav (Mobile) --- */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: #ffffff;
            border-top: 2px solid var(--primary);
            display: none;
            justify-content: space-around;
            padding: 0.8rem 0;
            z-index: 1000;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-decoration: none;
            color: var(--text-dim);
            font-size: 0.9rem;
            gap: 0.3rem;
            font-family: var(--font-heading);
            transition: color 0.3s ease;
        }

        .nav-item i {
            font-size: 1.2rem;
        }

        .nav-item.active {
            color: var(--primary);
            font-weight: 700;
        }

        /* --- Responsive --- */
        @media (max-width: 768px) {
            .navbar {
                display: none;
            }

            .bottom-nav {
                display: flex;
            }

            body {
                padding-bottom: 60px;
            }

            .hero {
                padding: 6rem 0 2rem;
                /* Increased top padding for mobile */
                min-height: auto;
            }

            .display-text {
                font-size: 2.5rem;
                /* Smaller font for mobile */
                padding: 0 1rem;
            }

            .lead-text {
                font-size: 1.1rem;
                padding: 0 1rem;
            }

            .hero-btns {
                flex-direction: column;
                width: 100%;
                padding: 0 2rem;
                gap: 1rem;
            }

            .btn-primary,
            .btn-secondary {
                width: 100%;
                justify-content: center;
            }

            .stats-row {
                flex-wrap: wrap;
                justify-content: center;
                gap: 1.5rem;
            }

            .experience-grid,
            .achievement-strip {
                grid-template-columns: 1fr;
            }

            .experience-card {
                min-height: auto;
                transform: rotate(0deg) !important;
            }

            /* Redesigned Services Section for Mobile (Vertical Stack) */
            .bento-grid {
                display: flex;
                flex-direction: column;
                gap: 2rem;
                margin: 0;
                padding: 0;
                overflow-x: visible;
            }

            .bento-card {
                min-width: auto;
                width: 100%;
                transform: rotate(0deg) !important;
                /* Reset rotation for cleaner vertical look */
                margin-bottom: 1rem;
            }

            /* Re-apply slight rotations for "messy stack" feel but vertically if desired, 
       or keep clean. Let's keep it slightly organic but readable. */
            .bento-card:nth-child(odd) {
                transform: rotate(-1deg) !important;
            }

            .bento-card:nth-child(even) {
                transform: rotate(1deg) !important;
            }

            .projects-stack-container {
                height: auto;
                max-width: 100%;
                display: flex;
                flex-direction: column;
                gap: 1.5rem;
                perspective: none;
                margin: 2rem auto;
            }

            .interaction-hint {
                display: none;
                /* Hide hint on mobile */
            }

            .project-card-stack {
                position: relative;
                height: auto;
                transform: none !important;
                opacity: 1 !important;
                z-index: 1 !important;
                background: var(--bg-card);
            }

            .stack-content {
                opacity: 1;
                flex-direction: column;
                pointer-events: auto;
            }

            .project-visual {
                height: 180px;
                width: 100%;
                min-height: 180px;
                max-height: 180px;
            }

            .project-visual img,
            .project-visual video {
                width: 100%;
                height: 100%;
                object-fit: cover;
                object-position: center;
            }

            .project-visual-carousel {
                min-height: 200px;
            }

            .carousel-container {
                min-height: 200px;
            }

            .carousel-btn {
                width: 35px;
                height: 35px;
                font-size: 0.9rem;
            }

            .carousel-prev {
                left: 0.5rem;
            }

            .carousel-next {
                right: 0.5rem;
            }

            .carousel-badge {
                top: 0.5rem;
                right: 0.5rem;
                padding: 0.3rem 0.6rem;
                font-size: 0.75rem;
            }

            .carousel-slide .image-label {
                font-size: 0.85rem;
                padding: 0.75rem;
            }

            .modal-nav {
                width: 40px;
                height: 40px;
                font-size: 1.2rem;
            }

            .modal-prev {
                left: 10px;
            }

            .modal-next {
                right: 10px;
            }

            .modal-close {
                top: -40px;
                width: 40px;
                height: 40px;
                font-size: 1.2rem;
            }

            .stack-header {
                margin-bottom: 1rem;
            }

            .floating-whatsapp {
                bottom: 5rem;
            }
        }
}

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

    .work-card.featured {
        grid-column: span 2;
        grid-template-columns: 1fr;
    }

    .work-card.featured .work-media {
        border-bottom: 2px solid var(--primary);
        border-right: 0;
        min-height: 280px;
    }
}

@media (max-width: 768px) {
    .hero-btns {
        flex-direction: column;
        width: 100%;
        padding: 0 2rem;
        gap: 1rem;
    }

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

    .work-card,
    .work-card.featured {
        display: flex;
        grid-column: auto;
        transform: none !important;
    }

    .work-card.featured .work-media,
    .work-media {
        aspect-ratio: 16 / 11;
        min-height: 210px;
    }

    .work-content h3 {
        font-size: 1.75rem;
    }

    .work-content p {
        font-size: 1.05rem;
    }

    .bottom-nav {
        padding: 0.65rem 0;
    }

    .nav-item {
        font-size: 0.78rem;
    }

    .nav-item i {
        font-size: 1.05rem;
    }
}

/* ==========================================================
   SPA shell: pages, transitions, navigation
   ========================================================== */

.view[hidden] {
    display: none !important;
}

.view.is-entering {
    animation: viewEnter .45s cubic-bezier(.2, .8, .2, 1) both;
}

html[data-nav-dir="back"] .view.is-entering {
    animation-name: viewEnterBack;
}

@keyframes viewEnter {
    from { opacity: 0; transform: translateX(28px); }
    to { opacity: 1; transform: none; }
}

@keyframes viewEnterBack {
    from { opacity: 0; transform: translateX(-28px); }
    to { opacity: 1; transform: none; }
}

/* View Transitions API (Chrome, Edge, Safari 18+): fixed chrome stays put */
.navbar { view-transition-name: navbar; }
.bottom-nav { view-transition-name: bottom-nav; }
.floating-whatsapp { view-transition-name: whatsapp; }

::view-transition-old(root) {
    animation: vtOut .2s ease-in both;
}

::view-transition-new(root) {
    animation: vtIn .42s cubic-bezier(.2, .8, .2, 1) both;
}

html[data-nav-dir="back"]::view-transition-old(root) { animation-name: vtOutBack; }
html[data-nav-dir="back"]::view-transition-new(root) { animation-name: vtInBack; }

@keyframes vtOut { to { opacity: 0; transform: translateX(-24px); } }
@keyframes vtIn { from { opacity: 0; transform: translateX(32px); } }
@keyframes vtOutBack { to { opacity: 0; transform: translateX(24px); } }
@keyframes vtInBack { from { opacity: 0; transform: translateX(-32px); } }

@media (prefers-reduced-motion: reduce) {
    .view.is-entering { animation: none; }
    ::view-transition-old(root),
    ::view-transition-new(root) { animation: none; }
}

/* Short pages shouldn't leave the footer floating mid-screen */
#app {
    min-height: calc(100vh - 140px);
    padding-top: 1px;
}

.view:not([data-view="home"]) > section:first-child {
    padding-top: 7.5rem;
}

/* Desktop nav */
.nav-links a {
    position: relative;
}

.nav-links a.active {
    color: var(--secondary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    transform: skewX(-12deg);
}

.nav-links a.nav-cta {
    background: var(--primary);
    color: #fff;
    padding: .35rem 1.1rem;
    border-radius: var(--border-radius-sketch);
    box-shadow: 3px 3px 0 var(--secondary);
}

.nav-links a.nav-cta:hover,
.nav-links a.nav-cta.active {
    color: #fff;
    text-decoration: none;
}

.nav-links a.nav-cta.active::after {
    display: none;
}

/* Hero */
.hero-resume {
    display: inline-block;
    margin: 1.2rem 0 1.6rem;
    color: var(--text-dim);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-color: var(--accent);
    text-underline-offset: 5px;
}

.hero-resume:hover {
    color: var(--secondary);
}

/* Quick links */
.quick-section {
    padding: 0 0 2rem;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.quick-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 16px 6px 18px 8px / 8px 18px 6px 16px;
    box-shadow: 4px 4px 0 var(--primary);
    color: var(--primary);
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease;
}

.quick-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--primary);
}

.quick-card:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--primary);
}

.quick-card.is-hot {
    background: #fef9c3;
}

.quick-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px dashed var(--primary);
    font-size: 1.15rem;
    color: var(--secondary);
}

.quick-text {
    display: grid;
    line-height: 1.25;
}

.quick-text strong {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 400;
}

.quick-text small {
    font-size: .85rem;
    color: var(--text-dim);
}

.quick-arrow {
    transition: transform .3s ease;
}

.quick-card:hover .quick-arrow {
    transform: translateX(4px);
}

/* "Next page" card at the end of a page */
.next-page {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto 4rem;
    padding: 1.3rem 1.6rem;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--border-radius-sketch);
    box-shadow: 6px 6px 0 var(--secondary);
    font-family: var(--font-heading);
    font-size: 1.6rem;
    transition: transform .25s ease, box-shadow .25s ease;
}

.next-page span {
    display: grid;
    line-height: 1.2;
}

.next-page small {
    font-family: var(--font-main);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
}

.next-page i {
    transition: transform .3s ease;
}

.next-page:hover {
    transform: translate(-2px, -2px);
    box-shadow: 9px 9px 0 var(--secondary);
}

.next-page:hover i {
    transform: translateX(6px);
}

/* About page */
.section-action {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1.2rem;
}

/* Contact page */
.contact-facts {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .6rem 1.6rem;
    margin-top: 2rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-dim);
}

.contact-facts i {
    color: var(--secondary);
    margin-right: .3rem;
}

body[data-view="contact"] .floating-whatsapp {
    display: none;
}

/* Bottom tab bar (mobile) */
.bottom-nav {
    padding-bottom: calc(.65rem + env(safe-area-inset-bottom, 0px));
}

.nav-indicator {
    position: absolute;
    top: 6px;
    left: 0;
    height: 44px;
    width: 0;
    background: #fef9c3;
    border: 2px solid var(--primary);
    border-radius: 14px 6px 16px 8px / 8px 16px 6px 14px;
    transition: transform .45s cubic-bezier(.65, -0.35, .25, 1.45), width .45s ease;
    pointer-events: none;
}

.bottom-nav .nav-item {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 44px;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav .nav-item.active i {
    color: var(--secondary);
    animation: tabPop .4s ease;
}

@keyframes tabPop {
    40% { transform: translateY(-3px) scale(1.15); }
}

@media (max-width: 768px) {
    .view:not([data-view="home"]) > section:first-child {
        padding-top: 2.5rem;
    }

    .quick-grid {
        grid-template-columns: 1fr;
        gap: .9rem;
    }

    .next-page {
        margin: 0 0 2.5rem;
        font-size: 1.35rem;
    }

    .site-footer {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
        justify-content: center;
        text-align: center;
    }
}

/* Phone polish */
@media (max-width: 768px) {
    .hero {
        padding-top: 3.5rem;
    }

    .hero-btns {
        padding: 0 .5rem;
        gap: .8rem;
    }

    .hero-btns a {
        width: 100%;
        justify-content: center;
        text-align: center;
        font-size: 1.15rem;
        padding: .8rem 1rem;
    }

    .lead-text {
        font-size: 1.05rem;
        line-height: 1.55;
    }

    .section-title {
        font-size: 2.3rem;
        line-height: 1.15;
    }

    .section-header {
        margin-bottom: 2.2rem;
    }

    .cta-box {
        padding: 2.5rem 1.2rem;
    }

    .cta-box h2 {
        font-size: 2.1rem;
        line-height: 1.15;
    }

    .cta-buttons a {
        width: 100%;
        justify-content: center;
    }

    .floating-whatsapp {
        width: 50px;
        height: 50px;
        right: 1rem;
        bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px));
        font-size: 1.6rem;
    }

    body[data-view="rates"] .floating-whatsapp {
        display: none;
    }
}

/* ==========================================================
   Visual sections: service tiles, timeline, counters
   ========================================================== */

.service-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.2rem;
    max-width: 1060px;
    margin: 0 auto;
}

.service-tile {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: .3rem;
    padding: 1.6rem 1rem 1.3rem;
    text-align: center;
    text-decoration: none;
    color: var(--primary);
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 20px 8px 22px 10px / 10px 22px 8px 20px;
    box-shadow: 5px 5px 0 var(--primary);
    transition: transform .35s cubic-bezier(.65, -0.35, .25, 1.45), box-shadow .3s ease;
    animation: tileFloat 6s ease-in-out infinite;
    animation-delay: calc(var(--i) * -1.4s);
}

.service-tile:nth-child(2) { background: #fef9c3; }
.service-tile:nth-child(3) { background: #e0f2fe; }
.service-tile:nth-child(4) { background: #dcfce7; }

@keyframes tileFloat {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -6px; }
}

.service-tile:hover {
    transform: rotate(-1.5deg) scale(1.03);
    box-shadow: 9px 9px 0 var(--primary);
}

.service-art {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin-bottom: .5rem;
    border-radius: 50%;
    background: var(--primary);
    color: var(--accent);
    font-size: 2rem;
    box-shadow: 4px 4px 0 var(--secondary);
    transition: transform .5s cubic-bezier(.65, -0.35, .25, 1.45);
}

.service-tile:hover .service-art {
    transform: rotate(-12deg) scale(1.1);
}

.service-tile strong {
    font-family: var(--font-heading);
    font-size: 1.55rem;
    font-weight: 400;
    line-height: 1.1;
}

.service-tile small {
    font-size: .88rem;
    color: var(--text-dim);
}

.service-price {
    margin-top: .6rem;
    font-weight: 700;
    font-size: .85rem;
    color: var(--secondary);
}

.service-price i {
    transition: transform .3s ease;
}

.service-tile:hover .service-price i {
    transform: translateX(4px);
}

.trust-row {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .7rem;
    margin-top: 2.2rem;
}

.trust-row li {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem 1rem;
    background: #fff;
    border: 2px dashed rgba(44, 62, 80, .4);
    border-radius: 999px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.trust-row i {
    color: var(--secondary);
}

/* Timeline */
.timeline {
    list-style: none;
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    padding-left: 3.4rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: repeating-linear-gradient(var(--primary) 0 8px, transparent 8px 14px);
    transform-origin: top;
    transform: scaleY(var(--tl-progress, 1));
    transition: transform .2s linear;
}

.tl-item {
    position: relative;
    margin-bottom: 1.4rem;
}

.tl-dot {
    position: absolute;
    left: -3.4rem;
    top: .6rem;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary);
    color: var(--secondary);
    font-size: 1.05rem;
    box-shadow: 3px 3px 0 var(--primary);
}

.tl-item.is-current .tl-dot {
    background: var(--accent);
    color: var(--primary);
}

.tl-card {
    padding: 1.1rem 1.3rem 1.2rem;
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 16px 6px 18px 8px / 8px 18px 6px 16px;
    box-shadow: 5px 5px 0 rgba(44, 62, 80, .85);
}

.tl-item.is-current .tl-card {
    background: #fef9c3;
}

.tl-period {
    display: inline-flex;
    align-items: center;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--secondary);
}

.tl-card h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.15;
    margin-top: .15rem;
}

.tl-company {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: .7rem;
}

.tl-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.tl-tags li {
    font-size: .8rem;
    font-weight: 600;
    padding: .2rem .65rem;
    border-radius: 999px;
    background: var(--bg-dark);
    border: 1.5px solid rgba(44, 62, 80, .25);
}

.js-anim .tl-item {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1);
}

.js-anim .tl-item.is-in {
    opacity: 1;
    transform: none;
}

.js-anim .tl-item.is-in .tl-dot {
    animation: dotPop .6s cubic-bezier(.65, -0.35, .25, 1.45) .15s both;
}

@keyframes dotPop {
    from { transform: scale(0) rotate(-90deg); }
    to { transform: scale(1) rotate(0deg); }
}

/* Achievement counters with icons */
.achievement-strip span i {
    display: block;
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: .3rem;
}

@media (max-width: 900px) {
    .service-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .9rem;
    }
}

@media (max-width: 768px) {
    .service-tile {
        padding: 1.1rem .6rem 1rem;
        animation: none;
    }

    .service-art {
        width: 56px;
        height: 56px;
        font-size: 1.45rem;
    }

    .service-tile strong {
        font-size: 1.25rem;
    }

    .service-tile small {
        font-size: .78rem;
    }

    .timeline {
        padding-left: 2.8rem;
    }

    .timeline::before {
        left: 17px;
    }

    .tl-dot {
        left: -2.8rem;
        width: 38px;
        height: 38px;
        font-size: .9rem;
    }

    .achievement-strip {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .service-tile { animation: none; }
    .js-anim .tl-item { opacity: 1; transform: none; transition: none; }
}

/* Skills marquee */
.skills-wrapper.is-marquee {
    display: grid;
    gap: .9rem;
    overflow: hidden;
    margin: 0 -2rem;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
    display: flex;
    gap: .9rem;
    width: max-content;
    padding: .2rem 0 .4rem;
    animation: marquee 38s linear infinite;
}

.marquee-lane.is-reverse .marquee-track {
    animation-direction: reverse;
    animation-duration: 44s;
}

.marquee-lane:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-track .skill-pill {
    flex: 0 0 auto;
    white-space: nowrap;
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-50% - .45rem)); }
}

@media (max-width: 768px) {
    .stats-row {
        flex-wrap: nowrap !important;
        justify-content: center;
        gap: 1.4rem !important;
        width: 100%;
    }

    .stat-number {
        font-size: 2rem !important;
    }

    .stat-label {
        font-size: .68rem !important;
        text-align: center;
    }

    .marquee-track .skill-pill {
        font-size: .95rem;
        padding: .35rem .9rem;
    }
}

/* ==========================================================
   Phone app shell: real 16px gutters, no overflow, tidy rhythm
   ========================================================== */
.next-page {
    margin: 3rem auto;
}

@media (max-width: 768px) {
    /* The page wraps every section in a second .container: drop the outer padding */
    body > .container {
        padding: 0;
    }

    .container {
        padding: 0 16px;
    }

    .section {
        padding: 2.5rem 0;
    }

    .view:not([data-view="home"]) > section:first-child {
        padding-top: 1.75rem;
    }

    .section-header {
        margin-bottom: 1.6rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1.05rem;
    }

    /* Projects: keep media inside the screen */
    .work-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1.4rem;
    }

    .work-card,
    .work-card.featured {
        min-width: 0;
    }

    .work-card.featured .work-media,
    .work-media {
        min-height: 0 !important;
        width: 100%;
    }

    /* "Next page" card sits evenly between the dashed lines */
    .next-page {
        margin: 2rem 0;
        padding: 1.1rem 1.2rem;
        border-radius: 16px;
        box-shadow: 4px 4px 0 var(--secondary);
    }

    .experience-section,
    .skills-section {
        border-left: 0;
        border-right: 0;
    }

    .timeline {
        max-width: none;
    }

    .cta-box {
        border-radius: 18px;
        box-shadow: 5px 5px 0 var(--primary);
    }

    .site-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

@media (max-width: 768px) {
    .skills-wrapper.is-marquee {
        margin: 0 -16px;
    }
}

@media (max-width: 768px) {
    /* The Contact tab already offers WhatsApp; keep the bubble only on Home */
    body:not([data-view="home"]) .floating-whatsapp {
        display: none;
    }
}
