/* ============================================
   LOGGIA TAIWAN — loggia.tw
   Official Brand Website — Premium Minimalist
   v2.0 — Clean redesign
   ============================================ */

:root {
  --loggia-navy: #2B2D42;
  --loggia-dark: #1B1B2F;
  --loggia-charcoal: #3A3A4A;
  --loggia-grey: #7A7A8A;
  --loggia-silver: #B0B0BA;
  --loggia-light: #F6F5F3;
  --loggia-warm: #F0EEEA;
  --loggia-white: #FFFFFF;
  --accent: #8C7B5E;
  --text: #1B1B2F;
  --text-light: #7A7A8A;
  --text-mute: #B0B0BA;
  --border: #E8E6E2;
  --font-display: 'Cormorant Garamond', 'Noto Serif TC', Georgia, serif;
  --font-body: 'Inter', 'Noto Sans TC', sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); color: var(--text); background: var(--loggia-white); line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* Typography */
h1, h2, h3 { font-family: var(--font-display); font-weight: 300; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }

.label {
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-mute);
}
.label-gold { color: var(--accent); }
.sub { font-size: 1rem; line-height: 1.85; color: var(--text-light); max-width: 520px; }
.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Container */
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.wrap-sm { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* ========== NAV ========== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--loggia-dark);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo img { height: 32px; filter: brightness(1.6) contrast(1.1); }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  transition: color 0.3s;
}
.nav-links a:hover { color: #fff; }
.nav-cta {
  border: 1px solid rgba(255,255,255,0.25) !important;
  padding: 7px 18px !important;
  color: rgba(255,255,255,0.8) !important;
}
.nav-cta:hover { background: rgba(255,255,255,0.08) !important; border-color: rgba(255,255,255,0.5) !important; }
.nav-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 5px; }
.nav-hamburger span { display: block; width: 20px; height: 1.5px; background: #fff; }

/* ========== HERO ========== */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(27,27,47,0.25) 0%, rgba(27,27,47,0.1) 40%, rgba(27,27,47,0.55) 75%, rgba(27,27,47,0.9) 100%);
}
.hero-body {
  position: relative; z-index: 2;
  text-align: center; color: #fff; padding: 0 24px; max-width: 700px;
}
.hero-body .label { color: rgba(255,255,255,0.5); margin-bottom: 20px; }
.hero-body h1 { margin-bottom: 20px; }
.hero-body .sub { color: rgba(255,255,255,0.6); margin: 0 auto 36px; }
.hero-scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.hero-scroll span { font-size: 0.58rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(255,255,255,0.3); }
.hero-scroll-bar { width: 1px; height: 40px; background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent); animation: pulse 2.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 0.3; transform: scaleY(0.6); } 50% { opacity: 1; transform: scaleY(1); } }

/* ========== BUTTONS ========== */
.btn {
  display: inline-block; font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 13px 34px; border: 1px solid;
  transition: all 0.3s var(--ease); cursor: pointer;
}
.btn-dark { border-color: var(--text); color: var(--text); background: transparent; }
.btn-dark:hover { background: var(--text); color: #fff; }
.btn-light { border-color: rgba(255,255,255,0.4); color: #fff; background: transparent; }
.btn-light:hover { background: rgba(255,255,255,0.1); border-color: #fff; }
.btn-fill { background: var(--text); color: #fff; border-color: var(--text); }
.btn-fill:hover { background: var(--loggia-charcoal); }

/* ========== SECTIONS ========== */
.sec { padding: 120px 0; }
.sec-dark { background: var(--loggia-dark); color: #fff; }
.sec-dark .sub { color: var(--loggia-silver); }
.sec-dark .label { color: var(--loggia-silver); }
.sec-warm { background: var(--loggia-light); }

/* Stats */
.stats { display: flex; justify-content: center; gap: 80px; }
.stat-n { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; line-height: 1; margin-bottom: 6px; }
.stat-l { font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-mute); }
.sec-dark .stat-l { color: var(--loggia-silver); }

/* ========== SPLIT ========== */
.split { display: grid; grid-template-columns: 1fr 1fr; min-height: 520px; }
.split-img { overflow: hidden; }
.split-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.split-img:hover img { transform: scale(1.03); }
.split-txt { display: flex; flex-direction: column; justify-content: center; padding: 80px 64px; }
.split-txt .label { margin-bottom: 14px; }
.split-txt h2 { margin-bottom: 20px; }
.split-txt .sub { margin-bottom: 32px; }

/* ========== PRODUCT GRID ========== */
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.pcard { position: relative; aspect-ratio: 3/4; overflow: hidden; }
.pcard img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.pcard:hover img { transform: scale(1.05); }
.pcard-ov {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(27,27,47,0.85) 0%, rgba(27,27,47,0.1) 50%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 24px;
}
.pcard-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 300; color: #fff; }
.pcard-sub { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-top: 3px; }

/* ========== PACKAGING ROW ========== */
.pkg-row { display: flex; justify-content: center; align-items: flex-end; gap: 48px; flex-wrap: wrap; }
.pkg-item { text-align: center; }
.pkg-item img { height: 160px; width: auto; margin: 0 auto 12px; object-fit: contain; }
.pkg-item span { font-size: 0.72rem; color: var(--text-light); letter-spacing: 0.08em; }

/* ========== HSCROLL ========== */
.hscroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0 24px; }
.hscroll-wrap::-webkit-scrollbar { display: none; }
.hscroll { display: flex; gap: 2px; width: max-content; }
.hscroll-item { position: relative; width: 340px; height: 450px; overflow: hidden; flex-shrink: 0; }
.hscroll-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.hscroll-item:hover img { transform: scale(1.04); }
.hscroll-item-body {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 24px;
  background: linear-gradient(0deg, rgba(27,27,47,0.85), transparent); color: #fff;
}
.hscroll-item-body h3 { font-size: 1.2rem; }
.hscroll-item-body span { font-size: 0.68rem; color: rgba(255,255,255,0.45); letter-spacing: 0.08em; }

/* ========== DOWNLOAD ========== */
.dl-section { margin-bottom: 48px; }
.dl-section h3 { margin-bottom: 20px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.dl-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dl-item { border: 1px solid var(--border); padding: 20px; display: flex; align-items: center; gap: 14px; transition: border-color 0.2s; }
.dl-item:hover { border-color: var(--text); }
.dl-item-icon { color: var(--text-mute); flex-shrink: 0; }
.dl-item-name { font-size: 0.88rem; font-weight: 500; }
.dl-item-meta { font-size: 0.7rem; color: var(--text-mute); margin-top: 2px; }

/* ========== COURSE CARDS ========== */
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.course-card { border: 1px solid var(--border); padding: 40px; transition: border-color 0.2s; }
.course-card:hover { border-color: var(--text); }
.course-card .label { margin-bottom: 14px; }
.course-card h3 { margin-bottom: 14px; }
.course-card p { font-size: 0.9rem; color: var(--text-light); line-height: 1.7; }

/* ========== CONTACT ========== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.contact-item { margin-bottom: 36px; }
.contact-item-label { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 8px; }
.contact-item-value { font-size: 1rem; line-height: 1.8; }
.contact-item-value a { border-bottom: 1px solid var(--border); transition: border-color 0.2s; }
.contact-item-value a:hover { border-color: var(--text); }

/* ========== FOOTER ========== */
.footer { background: var(--loggia-dark); color: #fff; padding: 80px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-logo { height: 56px; margin-bottom: 20px; }
.footer-desc { font-size: 0.82rem; color: var(--loggia-silver); line-height: 1.7; }
.footer-col h4 { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--loggia-silver); margin-bottom: 20px; font-family: var(--font-body); }
.footer-col a { display: block; font-size: 0.82rem; color: rgba(255,255,255,0.5); margin-bottom: 8px; transition: color 0.2s; }
.footer-col a:hover { color: #fff; }
.footer-bar { border-top: 1px solid rgba(255,255,255,0.06); padding-top: 20px; display: flex; justify-content: space-between; font-size: 0.7rem; color: rgba(255,255,255,0.25); }

/* ========== FADE ========== */
.fi { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.fi.visible { opacity: 1; transform: translateY(0); }
.fi-d1 { transition-delay: 0.1s; } .fi-d2 { transition-delay: 0.2s; } .fi-d3 { transition-delay: 0.3s; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .pgrid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .split-txt { padding: 48px 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats { gap: 40px; }
  .dl-list { grid-template-columns: repeat(2, 1fr); }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sec { padding: 80px 0; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: fixed; inset: 0; background: rgba(27,27,47,0.97); justify-content: center; align-items: center; gap: 28px; z-index: 999; }
  .nav-links.open a { font-size: 1rem; color: #fff; }
  .nav-hamburger { display: flex; }
  .pgrid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats { flex-direction: column; gap: 28px; }
  .pkg-row { gap: 24px; }
  .pkg-item img { height: 110px; }
  .hscroll-item { width: 280px; height: 370px; }
  .dl-list { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .fi, .fade-in { opacity: 1; transform: none; }
}

/* ========== LEGACY COMPAT (for brand/contact/downloads/academy/product pages) ========== */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in-d1 { transition-delay: 0.1s; } .fade-in-d2 { transition-delay: 0.2s; } .fade-in-d3 { transition-delay: 0.3s; } .fade-in-d4 { transition-delay: 0.4s; }
.section { padding: 120px 0; }
.section-dark { background: var(--loggia-dark); color: #fff; }
.section-dark .subtitle { color: var(--loggia-silver); }
.section-dark .label { color: var(--loggia-silver); }
.section-warm { background: var(--loggia-light); }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.subtitle { font-size: 1rem; line-height: 1.85; color: var(--text-light); max-width: 520px; }
.label-accent { color: var(--accent); }
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-sm { margin-bottom: 8px; } .mb-md { margin-bottom: 16px; } .mb-lg { margin-bottom: 24px; } .mb-xl { margin-bottom: 40px; } .mb-2xl { margin-bottom: 64px; }
h4 { font-size: 1.1rem; font-weight: 400; font-family: var(--font-display); line-height: 1.15; }

/* Legacy split compat */
.split-content { display: flex; flex-direction: column; justify-content: center; padding: 80px 64px; }
.split-content .label { margin-bottom: 14px; }
.split-content h2 { margin-bottom: 20px; }
.split-content .subtitle { margin-bottom: 32px; }
.split-image { overflow: hidden; }
.split-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.split-reverse { direction: rtl; }
.split-reverse > * { direction: ltr; }

/* Legacy buttons */
.btn-white { border-color: rgba(255,255,255,0.4); color: #fff; background: transparent; }
.btn-white:hover { background: rgba(255,255,255,0.1); border-color: #fff; }
.btn-accent { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-accent:hover { background: var(--accent); color: #fff; }
.btn { display: inline-block; font-size: 0.7rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; padding: 13px 34px; border: 1px solid; transition: all 0.3s var(--ease); cursor: pointer; background: transparent; font-family: var(--font-body); }

/* Legacy product cards */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.product-card { position: relative; aspect-ratio: 3/4; overflow: hidden; }
.product-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.product-card:hover img { transform: scale(1.05); }
.product-card-overlay { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(27,27,47,0.85) 0%, rgba(27,27,47,0.1) 50%, transparent 100%); display: flex; flex-direction: column; justify-content: flex-end; padding: 24px; }
.product-card-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 300; color: #fff; }
.product-card-sub { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-top: 3px; }

/* Legacy category grid */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.category-card { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.category-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.category-card:hover img { transform: scale(1.05); }
.category-card-overlay { position: absolute; inset: 0; background: rgba(27,27,47,0.35); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.category-card-name { font-family: var(--font-display); font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 300; color: #fff; }
.category-card-count { font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.5); }

/* Legacy stat */
.stat-number { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-mute); }
.section-dark .stat-number { color: #fff; }

/* Legacy footer compat */
.footer-brand-logo { height: 56px; margin-bottom: 20px; }
.footer-brand-desc { font-size: 0.82rem; color: var(--loggia-silver); line-height: 1.7; }
.footer-bar-distributor { font-size: 0.7rem; color: rgba(255,255,255,0.25); }

/* Legacy download grid */
.download-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.download-card { border: 1px solid var(--border); padding: 24px; text-align: center; transition: border-color 0.2s; }
.download-card:hover { border-color: var(--text); }
.download-card-icon { font-size: 1.6rem; margin-bottom: 14px; color: var(--text-mute); }
.download-card-title { font-size: 0.85rem; font-weight: 500; }
.download-card-sub { font-size: 0.72rem; color: var(--text-mute); }

/* Legacy hero compat */
.hero-content { position: relative; z-index: 2; text-align: center; color: #fff; padding: 0 24px; max-width: 700px; }
.hero-content .label { color: rgba(255,255,255,0.5); margin-bottom: 20px; }
.hero-content h1 { margin-bottom: 20px; }
.hero-content .subtitle { color: rgba(255,255,255,0.6); margin: 0 auto 36px; }

@media (max-width: 1024px) {
  .product-grid, .category-grid { grid-template-columns: repeat(2, 1fr); }
  .download-grid { grid-template-columns: repeat(2, 1fr); }
  .split-content { padding: 48px 24px; }
}
@media (max-width: 768px) {
  .section { padding: 80px 0; }
  .product-grid, .category-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .footer-bar { flex-direction: column; gap: 8px; }
}
