@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --midnight: #16352d;
  --midnight-2: #21443a;
  --gold: #d1aa73;
  --ivory: #fbf6ed;
  --teal: #2f8f8a;
  --violet: #7c6ee6;
  --ink: #111827;
  --slate: #475467;
  --mist: #d0d5dd;
  --white: #f9fafb;
  --line: rgba(214, 168, 79, 0.28);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: "Noto Sans TC", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.container {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.section {
  padding: clamp(72px, 9vw, 128px) 0;
}

.section-tight {
  padding: clamp(56px, 7vw, 96px) 0;
}

.dark {
  background: var(--midnight);
  color: var(--white);
}

.serif {
  font-family: "Noto Sans TC", Inter, system-ui, sans-serif;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 780ms ease, transform 780ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 700;
  gap: 10px;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--gold);
  color: #172033;
}

.btn-secondary {
  background: rgba(22, 53, 45, 0.08);
  border-color: rgba(22, 53, 45, 0.16);
  color: var(--midnight);
}

.dark .btn-secondary {
  background: rgba(251, 246, 237, 0.08);
  border-color: rgba(251, 246, 237, 0.2);
  color: var(--white);
}

.btn-ivory {
  background: var(--ivory);
  color: var(--midnight);
}

.kicker {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
}

.section-title {
  font-family: "Noto Sans TC", Inter, system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.18;
  margin: 0;
}

.section-copy {
  color: var(--slate);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  margin: 20px 0 0;
  max-width: 760px;
}

.dark .section-copy {
  color: var(--mist);
}

.grid-texture {
  position: relative;
}

.grid-texture::before {
  background-image:
    linear-gradient(rgba(214, 168, 79, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 158, 158, 0.07) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(180deg, black, transparent 82%);
  pointer-events: none;
  position: absolute;
}

.card {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(16, 24, 40, 0.1);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}

.sacred-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 244, 236, 0.72)),
    radial-gradient(circle at 100% 0%, rgba(214, 168, 79, 0.14), transparent 34%);
  border: 1px solid rgba(16, 24, 40, 0.1);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
  overflow: hidden;
  position: relative;
}

.sacred-card::after {
  background-image: linear-gradient(rgba(214, 168, 79, 0.1) 1px, transparent 1px);
  background-size: 100% 11px;
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 220ms ease;
}

.sacred-card:hover {
  border-color: rgba(209, 170, 115, 0.7);
  transform: translateY(-5px);
}

.sacred-card:hover::after {
  opacity: 1;
}

.page-hero {
  background:
    radial-gradient(circle at var(--mx, 70%) var(--my, 25%), rgba(209, 170, 115, 0.16), transparent 28%),
    radial-gradient(circle at 20% 20%, rgba(47, 143, 138, 0.16), transparent 32%),
    linear-gradient(135deg, #fdfaf4, #f5efe3 52%, #ede3d1);
  color: var(--midnight);
  min-height: 0;
  padding: 112px 0 28px;
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  background: linear-gradient(180deg, transparent, rgba(22, 53, 45, 0.04));
  bottom: 0;
  content: "";
  height: 180px;
  left: 0;
  position: absolute;
  right: 0;
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  font-family: "Noto Sans TC", Inter, system-ui, sans-serif;
  font-size: clamp(3rem, 8vw, 6.8rem);
  letter-spacing: 0;
  line-height: 1.02;
  margin: 0;
  max-width: 900px;
}

.page-hero p {
  color: rgba(22, 53, 45, 0.78);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  margin: 24px 0 0;
  max-width: 760px;
}

.page-hero.course-detail-hero .page-hero-eyebrow {
  font-size: clamp(1.6rem, 2vw, 1.9rem);
  margin-bottom: 12px;
}

.page-hero.course-detail-hero h1 {
  font-size: clamp(1.7rem, 2.9vw, 3rem);
  line-height: 1.18;
  max-width: 980px;
}

.page-hero.course-detail-hero p {
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  margin-top: 18px;
}

.page-hero h1 {
  color: var(--midnight);
}

.split {
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: center;
}

.feature-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.transform-section .service-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.two-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-frame {
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(214, 168, 79, 0.32);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.media-frame img {
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease;
  width: 100%;
}

.media-frame:hover img {
  transform: scale(1.03);
}

.media-frame::before {
  background: linear-gradient(108deg, transparent 24%, rgba(255, 255, 255, 0.16) 46%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.14) 54%, transparent 74%);
  content: "";
  inset: -12% -42%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-130%) skewX(-14deg);
  transition: transform 780ms ease, opacity 260ms ease;
  z-index: 2;
}

.media-frame:hover::before {
  opacity: 1;
  transform: translateX(130%) skewX(-14deg);
}

.media-frame::after {
  background: linear-gradient(180deg, transparent, rgba(209, 170, 115, 0.22));
  content: "";
  inset: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 240ms ease;
}

.media-frame:hover::after {
  opacity: 1;
}

.marquee {
  background: var(--midnight);
  color: var(--ivory);
  overflow: hidden;
  position: relative;
}

.marquee::before,
.marquee::after {
  background: linear-gradient(90deg, rgba(22, 53, 45, 1), rgba(22, 53, 45, 0));
  bottom: 0;
  content: "";
  position: absolute;
  top: 0;
  width: 90px;
  z-index: 2;
}

.marquee::after {
  left: auto;
  right: 0;
  transform: scaleX(-1);
}

.marquee-track {
  animation: marquee 30s linear infinite;
  display: flex;
  gap: 14px;
  padding: 18px 0;
  width: max-content;
}

.ribbon-pill {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: var(--ivory);
  display: inline-flex;
  font-weight: 700;
  gap: 10px;
  letter-spacing: 0;
  padding: 10px 18px;
  white-space: nowrap;
}

.ribbon-pill strong {
  color: var(--gold);
  font-size: 1rem;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 980px) {
  .split,
  .two-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .transform-section .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .container {
    width: min(100% - 28px, 1160px);
  }

  .feature-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .transform-section .service-grid {
    grid-template-columns: 1fr;
  }

  .page-hero {
    padding: 96px 0 20px;
  }

  .page-hero.course-detail-hero .page-hero-eyebrow {
    font-size: 1.28rem;
  }

  .page-hero.course-detail-hero h1 {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
