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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK JP", "Yu Gothic", "Meiryo", sans-serif;
    line-height: 1.8;
    color: #333;
    background-color: #f1e0c6;
    opacity: 0;
    animation: fadeInPage 1.5s ease-in forwards;
    font-feature-settings: "palt" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes fadeInPage {
    to {
        opacity: 1;
    }
}

@keyframes fadeInScroll {
    to {
        opacity: 1;
    }
}

@keyframes fadeInTitle {
    to {
        opacity: 1;
    }
}

@keyframes fadeInSubtitle {
    to {
        opacity: 1;
    }
}

.container {
    max-width: 1000px;
    margin: 0 auto 100px;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Navigation */
.navigation {
    background-color: rgba(255, 255, 255, 0.5);
    color: black;
    padding: 0.5rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease;
}

/* Hide navigation only on non-touch devices > 768px */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
    .navigation {
        transform: translateY(-100%);
    }
}

/* Always show on smaller screens */
@media (max-width: 767px) {
    .navigation {
        transform: translateY(0);
    }
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav a {
    color: black;
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: block;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Hamburger menu button */
.hamburger {
    display: none;
    width: 30px;
    height: 25px;
    position: absolute;
    cursor: pointer;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

.hamburger span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: #333;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.hamburger span:nth-child(1) {
    top: 0px;
}

.hamburger span:nth-child(2) {
    top: 10px;
}

.hamburger span:nth-child(3) {
    top: 20px;
}

.hamburger.open span:nth-child(1) {
    top: 10px;
    transform: rotate(135deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.hamburger.open span:nth-child(3) {
    top: 10px;
    transform: rotate(-135deg);
}

.hero {
    background-color: #333;
    color: white;
    padding: 80px 20px;
    text-align: center;
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    padding-top: 100px;
}

.hero::before {
    content: '';
    position: fixed;
    top: -50px; /* Shift the background container up, which shifts image down relatively */
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 950px;
    opacity: 0.3;
    z-index: 0;
    transition: opacity 0.5s ease-in-out;
    background-image: url('img/hero-warehouses-placeholder.jpg');
    background-repeat: no-repeat;
    background-position: 65% 20%;
    background-size: cover;
    filter: blur(20px);
}


.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: left;
}

.hero-content .container {
    margin-top: 0;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 0.2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    color: #ffffff;
    opacity: 0;
    animation: fadeInTitle 0.6s ease-in forwards;
    animation-delay: 0.3s;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.hero .subtitle {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    margin-top: -0.5rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    color: #ffffff;
    opacity: 0;
    animation: fadeInSubtitle 0.6s ease-in forwards;
    animation-delay: 0.5s;
}

.title-link {
    color: inherit;
    text-decoration: none;
}

.title-link:hover {
    text-decoration: none;
}

.subtitle-nowrap {
    white-space: nowrap;
}


/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    text-decoration: none;
    color: #333;
    z-index: 3;
    cursor: pointer;
    opacity: 0;
    animation: fadeInScroll 1s ease-in forwards;
    animation-delay: 2s;
}

.scroll-indicator:hover .scroll-box {
    transform: scale(1.05);
}

#days-remaining {
    display: inline-block;
    min-width: 1.5em;
    text-align: center;
}

.scroll-arrow {
    margin-top: 5px;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8))
            drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
    animation: gentle-bounce 1s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
}

.scroll-arrow img {
    width: 60px;
    height: auto;
    display: block;
}

@keyframes gentle-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(5px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* Shared content section styles */
.content-section {
    padding: 0;
    color: #333;
    scroll-margin-top: 60px;
    width: 100%;
    overflow: hidden;
}

.content-section .container {
    position: relative;
    z-index: 2;
    padding: 30px;
    border-radius: 0;
    backdrop-filter: blur(25px);
    background-color: rgba(80, 40, 25, 0.9);
    border-top: 2px solid #333;
    border-bottom: 2px solid #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15),
                inset 0 10px 0 0 #5a4037,
                inset 0 -10px 0 0 #5a4037;
    will-change: transform;
    backface-visibility: hidden;
}

@media (min-width: 1024px) {
    .content-section .container {
        padding: 40px 40px !important;
    }
}

.content-section h2 {
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    margin-top: 20px;
}

.content-section h2::after {
    background-color: white;
}

.content-section h2:not(:first-child) {
    margin-top: 60px;
}

.content-section p {
    color: white;
    font-size: 1.3rem;
    line-height: 1.8;
}

.content-section p a {
    color: white;
    font-weight: bold;
    text-decoration: underline;
}

.content-section p a:hover {
    text-decoration: none;
}

.map-container {
    margin: 40px 0 20px;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    filter: invert(90%) hue-rotate(180deg);
}

.map-container iframe {
    width: 100%;
    height: 450px;
    border: 0;
}

@media (max-width: 767px) {
    .map-container {
        margin: 30px 0 0;
    }

    .map-container iframe {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .map-container {
        margin: 30px 0 0;
    }

    .map-container iframe {
        height: 300px;
    }
}

.content-section img {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    margin: 0 0 20px 20px;
}

.content-section img.float-right {
    float: right;
}

.content-section .full-width-image {
    width: 100%;
    margin: 40px 0 0;
    display: block;
    float: none;
    max-width: none;
    height: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    filter: opacity(0.85) contrast(0.9) saturate(0.8);
    border: 6px solid rgba(255, 255, 255, 0.3);
    box-sizing: border-box;
}

/* Clear floats before full-width image */
.content-section .container::after {
    content: "";
    display: table;
    clear: both;
}

.content-section p {
    margin-bottom: 1.5rem;
}

#history .timeline {
    color: white;
}

#history .year {
    color: #ffddaa;
    font-size: 1.3rem;
}

#history p {
    font-size: 1.2rem;
}

/* Sections */
section {
    padding: 60px 0;
}

section:last-child {
    border-bottom: none;
}

h2 {
    font-size: 2rem;
    color: #8B4513;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #5a4037;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 20px 0;
    padding-bottom: 80px;
}

.timeline-item {
    padding: 20px 0;
    position: relative;
    padding-left: 40px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 42px;
    width: 10px;
    height: 10px;
    background-color: #5a4037;
    border-radius: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 14px;
    top: 52px;
    width: 2px;
    height: calc(100% - 8px);
    background-color: #ddd;
}

.timeline-item:last-child::after {
    background: repeating-linear-gradient(
        to bottom,
        white,
        white 5px,
        transparent 5px,
        transparent 10px
    );
    height: 120px;
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
}

.year {
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 0.5rem;
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.feature-card h3 {
    color: #8B4513;
    margin-bottom: 1rem;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

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

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* CTA Section */
#action.cta {
    margin-top: 100px;
}

.cta-buttons {
    text-align: center;
    margin-top: 2rem;
}

.cta-buttons .btn {
    display: inline-block;
    padding: 12px 30px;
    margin: 10px;
    background-color: white;
    color: #333;
    text-decoration: none;
    border-radius: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
    font-weight: bold;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.cta-buttons .btn-secondary {
    background-color: transparent !important;
    color: white !important;
    border: 2px solid white;
}

.cta-buttons .btn-twitter {
    background-color: #1DA1F2 !important;
    color: white !important;
    border: 2px solid #1DA1F2;
    max-width: 90%;
}

.cta-buttons .btn-twitter:hover {
    background-color: #1a91da !important;
    border-color: #1a91da;
    color: white !important;
}

.btn-wikipedia {
    background-color: #fff !important;
    color: #333 !important;
    border: 2px solid #ccc;
}

.btn-wikipedia:hover {
    background-color: #f8f8f8 !important;
}

/* Footer */
footer {
    background-color: rgba(80, 40, 25, 0.9);
    color: white;
    text-align: center;
    padding: 30px 0;
    position: relative;
    z-index: 2;
    border-top: 2px solid #333;
    box-shadow: inset 0 10px 0 0 #5a4037;
}

@media only screen and (max-height: 900px) and (orientation: landscape) {
    .hero::before {
      top: -200px !important; /* Shift the background container up, which shifts image down relatively */
    }
}

@media only screen and (max-height: 600px) and (orientation: landscape) {
    .hero::before {
      top: -250px !important; /* Shift the background container up, which shifts image down relatively */
    }
}

@media only screen and (max-height: 450px) and (orientation: landscape) {
    .hero::before {
      top: -300px !important; /* Shift the background container up, which shifts image down relatively */
    }

    .hero {
        padding-top: 80px;
    }
}

@media (min-width: 1024px) {
    .hero::before {
        background-image: url('img/hero-warehouses.jpg');
        background-repeat: no-repeat;
        background-position: 65% 20%;
        background-size: cover;
        filter: none;
    }
    
    .hero.loaded::before {
        opacity: 1;
    }

    .scroll-box {
        font-size: 2.2rem;
    }

}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero::before {
        background-image: url('img/hero-warehouses.jpg');
        background-repeat: no-repeat;
        background-position: 65% 20%;
        background-size: cover;
        filter: none;
    }
    
    .hero.loaded::before {
        opacity: 1;
    }
}

/* Use mobile background for tablets and below */
@media (max-width: 767px) {
    .hero::before {
        background-image: url('img/hero-warehouses.jpg');
        background-repeat: no-repeat;
        background-position: 65% 20%;
        background-size: cover;
        filter: none;
    }
    
    .hero.loaded::before {
        opacity: 1;
    }

    .hero-content {
      margin-top: 60px;
    }
    
}

/* Tablet and mobile adjustments */
@media (max-width: 767px) {
    .scroll-indicator {
        bottom: 65px;
    }
    /* Navigation fixes for tablets and mobile */
    .navigation {
        padding: 1rem;
        position: fixed;
        min-height: 60px;
        background-color: transparent;
        box-shadow: none;
        backdrop-filter: none;
        transform: translateY(0) !important;
    }
    
    .hamburger {
        display: block;
    }
    
    nav ul {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        flex-direction: column;
        padding: 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    nav ul.active {
        display: flex;
    }
    
    nav a {
        padding: 1rem;
        font-size: 1rem;
        text-align: center;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    nav li:last-child a {
        border-bottom: none;
    }
}

@media (min-width: 768px){
    .content-section img {
        max-width: 450px;
    }
}

/* Tablet size adjustments */
@media (max-width: 767px) and (min-width: 481px) {
    .content-section img {
        max-width: 50%;
    }
    
    .hero {
        padding-top: 0;
    }

    /* Hero section mobile fixes */
    .hero h1 {
        font-size: 3rem;
        white-space: nowrap;
    }

}

/* Responsive */
@media (max-width: 480px) {
    .scroll-box {
        font-size: 1.5rem;
        padding: 6px 14px;
    }

    .content-section img.float-right {
      display: block !important;
      max-width: 100% !important;
      margin: 20px auto !important;
      float: none !important;
    }

    /* Hero section mobile fixes */
    .hero h1 {
        font-size: 2.2rem;
        white-space: nowrap;
    }

    .hero .subtitle {
        font-size: 1.3rem;
        margin-top: -0.5rem;
    }

    .hero {
        padding-top: 0;
        padding-bottom: 0;
    }
    
    /* Content sections mobile */
    .content-section .container {
        padding: 30px 20px;
        border-top: 6px solid #5a4037;
        border-bottom: 6px solid #5a4037;
    }
    
    .content-section img.float-right {
        float: right;
        margin: 0 auto 10px 20px;
    }
    
    footer {
        margin-top: 50px;
    }
    
    .content-section h2 {
        font-size: 1.6rem;
    }
    
    #history .year {
        font-size: 1.1rem;
    }
    
    /* Timeline adjustments for mobile */
    .timeline-item {
        padding-left: 30px;
    }
    
    .timeline-item::before {
        left: 8px;
        top: 36px;
        width: 8px;
        height: 8px;
    }
    
    .timeline-item::after {
        left: 11px;
        top: 44px;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
}

/* Very small screens (iPhone SE/5, etc) */
@media (max-width: 360px) {
    .scroll-indicator {
        bottom: 50px;
    }
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero .subtitle {
        font-size: 1.3rem;
    }

    .subtitle-nowrap {
        white-space: normal;
    }

    .scroll-box {
        font-size: 1.3rem;
        padding: 5px 12px;
    }


    .cta-buttons {
        font-size: 0.7rem;
    }
}

/* Large screens */
@media (min-width: 1440px) {
    .scroll-box {
        font-size: 2rem;
    }

}

/* Extra large screens */
@media (min-width: 1920px) {
    .scroll-box {
        font-size: 3rem;
    }

}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}
