/* ============================================================
   FelixCraft · Design System — Editorial Collage, Soft Light Blue
   Atelier Zero × Monocle × Apartamento × Études
   ============================================================ */

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

  /* ── Editorial Light Blue Palette ──────────────────────── */
  --bg:          #f0f7ff;
  --bg-grad:     linear-gradient(180deg, #f0f7ff 0%, #e3f1ff 100%);
  --bg2:         #e6f4ff;
  --card:        rgba(255, 255, 255, 0.74);
  --card-solid:  #ffffff;
  --card2:       rgba(240, 249, 255, 0.85);

  --ink:         #0f2c45;
  --ink2:        #1e3a55;
  --muted:       #4f6b85;
  --muted2:      #8ba4bd;

  --line:        rgba(11, 58, 90, 0.10);
  --line-strong: rgba(11, 58, 90, 0.18);

  --accent:        #0f2c45;
  --accent2:       #14679b;
  --accent3:       #38bdf8;
  --accent-glow:   rgba(56, 189, 248, 0.10);
  --accent-subtle: rgba(14, 165, 233, 0.08);

  --gradient:      linear-gradient(135deg, #0f2c45 0%, #0ea5e9 100%);
  --gradient-ice:  linear-gradient(135deg, #0ea5e9 0%, #7dd3fc 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.8) 0%, rgba(230,244,255,0.6) 100%);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.10);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.14);
  --shadow-glow: 0 0 0 rgba(0, 0, 0, 0);

  --r-xl: 6px;
  --r-lg: 4px;
  --r-md: 3px;
  --r-sm: 2px;
  --r-pill: 999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Dark Blue Palette ──────────────────────────────────── */
[data-theme="dark"] {
  --bg:          #0d1f33;
  --bg-grad:     linear-gradient(180deg, #0d1f33 0%, #0a1828 100%);
  --bg2:         #0f2439;
  --card:        rgba(16, 34, 53, 0.74);
  --card-solid:  #0f2439;
  --card2:       rgba(12, 27, 44, 0.85);

  --ink:         #e8f3fd;
  --ink2:        #d3e9fb;
  --muted:       #9bb8d0;
  --muted2:      #4a6c8a;

  --line:        rgba(200, 230, 255, 0.10);
  --line-strong: rgba(200, 230, 255, 0.18);

  --accent:        #e8f3fd;
  --accent2:       #7dd3fc;
  --accent3:       #38bdf8;
  --accent-glow:   rgba(56, 189, 248, 0.14);
  --accent-subtle: rgba(56, 189, 248, 0.10);

  --gradient:      linear-gradient(135deg, #e8f3fd 0%, #38bdf8 100%);
  --gradient-ice:  linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  --gradient-card: linear-gradient(145deg, rgba(16,34,53,0.8) 0%, rgba(10,24,40,0.6) 100%);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.20);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.40);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.50);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.60);
  --shadow-glow: 0 0 0 rgba(0, 0, 0, 0);
}

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

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

html, body, .navbar, .tile, .btn, .tag, .badge, .icon-btn, .ip-chip, #hero-clock {
  transition: background-color 0.45s var(--ease),
              color 0.35s var(--ease),
              border-color 0.35s var(--ease),
              box-shadow 0.45s var(--ease);
}

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

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

::selection { background: rgba(14, 165, 233, 0.2); color: var(--ink); }

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

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

.section {
  padding: 120px 0;
  position: relative;
}
@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;
  padding: 4px 12px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  width: fit-content;
  box-shadow: none;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}
.section-title em {
  font-style: normal;
  font-weight: 700;
}

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

/* ── Tile (Card Base) ──────────────────────────────────── */
.tile {
  background: var(--gradient-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), border-color 0.35s ease, box-shadow 0.35s ease;
  will-change: transform;
}
.tile:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: none;
}
.btn-primary:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--ink2);
  backdrop-filter: blur(16px);
}
.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--accent-subtle);
  box-shadow: none;
  transform: translateY(-1px);
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.5);
}

/* ── Icon Button ────────────────────────────────────────── */
.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--accent-subtle);
  color: var(--ink2);
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s var(--ease-bounce);
}
.icon-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: rgba(14, 165, 233, 0.1);
  transform: scale(1.05);
}

/* ── Tags & Badges ──────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
}
.tag:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-open { background: rgba(34, 197, 94, 0.08); color: #16a34a; border: 1px solid rgba(34, 197, 94, 0.2); }
.badge-soon { background: rgba(234, 179, 8, 0.08); color: #d97706; border: 1px solid rgba(234, 179, 8, 0.2); }
.badge-offline { background: rgba(239, 68, 68, 0.08); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.2); }

[data-theme="dark"] .badge-open { color: #4ade80; }
[data-theme="dark"] .badge-soon { color: #fbbf24; }
[data-theme="dark"] .badge-offline { color: #f87171; }

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

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

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(14, 165, 233, 0.35); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

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