/* ========================================================
   WebDev Learning Hub — Base CSS & Typography System
   Primary Font: LINE Seed Sans TH (Fallback: Noto Sans Thai, sans-serif)
   Code Font: JetBrains Mono
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Noto+Sans+Thai:wght@300;400;500;600;700;800&display=swap');

/* LINE Seed Sans TH local declarations with reliable fallback */
@font-face {
  font-family: 'LINE Seed Sans TH';
  src: local('LINE Seed Sans TH Regular'), local('LINE Seed Sans TH'), local('LINESeedSansTH-Regular'), local('LINESeedSansTH');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LINE Seed Sans TH';
  src: local('LINE Seed Sans TH Medium'), local('LINESeedSansTH-Medium');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LINE Seed Sans TH';
  src: local('LINE Seed Sans TH Bold'), local('LINESeedSansTH-Bold');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LINE Seed Sans TH';
  src: local('LINE Seed Sans TH ExtraBold'), local('LINESeedSansTH-ExtraBold'), local('LINESeedSansTH-Heavy');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: var(--lh-normal);
  font-size: var(--fs-body);
  font-weight: 400;
}

/* Monospace & Code Elements */
code, pre, kbd, samp, .font-mono {
  font-family: var(--font-mono);
  font-feature-settings: "liga" 1, "calt" 1;
}

code {
  font-size: 0.86em;
  color: #0284c7;
  background-color: rgba(14, 165, 233, 0.08);
  padding: 0.18em 0.45em;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(14, 165, 233, 0.15);
}

pre {
  font-size: 0.88rem;
  line-height: 1.6;
  border-radius: var(--radius-md);
}

/* Headings Typography Hierarchy */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-sans);
  color: var(--color-text);
  line-height: var(--lh-snug);
  margin-top: 0;
  letter-spacing: -0.015em;
}

h1, .h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

h2, .h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  margin-bottom: 0.65rem;
}

h3, .h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

h4, .h4 {
  font-size: var(--fs-h4);
  font-weight: 600;
  margin-bottom: 0.45rem;
}

h5, .h5 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

h6, .h6 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* Paragraphs & Thai Ergonomic Line Height */
p {
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: var(--lh-relaxed);
}

p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: clamp(1rem, 0.3vw + 0.95rem, 1.15rem);
  line-height: var(--lh-relaxed);
  font-weight: 400;
  color: var(--color-text-secondary);
}

/* Links & Micro-transitions */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* Form Elements Font Inheritance */
input, select, textarea, button, optgroup {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

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

/* ========================================================
   SPECIAL TYPOGRAPHY & KEY PHRASES STYLING
   ======================================================== */

/* 1. "WebDev Learning Hub" */
.highlight-phrase-hub, .text-brand-gradient {
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 50%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 2. "Learn • Code • AI • Create" */
.highlight-phrase-motto, .badge-motto-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.22);
  color: #0f766e;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.06);
}

/* 3. "AI assists. Student decides." */
.highlight-phrase-ai-rule, .badge-ai-rule {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(16, 185, 129, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #0369a1;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

/* 4. "จากพื้นฐานสู่การสร้างผลงานจริง" */
.highlight-phrase-foundation {
  font-weight: 700;
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 60%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 5. "คิด • ทดลอง • แก้ปัญหา • สร้างสรรค์" */
.highlight-phrase-thinking, .badge-process-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #0284c7;
  font-weight: 700;
  font-size: 0.86rem;
}

/* Gradient Text Utilities */
.text-gradient-brand {
  background: linear-gradient(135deg, var(--color-sky) 0%, var(--color-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-sky {
  background: linear-gradient(135deg, var(--color-sky) 0%, var(--color-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-emerald {
  background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Code-inspired Motifs & Eyebrow Labels */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-teal);
  background: rgba(13, 148, 136, 0.08);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(13, 148, 136, 0.2);
  margin-bottom: 0.75rem;
}

.code-motif {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--color-teal);
  background: rgba(13, 148, 136, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  font-size: 0.82em;
}

/* Subtle Glass Surface */
.glass-surface {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Accessibility: Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transform: none !important;
  }
}
