:root {
  color-scheme: dark;
  --color-bg: #04070f;
  --color-surface-strong: #0c1526;
  --color-line: rgba(148, 176, 226, 0.12);
  --color-line-strong: rgba(148, 176, 226, 0.26);
  --color-text: #eef3ff;
  --color-text-muted: #9fb0cd;
  --color-text-dim: #7c8fae;
  --color-brand: #4f8dff;
  --color-accent: #35e0cf;
  --gradient-brand: linear-gradient(135deg, #7cadff 0%, var(--color-brand) 46%, var(--color-accent) 100%);
  --shadow-panel: 0 32px 80px -40px rgba(2, 6, 16, 0.95), 0 0 0 1px rgba(2, 6, 16, 0.35);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --layout-max: 76rem;
  --layout-gutter: clamp(1.25rem, 5vw, 3.5rem);
  --header-height: 4.25rem;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --text-display: clamp(1.75rem, 1.1rem + 2.7vw, 3.65rem);
  --text-lead: clamp(1.0625rem, 0.98rem + 0.4vw, 1.25rem);
  --text-body: clamp(0.9375rem, 0.91rem + 0.14vw, 1rem);
  --text-label: clamp(0.625rem, 0.6rem + 0.1vw, 0.7rem);
  --text-small: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);
  --duration-fast: 150ms;
  --duration-base: 240ms;
  --duration-slow: 700ms;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --z-base: 0;
  --z-content: 1;
  --z-header: 30;
  --z-panel: 40;
  --z-skip: 100;
  --pointer-x: 0.5;
  --pointer-y: 0.35;
}

html:lang(ja) {
  --font-sans: ui-sans-serif, system-ui, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Noto Sans JP", Meiryo, sans-serif;
}

html:lang(zh) {
  --font-sans: ui-sans-serif, system-ui, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html:lang(ko) {
  --font-sans: ui-sans-serif, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

html:lang(th) {
  --font-sans: ui-sans-serif, system-ui, "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
}

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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html:lang(th) body {
  line-height: 1.75;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

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

button {
  padding: 0;
  border: 0;
  background: none;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

::selection {
  background: rgba(79, 141, 255, 0.32);
  color: #ffffff;
}

.app {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: var(--z-skip);
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-strong);
  color: var(--color-text);
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-panel);
  transform: translateY(calc(-100% - var(--space-6)));
  transition: transform var(--duration-base) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.site-main:focus {
  outline: none;
}

.noscript {
  display: grid;
  gap: var(--space-3);
  max-width: 42rem;
  margin: 14vh auto 0;
  padding: 0 var(--layout-gutter);
}

.noscript__brand {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.noscript__message {
  color: var(--color-text-muted);
  line-height: 1.75;
}
