/* ============================================================
   gosogood · Portfolio
   "Maker's notebook" — กระดาษครีม / หมึกเข้ม / สติ๊กเกอร์เส้นหนา
   ลายมือในจุดสำคัญ · เงาแข็งแบบแปะกระดาษ · ไม่ใช่ลุค AI-template
   ============================================================ */

:root {
  color-scheme: light;

  /* ---- Light theme (soft lychee pink + rose ink) ---- */
  --paper: #fff6f8;
  --paper-2: #ffedf2;
  --surface: #ffffff;
  --surface-2: #fff4f7;
  --ink: #7c3e50;
  --ink-soft: #a45e70;
  --ink-dim: #c89aa6;
  --line: rgba(124, 62, 80, 0.14);
  --line-strong: rgba(124, 62, 80, 0.5);

  --accent: #e4638f;
  --accent-soft: #ffc2d2;
  --teal: #c7487a;
  --plum: #a1326b;
  --cream: #ffe3ea;

  --shadow-ink: rgba(124, 62, 80, 0.42);
  --glow: rgba(228, 99, 143, 0.25);

  --nav-bg: rgba(255, 246, 248, 0.86);
  --code-bg: rgba(228, 99, 143, 0.12);
  --dot: rgba(124, 62, 80, 0.1);

  /* มีฟอนต์ CJK ต่อท้ายไว้รองรับภาษาจีน — ใช้ฟอนต์ระบบ ไม่ต้องโหลดเว็บฟอนต์ */
  --font-display: "Chakra Petch", "Sarabun", "Noto Sans SC", "Microsoft YaHei",
    "PingFang SC", system-ui, sans-serif;
  --font-body: "Sarabun", "Noto Sans SC", "Microsoft YaHei", "PingFang SC",
    system-ui, sans-serif;
  --font-hand: "Mali", "Sarabun", "Noto Sans SC", "Microsoft YaHei", cursive;

  --radius: 18px;
  --radius-sm: 12px;

  /* ---- Easings — เนียนๆ ไม่อึดอัด ----
     --ease          : ค่าเดิมของระบบ (ease-out quint)
     --ease-out      : expo-out แบบลื่นไหล "ไม่แข็ง"
     --ease-spring   : มีเด้งนิดๆ ตอนโผล่
     --ease-inout    : ค่อยๆ ไป-กลับ ใช้กับ loop */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  /* ---- Dark theme (deep plum + soft lychee) ---- */
  --paper: #2a1218;
  --paper-2: #381a22;
  --surface: #43202a;
  --surface-2: #4f2733;
  --ink: #ffe4ec;
  --ink-soft: #e7b9c6;
  --ink-dim: #c08e9c;
  --line: rgba(255, 228, 236, 0.12);
  --line-strong: rgba(255, 228, 236, 0.4);

  --accent: #f68fb0;
  --accent-soft: #ffc2d2;
  --teal: #f47a9e;
  --plum: #ff9ec4;
  --cream: #5a2a38;

  --shadow-ink: rgba(0, 0, 0, 0.55);
  --glow: rgba(246, 143, 176, 0.25);

  --nav-bg: rgba(42, 18, 24, 0.86);
  --code-bg: rgba(246, 143, 176, 0.14);
  --dot: rgba(255, 228, 236, 0.07);
}

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

html {
  scroll-behavior: smooth;
  /* เลื่อน anchor ให้มีระยะเผื่อจาก nav ที่ลอยอยู่ */
  scroll-padding-top: 86px;
}

body {
  font-family: var(--font-body);
  font-size: 1.02rem;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
}

button {
  font-family: inherit;
}

code {
  font-family: var(--font-display), ui-monospace, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--accent);
}

::selection {
  background: rgba(228, 99, 143, 0.9);
  color: #ffffff;
}
:root[data-theme="dark"] ::selection {
  background: rgba(246, 143, 176, 0.85);
  color: #2a1218;
}

::-webkit-scrollbar {
  width: 11px;
}
::-webkit-scrollbar-track {
  background: var(--paper);
}
::-webkit-scrollbar-thumb {
  background: var(--ink-dim);
  border-radius: 99px;
  border: 3px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ink-soft);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 90;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Background layers ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 620px at 82% -8%, rgba(228, 99, 143, 0.12) 0%, transparent 60%),
    radial-gradient(820px 540px at -8% 32%, rgba(199, 72, 122, 0.1) 0%, transparent 55%),
    var(--paper);
  transition: background 0.4s var(--ease);
}
:root[data-theme="dark"] .bg {
  background:
    radial-gradient(1000px 620px at 82% -8%, rgba(246, 143, 176, 0.09) 0%, transparent 60%),
    radial-gradient(820px 540px at -8% 32%, rgba(246, 143, 176, 0.07) 0%, transparent 55%),
    var(--paper);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1.3px, transparent 1.6px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 95% 65% at 50% 0%, #000 25%, transparent 78%);
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .bg-noise {
  mix-blend-mode: overlay;
  opacity: 0.06;
}

#plasma {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* ---------- Shared primitives ---------- */
.eyebrow {
  font-family: var(--font-hand);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "✶ ";
  color: var(--teal);
}

.grad {
  color: var(--teal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='16' viewBox='0 0 240 16'%3E%3Cpath d='M4 11c18-7 30 1 48-4 22-6 40 7 62-2 20-8 42 4 62-2 14-4 36-2 60-1' fill='none' stroke='currentColor' stroke-width='4.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 0.42em;
  padding-bottom: 0.06em;
}

/* ---------- Buttons ----------
   สัมผัสแบบสติกเกอร์: ชี้→เด้งขึ้น + เอียงนิดๆ · กด→ยุบลง เงาแข็งหุบ
   ปล่อยมือ→สปริงกลับ (--ease-spring) ให้รู้สึกมี "น้ำหนัก" ไม่แข็ง */
.btn {
  position: relative;
  overflow: hidden; /* ตัด shine sweep ตอน hover */
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.28s var(--ease),
    background 0.28s var(--ease), border-color 0.28s var(--ease),
    color 0.28s var(--ease);
}
.btn svg {
  width: 17px;
  height: 17px;
  transition: transform 0.35s var(--ease-spring);
}
.btn:hover svg {
  transform: translateX(4px);
}
.btn:active svg {
  transform: translateX(1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 5px 5px 0 var(--shadow-ink);
}
/* แสงวิ่งผ่านแนวเฉียงตอนชี้ */
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38%;
  border-radius: inherit;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 255, 255, 0.42) 50%,
    transparent 80%
  );
  transform: translateX(-320%) skewX(-20deg);
  transition: transform 0.8s var(--ease-out);
  pointer-events: none;
}
.btn-primary:hover::after {
  transform: translateX(340%) skewX(-20deg);
}
.btn-primary:hover {
  transform: translate(-2px, -2px) rotate(-0.6deg);
  box-shadow: 7px 7px 0 var(--shadow-ink);
  background: var(--teal);
}
.btn-primary:active {
  transform: translate(2px, 2px) rotate(0deg);
  box-shadow: 1px 1px 0 var(--shadow-ink);
  transition: transform 0.09s var(--ease), box-shadow 0.09s var(--ease);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--shadow-ink);
}
.btn-ghost:hover {
  transform: translate(-2px, -2px) rotate(-0.6deg);
  box-shadow: 6px 6px 0 var(--shadow-ink);
  background: var(--surface-2);
}
.btn-ghost:active {
  transform: translate(2px, 2px) rotate(0deg);
  box-shadow: 1px 1px 0 var(--shadow-ink);
  transition: transform 0.09s var(--ease), box-shadow 0.09s var(--ease);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  box-shadow: 3px 3px 0 var(--shadow-ink);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
    backdrop-filter 0.4s var(--ease);
  border-bottom: 2px dashed transparent;
}
.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line-strong);
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #ffffff;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow-ink);
  transform: rotate(-4deg);
}
.logo-mark svg {
  width: 16px;
  height: 16px;
}
.logo-text {
  position: relative;
}
.logo-text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
  transform: rotate(-1deg);
}

.nav-links {
  display: flex;
  gap: 34px;
}
.nav-links a {
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.25s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
  transform: scaleX(0) rotate(-1deg);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav-links a:hover {
  color: var(--ink);
}
.nav-links a:hover::after {
  transform: scaleX(1) rotate(-1deg);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--shadow-ink);
  transition: color 0.25s, border-color 0.25s, background 0.25s,
    transform 0.32s var(--ease-spring), box-shadow 0.25s var(--ease);
}
.theme-toggle:hover {
  color: var(--accent);
  background: var(--surface-2);
  transform: translate(-1px, -1px) rotate(-5deg);
  box-shadow: 3px 3px 0 var(--shadow-ink);
}
.theme-toggle:active {
  transform: translate(1px, 1px) rotate(-5deg);
  box-shadow: 1px 1px 0 var(--shadow-ink);
  transition: transform 0.09s var(--ease), box-shadow 0.09s var(--ease);
}
.theme-toggle svg {
  width: 19px;
  height: 19px;
  transition: transform 0.35s var(--ease), opacity 0.25s;
}
.theme-toggle .icon-sun {
  animation: spin-in 0.4s var(--ease);
}
.theme-toggle .icon-moon {
  display: none;
  animation: spin-in 0.4s var(--ease);
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}
@keyframes spin-in {
  from {
    transform: rotate(-120deg) scale(0.6);
    opacity: 0;
  }
  to {
    transform: rotate(0) scale(1);
    opacity: 1;
  }
}

/* ---------- Language toggle (ไทย / EN / 中文) ---------- */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--shadow-ink);
  transition: color 0.25s, border-color 0.25s, background 0.25s,
    transform 0.32s var(--ease-spring), box-shadow 0.25s var(--ease);
}
.lang-toggle:hover {
  color: var(--accent);
  background: var(--surface-2);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--shadow-ink);
}
.lang-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--shadow-ink);
  transition: transform 0.09s var(--ease), box-shadow 0.09s var(--ease);
}
.lang-toggle svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
/* จอแคบ: เหลือแค่ตัวอักษรภาษา จะได้ไม่ล้น nav */
@media (max-width: 480px) {
  .lang-toggle svg {
    display: none;
  }
  .lang-toggle {
    padding: 0 10px;
  }
}

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 11px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--shadow-ink);
  transition: transform 0.32s var(--ease-spring), box-shadow 0.25s var(--ease);
}
.nav-burger:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--shadow-ink);
}
.nav-burger:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--shadow-ink);
  transition: transform 0.09s var(--ease), box-shadow 0.09s var(--ease);
}
.nav-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s;
}
.nav-burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-burger.open span:nth-child(2) {
  opacity: 0;
}
.nav-burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 96vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 130px 24px 90px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--shadow-ink);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 34px;
  rotate: -1.5deg;
}

.pulse-dot {
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  box-shadow: none;
  animation: none;
  color: var(--accent);
  font-size: 1.05rem;
}
.pulse-dot::before {
  content: "✶";
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 6.4vw, 4.6rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 820px;
  text-wrap: balance;
}

.hero-sub {
  margin-top: 26px;
  max-width: 540px;
  color: var(--ink-soft);
  font-size: 1.06rem;
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-stats {
  margin-top: 64px;
  display: flex;
  align-items: stretch;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}
.stat {
  position: relative;
  padding: 20px 30px;
  text-align: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--shadow-ink);
}
.stat:nth-child(1) {
  transform: rotate(-1.4deg);
}
.stat:nth-child(2) {
  transform: rotate(0.8deg);
}
.stat:nth-child(3) {
  transform: rotate(-1deg);
}
.stat::after {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 54px;
  height: 15px;
  background: linear-gradient(
    105deg,
    rgba(228, 99, 143, 0.55) 0 22%,
    transparent 22% 38%,
    rgba(199, 72, 122, 0.5) 38% 62%,
    transparent 62% 78%,
    rgba(228, 99, 143, 0.55) 78%
  );
  border: 1px solid rgba(124, 62, 80, 0.2);
  opacity: 0.85;
}
.stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--accent);
}
.stat-label {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

/* ---------- Ticker ---------- */
.ticker {
  border-top: 2px dashed var(--line-strong);
  border-bottom: 2px dashed var(--line-strong);
  background: var(--paper-2);
  padding: 15px 0;
  overflow: hidden;
  transform: rotate(-0.5deg) scale(1.01);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 30s linear infinite;
}
.ticker:hover .ticker-track {
  animation-play-state: paused;
}
@keyframes ticker {
  to {
    transform: translateX(-50%);
  }
}
.tick-item {
  display: inline-flex;
  align-items: center;
  margin-right: 44px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.tick-item::after {
  content: "✳";
  margin-left: 44px;
  font-size: 0.85rem;
  color: var(--accent);
}

/* ---------- Sections ---------- */
.showcase,
.work,
.about {
  max-width: 1160px;
  margin: 0 auto;
  padding: 120px 24px 0;
}
.showcase {
  padding-top: 110px;
}
.about {
  padding-top: 140px;
  padding-bottom: 40px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-sub {
  color: var(--ink-soft);
  max-width: 400px;
  font-size: 0.98rem;
}

/* ---------- Showcase carousel ---------- */
.carousel {
  position: relative;
}
.car-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 10px 10px 30px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.car-track::-webkit-scrollbar {
  display: none;
}

.car-card {
  flex: 0 0 min(720px, 86%);
  scroll-snap-align: center;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: 8px 8px 0 var(--shadow-ink);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease), background 0.35s var(--ease);
}
.car-card:hover {
  transform: translate(-3px, -3px);
  border-color: var(--ink);
  background: var(--surface-2);
  box-shadow: 12px 12px 0 var(--shadow-ink);
}

.car-media {
  position: relative;
  min-height: 260px;
  overflow: hidden;
}
.car-media .thumb {
  inset: 0;
}

.car-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 26px 24px;
}
.car-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.car-top h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.car-desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.75;
}

.car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--shadow-ink);
  transition: transform 0.34s var(--ease-spring), border-color 0.3s var(--ease),
    color 0.3s var(--ease), background 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}
.car-btn:hover {
  border-color: var(--ink);
  color: var(--accent);
  background: var(--surface-2);
  transform: translateY(calc(-50% - 3px)) scale(1.06);
  box-shadow: 5px 5px 0 var(--shadow-ink);
}
.car-btn:active {
  transform: translateY(calc(-50% + 2px)) scale(0.94);
  box-shadow: 2px 2px 0 var(--shadow-ink);
  transition: transform 0.09s var(--ease), box-shadow 0.09s var(--ease);
}
.car-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.34s var(--ease-spring);
}
.car-btn:hover svg {
  transform: scale(1.15);
}
.car-prev {
  left: -16px;
}
.car-next {
  right: -16px;
}

.car-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 8px;
}
.car-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  border: 1.5px solid var(--ink);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s var(--ease);
}
.car-dot:hover {
  transform: translateY(-1px) scale(1.2);
  background: var(--accent-soft);
}
.car-dot:active {
  transform: translateY(1px) scale(0.85);
}
.car-dot.active {
  width: 28px;
  background: var(--accent);
  border-color: var(--ink);
  transform: rotate(-3deg);
}
.car-dot.active:hover {
  background: var(--accent);
  transform: rotate(-3deg) scale(1.1);
}

/* ---------- Controls ---------- */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.filter {
  padding: 8px 18px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.28s var(--ease-spring), border-color 0.25s var(--ease),
    color 0.25s var(--ease), background 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}
.filter:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translate(-1px, -1px) rotate(-1deg);
  box-shadow: 5px 5px 0 var(--shadow-ink);
}
.filter:active {
  transform: translate(2px, 2px) rotate(0deg);
  box-shadow: 1px 1px 0 var(--shadow-ink);
  transition: transform 0.09s var(--ease), box-shadow 0.09s var(--ease);
}
.filter.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--shadow-ink);
  font-weight: 700;
  transform: rotate(-1.2deg);
}
.filter.active:hover {
  box-shadow: 5px 5px 0 var(--shadow-ink);
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  height: 44px;
  min-width: 250px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}
.search svg {
  width: 16px;
  height: 16px;
  color: var(--ink-dim);
  flex-shrink: 0;
}
.search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.92rem;
}
.search input::placeholder {
  color: var(--ink-dim);
}

.result-count {
  font-size: 0.82rem;
  color: var(--ink-dim);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

/* ---------- Grid / cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.card {
  position: relative;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--shadow-ink);
  transition: translate 0.35s var(--ease), border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease), background 0.35s var(--ease);
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--ink);
  background: var(--surface-2);
  box-shadow: 10px 10px 0 var(--shadow-ink);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  transition: filter 0.45s var(--ease);
}
.card:hover .card-media {
  filter: saturate(1.15) brightness(1.03);
}

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(124, 62, 80, 0.38));
  pointer-events: none;
}

.card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  font-family: var(--font-hand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 99px;
  color: #ffffff;
  background: var(--accent);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow-ink);
  transform: rotate(-3deg);
}

/* status — ใช้งานได้ (มี demo) / ใช้งานไม่ได้ */
.demo-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-hand);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 11px;
  border-radius: 99px;
  border: 2px solid;
  box-shadow: 2px 2px 0 var(--shadow-ink);
}
.demo-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.demo-badge.ok {
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.5);
  background: rgba(22, 163, 74, 0.1);
}
.demo-badge.no {
  color: var(--ink-dim);
  border-color: var(--line-strong);
  background: var(--surface);
}

.card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.card-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.card-index {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}
.card-year {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--ink-dim);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 1px 8px;
  transform: rotate(2deg);
}

.card-desc {
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.7;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tag {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 4px 11px;
  border-radius: 99px;
  border: 1.5px solid var(--ink);
  background: var(--cream);
}

.card-links {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.link-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--shadow-ink);
  transition: transform 0.32s var(--ease-spring), border-color 0.25s var(--ease),
    color 0.25s var(--ease), background 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}
.link-btn svg {
  width: 15px;
  height: 15px;
  transition: transform 0.35s var(--ease-spring);
}
.link-btn:hover svg {
  transform: translateX(2px) scale(1.12);
}
.link-btn:hover {
  border-color: var(--ink);
  background: var(--cream);
  color: var(--accent);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow-ink);
}
.link-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow-ink);
  transition: transform 0.09s var(--ease), box-shadow 0.09s var(--ease);
}

/* ---------- Magic card effects (port จาก MagicBento) ---------- */
.grid {
  --glow-rgb: 228, 99, 143;   /* #e4638f */
  --spotlight-radius: 340px;
}
:root[data-theme="dark"] .grid {
  --glow-rgb: 246, 143, 176;   /* #f68fb0 */
}

.card-inner {
  position: relative;
  z-index: 2; /* ให้เนื้อหาอยู่เหนือ spotlight */
}

.card::before { /* spotlight — แสงเรืองไล่ตามเมาส์ */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    var(--spotlight-radius) circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(var(--glow-rgb), 0.12),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.card::after { /* border glow — ขอบเรืองแสงตามเมาส์ */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  padding: 2px;
  background: radial-gradient(
    var(--spotlight-radius) circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(var(--glow-rgb), 0.45),
    transparent 42%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover::before,
  .card:hover::after {
    opacity: 1;
  }
}

/* ripple — ระลอกคลื่นตอนคลิก */
.m-ripple {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgba(var(--glow-rgb), 0.5);
  pointer-events: none;
  z-index: 6;
  animation: m-ripple-grow 0.8s ease-out forwards;
}
@keyframes m-ripple-grow {
  from {
    transform: scale(0);
    opacity: 1;
  }
  to {
    transform: scale(45);
    opacity: 0;
  }
}

/* ---------- Thumbnails (CSS mock UIs) ---------- */
.thumb {
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, var(--a1), var(--a2));
  display: flex;
  flex-direction: column;
  padding: 34px 34px 22px;
}

.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1.4px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000, transparent 90%);
}

.window {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  background: rgba(24, 14, 4, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}
.window-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}
.window-bar i:nth-child(1) {
  background: #f87171;
}
.window-bar i:nth-child(2) {
  background: #fbbf24;
}
.window-bar i:nth-child(3) {
  background: #34d399;
}
.window-file {
  margin-left: 8px;
  font-family: var(--font-display), ui-monospace, monospace;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-body {
  padding: 14px 16px;
  min-height: 130px;
}

/* terminal thumb */
.t-line {
  font-family: var(--font-display), ui-monospace, monospace;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
  white-space: nowrap;
}
.t-line .t-p {
  color: #34d399;
  font-weight: 700;
}
.t-line.dim {
  color: rgba(255, 255, 255, 0.42);
}
.t-c {
  font-size: 0.5rem;
  letter-spacing: 0.06em;
}
.t-c.c1 { color: #fbbf24; }
.t-c.c2 { color: #f97316; }
.t-c.c3 { color: #a78bfa; }
.t-bar {
  margin-top: 12px;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 34px;
}
.t-bar i {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.35));
  height: 55%;
}
.t-bar i:nth-child(2) { height: 80%; }
.t-bar i:nth-child(3) { height: 65%; }
.t-bar i:nth-child(4) { height: 95%; }
.t-bar i:nth-child(5) { height: 70%; }
.t-bar i:nth-child(6) { height: 45%; }

/* map thumb */
.m-map {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(140deg, #12375c, #0c2b4a);
  background-size: 44px 44px, 44px 44px, cover;
  display: grid;
  place-items: center;
}
.m-block {
  position: absolute;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.m-block.b1 { width: 34%; height: 22%; top: 12%; left: 10%; }
.m-block.b2 { width: 26%; height: 26%; top: 48%; left: 56%; }
.m-block.b3 { width: 20%; height: 16%; top: 60%; left: 14%; }
.m-pin-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
}
.m-pin {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}
.m-pin svg {
  width: 30px;
  height: 30px;
  color: #fff;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}
.m-pin::before {
  content: "";
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  animation: ring 2s var(--ease) infinite;
}
@keyframes ring {
  0% {
    transform: scale(0.4);
    opacity: 0.9;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}
.m-label {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display), ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(24, 14, 4, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 12px;
  border-radius: 99px;
  white-space: nowrap;
  z-index: 2;
}

/* chart thumb */
.c-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  justify-content: flex-end;
}
.c-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.2rem;
  color: #fff;
  line-height: 1;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.c-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.c-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 90px;
}
.c-bars i {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.3));
  height: var(--h, 50%);
}
.c-bars i:nth-child(1) { --h: 45%; }
.c-bars i:nth-child(2) { --h: 70%; }
.c-bars i:nth-child(3) { --h: 38%; }
.c-bars i:nth-child(4) { --h: 85%; }
.c-bars i:nth-child(5) { --h: 60%; }
.c-bars i:nth-child(6) { --h: 92%; }

/* generic thumb */
.g-badge {
  position: absolute;
  right: 22px;
  bottom: 18px;
  width: 74px;
  height: 74px;
  border-radius: 20px;
  background: rgba(24, 14, 4, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  z-index: 1;
}
.g-badge svg {
  width: 32px;
  height: 32px;
  color: rgba(255, 255, 255, 0.95);
}

/* bot thumb (Discord security) */
.b-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  justify-content: flex-end;
}
.b-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(24, 14, 4, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
}
.b-shield {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border-radius: 8px;
}
.b-shield svg {
  width: 18px;
  height: 18px;
}
.b-st {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.b-st-t {
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.5);
}
.b-st-v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: #34d399;
}
.b-threat {
  margin-left: auto;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 3px 8px;
  border-radius: 99px;
}
.b-log {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* pass thumb (password generator) */
.p-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  justify-content: flex-end;
}
.p-field {
  font-family: var(--font-display), ui-monospace, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  color: #fff;
  background: rgba(24, 14, 4, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 11px 14px;
  text-align: center;
}
.p-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}
.p-strength {
  font-weight: 700;
  color: #34d399;
}
.p-len {
  color: rgba(255, 255, 255, 0.55);
}
.p-meter {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.p-meter i {
  display: block;
  height: 100%;
  width: 88%;
  border-radius: 99px;
  background: linear-gradient(90deg, #fbbf24, #34d399);
}
.p-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.p-token {
  flex: 1;
  font-family: var(--font-display), ui-monospace, monospace;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 7px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-copy {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.p-copy svg {
  width: 15px;
  height: 15px;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-soft);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.empty svg {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  color: var(--ink-dim);
}
.empty-sub {
  color: var(--ink-dim);
  font-size: 0.85rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 60px;
  align-items: start;
}
.about-text h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.about-text p {
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.about-text strong {
  color: var(--ink);
}
.signature {
  margin-top: 22px;
  font-family: var(--font-hand);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent);
  transform: rotate(-2.5deg);
  transform-origin: left center;
  display: inline-block;
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.about-list li {
  display: flex;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 16px;
  border: 2px solid var(--ink);
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--shadow-ink);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease-spring),
    background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.about-list li:nth-child(1) {
  transform: rotate(-0.5deg);
}
.about-list li:nth-child(2) {
  transform: rotate(0.4deg);
}
.about-list li:nth-child(3) {
  transform: rotate(-0.3deg);
}
.about-list li:hover {
  border-color: var(--ink);
  background: var(--surface-2);
  transform: translateX(5px);
}
.al-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--cream);
  border: 2px solid var(--ink);
  color: var(--accent);
  transform: rotate(-3deg);
}
.al-icon svg {
  width: 22px;
  height: 22px;
}
.about-list h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 3px;
}
.about-list p {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.65;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 140px;
  border-top: 3px double var(--ink);
  background: var(--paper-2);
}
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 90px 24px 40px;
  text-align: center;
}
.footer-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.footer-sub {
  color: var(--ink-soft);
  margin-top: 14px;
  margin-bottom: 34px;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.social {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 3px 3px 0 var(--shadow-ink);
  transition: transform 0.34s var(--ease-spring), border-color 0.25s var(--ease),
    color 0.25s var(--ease), background 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}
.social svg {
  width: 17px;
  height: 17px;
  transition: transform 0.35s var(--ease-spring);
}
.social:hover {
  color: var(--accent);
  border-color: var(--ink);
  background: var(--surface-2);
  transform: translate(-2px, -2px) rotate(-1.2deg);
  box-shadow: 5px 5px 0 var(--shadow-ink);
}
.social:hover svg {
  transform: scale(1.15) rotate(-6deg);
}
.social:active {
  transform: translate(2px, 2px) rotate(0deg);
  box-shadow: 1px 1px 0 var(--shadow-ink);
  transition: transform 0.09s var(--ease), box-shadow 0.09s var(--ease);
}

.footer-bottom {
  margin-top: 70px;
  padding-top: 26px;
  border-top: 2px dashed var(--line-strong);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--ink-dim);
}
.footer-built {
  font-family: var(--font-hand);
  letter-spacing: 0.06em;
}

/* ---------- Compact work-grid cards (การ์ดชิ้นเล็กลง แบบ bento) ---------- */
.card--featured {
  grid-column: auto;
}
.card--featured .card-inner {
  display: block;
}
.card--featured .card-media {
  aspect-ratio: 2 / 1;
  border-bottom: none;
}

.card-media {
  aspect-ratio: 2 / 1;
}
.card-body {
  padding: 15px 17px 17px;
  gap: 8px;
}
.card-title {
  font-size: 1.02rem;
}
.card-desc {
  font-size: 0.86rem;
  line-height: 1.6;
}
.card-index {
  font-size: 0.75rem;
}
.card-year {
  font-size: 0.72rem;
}
.card-tags {
  gap: 6px;
}
.tag {
  font-size: 0.62rem;
  padding: 3px 9px;
}
.card-links {
  gap: 8px;
  margin-top: 2px;
}
.link-btn {
  font-size: 0.78rem;
  padding: 6px 11px;
}

/* ย่อภาพปกจำลอง (mock UI) ให้พอดีการ์ดเล็ก */
.card .thumb {
  padding: 20px 20px 14px;
}
.card .window--abs {
  inset: 16px 16px 12px !important;
}
.card .window-bar {
  padding: 6px 10px;
}
.card .window-file {
  font-size: 0.6rem;
}
.card .window-body {
  min-height: 74px;
  padding: 9px 11px;
}
.card .t-line {
  font-size: 0.62rem;
}
.card .t-bar {
  height: 24px;
  margin-top: 8px;
}
.card .m-pin {
  width: 32px;
  height: 32px;
}
.card .m-pin svg {
  width: 22px;
  height: 22px;
}
.card .m-pin::before {
  width: 28px;
  height: 28px;
}
.card .m-label {
  font-size: 0.6rem;
  padding: 4px 10px;
  bottom: 10px;
}
.card .c-num {
  font-size: 1.5rem;
}
.card .c-bars {
  height: 58px;
}
.card .c-label {
  font-size: 0.6rem;
}
.card .p-field {
  font-size: 0.8rem;
  padding: 8px 10px;
}
.card .p-meta {
  font-size: 0.56rem;
}
.card .p-token {
  font-size: 0.6rem;
  padding: 5px 8px;
}
.card .b-status {
  padding: 6px 8px;
}
.card .b-shield {
  width: 24px;
  height: 24px;
}
.card .b-st-v {
  font-size: 0.72rem;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  filter: blur(5px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out),
    filter 0.8s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* ============================================================
   Hero entrance — choreography ตอนเปิดหน้า (รอสัญญาณ site:ready)
   JS ใส่ body.hero-pending → องค์ประกอบ .hero-ent ซ่อนไว้
   แล้วเปลี่ยนเป็น body.hero-go ให้โผล่ทีละตัวตาม --d
   (ลำดับ CSS: ใส่ class hero-go ไว้ล่างสุด ไม่ให้ pending ชน)
   ============================================================ */
.hero-ent {
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out),
    filter 0.85s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
body.hero-pending .hero-ent {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
}
body.hero-go .hero-ent {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* สองบรรทัดชื่อเรื่อง — เลื่อนขึ้นแบบมีม่านปิด (masked) */
.hero-title .hero-line {
  display: block;
  overflow: clip; /* ตัดคำที่ยังอยู่ล่างสุด ไม่ให้ล้น */
  padding: 0.06em 0;
  margin: -0.06em 0;
}
.hero-title .w {
  display: inline-block;
  transform: translateY(0);
  transition: transform 0.95s var(--ease-spring);
  transition-delay: var(--wd, 0s);
}
body.hero-pending .hero-title .w {
  transform: translateY(115%);
}
body.hero-go .hero-title .w {
  transform: translateY(0);
}
.hero-title .hero-line:nth-child(1) .w { --wd: 0.3s; }
.hero-title .hero-line:nth-child(2) .w { --wd: 0.44s; }

/* pulse-dot — ประกายรูปดาวหมุนช้าๆ (เดิมเป็น ✶ นิ่ง) */
.pulse-dot::before {
  display: inline-block;
  animation: hero-spark 2.6s var(--ease-inout) infinite;
}
@keyframes hero-spark {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.3); }
}

/* logo-mark — เด้งเล็กน้อยตอนชี้ (จากท่าบิด -4deg) */
.logo-mark {
  transition: transform 0.45s var(--ease-spring), box-shadow 0.3s var(--ease),
    background 0.3s var(--ease);
}
.logo:hover .logo-mark {
  transform: rotate(0deg) scale(1.1);
}

/* ---------- Nav / staggered menu — ไฮไลต์ลิงก์ของส่วนที่กำลังดู ---------- */
.nav-links a.active {
  color: var(--ink);
}
.nav-links a.active::after {
  transform: scaleX(1) rotate(-1deg);
}
.sm-item a.active {
  color: var(--accent);
}
.sm-item a.active::after {
  transform: scaleX(1) rotate(-1deg);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .card--featured .card-inner {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .car-card {
    grid-template-columns: 1fr;
  }
  .car-media {
    min-height: 220px;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .hero-stats {
    gap: 14px;
  }
  .stat {
    padding: 16px 24px;
  }
}

@media (max-width: 720px) {
  .nav-cta {
    display: none;
  }
  /* บนมือถือ ใช้ Staggered menu แทน dropdown เดิม */
  .nav-links {
    display: none;
  }
  .nav-burger {
    display: flex;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  .search {
    width: 100%;
  }
  .hero {
    min-height: 90vh;
    padding-top: 110px;
  }
  .thumb {
    padding: 22px 22px 16px;
  }
  .car-btn {
    width: 40px;
    height: 40px;
  }
  .car-prev {
    left: -6px;
  }
  .car-next {
    right: -6px;
  }
  .card {
    box-shadow: 4px 4px 0 var(--shadow-ink);
  }
  .car-card {
    box-shadow: 5px 5px 0 var(--shadow-ink);
  }
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ============================================================
   Loading screen — speedloader (Hyper-Speed Loading)
   ใช้เปิดหน้าแรก แล้ว fade ออกด้วย JS
   ============================================================ */
.load-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: opacity 0.7s var(--ease), visibility 0s 0.7s;
}
.load-screen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.load-screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}
.load-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
  animation: load-pulse 1.6s var(--ease-inout) infinite;
}
.load-sub {
  font-family: var(--font-hand);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-top: 6px;
}
.load-bar {
  width: min(240px, 60vw);
  height: 6px;
  border-radius: 99px;
  border: 2px solid var(--ink);
  background: var(--surface);
  overflow: hidden;
}
.load-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  animation: load-progress 2.2s var(--ease-inout) infinite;
}
@keyframes load-progress {
  0% {
    transform: translateX(-105%);
  }
  60% {
    transform: translateX(105%);
  }
  100% {
    transform: translateX(105%);
  }
}
@keyframes load-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ---------- Speedloader (character-like speeder) ---------- */
.speedloader {
  --ldr: var(--ink);
  position: relative;
  width: 0;
  height: 0;
  animation: speeder 0.4s linear infinite;
}
.speedloader > span {
  height: 5px;
  width: 35px;
  background: var(--ldr);
  position: absolute;
  top: -19px;
  left: 60px;
  border-radius: 2px 10px 1px 0;
}
.speedloader .base span {
  position: absolute;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-right: 100px solid var(--ldr);
  border-bottom: 6px solid transparent;
}
.speedloader .base span:before {
  content: "";
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: var(--ldr);
  position: absolute;
  right: -110px;
  top: -16px;
}
.speedloader .base span:after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-top: 0 solid transparent;
  border-right: 55px solid var(--ldr);
  border-bottom: 16px solid transparent;
  top: -16px;
  right: -98px;
}
.speedloader .face {
  position: absolute;
  height: 12px;
  width: 20px;
  background: var(--ldr);
  border-radius: 20px 20px 0 0;
  transform: rotate(-40deg);
  right: -125px;
  top: -15px;
}
.speedloader .face:after {
  content: "";
  height: 12px;
  width: 12px;
  background: var(--ldr);
  right: 4px;
  top: 7px;
  position: absolute;
  transform: rotate(40deg);
  transform-origin: 50% 50%;
  border-radius: 0 0 0 2px;
}
.speedloader > span > span:nth-child(1),
.speedloader > span > span:nth-child(2),
.speedloader > span > span:nth-child(3),
.speedloader > span > span:nth-child(4) {
  width: 30px;
  height: 1px;
  background: var(--ldr);
  position: absolute;
  animation: fazer1 0.2s linear infinite;
}
.speedloader > span > span:nth-child(2) {
  top: 3px;
  animation: fazer2 0.4s linear infinite;
}
.speedloader > span > span:nth-child(3) {
  top: 1px;
  animation: fazer3 0.4s linear infinite;
  animation-delay: -1s;
}
.speedloader > span > span:nth-child(4) {
  top: 4px;
  animation: fazer4 1s linear infinite;
  animation-delay: -1s;
}
@keyframes speeder {
  0% { transform: translate(2px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -3px) rotate(-1deg); }
  20% { transform: translate(-2px, 0px) rotate(1deg); }
  30% { transform: translate(1px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 3px) rotate(-1deg); }
  60% { transform: translate(-1px, 1px) rotate(0deg); }
  70% { transform: translate(3px, 1px) rotate(-1deg); }
  80% { transform: translate(-2px, -1px) rotate(1deg); }
  90% { transform: translate(2px, 1px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}
@keyframes fazer1 {
  0% { left: 0; }
  100% { left: -80px; opacity: 0; }
}
@keyframes fazer2 {
  0% { left: 0; }
  100% { left: -100px; opacity: 0; }
}
@keyframes fazer3 {
  0% { left: 0; }
  100% { left: -50px; opacity: 0; }
}
@keyframes fazer4 {
  0% { left: 0; }
  100% { left: -150px; opacity: 0; }
}

/* ---------- Long fazers (moving horizontal lines) ---------- */
.longfazers {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.longfazers span {
  position: absolute;
  height: 2px;
  width: 20%;
  background: var(--ldr, var(--ink));
  opacity: 0.12;
}
.longfazers span:nth-child(1) {
  top: 20%;
  animation: lf 0.6s linear infinite;
  animation-delay: -5s;
}
.longfazers span:nth-child(2) {
  top: 40%;
  animation: lf2 0.8s linear infinite;
  animation-delay: -1s;
}
.longfazers span:nth-child(3) {
  top: 60%;
  animation: lf3 0.6s linear infinite;
}
.longfazers span:nth-child(4) {
  top: 80%;
  animation: lf4 0.5s linear infinite;
  animation-delay: -3s;
}
@keyframes lf { 0% { left: 200%; } 100% { left: -200%; opacity: 0; } }
@keyframes lf2 { 0% { left: 200%; } 100% { left: -200%; opacity: 0; } }
@keyframes lf3 { 0% { left: 200%; } 100% { left: -100%; opacity: 0; } }
@keyframes lf4 { 0% { left: 200%; } 100% { left: -100%; opacity: 0; } }

/* ---------- Loader thumb (ในการ์ดโปรเจกต์) ---------- */
.ldr-thumb {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 120px;
  display: grid;
  place-items: center;
  overflow: hidden;
  --ldr: rgba(255, 255, 255, 0.95);
}
.ldr-thumb .longfazers span {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}
.ldr-thumb .speedloader {
  transform: scale(0.9);
}
.ldr-caption {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.78);
  animation: load-pulse 1.4s var(--ease-inout) infinite;
}

/* ============================================================
   Dash thumb — Dynamic Data Display (mock dashboard เรียลไทม์)
   ============================================================ */
.d-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  justify-content: flex-end;
}
.d-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.d-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #34d399;
  font-weight: 700;
}
.d-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  animation: d-blink 1.2s var(--ease-inout) infinite;
}
@keyframes d-blink {
  50% {
    opacity: 0.25;
  }
}
.d-name {
  font-family: var(--font-display);
  color: rgba(255, 255, 255, 0.55);
}
.d-panel {
  background: rgba(24, 14, 4, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.d-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.d-label {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.d-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
}
.d-spark i {
  flex: 1;
  height: var(--h, 60%);
  border-radius: 2px 2px 0 0;
  transform-origin: bottom;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.25));
  animation: d-bar 2.8s var(--ease-inout) infinite;
}
.d-spark i:nth-child(1) { --h: 42%; animation-delay: 0s; }
.d-spark i:nth-child(2) { --h: 72%; animation-delay: -0.4s; }
.d-spark i:nth-child(3) { --h: 55%; animation-delay: -1.1s; }
.d-spark i:nth-child(4) { --h: 88%; animation-delay: -0.7s; }
.d-spark i:nth-child(5) { --h: 64%; animation-delay: -1.6s; }
.d-spark i:nth-child(6) { --h: 78%; animation-delay: -0.2s; }
.d-spark i:nth-child(7) { --h: 48%; animation-delay: -1.9s; }
.d-spark i:nth-child(8) { --h: 92%; animation-delay: -1.3s; }
@keyframes d-bar {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}
.d-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.d-row {
  display: flex;
  align-items: center;
  gap: 9px;
}
.d-row-label {
  flex: 1;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
}
.d-meter {
  width: 46px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.d-meter i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #34d399, #22d3ee);
  animation: d-meter 3s var(--ease-inout) infinite alternate;
}
@keyframes d-meter {
  from {
    transform: scaleX(0.2);
  }
  to {
    transform: scaleX(0.95);
  }
}
.d-row-val {
  font-family: var(--font-display);
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
}

/* ปรับ dash ในการ์ดเล็ก (compact) */
.card .d-num {
  font-size: 1.45rem;
}
.card .d-label {
  font-size: 0.56rem;
}
.card .d-panel {
  padding: 8px 10px;
  gap: 6px;
}
.card .d-spark {
  height: 20px;
}
.card .d-row {
  gap: 7px;
}
.card .d-meter {
  width: 36px;
}
.card .ldr-thumb {
  min-height: 74px;
}

/* ============================================================
   Staggered menu — vanilla port ของ StaggeredMenu (GSAP → CSS)
   เปิดด้วย burger บนมือถือ · เลเยอร์เลื่อนเข้าแบบสเต็กเกอร์
   ============================================================ */
.sm {
  position: fixed;
  inset: 0;
  z-index: 49; /* ใต้ nav (50) ให้ปุ่ม burger ยังคลิกได้ */
  pointer-events: none;
  visibility: hidden;
}
.sm.open {
  pointer-events: auto;
  visibility: visible;
}
body.sm-open {
  overflow: hidden;
}

.sm-layer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 1;
  width: 100vw;
  border-left: 2px dashed var(--line-strong);
  transform: translateX(101%);
  transition: transform 0.55s var(--ease-out);
}
.sm .sm-layer:nth-child(1) {
  background: var(--paper-2);
  transition-delay: 0s;
}
.sm .sm-layer:nth-child(2) {
  width: 92vw;
  background: var(--cream);
  transition-delay: 0.06s;
}
.sm.open .sm-layer {
  transform: translateX(0);
}
.sm.open .sm-layer:nth-child(1) {
  transition-delay: 0s;
}
.sm.open .sm-layer:nth-child(2) {
  transition-delay: 0.07s;
}
/* ตอนปิด ให้เลื่อนออกสลับกันจากหลังมาหน้า */
.sm:not(.open) .sm-layer:nth-child(2) {
  transition-delay: 0.08s;
}
.sm:not(.open) .sm-layer:nth-child(1) {
  transition-delay: 0.16s;
}

.sm-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 2;
  width: min(420px, 88vw);
  display: flex;
  flex-direction: column;
  padding: 118px 34px 44px;
  overflow-y: auto;
  background: var(--surface);
  border-left: 2px solid var(--ink);
  box-shadow: -12px 0 0 var(--shadow-ink);
  transform: translateX(102%);
  transition: transform 0.6s var(--ease-out);
}
.sm.open .sm-panel {
  transform: translateX(0);
  transition-delay: 0.13s;
}
.sm:not(.open) .sm-panel {
  transition-delay: 0s;
}

.sm-eyebrow {
  font-family: var(--font-hand);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 26px;
}
.sm-nav ul {
  display: flex;
  flex-direction: column;
}
.sm-item {
  overflow: hidden; /* ตัดตอน translateY(120%) */
}
.sm-item-inner {
  display: inline-block;
  transform: translateY(120%);
  transition: transform 0.7s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.sm.open .sm-item-inner {
  transform: translateY(0);
}
.sm-item a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 7px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 7vw, 2.3rem);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
}
.sm-item a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
  transform: scaleX(0) rotate(-1deg);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.sm-item a:hover::after,
.sm-item a:focus-visible::after {
  transform: scaleX(1) rotate(-1deg);
}
.sm-item a:hover,
.sm-item a:focus-visible {
  color: var(--accent);
}
.sm-item-num {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-dim);
}
.sm-socials {
  margin-top: auto;
  padding-top: 44px;
}
.sm-socials-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 14px;
}
.sm-socials ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}
.sm-socials a {
  display: inline-block;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.92rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out),
    color 0.25s var(--ease);
  transition-delay: var(--d, 0s);
}
.sm.open .sm-socials a {
  opacity: 1;
  transform: translateY(0);
}
.sm-socials a:hover,
.sm-socials a:focus-visible {
  color: var(--accent);
}

/* เฉพาะจอใหญ่ ใช้เมนู inline เดิม ไม่ต้องแสดง staggered menu */
@media (min-width: 721px) {
  .sm {
    display: none;
  }
}

/* ============================================================
   Theme switch — ให้ทุกสีเปลี่ยนผ่านกันเนียนๆ ชั่วครู่
   (เพิ่ม class .theme-anim ที่ <html> ตอนกดปุ่มสลับธีม)
   ============================================================ */
html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  /* เฉพาะ background-color + color (ตัวถูกสุด) — ไม่รวม border-color
     เพราะเส้นขอบ 1px แทบไม่เห็น fade แต่ repaint แพงสุด
     box-shadow: 0s — เงาเด้งทันที ไม่งั้นทุกการ์ด/ปุ่ม repaint เงาเอง */
  transition: background-color 0.28s ease, color 0.28s ease,
    box-shadow 0s !important;
}

/* ข้ามส่วนที่ repaint แพงหรือสีไม่เปลี่ยนระหว่างสลับธีม:
   - .bg / .bg-grid / canvas   — พื้นหลังเต็มจอ + พลาสม่า (สลับทันที)
   - .ticker-track             — แถบวิ่งมี 40+ อัน อย่าให้ fade ค้างกลางแอนิเมชัน
   - .card-media               — หน้าจอจำลอง สีคงที่ ไม่เข้า theme อยู่แล้ว
   ทั้งหมดให้สลับทันที ลดภาระ repaint ตอนสลับธีม */
html.theme-anim .bg,
html.theme-anim .bg-grid,
html.theme-anim canvas,
html.theme-anim .ticker-track,
html.theme-anim .ticker-track *,
html.theme-anim .card-media,
html.theme-anim .card-media *,
html.theme-anim .card-media::after {
  transition: none !important;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
  /* hero entrance — เห็นทันที ไม่รอ choreography */
  body.hero-pending .hero-ent,
  body.hero-pending .hero-title .w {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ============================================================
   Polish — lychee theme refinements
   ============================================================ */
/* ปุ่มหลักไล่เฉดชมพู → โรสให้ดูมีมิติขึ้น */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--teal) 100%);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--teal) 0%, var(--accent) 100%);
}

/* การ์ดยกขึ้นนิดๆ ตอนชี้ (รวมกับ 3D tilt ของ magic effect ได้ เพราะเป็น
   property translate แยกจาก transform) */
.card:hover {
  translate: 0 -3px;
}
.card:active {
  translate: 0 0;
}

/* ป้าย hero มีกลอว์ชมพูอ่อนลอยอยู่รอบ */
.hero-badge {
  box-shadow: 3px 3px 0 var(--shadow-ink), 0 0 32px var(--glow);
}

/* focus ring ที่มองเห็นชัดทุกตัว interact ใช้คีบอร์ด */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
  border-radius: 6px;
}

/* การ์ด carousel พื้นหลังไล่เฉดบางๆ ให้มี depth */
.car-card {
  background: linear-gradient(165deg, var(--surface) 0%, var(--surface-2) 100%);
}
