/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Merriweather', serif;
    background-color: #4eb5ef;
    overflow-x: hidden;
}

/* Scroll snapping for smooth section-to-section scrolling */
html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

section {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

/* Hide problem elements during loading to prevent flash */
html.loading .hero-bg-layer,
html.loading .hero-mt-fuji {
    opacity: 0 !important;
}

/* Pause all animations until page is fully loaded */
body:not(.loaded) * {
    animation-play-state: paused !important;
}

/* Disable animations after they complete (allows scroll-based control) */
body.animations-complete .hero-bg-layer,
body.animations-complete .hero-sun,
body.animations-complete .hero-mt-fuji,
body.animations-complete .hero-horizon,
body.animations-complete .hero-grass,
body.animations-complete .hero-cloud-1,
body.animations-complete .hero-cloud-2,
body.animations-complete .hero-cloud-3,
body.animations-complete .hero-cloud-wisps,
body.animations-complete .fan,
body.animations-complete .logo {
    animation: none !important;
}

/* ============================================
   CHERRY BLOSSOM TREE BRANCHES
   ============================================ */

/* Tree branches - below portfolio/testimonials backplates, above other sections */
.tree-branch-left,
.tree-branch-right {
    position: fixed;
    top: 30px;
    z-index: 2; /* Above background (z-index: 1), below portfolio/testimonials (z-index: 10) and logo (z-index: 12) */
    pointer-events: none;
    max-width: none; /* Ensure full size */
    height: auto;
    opacity: 0; /* Start hidden for animation */
}

.tree-branch-left {
    left: -100px; /* Clip 100px off the left edge by default */
    top: 130px; /* 80px + 50px = 130px */
    animation: slideInFromLeftBranch 2s ease-out 1s forwards;
}

.tree-branch-right {
    right: -100px; /* Clip 100px off the right edge by default */
    animation: slideInFromRightBranch 2s ease-out 1s forwards;
}

/* Show full branches on large screens */
@media (min-width: 1400px) {
    .tree-branch-left {
        left: 0; /* Show full image at full width */
    }
    
    .tree-branch-right {
        right: 0; /* Show full image at full width */
    }
}

/* Branch animations moved to ANIMATIONS section */

/* ============================================
   SAKURA.JS PETALS - Z-INDEX OVERRIDE
   ============================================ */

/* Sakura container - positioned within hero section */
.sakura-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2; /* Below portfolio section (z-index: 3) so fan appears above petals */
    pointer-events: none;
}

/* Override Sakura.js z-index to place petals at z-index 10 
   (same as original hero-blossoms, below fan z-index: 11 and logo z-index: 12) */
.sakura {
    z-index: 10 !important;
    /* Add drop shadow - shadow on bottom-right */
    filter: drop-shadow(2px -2px 2px rgba(42, 99, 147, 0.5));
}

/* Fall animation moved to ANIMATIONS section */

/* ============================================
   TYPOGRAPHY
   ============================================ */

/* H2 Headings - Japanese Pattern with white base */
h2 {
    position: relative;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 48px;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
    color: #ffffff;
    z-index: 1;
    margin: 0 auto;
    white-space: nowrap;
}

/* Pattern overlay on the white text */
h2::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 48px;
    letter-spacing: 2px;
    text-transform: uppercase;
    background-image: url('../images/slices/pattern-1.png');
    background-size: auto;
    background-repeat: repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    z-index: 2;
    white-space: nowrap;
    width: auto;
}

/* H2 Drop Shadow - blue shadow behind */
h2::before {
    content: attr(data-text);
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 48px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #2a6393;
    opacity: 0.5;
    z-index: -1;
}

/* Visually Hidden (for screen readers only) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   HERO SECTION
   ============================================ */

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    height: 520px;
    background-color: #4fb5f0;
    overflow: hidden; /* Hide mountain when it starts below viewport */
    z-index: 1; /* Establish stacking context, lower than portfolio (z-index: 3) */
    /* Background color stays constant to match sunrays image edges */
}

/* Hero background overlay to cover fixed backgrounds from other sections */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #4fb5f0;
    z-index: 0;
    pointer-events: none;
    /* Background color stays constant to match sunrays image edges */
}

/* Hero Background Layer (full width, centered) */
.hero-bg-layer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1920px;
    height: 520px;
    background: url('../images/slices/hero-bg.png') center center no-repeat;
    background-size: auto;
    z-index: 1;
    opacity: 0; /* Start hidden before animation */
    visibility: hidden; /* Prevent flash before animation starts */
    
    /* Animation - starts AFTER sun reaches final position */
    animation: backgroundFadeIn 1s ease-out 3.06s forwards;
}

/* Hero Sun */
.hero-sun {
    position: absolute;
    top: 168px; /* FINAL POSITION */
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    right: 50%;
    
    /* Animation - starts halfway through Mt. Fuji animation */
    animation: sunRise 2s ease-out 1.06s forwards;
    opacity: 0;
}

/* Logo Wrapper (topmost layer) */
.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    margin: 30px auto 30px 180px; /* FINAL POSITION */
    pointer-events: none;
    
    /* Animation - bounces in from top, staggered during fan animation */
    animation: logoDropBounce 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) 6.36s forwards;
    opacity: 0;
}

/* Logo Image */
.logo img {
    position: relative;
    display: block;
    z-index: 2;
}

/* Drop Shadow Utility Class - Light source from top right */
.drop-shadow-wrapper {
    --drop-shadow-image-path: '';
    --drop-shadow-offset-left: -4px;
}

.drop-shadow-wrapper::before {
    content: '';
    position: absolute;
    top: 4px;
    left: var(--drop-shadow-offset-left);
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(#2a6393, #2a6393),
        var(--drop-shadow-image-path) no-repeat;
    background-size: contain;
    background-blend-mode: multiply;
    -webkit-mask: var(--drop-shadow-image-path) no-repeat;
    -webkit-mask-size: contain;
    mask: var(--drop-shadow-image-path) no-repeat;
    mask-size: contain;
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
}

/* Logo Drop Shadow */
.logo {
    --drop-shadow-image-path: url('../images/slices/logo.png');
    --drop-shadow-offset-left: -4px;
}

/* Hero Container (990px centered) */
.hero-container {
    position: relative;
    width: 990px;
    height: 520px;
    margin: 0 auto;
    z-index: 2;
}

/* Hero Cloud 1 */
.hero-cloud-1 {
    position: absolute;
    top: 104px;
    left: 216px; /* FINAL POSITION */
    --final-left: 216px;
    z-index: 4;
    
    /* Animation - slides in from left after sun finishes (first) */
    animation: slideInFromLeft 3s ease-out 3.06s forwards;
    opacity: 0;
}

/* Hero Cloud 2 */
.hero-cloud-2 {
    position: absolute;
    top: 231px;
    right: 157px; /* FINAL POSITION */
    --final-right: 157px;
    z-index: 5;
    
    /* Animation - slides in from right after sun finishes (staggered +0.3s) */
    animation: slideInFromRight 3s ease-out 3.36s forwards;
    opacity: 0;
}

/* Hero Cloud 3 */
.hero-cloud-3 {
    position: absolute;
    top: 280px;
    left: 128px; /* FINAL POSITION */
    --final-left: 128px;
    z-index: 6;
    
    /* Animation - slides in from left after sun finishes (staggered +0.6s) */
    animation: slideInFromLeft 3s ease-out 3.66s forwards;
    opacity: 0;
}

/* Mount Fuji */
.hero-mt-fuji {
    position: absolute;
    top: 600px; /* Start hidden below portfolio */
    left: 173px;
    z-index: 7;
    width: 465px;
    height: 312px;
    
    /* Animation - FIRST element to appear, rises from below portfolio */
    animation: mtFujiRise 1.125s ease-out 0.5s forwards;
}

/* Cloud Wisps */
.hero-cloud-wisps {
    position: absolute;
    top: 141px;
    left: 47%;
    transform: translateX(-50%);
    z-index: 9;
    
    /* Animation - fades in after clouds start sliding */
    animation: fadeIn 2s ease-out 4.06s forwards;
    opacity: 0;
}

/* Hero Horizon - blue rectangle that slides down */
.hero-horizon {
    position: absolute;
    bottom: 0; /* FINAL POSITION (will be -100px after animation) */
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100px;
    background-color: #357dc6;
    z-index: 3; /* Above branches (z-index: 2) and in front of mountain */
    
    /* Animation - slides down with mountain, same timing */
    animation: horizonSlideDown 1.125s ease-out 0.5s forwards;
    /* Background color will be transitioned via JavaScript based on scroll position */
    transition: background-color 0.1s linear;
}

/* Grass silhouette - positioned directly above horizon with 3px overlap */
.hero-grass {
    position: absolute;
    bottom: 97px; /* Positioned 3px lower to overlap horizon (horizon height is 100px, so 100-3=97) */
    left: 0;
    width: 100vw;
    height: 43px; /* Exact height of grass-silhouette.png */
        background-image: url('../images/slices/grass-silhouette.png');
    background-repeat: repeat-x; /* Tile horizontally for wide screens */
    background-position: bottom left;
    background-size: auto 43px; /* Natural size - 43px height, auto width maintains aspect ratio */
    z-index: 8; /* In front of mountain (z-index: 7) within hero stacking context */
    pointer-events: none;
    /* Always visible - independent of horizon opacity */
    opacity: 1;
    /* Animation - moves with horizon, same timing */
    animation: grassMoveWithHorizon 1.125s ease-out 0.5s forwards;
    /* Filter will be applied via JavaScript for scroll-based tinting */
    transition: filter 0.1s linear;
}

/* Retina display support for grass */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-grass {
        background-image: url('../images/slices/grass-silhouette@2x.png');
        /* @2x image scaled to 1x visual size (43px) */
        background-size: auto 43px;
    }
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */

/* Portfolio Section */
.portfolio {
    position: relative;
    width: 100%;
    background-color: #357dc6;
    padding: 100px 0 0 0;
    z-index: 10; /* Higher than hero section (z-index: 1) to ensure portfolio elements (like fan) appear above hero elements (like grass) */
    /* Background color will be transitioned via JavaScript based on scroll position */
    transition: background-color 0.1s linear;
}

/* Fan Wrapper (positioned above portfolio, overlapping hero) */
.fan {
    position: absolute;
    top: -200px; /* FINAL POSITION */
    left: 42%;
    transform: translateX(25%);
    z-index: 12 !important; /* Higher than grass (z-index: 8) to ensure fan appears in front - !important to override any stacking context issues */
    pointer-events: none;
    
    /* Animation - drops down with bounce after blossoms */
    animation: fanDropBounce 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) 6.06s forwards;
    opacity: 0;
}

/* Fan Image */
.fan img {
    position: relative;
    display: block;
    z-index: 2;
}

/* Fan Drop Shadow */
.fan {
    --drop-shadow-image-path: url('../images/slices/fan.png');
    --drop-shadow-offset-left: -8px;
}

/* Cherry Blossoms Wrapper (now in hero section) */
.hero-blossoms {
    position: absolute;
    top: 50px; /* FINAL POSITION - moved down 100px total */
    left: 20%; /* FINAL POSITION */
    z-index: 10;
    pointer-events: none;
    
    /* Animation - snows/falls down from above */
    animation: blossomsSnowDown 2s ease-out 4.06s forwards;
    opacity: 0;
}

/* Cherry Blossoms Image */
.hero-blossoms img {
    position: relative;
    display: block;
    z-index: 2;
}

/* Cherry Blossoms Drop Shadow */
.hero-blossoms {
    --drop-shadow-image-path: url('../images/slices/hero-blossoms.png');
    --drop-shadow-offset-left: -4px;
}

/* Section Content Base Class */
.section-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 60px;
    width: 100%;
}

/* Portfolio Content - wider container */
.portfolio-content {
    position: relative;
    max-width: 1400px;
    padding: 0px 60px 0 60px;
    z-index: 5;
}

/* Section Heading Base Class */
.section-heading {
    margin: 0 auto 10px auto;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-heading::before,
.section-heading::after {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.section-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-heading.visible::before {
    opacity: 0.5;
}

.section-heading.visible::after {
    opacity: 1;
}

/* Portfolio Heading - left aligned with specific positioning */
.portfolio-heading {
    margin: 0 0 10px 0;
    text-align: left;
}

.portfolio-heading::before,
.portfolio-heading::after {
    left: 0;
    transform: none;
}

/* Portfolio subheading - left aligned to match heading */
.portfolio .section-subheading-left {
    text-align: left !important;
    margin: 10px 0 40px 0 !important;
}

/* Fade-in Utility Classes */
.fade-in-up-20 {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up-20.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-up-30 {
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up-30.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section Subheading Left Alignment */
.section-subheading-left {
    text-align: left !important;
    margin: 10px 0 40px 0 !important;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 30px;
    margin-left: -60px;
    margin-right: -60px;
    width: calc(100% + 120px);
}

/* Portfolio Item */
.portfolio-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16/9;
}

/* Portfolio Item Image */
.portfolio-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-item-image {
    transform: scale(1.05);
}

/* Portfolio Item Content - Hidden by default */
.portfolio-item-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 30px;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-item-content {
    opacity: 1;
}

/* Portfolio Item Title */
.portfolio-item-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 18px;
    color: #ffffff;
    margin: 0 0 12px 0;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Portfolio Item Tags */
.portfolio-item-tags {
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #ffffff;
    line-height: 1.5;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   PORTFOLIO MODAL
   ============================================ */

/* Portfolio Modal Overlay */
.portfolio-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.portfolio-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Portfolio Modal Container */
.portfolio-modal {
    position: relative;
    background-color: #473d3b;
    border-radius: 8px;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    padding: 0;
    margin: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.portfolio-modal-content {
    padding: 40px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 90vh;
    flex: 1;
}

/* Custom Scrollbar for Portfolio Modal */
.portfolio-modal-content::-webkit-scrollbar {
    width: 12px;
}

.portfolio-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.portfolio-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.portfolio-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Firefox scrollbar */
.portfolio-modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.2);
}

.portfolio-modal-overlay.active .portfolio-modal {
    transform: scale(1);
}

/* Portfolio Modal Close Button */
.portfolio-modal-close {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #000000;
    border: none;
    color: #ffffff;
    cursor: pointer;
    width: 60px;
    height: 60px;
    padding: 0;
    transition: background-color 0.3s ease;
    z-index: 1001;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    overflow: visible;
    margin: 0;
}

.portfolio-modal-close::before {
    content: '×';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 24px;
    color: #ffffff;
    font-weight: bold;
    line-height: 1;
    z-index: 1;
    transition: transform 0.2s ease;
}

.portfolio-modal-close:hover {
    background-color: #c70000;
}

.portfolio-modal-close:hover::before {
    transform: rotate(90deg);
}

.portfolio-modal-close:focus {
    outline: none;
}

/* Portfolio Modal Header */
.portfolio-modal-header {
    margin-top: 10px;
    margin-bottom: 30px;
    padding-right: 0px;
    box-sizing: border-box;
    max-width: 1000px;
}

/* Portfolio Modal Title */
.portfolio-modal-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 32px;
    color: #ffffff;
    margin: 0;
    padding: 0;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    width: 100%;
    box-sizing: border-box;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    text-align: left;
}

/* Portfolio Modal Media Container */
.portfolio-modal-media-container {
    margin: 0 0 0 0;
    padding-bottom: 30px;
    text-align: center;
    max-width: 1000px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Portfolio Modal Carousel Wrapper */
.portfolio-modal-carousel-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

/* Portfolio Modal Carousel Indicators - Above Image */
.portfolio-modal-carousel-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    order: 1;
}

/* Portfolio Modal Carousel */
.portfolio-modal-carousel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    width: 100%;
    max-height: calc(90vh - 200px); /* Account for modal padding, header, description, button */
    gap: 0;
    order: 2;
    position: relative;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.portfolio-modal-carousel::-webkit-scrollbar {
    display: none;
}

/* Portfolio Modal Carousel Item */
.portfolio-modal-carousel-item {
    flex: 0 0 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    position: relative;
    min-height: 400px; /* Ensure minimum height for videos */
    overflow: visible;
}

/* Portfolio Modal Carousel Image */
.portfolio-modal-carousel-image {
    max-width: 100%;
    max-height: calc(90vh - 200px); /* Account for modal padding, header, description, button */
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
    pointer-events: none; /* Allow clicks to pass through to wrapper */
}

/* Portfolio Modal Carousel Image Wrapper */
.portfolio-modal-carousel-image-wrapper {
    position: relative;
    display: inline-block;
    border-radius: 4px;
    overflow: hidden;
    max-width: 100%;
    max-height: calc(90vh - 200px);
}

/* Portfolio Modal Carousel Video Wrapper */
.portfolio-modal-carousel-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 4px;
    min-height: 400px;
}

.portfolio-modal-carousel-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 4px;
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
    .portfolio-modal-carousel-video-wrapper {
        padding-bottom: 56.25%; /* 16:9 aspect ratio */
        height: 0;
    }
}

/* Portfolio Modal Carousel Navigation Arrows */
.portfolio-modal-carousel-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    background-color: rgba(0, 0, 0, 0.4); /* 60% transparent = 40% opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    pointer-events: none;
    border: none;
}

.portfolio-modal-carousel-nav:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.portfolio-modal-carousel-nav-left {
    left: 0;
    border-radius: 0;
}

.portfolio-modal-carousel-nav-right {
    right: 0;
    border-radius: 0;
}

.portfolio-modal-carousel-image-wrapper:hover .portfolio-modal-carousel-nav.show {
    opacity: 1;
    pointer-events: auto;
}

/* Chevron indicators */
.portfolio-modal-carousel-nav::before {
    content: '';
    width: 24px;
    height: 24px;
    border-style: solid;
    border-width: 3px 3px 0 0;
    border-color: #ffffff;
    transition: transform 0.2s ease;
    position: relative;
    z-index: 21;
}

.portfolio-modal-carousel-nav-left::before {
    transform: rotate(-135deg);
    margin-right: 2px;
}

.portfolio-modal-carousel-nav-right::before {
    transform: rotate(45deg);
    margin-left: 2px;
}

.portfolio-modal-carousel-nav-left:hover::before {
    transform: rotate(-135deg) scale(1.2);
}

.portfolio-modal-carousel-nav-right:hover::before {
    transform: rotate(45deg) scale(1.2);
}

/* Portfolio Modal Single Image Wrapper */
.portfolio-modal-single-image-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Portfolio Modal Single Image Indicators - Above Image */
.portfolio-modal-single-indicator {
    order: 1;
    margin-bottom: 15px;
    margin-top: 0;
}

/* Portfolio Modal Single Image */
.portfolio-modal-image {
    max-width: 1000px;
    width: 100%;
    max-height: calc(90vh - 200px); /* Account for modal padding, header, description, button */
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    order: 2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    order: 2;
}

/* Portfolio Modal Indicator Button */
.portfolio-modal-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background-color: transparent;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    outline: none;
}

.portfolio-modal-indicator:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

.portfolio-modal-indicator.active {
    background-color: #ffffff;
    border-color: #ffffff;
    width: 14px;
    height: 14px;
}

.portfolio-modal-indicator:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Portfolio Modal Description */
.portfolio-modal-description {
    font-family: 'Merriweather', serif;
    font-size: 16px;
    line-height: 1.8;
    color: #ffffff;
    margin-bottom: 20px;
    max-width: 1000px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Single-column layout for full-width content */
.portfolio-modal-description-single-col {
    max-width: 100%;
}

.portfolio-modal-description-single-content {
    width: 100%;
}

.portfolio-modal-description-single-content > p {
    margin-bottom: 16px;
    text-align: left;
    opacity: 0.8;
}

.portfolio-modal-description-single-content > p:last-child {
    margin-bottom: 0;
}

/* Centered text for Unt! Records */
.portfolio-modal-description-centered .portfolio-modal-description-single-content {
    text-align: center;
}

.portfolio-modal-description-centered .portfolio-modal-description-single-content > p {
    text-align: center;
}

.portfolio-modal-description-column {
    text-align: left;
}

.portfolio-modal-description-left {
    margin-bottom: 30px;
}

.portfolio-modal-description-right {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Intro paragraphs (direct children of left column, before Features heading) are justified */
.portfolio-modal-description-left > p {
    margin-bottom: 16px;
    text-align: justify;
    opacity: 0.8;
}

.portfolio-modal-description-left > p:last-of-type {
    margin-bottom: 0;
}

/* Features section (after heading) uses left alignment */
.portfolio-modal-description-left .portfolio-modal-description-heading ~ * {
    text-align: left;
}

/* Credits use left alignment */
.portfolio-modal-description-right p {
    margin-bottom: 16px;
    text-align: left;
    opacity: 0.8;
}

.portfolio-modal-description-right .portfolio-modal-credit-item {
    text-align: left;
}

.portfolio-modal-description-right p:last-child {
    margin-bottom: 0;
}

.portfolio-modal-description p {
    margin-bottom: 16px;
}

.portfolio-modal-description p:last-child {
    margin-bottom: 0;
}

/* Override paragraph margin for credit roles - ensure no top margin */
.portfolio-modal-credit-role {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
}

/* Ensure credit title and role have consistent spacing */
.portfolio-modal-credit-title + .portfolio-modal-credit-role {
    margin-top: 0;
}

.portfolio-modal-description-heading {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #ffffff;
    margin: 24px 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 1;
    text-align: left;
    line-height: normal;
}

.portfolio-modal-description-heading:first-child {
    margin-top: 0;
}

/* Generic highlight style for emphasized inline text */
.text-highlight {
    font-weight: 700;
    font-style: italic;
    color: #ffffff;
    opacity: 1;
}

/* Links inside portfolio modal description (but not buttons) */
.portfolio-modal-description a:not(.portfolio-modal-launch) {
    color: #4fb5f0;
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.portfolio-modal-description a:not(.portfolio-modal-launch):hover {
    text-decoration: underline;
}

.portfolio-modal-description-item {
    margin-left: 0;
    margin-bottom: 12px;
    padding-left: 20px;
    text-align: left;
    position: relative;
    opacity: 0.8;
}

.portfolio-modal-description-item::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #ffffff;
    font-weight: bold;
    opacity: 0.8;
}

/* Credit items */
.portfolio-modal-credit-item {
    margin-bottom: 32px;
    text-align: left;
}

.portfolio-modal-credit-item:last-child {
    margin-bottom: 0;
}

.portfolio-modal-credit-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #ffffff;
    margin: 0 0 4px 0;
    padding: 0;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: 0.3px;
    opacity: 1;
}

.portfolio-modal-credit-title {
    font-family: 'Merriweather', serif;
    font-size: 16px;
    font-style: italic;
    color: #ffffff;
    margin: 0 0 4px 0;
    padding: 0;
    line-height: 1.3;
    opacity: 0.8;
}

.portfolio-modal-credit-role {
    font-family: 'Merriweather', serif;
    font-size: 16px;
    color: #ffffff;
    margin: 0;
    padding: 0;
    line-height: 1.3;
    opacity: 0.8;
    text-align: left;
}

/* Three-column layout styles */
.portfolio-modal-description-col1,
.portfolio-modal-description-col2,
.portfolio-modal-description-col3 {
    margin-bottom: 30px;
}

.portfolio-modal-description-col1 > p,
.portfolio-modal-description-col2 > p,
.portfolio-modal-description-col3 > p {
    margin-bottom: 16px;
    text-align: left;
    opacity: 0.8;
}

.portfolio-modal-description-col1 > p:last-child,
.portfolio-modal-description-col2 > p:last-child,
.portfolio-modal-description-col3 > p:last-child {
    margin-bottom: 0;
}

/* Two columns on wider screens */
@media (min-width: 900px) {
    .portfolio-modal-description {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .portfolio-modal-description-left {
        margin-bottom: 0;
    }
    
    /* Three-column layout for Sock Dreams */
    .portfolio-modal-description-col1,
    .portfolio-modal-description-col2,
    .portfolio-modal-description-col3 {
        margin-bottom: 0;
    }
    
    /* Single-column layout overrides grid */
    .portfolio-modal-description-single-col {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0 !important;
    }
    
    /* Three-column layout on tablet and desktop */
    .portfolio-modal-description-three-col {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 30px;
    }
}

/* Mobile: stack three columns vertically */
@media (max-width: 899px) {
    .portfolio-modal-description-col1,
    .portfolio-modal-description-col2,
    .portfolio-modal-description-col3 {
        margin-bottom: 30px;
    }
    
    .portfolio-modal-description-col3 {
        margin-bottom: 0;
    }
}

/* Portfolio Modal Launch Button */
.portfolio-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: auto;
    padding-top: 30px;
}

.portfolio-modal-launch {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: #ffffff !important;
    background-color: #000000;
    padding: 18px 50px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-decoration: none !important;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

.portfolio-modal-launch:hover {
    background-color: #c70000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: #ffffff !important;
    text-decoration: none !important;
}

.portfolio-modal-launch:active {
    transform: translateY(0);
}

.portfolio-modal-launch:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.portfolio-modal-close:focus-visible {
    outline: none;
}

/* ============================================
   SECTION SUBHEADINGS
   ============================================ */

.section-subheading {
    font-family: 'Satisfy', serif;
    font-weight: 400;
    font-size: 30px;
    color: #ffffff;
    text-align: center;
    margin: 10px auto 40px auto;
    letter-spacing: 1.5px;
    text-transform: none;
}

.about .section-subheading {
    color: #ffd4de;
}

.contact .section-subheading {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============================================
   ABOUT ME SECTION
   ============================================ */

.about {
    position: relative;
    width: 100%;
    background-color: #1a1a1a;
    padding: 100px 0;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

/* About Content - uses base .section-content styles */

/* About Heading - centered with specific positioning */
.about-heading::before,
.about-heading::after {
    left: 50%;
    transform: translateX(-50%);
}

.about-heading::before {
    top: 4px;
}

.about-heading::after {
    top: 0;
    white-space: nowrap;
    width: auto;
}

.about-layout {
    margin-top: 40px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.about-layout.visible {
    opacity: 1;
    transform: translateY(0);
}

.about-layout::after {
    content: "";
    display: table;
    clear: both;
}

.about-image-wrapper {
    float: left;
    shape-outside: circle(calc(50% + 4px));
    margin-right: 40px;
    margin-bottom: 20px;
    width: 300px;
    position: relative;
}

.about-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.about-image-inner {
    position: absolute;
    top: 40px;
    left: 40px;
    right: 40px;
    bottom: 40px;
    width: calc(100% - 80px);
    height: calc(100% - 80px);
    object-fit: cover;
    border-radius: 50%;
    border: 8px solid #e7ad57;
    box-shadow: 0 0 20px rgba(0, 0, 0, 1);
    pointer-events: none;
    transition: transform 0.3s ease;
}

.about-image-wrapper:hover .about-image-inner {
    transform: scale(1.1);
}

.about-text {
    padding-top: 10px;
}

.about-text p {
    font-family: 'Merriweather', serif;
    font-size: 18px;
    line-height: 1.8;
    color: #e7ad57;
    margin-bottom: 20px;
}

.about-hilight {
    color: #ffffff;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-text p.about-text-last {
    text-align: center;
    line-height: 1.8;
    color: #ffd4de;
}

/* ============================================
   SERVICES SECTION
   ============================================ */

.services {
    position: relative;
    width: 100%;
    padding: 100px 0;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
}

.services * {
    cursor: inherit;
}

/* Blue background layer - behind koi animation */
.services::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 40% 30%, #56c8ff 0%, #4eb5ef 45%, #2f8bd1 100%);
    z-index: 0;
}

.koi-animation-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.koi-animation-container .fishesHolder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

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

/* Services Content - uses base .section-content styles */

/* Services Heading - uses base .section-heading styles */

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background: #2b6594;
    padding: 40px 30px;
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.service-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 15px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.service-description {
    font-family: 'Merriweather', serif;
    font-size: 16px;
    line-height: 1.75;
    color: #9ed7ff;
    margin: 0;
}

.services-note {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.6;
    color: #ffffff;
    text-align: center;
    margin-top: 60px;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.services-accessibility {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #ffffff;
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.services-accessibility.visible {
    opacity: 1;
    transform: translateY(0);
}

.services-accessibility em {
    font-style: normal;
    font-weight: 800;
}


.testimonials {
    position: relative;
    width: 100%;
    background-color: #1a1a1a;
    background-image: url('../images/teatime/woodgrain.png');
    background-repeat: repeat;
    background-size: auto;
    background-blend-mode: overlay;
    padding: 120px 0 140px;
    z-index: 10; /* Matches portfolio so branches slip behind the background */
    min-height: 900px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

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

.testimonials-decor {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1920px;
    max-width: none;
    height: 100%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 3;
}

.decor-item {
    position: absolute;
    display: block;
    max-width: none;
    transform-origin: center;
    left: 50%;
    transform: translateX(-50%);
}

.decor-tea {
    top: 60px;
    margin-left: -550px;
}

.decor-matcha {
    top: 335px;
    margin-left: -700px;
}

.decor-teapot {
    top: 600px;
    margin-left: 360px;
}

/* Teapot smoke canvas - spans entire section, smoke positioned at teapot */
.teapot-smoke-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.decor-whisk {
    top: 1250px;
    margin-left: 410px;
}

.decor-leaf-1 {
    top: 900px;
    margin-left: 500px;
}

.decor-leaf-2 {
    top: 120px;
    margin-left: -760px;
}

.decor-leaf-3 {
    top: 200px;
    margin-left: 500px;
}

.decor-leaf-cluster-left {
    top: 320px;
    margin-left: -453px;
}

.decor-leaf-cluster-right {
    top: 1300px;
    margin-left: -160px;
}

.decor-spoon {
    top: 290px;
    margin-left: 450px;
}

.decor-leaves-4 {
    top: 20px;
    margin-left: 380px;
}

.decor-leaf-4 {
    top: 5px;
    margin-left: -450px;
}

.decor-leaves-2 {
    top: 710px;
    margin-left: -50px;
}

@media (max-width: 1400px) {
    .testimonials {
        padding: 100px 0 120px;
        min-height: 820px;
    }
}

@media (max-width: 1200px) {
    .testimonials {
        padding: 90px 0 110px;
        min-height: 780px;
    }
}

@media (max-width: 900px) {
    .testimonials {
        padding: 80px 0 100px;
        min-height: auto;
        background-position: center;
    }
    
    .testimonials-decor {
        display: none;
    }
}

/* Testimonials Content - uses base .section-content styles */

/* Testimonials Heading - uses base .section-heading styles */

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 50px 40px;
    margin-top: 60px;
    position: relative;
    padding: 20px 0;
}

/* Base paper note styling */
.testimonial-card {
    position: relative;
    padding: 35px 40px;
    border-radius: 0;
    transition: transform 0.8s ease, opacity 0.8s ease, box-shadow 0.3s ease;
    cursor: default;
    /* Paper texture as base background */
    background-image: url('../images/slices/crumpled-paper-texture.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    /* Dramatic multi-layer shadows for 3D effect */
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.25),
        0 4px 8px rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Color overlay using pseudo-element with multiply blend mode to tint the texture */
.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Color will be set per note class */
    mix-blend-mode: multiply;
    opacity: 0.5;
    border-radius: 0;
    pointer-events: none;
    z-index: 1;
}

/* Testimonial card uses fade-in-up-30 utility */

/* Hover effect - slight lift with pointer cursor (desktop/tablet only) */
.testimonial-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.3),
        0 6px 12px rgba(0, 0, 0, 0.25),
        0 3px 6px rgba(0, 0, 0, 0.2),
        0 1px 3px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

/* Individual note variations - colors, sizes, rotations, and positioning */

/* Note 1 - Cream paper, straight, 50% wider */
.testimonial-note-1 {
    width: 90%;
    max-width: 630px;
    opacity: 0;
    transform: translateY(30px) rotate(0deg) translateX(-20px) !important;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    z-index: 1;
    position: relative;
}

.testimonial-note-1::before {
    background-color: #fef9e7;
}

.testimonial-note-1.visible {
    opacity: 1;
    transform: translateY(0) rotate(0deg) translateX(-20px) !important;
}

.testimonial-note-1:hover {
    transform: translateY(-5px) rotate(0deg) translateX(-20px) !important;
}

/* Note 2 - Pastel pink, auto height, overlapping note 1 */
.testimonial-note-2 {
    width: 100%;
    max-width: 680px;
    opacity: 0;
    transform: translateY(30px) rotate(-8deg) translateX(-120px) !important;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-top: 20px;
    height: auto;
    z-index: 2;
    position: relative;
}

.testimonial-note-2::before {
    background-color: #ffe4e1;
}

.testimonial-note-2.visible {
    opacity: 1;
    transform: translateY(0) rotate(-8deg) translateX(-120px) !important;
}

.testimonial-note-2:hover {
    transform: translateY(-5px) rotate(-7deg) translateX(-120px) !important;
}

/* Note 3 - Light yellow, rotated left, height adjusts to content */
.testimonial-note-3 {
    width: 100%;
    max-width: 480px;
    opacity: 0;
    transform: translateY(30px) rotate(-6deg) translateX(-5px) !important;
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    margin-top: -10px;
    height: auto;
}

.testimonial-note-3::before {
    background-color: #fffacd;
}

.testimonial-note-3.visible {
    opacity: 1;
    transform: translateY(0) rotate(-6deg) translateX(-5px) !important;
}

.testimonial-note-3:hover {
    transform: translateY(-5px) rotate(-5deg) translateX(-5px) !important;
}

/* Note 4 - Pastel blue, rotated right, taller, moved in by 50px, moved up */
.testimonial-note-4 {
    width: 92%;
    max-width: 440px;
    opacity: 0;
    transform: translateY(30px) rotate(5deg) translateX(-40px) !important;
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    margin-top: 10px;
    padding: 45px 40px;
}

.testimonial-note-4::before {
    background-color: #e0f2f1;
}

.testimonial-note-4.visible {
    opacity: 1;
    transform: translateY(-30px) rotate(5deg) translateX(-40px) !important;
}

.testimonial-note-4:hover {
    transform: translateY(-35px) rotate(6deg) translateX(-40px) !important;
}

/* Typography adjustments for readability on pastel backgrounds */
/* Ensure text appears above texture overlay */
.testimonial-title,
.testimonial-quote,
.testimonial-attribution {
    position: relative;
    z-index: 2;
}

.testimonial-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 18px;
    color: #2a6393;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.testimonial-quote {
    font-family: 'Merriweather', serif;
    font-size: 18px;
    line-height: 1.7;
    color: #473d3b;
    font-style: italic;
    margin: 0 0 25px 0;
    border-left: 4px solid rgba(42, 99, 147, 0.3);
    padding-left: 20px;
}

.testimonial-attribution {
    margin: 0;
}

.testimonial-name {
    font-family: 'Satisfy', serif;
    font-weight: 400;
    font-size: 30px;
    color: #2a6393;
    display: block;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.testimonial-company {
    font-family: 'Merriweather', serif;
    font-size: 16px;
    color: #5a4f4d;
    display: block;
}

.testimonial-company a {
    color: #357dc6;
    text-decoration: none;
    border-bottom: 1px solid rgba(53, 125, 198, 0.4);
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}

.testimonial-company a:hover {
    color: #2a6393;
    border-bottom-color: #2a6393;
}

/* ============================================
   CONTACT SECTION
   ============================================ */

.contact {
    position: relative;
    width: 100%;
    background-color: #367ec7;
    padding: 100px 0 120px 0;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

/* Cloud divider pinned to bottom of contact section */
.contact-cloud-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 2;
    pointer-events: none;
}

/* Shell pattern background overlay - behind all content, fixed when scrolling */
/* Using overlay blend mode with 50% opacity for texture and contrast */
.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/slices/seamless-wave-pattern.jpg');
    background-repeat: repeat;
    background-position: top left;
    background-attachment: fixed;
    opacity: 0.4;
    mix-blend-mode: lighten;
    z-index: 0;
    pointer-events: none;
}

/* Contact Content - uses base .section-content with additional properties */
.contact-content {
    position: relative;
    z-index: 1;
}

/* Contact Heading - uses base .section-heading styles */

.contact-layout {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 60px;
    margin-top: 40px;
    padding: 40px;
    background-image: url('../images/slices/handmade-paper.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
    position: relative;
    overflow: hidden;
    /* Same dramatic multi-layer shadows as testimonial papers */
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.25),
        0 4px 8px rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.contact-layout.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Color overlay with multiply blend mode to tint the paper texture */
.contact-layout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fcc7d4;
    mix-blend-mode: darken;
    opacity: 0.5;
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
}

.contact-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.contact-text p {
    font-family: 'Merriweather', serif;
    font-size: 18px;
    line-height: 1.8;
    color: #473d3b;
    margin-bottom: 20px;
    text-shadow: 0 0 4px rgba(255, 255, 255, 1), 0 0 8px rgba(255, 255, 255, 1), 0 0 12px rgba(255, 255, 255, 0.9), 0 0 16px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.7);
}

.contact-text p:last-child {
    margin-bottom: 0;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

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

.form-group-half {
    margin-bottom: 0;
}

.form-group label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #2a6393;
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 3px rgba(255, 255, 255, 1), 0 0 6px rgba(255, 255, 255, 1), 0 0 9px rgba(255, 255, 255, 0.9), 0 0 12px rgba(255, 255, 255, 0.8);
}

/* Add asterisk to required field labels in contact form */
.contact-form .form-group label::after {
    content: ' *';
    color: #c70000;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    font-family: 'Merriweather', serif;
    font-size: 16px;
    color: #2a6393;
    background-color: #ffffff;
    border: none;
    border-radius: 4px;
    transition: box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Remove browser autofill background color */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #2a6393 !important;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.submit-button {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 16px;
    color: #ffffff;
    background-color: #2a6393;
    padding: 18px 50px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.submit-button:hover {
    background-color: #357dc6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    background-color: #999;
    cursor: not-allowed;
    transform: none;
}

/* Form Message Styles */
.form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
}

.form-message-success {
    background-color: rgba(46, 125, 50, 0.15);
    border: 1px solid #2e7d32;
    color: #1b5e20;
}

.form-message-error {
    background-color: rgba(198, 40, 40, 0.15);
    border: 1px solid #c62828;
    color: #b71c1c;
}

.form-message a {
    color: inherit;
    font-weight: 600;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    width: 100%;
    background-color: #ffffff;
    padding: 40px 0;
    z-index: 1;
    position: relative;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 60px;
    text-align: center;
}

.footer-content p {
    font-family: 'Satisfy', cursive;
    font-weight: 400;
    font-size: 26px;
    color: #473d3b;
    margin: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Branch animations */
@keyframes slideInFromLeftBranch {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRightBranch {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Override the fall animation to keep petals opaque longer */
@keyframes fall {
    0% {
        opacity: 0.9;
        top: 0;
    }
    50% {
        opacity: 0.9; /* Stay opaque until halfway */
    }
    100% {
        opacity: 0.2;
        top: 100%;
    }
}

@-webkit-keyframes fall {
    0% {
        opacity: 0.9;
        top: 0;
    }
    50% {
        opacity: 0.9; /* Stay opaque until halfway */
    }
    100% {
        opacity: 0.2;
        top: 100%;
    }
}

/* Background rays fade in */
@keyframes backgroundFadeIn {
    from {
        opacity: 0;
        visibility: visible;
    }
    to {
        opacity: 1;
        visibility: visible;
    }
}

/* Mt. Fuji rises from below portfolio */
@keyframes mtFujiRise {
    from {
        top: 600px; /* Start below horizon */
    }
    to {
        top: 210px; /* FINAL POSITION */
    }
}

/* Horizon slides down and disappears */
@keyframes horizonSlideDown {
    0% {
        bottom: 0;
        opacity: 1;
    }
    99% {
        bottom: -100px; /* Slides down by its height */
        opacity: 1; /* Stays visible while sliding */
    }
    100% {
        bottom: -100px;
        opacity: 0; /* Becomes invisible at the very end */
    }
}

/* Grass moves down with horizon - always visible */
@keyframes grassMoveWithHorizon {
    0% {
        bottom: 97px; /* Start 3px above horizon (horizon is at bottom: 0) */
    }
    100% {
        bottom: -3px; /* End 3px below viewport (horizon moved to bottom: -100px, so grass moves to -3px to maintain 3px overlap) */
    }
}

/* Sun rises from horizon */
@keyframes sunRise {
    from {
        top: 600px; /* Start below horizon */
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    to {
        top: 168px; /* FINAL POSITION */
        opacity: 1;
    }
}

/* Clouds slide in from left with bounce */
@keyframes slideInFromLeft {
    0% {
        left: -300px;
        opacity: 0;
    }
    70% {
        opacity: 1;
    }
    80% {
        left: calc(var(--final-left, 0px) + 15px); /* Overshoot right */
    }
    90% {
        left: calc(var(--final-left, 0px) - 5px); /* Bounce back left */
    }
    100% {
        opacity: 1;
        /* Left position comes from element's CSS (216px for cloud-1, 128px for cloud-3) */
    }
}

/* Cloud slides in from right with bounce */
@keyframes slideInFromRight {
    0% {
        right: -300px;
        opacity: 0;
    }
    70% {
        opacity: 1;
    }
    80% {
        right: calc(var(--final-right, 0px) + 15px); /* Overshoot left */
    }
    90% {
        right: calc(var(--final-right, 0px) - 5px); /* Bounce back right */
    }
    100% {
        opacity: 1;
        /* Right position comes from element's CSS (157px for cloud-2) */
    }
}

/* Simple fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Cherry blossoms snow/fall down from above */
@keyframes blossomsSnowDown {
    from {
        top: -300px; /* Start higher up */
        opacity: 0;
    }
    to {
        top: 50px; /* FINAL POSITION - moved down 100px total */
        opacity: 1;
    }
}

/* Fan drops down with bounce */
@keyframes fanDropBounce {
    0% {
        top: -600px; /* Start high above */
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    70% {
        top: -190px; /* Overshoot down (subtle) */
    }
    85% {
        top: -205px; /* Bounce back up (subtle) */
    }
    100% {
        top: -200px; /* FINAL POSITION - settle */
        opacity: 1;
    }
}

/* Logo drops down with bounce */
@keyframes logoDropBounce {
    0% {
        margin-top: -200px; /* Start high above */
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    70% {
        margin-top: 40px; /* Overshoot down (subtle) */
    }
    85% {
        margin-top: 25px; /* Bounce back up (subtle) */
    }
    100% {
        margin-top: 30px; /* FINAL POSITION - settle */
        opacity: 1;
    }
}

/* Profile image bounce on hover */
@keyframes profileBounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}


/* ============================================
   RESPONSIVE - TABLET & MOBILE
   ============================================ */

/* Extra Wide Screens - 4 columns and wider container */
@media (min-width: 1600px) {
    .portfolio-content {
        max-width: 1800px;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet - 2 columns */
@media (max-width: 990px) {
    /* Hide right tree branch on tablet */
    .tree-branch-right {
        display: none;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
    }
}

/* Tablet - 2 columns for services and testimonials */
@media (max-width: 990px) and (min-width: 769px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile - 1 column */
@media (max-width: 768px) {
    /* Allow overflow on mobile since elements are in final position */
    .hero {
        overflow: visible;
    }
    
    /* Hide right tree branch on mobile */
    .tree-branch-right {
        display: none;
    }
    
    /* Position logo in top right with equal spacing */
    .logo {
        left: auto !important;
        right: 30px !important;
        transform: translateX(0) !important;
        margin: 30px 0 30px auto !important;
    }
    
    /* Move Mt. Fuji back to previous position */
    .hero-mt-fuji {
        left: -27px;
    }
    
    /* Move fan more to the right off center */
    .fan {
        left: 65%;
        transform: translateX(-50%);
    }
    
    /* Move clouds to the left */
    .hero-cloud-1,
    .hero-cloud-2,
    .hero-cloud-3 {
        transform: translateX(-150px);
    }
    
    /* Move cloud wisps to the left */
    .hero-cloud-wisps {
        left: 30%;
    }
    
    /* Hide cherry blossoms on mobile */
    .hero-blossoms {
        display: none !important;
    }
    
    /* Hide Sakura petals on mobile */
    .sakura {
        display: none !important;
    }
    
    /* Hide Sakura container on mobile */
    .sakura-container {
        display: none !important;
    }
    
    /* Portfolio grid - single column on mobile */
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    /* Reduce portfolio content padding on mobile */
    .portfolio-content {
        padding: 0px 20px 0 20px;
    }
    
    /* Adjust grid negative margins for mobile */
    .portfolio-grid {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
    }
    
    /* Adjust heading size on mobile */
    h2 {
        font-size: 36px;
    }
    
    h2::before,
    h2::after {
        font-size: 36px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* About section - stack layout on mobile */
    .about {
        padding: 100px 0 100px 0;
    }
    
    .about-content {
        padding: 0 20px;
    }
    
    .about-layout {
        flex-direction: column;
        gap: 30px;
    }
    
    .about-image-wrapper {
        float: none;
        shape-outside: none;
        width: 100%;
        max-width: 300px;
        margin: 0 auto 30px auto;
    }
    
    .about-image {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .about-text p {
        font-size: 16px;
    }
    
    /* Services section - single column on mobile */
    .services-content {
        padding: 0 40px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .service-card {
        margin: 0 0;
    }
    
    .services-note {
        font-size: 18px;
        padding: 20px;
    }
    
    .services-accessibility {
        font-size: 14px;
    }
    
    /* Testimonials section - stacked cards on mobile with smaller rotations */
    .testimonials-content {
        padding: 0 20px;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
        padding: 10px 0;
    }
    
    .testimonial-card {
        padding: 30px;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 0 !important;
        justify-self: center !important;
        /* Reset grid positioning for proper stacking */
        grid-column: 1 !important;
        grid-row: auto !important;
        /* No pointer cursor on mobile */
        cursor: default !important;
    }
    
    /* Reset note 3 padding and max-height on mobile */
    .testimonial-note-3 {
        padding: 30px !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Reset note 4 padding on mobile */
    .testimonial-note-4 {
        padding: 30px !important;
    }
    
    /* Mobile styles - note 1 tilted right, note 2 straight, overlapping slightly, note 4 moved down 10px */
    .testimonial-note-1 {
        transform: translateY(30px) rotate(4deg) translateX(-10px) !important;
        max-width: 100% !important;
        z-index: 1;
        margin-bottom: -30px !important;
    }
    
    .testimonial-note-1.visible {
        transform: translateY(0) rotate(4deg) translateX(-10px) !important;
    }
    
    .testimonial-note-1:hover {
        transform: translateY(-5px) rotate(5deg) translateX(-10px) !important;
        cursor: default !important;
    }
    
    .testimonial-note-2 {
        transform: translateY(30px) rotate(0deg) translateX(-10px) !important;
        max-width: 100% !important;
        max-height: none !important;
        padding: 30px !important;
        overflow: visible !important;
        z-index: 2 !important;
        margin-bottom: -30px !important;
    }
    
    .testimonial-note-2.visible {
        transform: translateY(0) rotate(0deg) translateX(-10px) !important;
    }
    
    .testimonial-note-2:hover {
        transform: translateY(-5px) rotate(0deg) translateX(-10px) !important;
        cursor: default !important;
    }
    
    .testimonial-note-3 {
        transform: translateY(30px) rotate(-3deg) translateX(0) !important;
        z-index: 3;
        margin-bottom: -30px !important;
    }
    
    .testimonial-note-3.visible {
        transform: translateY(0) rotate(-3deg) translateX(0) !important;
    }
    
    .testimonial-note-3:hover {
        transform: translateY(-5px) rotate(-2deg) translateX(0) !important;
        cursor: default !important;
    }
    
    .testimonial-note-4 {
        transform: translateY(30px) rotate(3deg) translateX(0) !important;
        z-index: 4;
    }
    
    .testimonial-note-4.visible {
        transform: translateY(10px) rotate(3deg) translateX(0) !important;
    }
    
    .testimonial-note-4:hover {
        transform: translateY(5px) rotate(4deg) translateX(0) !important;
        cursor: default !important;
    }
    
    .testimonial-quote {
        font-size: 16px;
    }
    
    /* Contact section - stack layout on mobile */
    .contact-content {
        padding: 0 20px;
    }
    
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .contact-text p {
        font-size: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-group-half {
        margin-bottom: 25px;
    }
    
    .section-subheading {
        font-size: 28px;
    }
    
    /* Portfolio Modal - Mobile */
    .portfolio-modal {
        max-height: 95vh;
        margin: 10px;
    }
    
    .portfolio-modal-content {
        padding: 30px 20px;
        max-height: 95vh;
    }
    
    .portfolio-modal-header {
        margin-top: 10px;
        padding-right: 0px;
    }
    
    .portfolio-modal-title {
        font-size: 24px;
        letter-spacing: 0.3px;
    }
    
    .portfolio-modal-image {
        max-width: 100%;
        max-height: calc(90vh - 250px); /* Account for mobile modal padding, header, description, button */
    }
    
    .portfolio-modal-carousel {
        max-height: calc(90vh - 250px); /* Account for mobile modal padding, header, description, button */
    }
    
    .portfolio-modal-carousel-image {
        max-height: calc(90vh - 250px); /* Account for mobile modal padding, header, description, button */
    }
    
    .portfolio-modal-carousel-indicators {
        gap: 6px;
        margin-bottom: 12px;
        margin-top: 0;
    }
    
    .portfolio-modal-single-indicator {
        margin-bottom: 12px;
        margin-top: 0;
    }
    
    .portfolio-modal-carousel-nav {
        width: 50%;
    }
    
    .portfolio-modal-carousel-nav::before {
        width: 20px;
        height: 20px;
        border-width: 2px 2px 0 0;
    }
    
    .portfolio-modal-indicator {
        width: 10px;
        height: 10px;
    }
    
    .portfolio-modal-indicator.active {
        width: 12px;
        height: 12px;
    }
    
    .portfolio-modal-buttons {
        flex-direction: column;
        align-items: flex-end;
    }
    
    .portfolio-modal-launch {
        width: auto;
        padding: 16px 30px;
        font-size: 14px;
    }
    
    .portfolio-modal-close {
        top: 0;
        right: 0;
        width: 50px;
        height: 50px;
    }
    
    .portfolio-modal-close::before {
        top: 6px;
        right: 8px;
        font-size: 20px;
    }
    
    /* Footer - mobile */
    .footer-content {
        padding: 0 20px;
    }
    
    .footer-content p {
        font-size: 12px;
    }
}
