/* ============================================================
   FelixCraft · Design System v15 — Ethereal Minimalism
   ============================================================ */

:root {
  --font: 'Outfit', 'Noto Sans Thai', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', Consolas, ui-monospace, monospace;

  /* ── Light Palette ─────────────────────────────────────── */
  --bg:      #fafbfc;
  --bg2:     #f3f4f6;
  --card:    #ffffff;
  --card2:   #f9fafb;

  --ink:     #111827;
  --ink2:    #374151;
  --muted:   #6b7280;
  --muted2:  #e5e7eb;

  --line:        rgba(0, 0, 0, 0.05);
  --line-strong: rgba(0, 0, 0, 0.10);

  --accent:      #0ea5e9;
  --accent2:     #0284c7;
  --accent3:     #7dd3fc;
  --accent-subtle: rgba(14, 165, 233, 0.04);

  --gradient: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 50%, #22d3ee 100%);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.08);

  --r-xl: 20px;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 7px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Dark Palette ─────────────────────────────────────── */
[data-theme="dark"] {
  --bg:      #09090b;
  --bg2:     #0f0f12;
  --card:    #18181b;
  --card2:   #1c1c21;

  --ink:     #f4f4f5;
  --ink2:    #d4d4d8;
  --muted:   #71717a;
  --muted2:  #27272a;

  --line:        rgba(255, 255, 255, 0.05);
  --line-strong: rgba(255, 255, 255, 0.10);

  --accent:      #38bdf8;
  --accent2:     #7dd3fc;
  --accent3:     #bae6fd;
  --accent-subtle: rgba(56, 189, 248, 0.06);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.20);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.40);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.50);
}

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

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

body {
  min-height: 100svh;
  overflow-x: hidden;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,h2,h3,h4,h5,h6 { line-height: 1.15; font-weight: 600; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
p { color: var(--muted); }

::selection { background: rgba(14, 165, 233, 0.12); }
[data-theme="dark"] ::selection { background: rgba(56, 189, 248, 0.20); }

:where(a,button,[tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Layout ────────────────────────────────────────────── */
.container {
  width: min(1100px, calc(100% - 48px));
  margin-inline: auto;
}
@media (max-width: 560px) {
  .container { width: calc(100% - 28px); }
}

.section {
  padding: 120px 0;
}
@media (max-width: 700px) {
  .section { padding: 80px 0; }
}
.section + .section {
  border-top: 1px solid var(--line);
}

/* ── Section Headers ───────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 540px;
  margin: 0 0 56px;
}
.section-head.center { align-items: center; text-align: center; margin-inline: auto; }

.section-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.10;
  color: var(--ink);
}
.section-title em { font-style: normal; color: var(--accent); }

.section-desc {
  font-size: 0.90rem;
  line-height: 1.75;
  color: var(--muted);
}

/* ── Tile (Card Base) ──────────────────────────────────── */
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.tile:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font: 500 0.82rem/1 var(--font);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(14, 165, 233, 0.25);
}
.btn-primary:hover {
  background: var(--accent2);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.30);
}

.btn-ghost {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--ink2);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.3;
  pointer-events: none;
}

/* Ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  animation: rippleAnim 0.5s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(2.5); opacity: 0; }
}

/* ── Icon Button ────────────────────────────────────────── */
.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-subtle);
}

/* ── Tags & Badges ──────────────────────────────────────── */
.tag {
  display: inline-flex;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card2);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-open { background: rgba(34,197,94,0.07); color: #16a34a; }
.badge-soon { background: rgba(234,179,8,0.07); color: #ca8a04; }
.badge-offline { background: rgba(239,68,68,0.07); color: #dc2626; }

/* ── Utility ────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

section { scroll-margin-top: 80px; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
