/* ==========================================================================
   Kan — portfolio styles
   Light by default, dark via [data-theme="dark"].
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --bg: #f6f8fc;
  --bg-alt: #edf3fb;
  --surface: #ffffff;
  --surface-2: #f5f8fd;
  --ink: #0b1220;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e3e9f2;
  --line-2: #cfd9e8;

  --sky: #0ea5e9;
  --blue: #2563eb;
  --indigo: #6366f1;
  --cyan: #06b6d4;
  --green: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;

  --primary: var(--blue);
  --primary-soft: #e6f0ff;
  --grad: linear-gradient(120deg, #0ea5e9 0%, #2563eb 50%, #6366f1 100%);
  --grad-soft: linear-gradient(135deg, rgba(14, 165, 233, .12), rgba(99, 102, 241, .12));

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 12px 32px -8px rgba(15, 23, 42, .12);
  --shadow-lg: 0 30px 80px -24px rgba(30, 64, 175, .35);
  --glow: 0 10px 30px -8px rgba(37, 99, 235, .55);

  --r-lg: 28px;
  --r: 20px;
  --r-sm: 12px;

  --f-display: "Space Grotesk", "IBM Plex Sans Thai", system-ui, sans-serif;
  --f-body: "Inter", "IBM Plex Sans Thai", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --nav-h: 72px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

[data-theme="dark"] {
  --bg: #060a14;
  --bg-alt: #0a1122;
  --surface: #0d1528;
  --surface-2: #111b33;
  --ink: #e9effc;
  --ink-2: #b7c3da;
  --muted: #7d8ba6;
  --line: #1a2440;
  --line-2: #26335a;

  --sky: #38bdf8;
  --blue: #60a5fa;
  --indigo: #818cf8;
  --primary: #60a5fa;
  --primary-soft: #0f2042;
  --grad: linear-gradient(120deg, #38bdf8 0%, #60a5fa 50%, #a5b4fc 100%);
  --grad-soft: linear-gradient(135deg, rgba(56, 189, 248, .12), rgba(129, 140, 248, .12));

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 12px 32px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .7);
  --glow: 0 10px 34px -8px rgba(56, 189, 248, .5);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

html[lang="th"] body {
  font-family: "IBM Plex Sans Thai", "Inter", system-ui, sans-serif;
  line-height: 1.75;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

::selection {
  background: rgba(37, 99, 235, .22);
}

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 3000;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

kbd {
  font-family: var(--f-mono);
  font-size: .72rem;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--muted);
}

/* brand icons */
.si {
  fill: var(--brand, currentColor);
  flex-shrink: 0;
}

[data-theme="dark"] .si-mono {
  fill: var(--ink);
}

.fa-ico {
  color: var(--brand, currentColor);
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

/* ---------- buttons ---------- */
.btn {
  --bh: 48px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  height: var(--bh);
  padding: 0 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s, color .25s, border-color .25s;
  will-change: transform;
}

.btn-sm {
  --bh: 38px;
  padding: 0 1rem;
  font-size: .85rem;
}

.btn-lg {
  --bh: 56px;
  padding: 0 1.7rem;
  font-size: 1rem;
}

.btn-primary {
  color: #fff;
  background: var(--grad);
  background-size: 160% 160%;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  background-position: 100% 50%;
  box-shadow: 0 14px 38px -8px rgba(37, 99, 235, .65);
}

[data-theme="dark"] .btn-primary {
  color: #04101f;
}

.btn-ghost {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-soft {
  color: #047857;
  background: #e7f8f0;
  border: 1px solid #bfead6;
}

.btn-soft:hover {
  background: #d3f3e4;
}

[data-theme="dark"] .btn-soft {
  color: #6ee7b7;
  background: rgba(16, 185, 129, .1);
  border-color: rgba(16, 185, 129, .3);
}

.btn-link {
  color: var(--ink-2);
  padding: 0 .9rem;
}

.btn-link:hover {
  color: var(--primary);
}

.btn-dark {
  color: #fff;
  background: #0f172a;
}

.btn-dark:hover {
  background: var(--primary);
}

[data-theme="dark"] .btn-dark {
  background: #1e293b;
  color: #e2e8f0;
}

[data-theme="dark"] .btn-dark:hover {
  background: var(--primary);
  color: #04101f;
}

.btn.is-private {
  cursor: default;
  color: var(--muted);
  border-style: dashed;
  box-shadow: none;
}

.btn.is-private:hover {
  color: var(--muted);
  border-color: var(--line-2);
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: border-color .3s, box-shadow .3s var(--ease), transform .3s var(--ease), background-color .4s;
}

/* ---------- scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--grad);
  z-index: 1200;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 12px 0 auto;
  z-index: 1000;
  padding: 0 16px;
  pointer-events: none;
}

.nav-inner {
  pointer-events: auto;
  max-width: 1200px;
  height: 60px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 10px 0 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--line-2) 70%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s, background-color .3s;
}

.nav.scrolled .nav-inner {
  box-shadow: var(--shadow);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.logo {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  color: var(--ink);
}

.logo .lb {
  color: var(--primary);
}

.nav nav {
  margin-left: auto;
}

.nav-links {
  display: flex;
  gap: 2px;
}

.nav-link {
  display: block;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color .2s, background-color .2s;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-soft);
}

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

.nav-btn {
  height: 40px;
  min-width: 40px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: color .2s, border-color .2s, background-color .2s;
}

.nav-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.cmdk-btn .kbd-hint {
  font-size: .68rem;
  padding: 1px 5px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.hamburger span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .3s var(--ease), opacity .2s;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 48px) 0 96px;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hb-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line-2) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line-2) 55%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 30%, transparent 75%);
}

.hb-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
}

.hb-glow.g1 {
  width: 560px;
  height: 560px;
  right: -120px;
  top: -140px;
  background: #7dd3fc;
  animation: drift 14s ease-in-out infinite;
}

.hb-glow.g2 {
  width: 480px;
  height: 480px;
  left: -160px;
  bottom: -120px;
  background: #a5b4fc;
  animation: drift 18s ease-in-out infinite reverse;
}

.hb-glow.g3 {
  width: 320px;
  height: 320px;
  left: 40%;
  top: 30%;
  background: #93c5fd;
  opacity: .35;
  animation: drift 22s ease-in-out infinite;
}

[data-theme="dark"] .hb-glow {
  opacity: .22;
}

.hb-spot {
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 70%) var(--my, 30%), rgba(56, 189, 248, .14), transparent 60%);
  transition: background .2s;
}

@keyframes drift {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(30px, -24px) scale(1.06);
  }
}

.hero-text {
  min-width: 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: 56px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  color: #047857;
  background: color-mix(in srgb, #10b981 12%, var(--surface));
  border: 1px solid color-mix(in srgb, #10b981 35%, transparent);
  margin-bottom: 22px;
}

[data-theme="dark"] .status-pill {
  color: #6ee7b7;
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: ping 1.8s var(--ease) infinite;
}

@keyframes ping {
  0% {
    transform: scale(.6);
    opacity: .9;
  }

  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.hi-line {
  font-family: var(--f-mono);
  font-size: .95rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.hero-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.6vw, 5.3rem);
  line-height: .95;
  letter-spacing: -.045em;
  margin-bottom: 14px;
}

.hn-text {
  display: inline-block;
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 41%, #2563eb 47%, #0ea5e9 52%, var(--ink) 59%, var(--ink) 100%);
  background-size: 250% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 7s ease-in-out 1.5s infinite;
}

.hn-text .ch {
  display: inline-block;
  -webkit-text-fill-color: transparent;
}

@keyframes shine {

  0%,
  60% {
    background-position: 100% 0;
  }

  100% {
    background-position: 0 0;
  }
}

.hero-name-th {
  font-family: "IBM Plex Sans Thai", var(--f-body);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 18px;
}

.hero-name-th .nick {
  color: var(--muted);
  font-weight: 500;
}

.role-line {
  font-family: var(--f-display);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 600;
  margin-bottom: 18px;
  min-height: 1.5em;
}

.role-pre {
  color: var(--muted);
}

.typewriter {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.typewriter::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -.12em;
  background: var(--sky);
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-desc {
  max-width: 560px;
  font-size: 1.05rem;
  color: var(--ink-2);
  margin-bottom: 30px;
}

.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.hero-socials,
.f-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.soc {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .25s var(--ease), color .2s, border-color .2s;
}

.soc:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-3px);
}

/* portrait */
.hero-visual {
  display: flex;
  justify-content: center;
}

.portrait {
  position: relative;
  width: min(380px, 100%);
  transform-style: preserve-3d;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  padding: 6px;
  background: var(--grad);
  box-shadow: var(--shadow-lg);
}

.portrait-frame::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -1;
  border-radius: 40px;
  background: var(--grad);
  filter: blur(40px);
  opacity: .35;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: calc(var(--r-lg) - 6px);
  background: var(--surface-2);
}

.orbit-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: float 6s ease-in-out infinite;
}

.oc1 {
  top: 8%;
  left: -14%;
}

.oc2 {
  top: 26%;
  right: -16%;
  animation-delay: -1.5s;
}

.oc3 {
  top: 54%;
  left: -18%;
  animation-delay: -3s;
}

.oc4 {
  bottom: 30%;
  right: -12%;
  animation-delay: -4.5s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.term-card {
  position: absolute;
  left: -10%;
  bottom: -8%;
  width: 250px;
  border-radius: 14px;
  overflow: hidden;
  background: #0b1220;
  color: #cbd5e1;
  box-shadow: 0 24px 60px -18px rgba(2, 6, 23, .55);
  border: 1px solid rgba(148, 163, 184, .18);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: #111a2e;
  font-family: var(--f-mono);
  font-size: .68rem;
  color: #64748b;
}

.term-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f87171;
}

.term-bar i:nth-child(2) {
  background: #fbbf24;
}

.term-bar i:nth-child(3) {
  background: #34d399;
}

.term-bar span {
  margin-left: 6px;
}

.term-body {
  margin: 0;
  padding: 12px 14px 14px;
  font-family: var(--f-mono);
  font-size: .76rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.tp {
  color: #38bdf8;
}

.to {
  color: #94a3b8;
}

.to.ok {
  color: #4ade80;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.sh-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--sky), transparent);
  animation: scrollLine 2s var(--ease) infinite;
  transform-origin: top;
}

@keyframes scrollLine {
  0% {
    transform: scaleY(0);
  }

  50% {
    transform: scaleY(1);
  }

  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

.stat {
  padding: 22px 22px 20px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.stat-n {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  line-height: 1;
  letter-spacing: -.04em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}

.stat-l {
  margin-top: 8px;
  font-size: .86rem;
  color: var(--muted);
}

/* ---------- sections ---------- */
.sec {
  position: relative;
  padding: 120px 0;
}

.sec-alt {
  background: var(--bg-alt);
}

.sec-head {
  margin-bottom: 52px;
  max-width: 720px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}

.eb-num {
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
}

.sec-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -.04em;
}

html[lang="th"] .sec-title,
html[lang="th"] .contact-title {
  letter-spacing: -.01em;
  line-height: 1.2;
}

.sec-sub {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 20px;
}

.about-main {
  padding: 36px;
}

.bio {
  font-size: 1.1rem;
  color: var(--ink-2);
}

.bio+.bio {
  margin-top: 16px;
}

.bio strong {
  color: var(--ink);
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--sky) 30%, transparent) 62%);
}

.interests {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--line-2);
}

.interests h4 {
  font-family: var(--f-mono);
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.itags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.itag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: transform .25s var(--ease), border-color .2s;
}

.itag i {
  color: var(--primary);
}

.itag:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.itag-heart,
.itag-heart i {
  color: #ef4444;
}

.itag-heart:hover {
  border-color: #ef4444;
}

.itag-heart i {
  animation: beat 1.6s ease-in-out infinite;
}

@keyframes beat {

  0%,
  100% {
    transform: scale(1);
  }

  15% {
    transform: scale(1.25);
  }

  30% {
    transform: scale(1);
  }
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.id-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.id-photo {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  object-fit: cover;
  object-position: 50% 20%;
  border: 2px solid var(--line);
}

.id-name {
  font-family: "IBM Plex Sans Thai", var(--f-body);
  font-weight: 700;
}

.id-name-en {
  font-size: .9rem;
  color: var(--ink-2);
}

.id-uni {
  margin-top: 4px;
  font-size: .82rem;
  color: var(--primary);
  font-weight: 600;
}

.info-list {
  padding: 8px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  transition: background-color .2s;
}

a.info-row:hover {
  background: var(--surface-2);
}

.info-row>i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--primary);
  background: var(--primary-soft);
}

.info-row>span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.info-row .il {
  font-size: .75rem;
  color: var(--muted);
}

.info-row b {
  font-weight: 600;
  font-size: .92rem;
  overflow-wrap: anywhere;
}

/* ---------- experience ---------- */
.xp-list {
  position: relative;
  display: grid;
  gap: 22px;
  padding-left: 34px;
}

.xp-list::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--sky), var(--indigo), transparent);
  border-radius: 2px;
}

.xp {
  position: relative;
}

.xp-dot {
  position: absolute;
  left: -34px;
  top: 26px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--sky);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--sky) 18%, transparent);
}

.xp-card {
  padding: 24px 26px;
}

.xp-card:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.xp-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.xp-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  padding: 4px;
}

.xp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.xp-kind {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
}

.xp-when {
  font-family: var(--f-mono);
  font-size: .8rem;
  color: var(--muted);
}

.xp-role {
  font-family: var(--f-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.xp-org {
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 10px;
}

.xp-desc {
  color: var(--ink-2);
  max-width: 760px;
}

.xp-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ---------- skills ---------- */
.sk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: -28px 0 24px;
  font-size: .85rem;
  color: var(--muted);
}

.sk-legend>span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.skills-cats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.skill-cat {
  padding: 24px;
}

.cat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.cat-title>i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: .9rem;
  color: var(--primary);
  background: var(--primary-soft);
}

.cat-n {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: .75rem;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 8px;
}

.skill {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s;
}

.skill:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 50%, var(--line));
  box-shadow: var(--shadow-sm);
}

.sk-ico {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.sk-ico .si {
  width: 18px;
  height: 18px;
}

.sk-name {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.25;
  min-width: 0;
}

.sk-lvl {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.sk-lvl-t {
  display: none;
}

.sk-dots {
  display: inline-flex;
  gap: 3px;
}

.sk-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-2);
}

.sk-dots i.on {
  background: var(--primary);
}

.skill[data-level="pro"] .sk-dots i.on {
  background: var(--green);
}

.sk-legend .sk-dots i.on {
  background: var(--primary);
}

.sk-legend>span:first-child .sk-dots i.on {
  background: var(--green);
}

/* ---------- projects ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -24px 0 32px;
}

.f-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px 0 16px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: color .2s, background-color .2s, border-color .2s, transform .2s;
}

.f-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.f-btn.on {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

[data-theme="dark"] .f-btn.on {
  color: #04101f;
}

.f-n {
  font-family: var(--f-mono);
  font-size: .72rem;
  padding: 1px 7px;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.p-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.p-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color .3s, box-shadow .35s var(--ease), background-color .4s;
}

.p-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(500px circle at var(--px, 50%) var(--py, 0%), rgba(56, 189, 248, .10), transparent 45%);
  opacity: 0;
  transition: opacity .3s;
}

.p-card:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
  box-shadow: var(--shadow-lg);
}

.p-card:hover::after {
  opacity: 1;
}

.p-card.is-hidden {
  display: none;
}

.p-card.flash {
  animation: flash 1.4s var(--ease);
}

@keyframes flash {

  0%,
  100% {
    box-shadow: var(--shadow-sm);
  }

  30% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 55%, transparent), var(--shadow-lg);
  }
}

.p-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.p-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
  transition: transform .8s var(--ease);
}

.p-card:hover .p-media img {
  transform: scale(1.04);
}

.zoomable {
  cursor: zoom-in;
}

.p-cover {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, .35), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, .35), transparent 50%),
    linear-gradient(135deg, #0b1530, #13254d);
}

.p-cover[data-cover="24sweets"] {
  background:
    radial-gradient(circle at 25% 25%, rgba(244, 114, 182, .45), transparent 55%),
    radial-gradient(circle at 80% 75%, rgba(251, 191, 36, .35), transparent 55%),
    linear-gradient(135deg, #3b0a2a, #5b1a3a);
}

.cover-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 32px 32px;
}

.p-cover .cover-logo {
  position: relative;
  width: 34%;
  max-width: 150px;
  height: auto;
  border-radius: 28px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .55);
  transition: transform .8s var(--ease);
}

.p-card:hover .p-cover .cover-logo {
  transform: scale(1.06) rotate(-2deg);
}

.p-slider .sl-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: #f1f5f9;
}

.p-slider .sl-track::-webkit-scrollbar {
  display: none;
}

.p-slider .sl-track img {
  flex: 0 0 100%;
  scroll-snap-align: start;
  object-fit: contain;
  object-position: 50% 50%;
}

.p-card:hover .p-slider img {
  transform: none;
}

.sl-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .55);
}

.sl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  transition: width .3s var(--ease), background-color .2s;
}

.sl-dot.on {
  width: 20px;
  border-radius: 6px;
  background: #fff;
}

.p-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px 26px 26px;
}

.p-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.p-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--surface-2);
  margin-top: -54px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.p-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-logo-img.contain {
  object-fit: contain;
  padding: 5px;
  background: #fff;
}

.p-logo-icon {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

#p-nexus .p-logo-icon {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
}

.p-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent);
}

.b-live {
  color: #047857;
  background: #e7f8f0;
}

.b-private {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.b-desktop {
  color: #4338ca;
  background: #eef0ff;
}

.b-client {
  color: #b45309;
  background: #fef6e4;
}

.b-demo {
  color: #92400e;
  background: #fef3c7;
}

.b-users {
  color: #1d4ed8;
  background: #e6f0ff;
}

.b-course {
  color: #6d28d9;
  background: #f3edff;
}

[data-theme="dark"] .badge {
  background: color-mix(in srgb, currentColor 14%, transparent);
  border-color: color-mix(in srgb, currentColor 25%, transparent);
}

[data-theme="dark"] .b-live {
  color: #6ee7b7;
}

[data-theme="dark"] .b-private {
  color: #94a3b8;
}

[data-theme="dark"] .b-desktop {
  color: #a5b4fc;
}

[data-theme="dark"] .b-client,
[data-theme="dark"] .b-demo {
  color: #fcd34d;
}

[data-theme="dark"] .b-users {
  color: #93c5fd;
}

[data-theme="dark"] .b-course {
  color: #c4b5fd;
}

.p-name {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 10px;
}

.p-desc {
  color: var(--ink-2);
  font-size: .97rem;
  margin-bottom: 18px;
}

.p-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  font-family: var(--f-mono);
  font-size: .72rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.p-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

/* featured */
.p-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad) border-box;
}

.p-card.featured .p-media {
  aspect-ratio: auto;
  min-height: 100%;
  border-bottom: 0;
  border-right: 1px solid var(--line);
}

.p-card.featured .p-body {
  padding: 34px;
}

.p-card.featured .p-logo {
  margin-top: 0;
}

.p-card.featured .p-name {
  font-size: 2.2rem;
}

.p-card.featured .p-badges::before {
  content: "★ Featured";
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
}

.gh-cta {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  color: var(--muted);
}

/* ---------- education ---------- */
.edu-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 28px;
  align-items: start;
}

.edu-list {
  position: relative;
  display: grid;
  gap: 18px;
  padding-left: 52px;
}

.edu-list::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(var(--sky), var(--line-2) 40%, var(--line-2));
}

.edu {
  position: relative;
}

.edu-dot {
  position: absolute;
  left: -52px;
  top: 18px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: .9rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-2);
}

.edu.current .edu-dot {
  color: #fff;
  background: var(--grad);
  border-color: transparent;
  box-shadow: var(--glow);
}

.edu.afs .edu-dot {
  color: #047857;
  background: #e7f8f0;
  border-color: #bfead6;
}

.edu-card {
  padding: 22px 24px;
}

.edu.current .edu-card {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
}

.pill {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: .74rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.pill-blue {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

.pill-green {
  color: #047857;
  background: #e7f8f0;
  border-color: #bfead6;
}

[data-theme="dark"] .pill-green,
[data-theme="dark"] .edu.afs .edu-dot {
  color: #6ee7b7;
  background: rgba(16, 185, 129, .1);
  border-color: rgba(16, 185, 129, .3);
}

.edu-deg {
  font-family: var(--f-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.3;
}

.edu-abbr {
  font-size: .85rem;
  color: var(--muted);
  margin-top: 2px;
}

.edu-school {
  margin-top: 8px;
  font-size: .92rem;
  color: var(--ink-2);
}

.edu-school i {
  color: var(--primary);
  margin-right: 6px;
}

.edu-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.afs-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.afs-photos figure {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.afs-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .6s var(--ease);
}

.afs-photos figure:hover img {
  transform: scale(1.05);
}

.afs-photos figcaption {
  padding: 8px 10px;
  font-size: .76rem;
  color: var(--muted);
}

.transcript {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  display: grid;
  gap: 14px;
}

.gpax {
  padding: 24px;
  overflow: hidden;
  position: relative;
}

.gpax::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  pointer-events: none;
}

.gpax-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.eyebrow-sm {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary);
}

.gpax-n {
  font-family: var(--f-display);
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.04em;
}

.gpax-n small {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
  letter-spacing: 0;
}

.gpax-l {
  color: var(--ink-2);
  font-size: .9rem;
}

.gpax-ic {
  font-size: 1.4rem;
  color: var(--primary);
}

.gpa-bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  height: 150px;
  margin-top: 22px;
  align-items: end;
}

.gb {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.gb-v {
  font-family: var(--f-mono);
  font-size: .74rem;
  font-weight: 600;
  color: var(--ink-2);
}

.gb-bar {
  width: 100%;
  height: var(--h);
  min-height: 6px;
  border-radius: 10px 10px 4px 4px;
  background: var(--grad);
  transform-origin: bottom;
}

.gb.pending .gb-bar {
  height: 30%;
  background: repeating-linear-gradient(45deg, var(--line-2) 0 6px, transparent 6px 12px);
  border: 1px dashed var(--line-2);
}

.gb-l {
  font-family: var(--f-mono);
  font-size: .68rem;
  color: var(--muted);
}

.sems {
  display: grid;
  gap: 10px;
}

.sem {
  overflow: hidden;
}

.sem summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: .93rem;
}

.sem summary::-webkit-details-marker {
  display: none;
}

.sem-l {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sem-l>i {
  color: var(--primary);
  width: 16px;
}

.sem-r {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sem-n {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 500;
}

.sem-gpa {
  font-family: var(--f-mono);
  font-size: .85rem;
  padding: 3px 9px;
  border-radius: 8px;
  color: var(--primary);
  background: var(--primary-soft);
}

.sem-gpa small {
  font-size: .68rem;
  opacity: .7;
}

.sem-gpa.live {
  font-family: var(--f-body);
  color: #4338ca;
  background: #eef0ff;
  animation: soft 2s ease-in-out infinite;
}

[data-theme="dark"] .sem-gpa.live {
  color: #a5b4fc;
  background: rgba(129, 140, 248, .14);
}

@keyframes soft {
  50% {
    opacity: .6;
  }
}

.chev {
  font-size: .75rem;
  color: var(--muted);
  transition: transform .3s var(--ease);
}

.sem[open] .chev {
  transform: rotate(180deg);
}

.sem-live {
  border-color: color-mix(in srgb, var(--indigo) 45%, var(--line));
}

.courses {
  padding: 4px 10px 12px;
  border-top: 1px solid var(--line);
}

.courses li {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 10px;
  font-size: .88rem;
}

.courses li:hover {
  background: var(--surface-2);
}

.cc {
  font-family: var(--f-mono);
  font-size: .75rem;
  color: var(--muted);
}

.cn {
  color: var(--ink-2);
}

.gr {
  min-width: 34px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
  font-size: .82rem;
}

.ga {
  color: #047857;
  background: #e7f8f0;
}

.gb2 {
  color: #1d4ed8;
  background: #e6f0ff;
}

.gc {
  color: #a16207;
  background: #fef9c3;
}

.gd {
  color: #c2410c;
  background: #ffedd5;
}

.gw,
.gp {
  color: #64748b;
  background: #f1f5f9;
}

[data-theme="dark"] .gr {
  background: color-mix(in srgb, currentColor 15%, transparent);
}

[data-theme="dark"] .ga {
  color: #6ee7b7;
}

[data-theme="dark"] .gb2 {
  color: #93c5fd;
}

[data-theme="dark"] .gc {
  color: #fde047;
}

[data-theme="dark"] .gd {
  color: #fdba74;
}

[data-theme="dark"] .gw,
[data-theme="dark"] .gp {
  color: #94a3b8;
}

/* ---------- languages ---------- */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.lang {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
}

.lang:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.flag {
  flex-shrink: 0;
  width: 52px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}

.flag-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.flag-inline {
  display: inline-block;
  width: 22px;
  height: 15px;
  border-radius: 3px;
  vertical-align: -1px;
  margin-left: 4px;
  box-shadow: 0 0 0 1px var(--line);
}

.lang-info {
  flex: 1;
  min-width: 0;
}

.lang-name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.15rem;
}

.lang-lvl {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.lang-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}

.lang-meter span {
  display: block;
  height: 100%;
  width: var(--v);
  border-radius: inherit;
  background: var(--grad);
  transform-origin: left;
}

/* ---------- contact ---------- */
.contact {
  overflow: hidden;
}

.contact::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 900px;
  height: 500px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(56, 189, 248, .18), transparent);
  pointer-events: none;
}

.contact-hero {
  position: relative;
  text-align: center;
  max-width: 860px;
  margin: 0 auto 56px;
}

.contact-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 1;
  letter-spacing: -.05em;
  margin-bottom: 20px;
}

.ct-b {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.contact-sub {
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 620px;
  margin: 0 auto 30px;
}

.contact-btns {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.c-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.c-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 18px 20px;
}

.c-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  box-shadow: var(--shadow);
}

.c-ic {
  grid-row: 1 / 3;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.15rem;
  color: #fff;
}

.c-mail .c-ic {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
}

.c-phone .c-ic {
  background: linear-gradient(135deg, #10b981, #059669);
}

.c-gh .c-ic {
  background: linear-gradient(135deg, #334155, #0f172a);
}

.c-ig .c-ic {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
}

.c-fb .c-ic {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.c-tg .c-ic {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
}

.c-l {
  font-size: .75rem;
  color: var(--muted);
}

.c-v {
  font-weight: 600;
  font-size: .92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-go {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: .75rem;
  color: var(--muted);
  transition: transform .3s var(--ease), color .2s;
}

.c-card:hover .c-go {
  color: var(--primary);
  transform: translate(2px, -2px);
}

/* ---------- footer ---------- */
.footer {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.f-copy {
  font-size: .85rem;
  color: var(--muted);
}

/* ---------- back to top ---------- */
#backToTop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #fff;
  background: var(--grad);
  box-shadow: var(--glow);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
}

#backToTop.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, .86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}

.lightbox.show {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s, visibility 0s;
}

.lightbox-content {
  max-width: min(1200px, 100%);
  max-height: 88vh;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  transform: scale(.96);
  transition: transform .35s var(--ease);
}

.lightbox.show .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.3rem;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  transition: background-color .2s, transform .2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, .24);
  transform: rotate(90deg);
}

/* ---------- command palette ---------- */
.cmdk {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14vh 16px 16px;
  background: rgba(2, 6, 23, .45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.cmdk[hidden] {
  display: none;
}

.cmdk-panel {
  width: min(620px, 100%);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 100px -20px rgba(2, 6, 23, .5);
  animation: pop .22s var(--ease);
}

@keyframes pop {
  from {
    transform: translateY(8px) scale(.98);
    opacity: 0;
  }
}

.cmdk-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.cmdk-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1.02rem;
  color: var(--ink);
}

.cmdk-list {
  max-height: min(380px, 52vh);
  overflow-y: auto;
  padding: 8px;
}

.cmdk-group {
  padding: 10px 10px 4px;
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.cmdk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: .94rem;
}

.cmdk-item i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: .82rem;
}

.cmdk-item .hint {
  margin-left: auto;
  font-size: .75rem;
  color: var(--muted);
}

.cmdk-item[aria-selected="true"] {
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.cmdk-empty {
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

.cmdk-foot {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: .75rem;
  color: var(--muted);
}

.cmdk-foot kbd {
  margin-right: 3px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 2600;
  transform: translate(-50%, 20px);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  background: #0f172a;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- cursor (fine pointers only) ---------- */
.cursor-ring,
.cursor-dot {
  display: none;
}

@media (hover: hover) and (pointer: fine) {

  .has-cursor .cursor-ring,
  .has-cursor .cursor-dot {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2400;
    pointer-events: none;
    border-radius: 50%;
  }

  .has-cursor .cursor-ring {
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border: 1.5px solid color-mix(in srgb, var(--sky) 70%, transparent);
    transition: width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease), background-color .25s, border-color .25s, opacity .25s;
  }

  .has-cursor .cursor-dot {
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    background: var(--sky);
  }

  .has-cursor .cursor-ring.hover {
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
    background: color-mix(in srgb, var(--sky) 12%, transparent);
    border-color: transparent;
  }

  .has-cursor .cursor-ring.hidden,
  .has-cursor .cursor-dot.hidden {
    opacity: 0;
  }
}

/* ---------- reveal (only when JS animations are on) ---------- */
.anim [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
}

/* ---------- X-ray intro stages ---------- */
/* 02 style: typography and layout, no paint */
.xr-mono #app *,
.xr-mono #app *::before,
.xr-mono #app *::after {
  background-image: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  text-shadow: none !important;
  border-color: var(--line-2) !important;
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
  fill: var(--ink) !important;
  filter: none !important;
  animation-play-state: paused !important;
}

.xr-mono #app img {
  filter: grayscale(1) contrast(.5) brightness(1.4) !important;
  opacity: .35;
}

.xr-mono .hb-glow,
.xr-mono .hb-spot {
  opacity: 0 !important;
}

/* 03 layout: box model outlines */
.xr-boxes #app * {
  outline: 1px dashed color-mix(in srgb, #0ea5e9 55%, transparent) !important;
  outline-offset: -1px;
}

#xr-labels {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 2147482000;
  pointer-events: none;
}

.xr-tag {
  position: absolute;
  padding: 2px 6px;
  border-radius: 4px;
  font: 500 10.5px/1.4 var(--f-mono);
  color: #fff;
  background: #0ea5e9;
  white-space: nowrap;
  transform: translateY(-100%);
}

.xr-tag b {
  font-weight: 600;
  opacity: .85;
  margin-left: 4px;
}

.xr-box {
  position: absolute;
  border: 1.5px solid #0ea5e9;
  background: rgba(14, 165, 233, .07);
}

/* 04 paint: let colours flood back in */
.xr-paint #app *,
.xr-paint #app *::before,
.xr-paint #app *::after {
  transition: background-color .7s var(--ease), color .7s var(--ease), border-color .7s, box-shadow .7s, opacity .7s, filter .7s, -webkit-text-fill-color .7s !important;
}

/* 05 composite: 3D layer split */
.xr-3d body {
  overflow: hidden;
}

.xr-3d #app {
  transform-style: preserve-3d;
}

.xr-3d main>section:not(#hero):not(.stats),
.xr-3d .footer {
  display: none;
}

.xr-3d #hero,
.xr-3d .hero-inner,
.xr-3d .nav {
  transform-style: preserve-3d;
}

.xr-3d .nav-inner,
.xr-3d .hero-inner {
  position: relative;
}

.xr-3d .nav-inner,
.xr-3d .hero-inner,
.xr-3d .hero-bg {
  outline: 2px solid rgba(56, 189, 248, .75);
  outline-offset: 10px;
  border-radius: 18px;
}

.xr-3d .hero-bg {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  box-shadow: 0 40px 120px -30px rgba(30, 64, 175, .45);
}

.xr-3d .hero-inner {
  background: color-mix(in srgb, var(--surface) 35%, transparent);
}

.xr-layer-tag {
  position: absolute;
  left: 18px;
  top: -34px;
  padding: 4px 9px;
  border-radius: 6px;
  font: 600 15px/1.4 var(--f-mono);
  color: #0b1220;
  background: #38bdf8;
  white-space: nowrap;
  pointer-events: none;
}

.xr-on .scroll-hint,
.xr-on #backToTop {
  opacity: 0 !important;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .nav-links .nav-link {
    padding: 8px 10px;
    font-size: .85rem;
  }

  .kbd-hint {
    display: none;
  }
}

@media (max-width: 980px) {
  :root {
    --nav-h: 64px;
  }

  .hamburger {
    display: inline-flex;
  }

  .nav nav {
    margin-left: auto;
  }

  .nav-links {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 70px;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-8px) scale(.98);
    pointer-events: none;
    transition: opacity .25s, transform .25s var(--ease);
  }

  .nav-links.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .nav-link {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 64px;
  }

  .hero-text {
    text-align: center;
  }

  .hero-name {
    font-size: clamp(2rem, 10.4vw, 5rem);
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-btns,
  .hero-socials {
    justify-content: center;
  }

  .portrait {
    width: min(320px, 78%);
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .about-grid,
  .skills-cats,
  .edu-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .transcript {
    position: static;
  }

  .p-card.featured {
    display: flex;
  }

  .p-card.featured .p-media {
    aspect-ratio: 16 / 9;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .p-card.featured .p-logo {
    margin-top: -54px;
  }

  .lang-grid,
  .c-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .sec {
    padding: 84px 0;
  }

  .sec-head {
    margin-bottom: 40px;
  }

  .p-grid {
    grid-template-columns: 1fr;
  }

  .p-card.featured .p-name {
    font-size: 1.8rem;
  }

  .p-card.featured .p-body,
  .p-body {
    padding: 22px 20px 22px;
  }

  .about-main {
    padding: 26px 22px;
  }

  .lang-grid,
  .c-grid {
    grid-template-columns: 1fr;
  }

  .orbit-chip {
    font-size: .72rem;
    padding: 6px 10px;
  }

  .oc1 {
    left: -8%;
  }

  .oc2 {
    right: -10%;
  }

  .oc3 {
    left: -10%;
  }

  .oc4 {
    right: -8%;
  }

  .term-card {
    left: -6%;
    width: 220px;
  }

  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: -24px;
    margin-right: -24px;
    padding: 0 24px 6px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .f-btn {
    flex-shrink: 0;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .f-right {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 16px;
  }

  .filters {
    margin-left: -16px;
    margin-right: -16px;
    padding: 0 16px 6px;
  }

  .nav {
    padding: 0 10px;
    inset: 8px 0 auto;
  }

  .nav-inner {
    padding: 0 6px 0 16px;
    gap: 8px;
  }

  .nav-btn {
    height: 38px;
    min-width: 38px;
    padding: 0 9px;
  }

  .lang-btn .fa-globe {
    display: none;
  }

  .hero {
    padding-top: calc(var(--nav-h) + 36px);
  }

  .hero-btns .btn {
    flex: 1 1 calc(50% - 10px);
    padding: 0 .8rem;
  }

  .stats {
    gap: 10px;
  }

  .stat {
    padding: 18px 16px;
  }

  .p-head {
    flex-wrap: wrap;
  }

  .p-badges {
    justify-content: flex-start;
  }

  .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skill-cat {
    padding: 18px 14px;
  }

  .sk-lvl {
    display: none;
  }

  .skill {
    box-shadow: inset 3px 0 0 var(--line-2);
  }

  .skill[data-level="mid"] {
    box-shadow: inset 3px 0 0 var(--primary);
  }

  .skill[data-level="pro"] {
    box-shadow: inset 3px 0 0 var(--green);
  }

  .sk-name {
    font-size: .84rem;
  }

  .sk-legend .sk-dots {
    display: none;
  }

  .sk-legend>span::before {
    content: "";
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--line-2);
  }

  .sk-legend>span:nth-child(1)::before {
    background: var(--green);
  }

  .sk-legend>span:nth-child(2)::before {
    background: var(--primary);
  }

  .skill {
    padding: 9px;
    gap: 8px;
  }

  .sk-ico {
    width: 30px;
    height: 30px;
  }

  .courses li {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    font-size: .82rem;
  }

  .sem summary {
    padding: 13px 14px;
  }

  .sem-n {
    display: none;
  }

  .edu-list {
    padding-left: 44px;
  }

  .edu-dot {
    left: -44px;
    width: 34px;
    height: 34px;
  }

  .edu-list::before {
    left: 16px;
  }

  .xp-card {
    padding: 20px;
  }

  .term-card {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
