/* css/global.css */

/* ═══════════════════════════════════════════════════════
   BRAND VARIABLES
   ═══════════════════════════════════════════════════════ */
:root {
  /* Colours (Aliased to support both legacy formats) */
  --midnight:        #080D14;
  --color-midnight:  #080D14;
  
  --deep:            #0D1520;
  --color-deep:      #0D1520;
  
  --surface:         #111C2E;
  --color-surface:   #111C2E;
  
  --lime:            #CAFF70;
  --color-lime:      #CAFF70;
  
  --teal:            #00C9D4;
  --color-teal:      #00C9D4;
  
  --violet:          #8B6CF7;
  --color-violet:    #8B6CF7;
  
  --white:           #FFFFFF;
  --color-white:     #FFFFFF;

  /* Typography (Default EN) */
  --font-heading:    'Space Grotesk', sans-serif;
  --font-body:       'DM Sans', sans-serif;
  --font-mono:       'JetBrains Mono', monospace;
}

/* Language Override */
body.lang-th {
  --font-heading: 'Prompt', sans-serif;
  --font-body: 'Prompt', sans-serif;
}
body.lang-ja {
  --font-heading: 'Noto Sans JP', sans-serif;
  --font-body: 'Noto Sans JP', sans-serif;
}

:root {

  /* Spacing */
  --section-y:       48px;
  --section-pad-y:   48px;
  --hero-y:          64px;
  --section-hero:    64px;
  --section-compact: 24px;
  
  --container-max:   1200px;
  --container-pad:   40px;
  --container-pad-x: 40px;

  /* Radii */
  --radius-card:     12px;
  --radius-btn:      100px;
  --radius-tag:      100px;

  /* Nav */
  --nav-h:           56px;

  --ease:            150ms ease;
  --transition-base: 150ms ease;
}

/* ═══════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

::selection { background: var(--lime); color: var(--midnight); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--midnight); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

@keyframes pageFadeIn {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

body {
  background: var(--midnight);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  animation: pageFadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

*:focus-visible { outline: 2px dashed var(--lime); outline-offset: 4px; border-radius: 2px; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font-family: inherit; cursor: pointer; }

/* ═══════════════════════════════════════════════════════
   SHARED LAYOUT UTILITIES
   ═══════════════════════════════════════════════════════ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section, .sec { padding: var(--section-y) 0; }
.section--deep, .sec--deep { background: var(--deep); padding: var(--section-y) 0; }
.section--compact { padding: var(--section-compact) 0; }

.divider { border: none; border-top: 1px solid rgba(255,255,255,0.07); }

/* ── Section tag (small overline label) ── */
.section-tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 9px;
  font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--lime);
  margin-bottom: 12px;
}
.section-tag--teal   { color: var(--teal); }
.section-tag--violet { color: var(--violet); }
.section-tag--center { display: block; text-align: center; }

/* ── Headings ── */
.h1 { font-family: var(--font-heading); font-size: 48px; font-weight: 700; line-height: 1.06; color: var(--white); }
.h2 { font-family: var(--font-heading); font-size: 36px; font-weight: 700; line-height: 1.1; color: var(--white); }
.h2--center { text-align: center; }
.h2 em, .h1 em { font-style: normal; color: var(--lime); }
.h3 { font-family: var(--font-heading); font-size: 16px; font-weight: 700; color: var(--white); letter-spacing: 0.04em; text-transform: uppercase; }

/* ── Body text variants ── */
.body-lead { font-size: 14px; color: rgba(255,255,255,0.55); line-height: 1.78; }
.body-dim  { font-size: 13px; color: rgba(255,255,255,0.4);  line-height: 1.65; }
.mono-label { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-heading); font-size: 12px; font-weight: 700;
  color: var(--midnight); background: var(--lime); border: none;
  border-radius: var(--radius-btn); padding: 10px 22px;
  transition: opacity var(--ease), box-shadow var(--ease); white-space: nowrap; text-decoration: none;
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 0 24px rgba(202,255,112,0.28); }
.btn-primary:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-heading); font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.65); background: transparent;
  border: 1px solid rgba(255,255,255,0.18); border-radius: var(--radius-btn);
  padding: 10px 22px; transition: border-color var(--ease), color var(--ease); white-space: nowrap; text-decoration: none;
}
.btn-ghost:hover { border-color: var(--lime); color: var(--lime); }
.btn-ghost:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* ── Pill badge ── */
.pill {
  display: inline-flex; align-items: center; font-family: var(--font-mono);
  font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--radius-tag);
}
.pill--lime   { color: var(--lime);   background: rgba(202,255,112,0.08);  border: 1px solid rgba(202,255,112,0.18); }
.pill--teal   { color: var(--teal);   background: rgba(0,201,212,0.08);    border: 1px solid rgba(0,201,212,0.18); }
.pill--violet { color: var(--violet); background: rgba(139,108,247,0.08);  border: 1px solid rgba(139,108,247,0.18); }

/* ── Cards ── */
.card {
  background: var(--deep);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-card);
  padding: 28px 28px 24px;
}

@media (max-width: 767px) {
  :root { --container-pad: 20px; --container-pad-x: 20px; }
  .h1 { font-size: 32px; }
  .h2 { font-size: 26px; }
}
