/* ============================================================
   賢記紙業 Hsien Ji Paper — 新生・彩蘊 (New Life & Color)
   Shared design tokens, navbar, footer, buttons, animations
   Design rule: NO rounded corners. Bold flat color. High contrast.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans TC', 'Space Grotesk', sans-serif;
  color: #1A1A1A;
  background: #FFFFFF;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul { list-style: none; }

/* ---------- Tokens ---------- */
:root {
  --coral: #0000FF;
  --coral-warm: #0000FF;
  --coral-hover: #0000CC;
  --teal: #4ECDC4;
  --yellow: #FFE66D;
  --navy: #1A1A2E;
  --ink: #1A1A1A;
  --bg-soft: #FAFAFA;
  --bg-cream: #F9F6F1;
  --line: #E0DDD8;

  --display: 'Space Grotesk', 'Noto Sans TC', sans-serif;
  --serif: 'Noto Serif TC', serif;
  --sans: 'Noto Sans TC', sans-serif;
  --hand: 'Caveat', cursive;
}

/* ---------- Helpers ---------- */
.display { font-family: var(--display); }
.serif { font-family: var(--serif); }
.hand { font-family: var(--hand); }
.coral { color: var(--coral); }
.teal { color: var(--teal); }

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.eyebrow .bar { width: 1.5rem; height: 2px; background: var(--coral); flex: none; }
.eyebrow span {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coral);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.9rem 1.75rem;
  transition: transform .18s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { transform: scale(1.04); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { background: var(--coral-hover); }
.btn-outline-dark { border: 2px solid var(--ink); color: var(--ink); background: transparent; }
.btn-outline-dark:hover { transform: scale(1.04); }
.btn-outline-light { border: 2px solid rgba(255,255,255,.3); color: #fff; }
.btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,.1); }
.btn .arrow { transition: transform .2s ease; display: inline-flex; }
.btn:hover .arrow { transform: translateX(4px); }

/* SVG icon sizing */
.icon { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 4rem;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(6px);
  transition: background .3s ease, box-shadow .3s ease;
}
.nav.scrolled {
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.55rem; }
.brand-mark {
  width: 2rem; height: 2rem;
  background: var(--coral);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 900; color: #fff;
  font-size: 0.9rem; line-height: 1;
}
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.2rem; line-height: 1.15; color: var(--coral); letter-spacing: 0.01em; }
.brand-en {
  font-family: var(--hand); font-size: 0.85rem; font-weight: 700; line-height: 1.15;
  background: linear-gradient(95deg, #FF1744 0%, #FF9100 16%, #FFEA00 33%, #00E676 50%, #00E5FF 66%, #2979FF 83%, #D500F9 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.nav-links { display: none; align-items: center; gap: 2rem; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-link {
  position: relative;
  font-family: var(--display);
  font-size: 0.9rem; font-weight: 500;
  color: var(--navy);
  transition: color .2s ease;
  padding: 0.25rem 0;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  height: 2px; width: 0; background: var(--coral);
  transition: width .3s ease;
}
.nav-link:hover { color: var(--coral); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--coral); }
.nav-link.active::after { width: 100%; }
.nav-cta {
  background: var(--coral); color: #fff;
  font-family: var(--display); font-weight: 600; font-size: 0.9rem;
  padding: 0.5rem 1.25rem; transition: background .2s ease;
}
.nav-cta:hover { background: var(--coral-hover); }
.nav-toggle { display: flex; color: var(--navy); }
@media (min-width: 768px) { .nav-toggle { display: none; } }
.nav-toggle .icon { width: 24px; height: 24px; }

.mobile-menu {
  display: none;
  background: var(--navy);
  color: #fff;
  padding: 1.5rem;
  flex-direction: column;
  gap: 1.25rem;
}
.mobile-menu.open { display: flex; }
.mobile-link { font-family: var(--display); font-size: 1rem; font-weight: 500; color: rgba(255,255,255,.8); }
.mobile-link.active { color: var(--coral); }
.mobile-menu .nav-cta { width: 100%; text-align: center; margin-top: 0.5rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--navy); color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2.25rem 1.75rem;
  padding: 3.5rem 0;
}
.footer-grid > div:first-child { grid-column: 1 / -1; }
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 3rem; padding: 4rem 0; }
  .footer-grid > div:first-child { grid-column: auto; }
}
.footer h4 {
  font-family: var(--display); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: #1E90FF;
  margin-bottom: 1.25rem;
}
.footer-links { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-links a { color: rgba(255,255,255,.78); font-size: 0.9rem; transition: color .2s ease; }
.footer-links a:hover { color: #fff; }
.footer-brand-name { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: #1E90FF; line-height: 1.15; }
.footer-brand-sub { font-family: var(--hand); font-size: 0.9rem; font-weight: 700; line-height: 1.15; background: linear-gradient(95deg, #FF1744 0%, #FF9100 16%, #FFEA00 33%, #00E676 50%, #00E5FF 66%, #2979FF 83%, #D500F9 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.footer-desc { color: rgba(255,255,255,.72); font-size: 0.9rem; line-height: 1.6; margin-top: 0.25rem; }
.footer-social { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.footer-social a {
  width: 2.25rem; height: 2.25rem; border: 1px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7);
  transition: color .2s ease, border-color .2s ease;
}
.footer-social a:hover { color: var(--coral); border-color: var(--coral); }
.footer-social .icon { width: 16px; height: 16px; }
.footer-contact { display: flex; flex-direction: column; gap: 1rem; }
.footer-contact li { display: flex; gap: 0.75rem; align-items: flex-start; color: rgba(255,255,255,.78); font-size: 0.9rem; line-height: 1.55; }
.footer-contact .icon { width: 19px; height: 19px; color: #1E90FF; margin-top: 0.1rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.16);
  padding: 1.5rem 0;
  display: flex; flex-direction: column; gap: 0.75rem;
  align-items: center; justify-content: space-between;
}
@media (min-width: 768px) { .footer-bottom { flex-direction: row; } }
.footer-bottom p { color: rgba(255,255,255,.68); font-size: 0.75rem; }
.footer-bottom .links { display: flex; gap: 1.5rem; }
.footer-bottom .links a { color: rgba(255,255,255,.68); font-size: 0.75rem; transition: color .2s ease; }
.footer-bottom .links a:hover { color: #fff; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity .8s ease, transform .8s ease; }
.reveal-left.in { opacity: 1; transform: none; }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity .8s ease, transform .8s ease; }
.reveal-right.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right { opacity: 1 !important; transform: none !important; transition: none; }
}

/* Section rhythm */
.section { padding: 6rem 0; }
.section-head { margin-bottom: 3.5rem; }
.section-head h2 {
  font-family: var(--display); font-weight: 900; color: var(--navy);
  font-size: clamp(2.25rem, 4vw, 3rem); line-height: 1.1;
}
