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

html {
    font-size: 62.5%; /* 1rem = 10px */
}

:root {
    --hero-red: #a90b08;
    --hero-dark: #5e0004;
    --ink: #1a1a1a;
    /* --paper: #fff8f0; */
    --paper: #fff;
    --border: #111111;
    --accent: #0d3c61;
    
    /* Typography Scale */
    --fs-body: clamp(1.6rem, 1.4rem + 0.5vw, 1.8rem);
    --fs-small: clamp(1.4rem, 1.2rem + 0.4vw, 1.6rem);
    --fs-h1: clamp(3.2rem, 2.5rem + 2.5vw, 5rem);
    --fs-h2: clamp(2.4rem, 2rem + 1.5vw, 3.2rem);
    --fs-h3: clamp(2rem, 1.6rem + 1vw, 2.8rem);
    --fs-hero-sub: clamp(2.8rem, 2rem + 2.5vw, 5.4rem);
    --fs-slogan: clamp(1.6rem, 1.2rem + 1vw, 2.8rem);
    
    /* Spacing */
    --section-padding: clamp(4rem, 3rem + 3vw, 8rem);
    --content-padding: clamp(1.6rem, 1rem + 1vw, 2.4rem);
}

body {
    font-family: 'Noto Sans TC', 'Segoe UI', sans-serif;
    background: var(--paper);
    color: var(--ink);
    font-size: var(--fs-body);
    line-height: 1.7;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== HERO SECTION ==================== */
.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    color: #fff;
    background: linear-gradient(90deg, var(--hero-red) 0%, var(--hero-red) 65%, #000 65%, #000 100%);
    min-height: clamp(36rem, 37.65vw, 51.2rem);
}

.hero-visual {
    position: absolute;
    bottom: -17%;
    left: 65%;
    transform: translateX(-50%);
    /* 與 hero 高度 (37.65vw) 成正比，圖片約為 hero 高度的 80% */
    width: clamp(27rem, 30vw, 40rem);
    pointer-events: none;
}

.hero-visual img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.hero-content {
    position: relative;
    padding: 1rem;
    z-index: 1;
    opacity: 0;
    animation: riseUp 0.9s 0.6s forwards ease-out;
    max-width: 72rem;
    display: flex;
    flex-direction: column;
    margin-left: clamp(2rem, 10vw, 20rem);
    gap: 0.8rem;
}

.hero-sub {
    letter-spacing: 0.2rem;
    font-size: var(--fs-hero-sub);
    color: #ffbd59;
    font-weight: 700;
    margin: 0 0 0.8rem;
    line-height: 1.1;
}

.hero h1 {
    font-size: var(--fs-h1);
    letter-spacing: 0.1rem;
    margin: 0 0 0.8rem;
    line-height: 1.1;
}

.slogan {
    font-size: var(--fs-slogan);
    color: #fff;
    letter-spacing: 0.1rem;
    margin: 0;
}

.hero-actions {
    display: none;
}

.hero-cta {
    position: absolute;
    transform: translateX(-45%);
    left: 82.5%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.4rem 3.2rem;
    border-radius: 0.2rem;
    border: 0.2rem solid #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: var(--fs-body);
    letter-spacing: 0.2rem;
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.btn.primary {
    background: #fff;
    color: var(--hero-red);
    border-color: #fff;
}

.hero-cta .btn {
    pointer-events: auto;
    background: #ffffff;
    border-color: #ffffff;
    color: #a90b08;
    font-weight: 700;
    /* 與 hero 高度 (37.65vw) 同步縮放 */
    font-size: clamp(1.4rem, 1.4vw, 2rem);
    padding: clamp(1rem, 1.2vw, 1.6rem) clamp(2rem, 2.8vw, 3.6rem);
    letter-spacing: clamp(0.1rem, 0.15vw, 0.25rem);
}

.btn.outline {
    color: var(--hero-red);
    border-color: var(--hero-red);
}

.btn:hover {
    transform: translateY(-0.2rem);
    box-shadow: 0 1.2rem 2.4rem rgba(0, 0, 0, 0.25);
}

/* ==================== SECTIONS ==================== */
section {
    padding: var(--section-padding) var(--content-padding);
}

/* ==================== BRAND INTRO ==================== */
.brand-intro {
    position: relative;
    background-image: url('img/brand-introbg.jpg');
    background-size: cover;
    background-position: center;
    padding: clamp(4rem, 5vw, 8rem) 0;
    overflow: hidden;
}

.brand-intro-content {
    position: relative;
    z-index: 1;
    max-width: 75%;
    margin: 0 auto;
    padding: clamp(2rem, 3vw, 4rem) clamp(2rem, 4vw, 5rem);
    background: rgba(255, 255, 255, 0.85);
    text-align: center;
    backdrop-filter: blur(4px);
}

.brand-intro-title {
    font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.8rem);
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    position: relative;
    display: inline-block;
}

.brand-intro-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 0.8rem;
    background: var(--hero-red);
    opacity: 0.3;
    z-index: -1;
}

.brand-intro-text {
    font-size: clamp(1.4rem, 1.2rem + 0.4vw, 1.6rem);
    color: var(--ink);
    line-height: 1.9;
    margin-bottom: 2rem;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
}

.brand-intro-btn {
    background: transparent;
    color: var(--hero-red);
    border: 2px solid var(--hero-red);
    font-size: clamp(1.4rem, 1.2rem + 0.3vw, 1.6rem);
}

.brand-intro-btn:hover {
    background: var(--hero-red);
    color: #fff;
}

.feature,
.products,
.pillars,
.story-inner {
    max-width: 120rem;
    margin: 0 auto;
    width: 100%;
}

.section-head {
    text-align: center;
    margin-bottom: 2rem;
}

.section-head h2 {
    font-size: var(--fs-h2);
    margin-top: 1.2rem;
}

.feature-text .tag,
.section-head .tag {
    letter-spacing: 0.4rem;
    color: var(--accent);
    font-size: var(--fs-small);
}

/* ==================== FEATURE ==================== */
.feature {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(32rem, 1fr));
    gap: 3.2rem;
    align-items: center;
    margin-top: 2.4rem;
}

.feature-media {
    position: relative;
}

.feature-media img {
    width: 100%;
    display: block;
    border-radius: 1.8rem;
    box-shadow: 0 2rem 3.5rem rgba(0, 0, 0, 0.18);
}

.feature-text h2 {
    font-size: var(--fs-h3);
    margin: 1rem 0;
}

.feature-text p {
    margin: 1rem 0 0 0;
    line-height: 1.8;
}

/* ==================== STORY ==================== */
.story {
    padding: 7.2rem 0;
}

.story-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: stretch;
    max-width: none;
    width: 100%;
    margin: 0;
}

.story-block {
    padding: 3.2rem 3.2rem 3.2rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.4rem;
    background: #fff;
}

.story-gallery {
    min-height: 38rem;
    background: #000;
}

.story-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.story p {
    word-break: break-word;
}

.artisan-line {
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.2rem;
    margin-top: clamp(4rem, 3rem + 3vw, 8rem);
    line-height: 1.6;
    font-size: clamp(2rem, 1.5rem + 2vw, 3.6rem);
    padding: 0 var(--content-padding);
}

/* ==================== PRODUCTS ==================== */
.products {
    display: flex;
    flex-direction: column;
    gap: 8rem;
}

.product-card {
    display: grid;
    grid-template-columns: minmax(28rem, 40rem) 1fr;
    gap: clamp(2.4rem, 2rem + 2vw, 4.8rem);
    margin-bottom: 6rem;
    align-items: start;
}

.product-image-area {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.product-main-image {
    width: 100%;
    border-radius: 0;
    overflow: hidden;
    height: clamp(32rem, 28rem + 10vw, 45rem);
    background: #f7f2eb;
}

.product-main-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.product-thumbnails {
    display: flex;
    flex-direction: row;
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
}

.thumb {
    width: 6rem;
    height: 6rem;
    flex-shrink: 0;
    border-radius: 0;
    border: 0.2rem solid transparent;
    background-color: #f2f2f2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.thumb.active {
    opacity: 1;
    border-color: var(--hero-red);
}

.product-details {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.product-price {
    font-size: var(--fs-body);
    color: var(--hero-red);
    font-weight: 600;
}

.product-name {
    font-size: var(--fs-h1);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.product-subtitle {
    font-size: var(--fs-body);
    color: var(--hero-red);
    font-weight: 600;
    letter-spacing: 0.1rem;
}

.product-description {
    line-height: 1.8;
    color: var(--ink);
    word-break: break-word;
}

.product-description p {
    margin-bottom: 1.2rem;
}

.product-description .label {
    display: inline-block;
    font-weight: 600;
    color: #fff;
    padding: 0.3rem 1.2rem;
    margin-bottom: 0.4rem;
    background-image: url('img/Highlight 紅色.png');
    background-size: 140% 140%;
    background-repeat: no-repeat;
    background-position: center;
}

/* Product Actions */
.product-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.2rem;
    margin-top: 0.8rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid var(--hero-red);
    border-radius: 0.4rem;
    overflow: hidden;
}

.quantity-btn {
    width: 4rem;
    height: 4rem;
    background: #fff;
    border: none;
    font-size: 2rem;
    font-weight: 600;
    color: var(--hero-red);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--hero-red);
    color: #fff;
}

.quantity-input {
    width: 5rem;
    height: 4rem;
    border: none;
    border-left: 2px solid var(--hero-red);
    border-right: 2px solid var(--hero-red);
    text-align: center;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
    /* 隱藏數字輸入框的上下箭頭 */
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Chrome, Safari, Edge 隱藏箭頭 */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input:focus {
    outline: none;
}

.btn-cart {
    background: #fff;
    color: var(--hero-red);
    border: 2px solid var(--hero-red);
}

.btn-cart:hover {
    background: var(--hero-red);
    color: #fff;
}

.btn-buy {
    background: var(--hero-red);
    color: #fff;
    border: 2px solid var(--hero-red);
}

.btn-buy:hover {
    background: var(--hero-dark);
    border-color: var(--hero-dark);
}

/* ==================== PILLARS ==================== */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
    gap: 2.4rem;
}

.pillars-grid article {
    background: #fff;
    padding: 2.4rem;
    border-radius: 2.4rem;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    word-break: break-word;
}

.pillars-grid article h3 {
    font-size: var(--fs-h3);
    line-height: 1.4;
}

.pillars-grid article p {
    font-size: var(--fs-body);
    line-height: 1.8;
}

.pillar-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    margin-bottom: 2rem;
    border-radius: 1.6rem;
    overflow: hidden;
}

.pillar-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pillar-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, background 0.2s;
}

.pillar-nav:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-50%) scale(1.05);
}

.pillar-prev {
    left: 1rem;
}

.pillar-next {
    right: 1rem;
}

/* ==================== FOOTER ==================== */
.footer {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: #fff;
    /* 左黑 65% 右紅 35%，與 hero 相反 */
    background: linear-gradient(90deg, #000 0%, #000 65%, var(--hero-red) 65%, var(--hero-red) 100%);
    min-height: clamp(28rem, 25vw, 40rem);
}

.footer-content {
    position: relative;
    z-index: 1;
    /* 置於左側黑色區域中間 */
    width: 65%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.footer-content h3 {
    font-size: var(--fs-h3);
    margin-bottom: 1.6rem;
}

.footer-content p {
    font-size: var(--fs-body);
    margin-bottom: 0.8rem;
}

.footer a {
    color: #ffbd59;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-visual {
    position: absolute;
    bottom: -17%;
    left: 65%;
    transform: translateX(-50%);
    width: clamp(20rem, 22vw, 32rem);
    pointer-events: none;
    z-index: 2;
}

.footer-visual img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* ==================== ANIMATIONS ==================== */
@keyframes riseUp {
    from {
        transform: translateY(2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== MEDIA QUERIES ==================== */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
    .hero-visual {
        left: 65%;
        /* hero 高度仍為 37.65vw，維持 80% 比例 */
        width: clamp(27rem, 30vw, 40rem);
    }
    
    /* hero-cta 定位不變，與 hero 高度同步 */
    
    .product-card {
        grid-template-columns: minmax(24rem, 35rem) 1fr;
    }
    
    .pillars-grid {
        grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr));
    }
}

/* Tablet Portrait & Large Phone: 600px - 768px */
@media (max-width: 768px) {
    .hero {
        flex-wrap: wrap;
        align-content: center;
        padding: 2rem 0;
    }
    
    .hero-content {
        padding: 2.4rem;
        flex: 0 0 60%;
        max-width: 60%;
    }
    
    .hero-visual {
        left: 65%;
        /* hero 高度仍為 37.65vw，維持 80% 比例 */
        width: clamp(27rem, 30vw, 40rem);
    }
    
    .hero-cta {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        flex: 0 0 100%;
        justify-content: flex-start;
        /* 對齊 hero-content 的文字：margin-left + padding */
        margin-left: clamp(2rem, 10vw, 20rem);
        padding-left: 2.4rem;
        margin-top: 0;
    }
    
    .hero-cta .btn {
        /* 取消 vw 縮放，改用固定大小 */
        font-size: 1.6rem;
        padding: 1.2rem 2.4rem;
        letter-spacing: 0.15rem;
    }
    
    .product-card {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .product-main-image {
        height: 34rem;
    }
    
    .thumb {
        width: 5.2rem;
        height: 5.2rem;
    }
    
    .story-inner {
        grid-template-columns: 1fr;
    }
    
    .story-gallery {
        min-height: 28rem;
        order: -1;
    }
    
    .story-block {
        padding: 2.4rem var(--content-padding);
    }
    
    .pillars-grid {
        grid-template-columns: 1fr;
    }
    
    .brand-intro-content {
        max-width: 85%;
    }
}

/* Mobile: < 560px */
@media (max-width: 560px) {
    html {
        font-size: 58%; /* Slightly smaller base for mobile */
    }
    
    .hero {
        min-height: 45vh;
    }
    
    .hero-content {
        gap: 0.6rem;
        margin-left: 0;
        padding: 1.6rem;
        flex: 0 0 65%;
        max-width: 65%;
    }
    
    .hero-visual {
        left: 65%;
        /* hero 高度改為 45vh，改用 vh 比例 */
        width: clamp(18rem, 36vh, 32rem);
    }
    
    .hero-cta {
        flex: 0 0 100%;
        /* 對齊 hero-content 的文字：margin-left(0) + padding */
        margin-left: 0;
        padding-left: 1.6rem;
    }
    
    .btn {
        padding: 1.2rem 2.2rem;
        letter-spacing: 0.1rem;
        font-size: 1.5rem;
    }
    
    section {
        padding: clamp(3rem, 2rem + 3vw, 6rem) var(--content-padding);
    }
    
    .product-card {
        margin-bottom: 3.2rem;
    }
    
    .product-main-image {
        height: 28rem;
    }
    
    .thumb {
        width: 4.8rem;
        height: 4.8rem;
    }
    
    .pillar-visual {
        aspect-ratio: 4/3;
    }
    
    .pillar-nav {
        width: 3.2rem;
        height: 3.2rem;
        font-size: 1.8rem;
    }
    
    .pillars-grid article {
        padding: 2rem;
        border-radius: 1.8rem;
    }
    
    .artisan-line {
        margin-top: 4rem;
    }
    
    .brand-intro-content {
        max-width: 92%;
        padding: 2rem 1.5rem;
    }
    
    .brand-intro-title::after {
        height: 0.6rem;
    }
    
    .footer {
        min-height: clamp(24rem, 30vw, 36rem);
    }
    
    .footer-content {
        padding: 1.5rem;
    }
    
    .footer-visual {
        width: clamp(16rem, 28vw, 26rem);
    }
}

/* Extra Small Mobile: < 400px */
@media (max-width: 400px) {
    html {
        font-size: 55%;
    }
    
    .hero-content {
        flex: 0 0 70%;
        max-width: 70%;
        padding: 1.2rem;
    }
    
    .hero-visual {
        left: 65%;
        /* hero 高度仍為 45vh，維持 vh 比例 */
        width: clamp(18rem, 36vh, 32rem);
    }
    
    .hero-cta {
        flex: 0 0 100%;
        /* 對齊 hero-content 的文字 */
        padding-left: 1.2rem;
    }
    
    .product-main-image {
        height: 24rem;
    }
    
    .thumb {
        width: 4.4rem;
        height: 4.4rem;
    }
}
