/* ============================================================
   創意印刷設計 — CMYK Creative / Bold Design System
   Cyan · Magenta · Yellow · Key — print studio energy
   Fonts: Bebas Neue (display) + Noto Sans TC (body) + Noto Serif TC (accent)
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Noto+Sans+TC:wght@300;400;500;600;700;900&family=Noto+Serif+TC:wght@400;600;700;900&family=Anton&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Colors — CMYK palette */
  --color-cyan:    oklch(0.65 0.20 230);
  --color-magenta: oklch(0.55 0.25 350);
  --color-yellow:  oklch(0.90 0.18 100);
  --color-key:     oklch(0.15 0.005 300);

  --color-cyan-light:    oklch(0.78 0.15 230);
  --color-magenta-light: oklch(0.70 0.20 350);
  --color-yellow-light:  oklch(0.93 0.14 100);

  --color-cyan-dark:    oklch(0.48 0.18 230);
  --color-magenta-dark: oklch(0.40 0.22 350);
  --color-yellow-dark:  oklch(0.75 0.18 95);

  /* Surfaces */
  --color-surface:       oklch(0.12 0.005 260);
  --color-surface-alt:   oklch(0.15 0.005 260);
  --color-surface-card:  oklch(0.18 0.008 260);
  --color-surface-dark:  oklch(0.08 0.003 260);
  --color-surface-light: oklch(0.22 0.005 260);

  /* Text */
  --color-text:          oklch(0.92 0.002 95);
  --color-text-muted:    oklch(0.62 0.008 260);
  --color-text-inverse:  oklch(0.12 0.005 260);

  /* Borders */
  --color-border:        oklch(0.25 0.01 260);
  --color-border-light:  oklch(0.18 0.005 260);

  /* Typography */
  --font-display:  'Bebas Neue', 'Anton', sans-serif;
  --font-heading:  'Noto Sans TC', sans-serif;
  --font-body:     'Noto Sans TC', sans-serif;
  --font-serif:    'Noto Serif TC', serif;

  --text-scale-ratio: 1.25;
  --text-xs:    clamp(0.64rem, 0.06vw + 0.63rem, 0.70rem);
  --text-sm:    clamp(0.80rem, 0.08vw + 0.78rem, 0.88rem);
  --text-base:  clamp(1.00rem, 0.10vw + 0.98rem, 1.10rem);
  --text-md:    clamp(1.25rem, 0.12vw + 1.22rem, 1.37rem);
  --text-lg:    clamp(1.56rem, 0.15vw + 1.53rem, 1.71rem);
  --text-xl:    clamp(1.95rem, 0.19vw + 1.91rem, 2.14rem);
  --text-2xl:   clamp(2.44rem, 0.24vw + 2.38rem, 2.68rem);
  --text-3xl:   clamp(3.05rem, 0.30vw + 2.98rem, 3.35rem);
  --text-4xl:   clamp(3.81rem, 0.38vw + 3.72rem, 4.19rem);
  --text-5xl:   clamp(4.77rem, 0.48vw + 4.65rem, 5.24rem);

  /* Spacing — 8px base */
  --space-1:  0.5rem;
  --space-2:  1rem;
  --space-3:  1.5rem;
  --space-4:  2rem;
  --space-5:  3rem;
  --space-6:  4rem;
  --space-7:  6rem;
  --space-8:  8rem;

  /* Layout */
  --max-width:        1280px;
  --content-width:    65ch;
  --header-height:    5rem;

  /* Borders & Radii */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px oklch(0 0 0 / 0.3);
  --shadow-md:  0 4px 20px oklch(0 0 0 / 0.4);
  --shadow-lg:  0 8px 40px oklch(0 0 0 / 0.5);
  --shadow-xl:  0 16px 60px oklch(0 0 0 / 0.6);
  --shadow-cyan:    0 0 40px oklch(0.65 0.20 230 / 0.3);
  --shadow-magenta: 0 0 40px oklch(0.55 0.25 350 / 0.3);
  --shadow-yellow:  0 0 40px oklch(0.90 0.18 100 / 0.25);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
  --ease-elastic:  cubic-bezier(0.68, -0.55, 0.27, 1.55);
  --duration-fast:   150ms;
  --duration-normal: 300ms;
  --duration-slow:   500ms;
  --duration-glacial: 800ms;

  /* Grain */
  --grain-opacity: 0.04;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-surface);
  overflow-x: hidden;
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.8'/%3E%3C/svg%3E");
  background-size: 256px;
}

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

a {
  color: var(--color-cyan-light);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-expo);
}

a:hover {
  color: var(--color-yellow);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-cyan), var(--color-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-cmy {
  background: linear-gradient(90deg, var(--color-cyan), var(--color-magenta), var(--color-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Section padding */
.section {
  padding-block: var(--space-7);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  color: var(--color-cyan);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.section-tag::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--color-magenta);
  border-radius: 50%;
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: var(--space-3);
}

.section-title .cn {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--color-magenta-light);
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}

.section-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 55ch;
  margin-inline: auto;
  line-height: 1.8;
}

/* --- Registration Mark (print design signature) --- */
.reg-mark {
  width: 20px;
  height: 20px;
  position: relative;
  display: inline-flex;
}

.reg-mark::before,
.reg-mark::after {
  content: '';
  position: absolute;
  background: currentColor;
}

.reg-mark::before {
  width: 100%;
  height: 1px;
  top: 50%;
  transform: translateY(-50%);
}

.reg-mark::after {
  width: 1px;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 0.875rem 2rem;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out-expo);
  white-space: nowrap;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--color-magenta);
  color: #fff;
  box-shadow: 0 4px 16px oklch(0.55 0.25 350 / 0.35);
  border-color: var(--color-magenta-light);
}

.btn--primary:hover {
  background: var(--color-magenta-light);
  box-shadow: 0 6px 24px oklch(0.55 0.25 350 / 0.5), var(--shadow-magenta);
  transform: translateY(-2px);
  color: #fff;
}

.btn--accent {
  background: var(--color-cyan);
  color: var(--color-surface-dark);
  box-shadow: 0 4px 16px oklch(0.65 0.20 230 / 0.3);
  border-color: var(--color-cyan-light);
}

.btn--accent:hover {
  background: var(--color-cyan-light);
  box-shadow: 0 6px 24px oklch(0.65 0.20 230 / 0.5), var(--shadow-cyan);
  transform: translateY(-2px);
  color: var(--color-surface-dark);
}

.btn--yellow {
  background: var(--color-yellow);
  color: var(--color-surface-dark);
  box-shadow: 0 4px 16px oklch(0.90 0.18 100 / 0.3);
  border-color: var(--color-yellow-light);
}

.btn--yellow:hover {
  background: var(--color-yellow-light);
  box-shadow: 0 6px 24px oklch(0.90 0.18 100 / 0.5), var(--shadow-yellow);
  transform: translateY(-2px);
  color: var(--color-surface-dark);
}

.btn--outline {
  background: transparent;
  color: var(--color-cyan-light);
  border-color: var(--color-cyan);
}

.btn--outline:hover {
  background: var(--color-cyan);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-cyan);
}

.btn--white {
  background: #fff;
  color: var(--color-surface-dark);
  box-shadow: 0 4px 16px oklch(0 0 0 / 0.2);
}

.btn--white:hover {
  background: var(--color-yellow-light);
  transform: translateY(-2px);
  color: var(--color-surface-dark);
}

.btn--lg {
  padding: 1.125rem 2.5rem;
  font-size: var(--text-base);
}

.btn--sm {
  padding: 0.625rem 1.25rem;
  font-size: var(--text-xs);
}

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: oklch(0.10 0.005 260 / 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: all var(--duration-normal) var(--ease-out-expo);
}

.site-header.scrolled {
  background: oklch(0.08 0.003 260 / 0.98);
  box-shadow: var(--shadow-md);
  border-bottom-color: var(--color-magenta);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  text-decoration: none;
  color: var(--color-text);
}

.logo-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text .cn {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 900;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.logo-text .en {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-magenta-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  padding-block: var(--space-1);
  position: relative;
  transition: color var(--duration-fast) var(--ease-out-expo);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-magenta);
  transition: width var(--duration-normal) var(--ease-out-expo);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  padding: 0.5rem 1.25rem !important;
  background: var(--color-magenta) !important;
  color: #fff !important;
  font-weight: 700 !important;
}

.nav-cta::after { display: none !important; }

.nav-cta:hover {
  background: var(--color-magenta-light) !important;
  color: #fff !important;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
  flex-direction: column;
  gap: 6px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all var(--duration-normal) var(--ease-out-expo);
}

/* --- Footer --- */
.site-footer {
  background: var(--color-surface-dark);
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-6) var(--space-4);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.footer-brand .logo { margin-bottom: var(--space-2); }

.footer-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.8;
  max-width: 40ch;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.footer-col a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--duration-fast);
}

.footer-col a:hover {
  color: var(--color-yellow);
}

.footer-bottom {
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* --- CMYK Strip --- */
.cmyk-strip {
  display: flex;
  height: 4px;
  width: 100%;
}

.cmyk-strip span {
  flex: 1;
}

.cmyk-strip .c { background: var(--color-cyan); }
.cmyk-strip .m { background: var(--color-magenta); }
.cmyk-strip .y { background: var(--color-yellow); }
.cmyk-strip .k { background: var(--color-key); }

/* --- Animations --- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes halftone-shift {
  0%, 100% { background-position: 0 0; }
  50% { background-position: 4px 4px; }
}

.reveal {
  animation: reveal-up var(--duration-slow) var(--ease-out-expo) both;
}

/* --- Halftone Pattern --- */
.halftone-bg {
  position: relative;
}

.halftone-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: radial-gradient(circle, var(--color-cyan) 1px, transparent 1px);
  background-size: 8px 8px;
  pointer-events: none;
  z-index: 0;
}

/* --- Registration marks decoration --- */
.reg-marks-deco {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.reg-marks-deco.tl { top: 12px; left: 12px; }
.reg-marks-deco.tr { top: 12px; right: 12px; }
.reg-marks-deco.bl { bottom: 12px; left: 12px; }
.reg-marks-deco.br { bottom: 12px; right: 12px; }

/* --- Page-specific hero backgrounds --- */
.page-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  background: var(--color-surface-dark);
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 60%, oklch(0.65 0.20 230 / 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, oklch(0.55 0.25 350 / 0.10) 0%, transparent 50%);
  z-index: 0;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-block: var(--space-6);
}

.page-hero-tag {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  color: var(--color-magenta);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.page-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.page-hero-title .en {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--color-yellow);
  margin-bottom: var(--space-2);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .section {
    padding-block: var(--space-5);
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
