/* ==========================================================================
   Cosmo Portfolio & Resume — Editorial Typography + iOS Liquid Glass Chrome
   3-Role Type System:
     Display : Newsreader + Noto Serif Thai + Noto Serif Lao (Editorial Serif)
     Body UI : Plus Jakarta Sans + IBM Plex Sans Thai + IBM Plex Sans Lao
     Tech    : JetBrains Mono (Indices, Blueprint, Stack, Repo metadata)
   ========================================================================== */

:root {
  /* 3-Role Designer Typography (Lao uses official Phetsarath OT) */
  --font-display: 'Newsreader', 'Noto Serif Thai', 'Phetsarath OT', 'Phetsarath', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', 'IBM Plex Sans Thai', 'Phetsarath OT', 'Phetsarath',
    system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Sans Thai', 'Phetsarath OT', 'Phetsarath',
    ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Light Mode Palette (Default) */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --surface-hover: #eef2f6;
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --accent: #1e3a5f;
  --accent-hover: #152c49;
  --accent-on: #ffffff;
  --accent-soft: rgba(30, 58, 95, 0.08);
  --accent-line: #2563eb;
  --status: #15803d;
  --blueprint-dot: rgba(15, 23, 42, 0.08);

  /* Subtle Daylight Atmospheric Wash (gives Liquid Glass real light to refract) */
  --atmo-1: rgba(186, 214, 247, 0.42);
  --atmo-2: rgba(244, 226, 204, 0.38);
  --atmo-3: rgba(203, 224, 245, 0.28);

  /* iOS 26 Liquid Glass Chrome (Light) */
  --glass-gradient: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.72) 0%,
    rgba(255, 255, 255, 0.32) 48%,
    rgba(241, 247, 255, 0.56) 100%
  );
  --glass-bg-inset: rgba(226, 234, 244, 0.48);
  --glass-active-bg: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(244, 248, 253, 0.88) 100%
  );
  --glass-border: rgba(255, 255, 255, 0.86);
  --glass-outer-ring: rgba(15, 23, 42, 0.1);
  --glass-specular-top: rgba(255, 255, 255, 0.98);
  --glass-specular-bottom: rgba(15, 23, 42, 0.08);
  --glass-glare: rgba(255, 255, 255, 0.72);
  --glass-shadow: 0 14px 36px -12px rgba(15, 23, 42, 0.16),
    0 3px 10px -3px rgba(15, 23, 42, 0.08);
  --glass-active-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.16),
    0 1px 2px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 1);

  /* Layout & Motion */
  --container-max: 1120px;
  --radius-pill: 999px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --ease-ios: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme='dark'] {
  --bg: #0b0d12;
  --surface: #11141c;
  --surface-subtle: #161a24;
  --surface-hover: #1b202d;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #232936;
  --border-strong: #333c4d;

  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-on: #0b0d12;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --accent-line: #60a5fa;
  --status: #4ade80;
  --blueprint-dot: rgba(241, 245, 249, 0.09);

  /* Subtle Twilight Atmospheric Wash (Dark) */
  --atmo-1: rgba(37, 74, 130, 0.28);
  --atmo-2: rgba(45, 62, 92, 0.22);
  --atmo-3: rgba(24, 42, 74, 0.2);

  /* iOS 26 Liquid Glass Chrome (Dark) */
  --glass-gradient: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(24, 30, 44, 0.42) 48%,
    rgba(255, 255, 255, 0.08) 100%
  );
  --glass-bg-inset: rgba(8, 10, 16, 0.52);
  --glass-active-bg: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-outer-ring: rgba(0, 0, 0, 0.55);
  --glass-specular-top: rgba(255, 255, 255, 0.34);
  --glass-specular-bottom: rgba(0, 0, 0, 0.45);
  --glass-glare: rgba(255, 255, 255, 0.22);
  --glass-shadow: 0 18px 42px -12px rgba(0, 0, 0, 0.72),
    0 3px 10px -2px rgba(0, 0, 0, 0.45);
  --glass-active-shadow: 0 2px 8px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

/* ==========================================================================
   Reset & Base Typography
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  font-family: var(--font-sans);
  font-size: 16px;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.62;
  overflow-x: hidden;
  transition: background-color 220ms var(--ease-ios), color 220ms var(--ease-ios);
}

/* Script-specific typography tuning */
html.lang-th body {
  line-height: 1.7;
}
html.lang-lo {
  --font-display: 'Phetsarath OT', 'Phetsarath', 'Newsreader', Georgia, serif;
  --font-sans: 'Phetsarath OT', 'Phetsarath', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Phetsarath OT', 'Phetsarath', ui-monospace, monospace;
}
html.lang-lo body {
  line-height: 1.78;
}

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

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

a {
  color: inherit;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Accessible Keyboard Focus Ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: min(var(--container-max), calc(100% - 40px));
  margin-inline: auto;
}

/* ==========================================================================
   Subtle Daylight Atmospheric Backdrop (For Liquid Glass Refraction)
   ========================================================================== */

.page-atmosphere {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 520px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(64% 85% at 14% 0%, var(--atmo-1) 0%, transparent 72%),
    radial-gradient(58% 80% at 86% 4%, var(--atmo-2) 0%, transparent 70%),
    radial-gradient(50% 60% at 50% 12%, var(--atmo-3) 0%, transparent 75%);
  transition: opacity 260ms var(--ease-ios);
}

/* ==========================================================================
   iOS 26 Liquid Glass Chrome (Strictly Navigation & Controls)
   ========================================================================== */

.liquid-glass {
  position: relative;
  overflow: hidden;
  background: var(--glass-gradient);
  backdrop-filter: blur(26px) saturate(210%) brightness(1.03);
  -webkit-backdrop-filter: blur(26px) saturate(210%) brightness(1.03);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1.5px 0 var(--glass-specular-top),
    inset 0 -1px 0 var(--glass-specular-bottom),
    inset 1px 0 0 rgba(255, 255, 255, 0.35),
    0 0 0 0.5px var(--glass-outer-ring),
    var(--glass-shadow);
}

.liquid-glass::before,
.liquid-glass-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: var(--glass-glare-opacity, 0);
  background: radial-gradient(
    240px circle at var(--gx, 50%) var(--gy, 0%),
    var(--glass-glare),
    transparent 70%
  );
  transition: opacity 240ms var(--ease-ios);
}

.liquid-glass:hover::before,
.liquid-glass-pill:hover::before {
  opacity: 0.9;
}

.liquid-glass > *,
.liquid-glass-pill > * {
  position: relative;
  z-index: 1;
}

.liquid-glass-inset {
  background: var(--glass-bg-inset);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.45);
}

[data-theme='dark'] .liquid-glass-inset {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.38),
    0 1px 0 rgba(255, 255, 255, 0.08);
}

.liquid-glass-pill {
  position: relative;
  overflow: hidden;
  background: var(--glass-gradient);
  backdrop-filter: blur(22px) saturate(200%) brightness(1.03);
  -webkit-backdrop-filter: blur(22px) saturate(200%) brightness(1.03);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1.5px 0 var(--glass-specular-top),
    inset 0 -1px 0 var(--glass-specular-bottom),
    0 0 0 0.5px var(--glass-outer-ring),
    0 8px 24px -10px rgba(15, 23, 42, 0.14);
}

/* Reduced Transparency Fallback */
@media (prefers-reduced-transparency: reduce) {
  .liquid-glass,
  .liquid-glass-pill {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--surface);
    border-color: var(--border-strong);
  }
  .liquid-glass::before,
  .liquid-glass-pill::before {
    display: none;
  }
  .liquid-glass-inset {
    background: var(--surface-subtle);
  }
}

/* ==========================================================================
   Floating Header & Navigation
   ========================================================================== */

.site-header {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 100;
  padding-inline: 20px;
  pointer-events: none;
}

.navbar {
  pointer-events: auto;
  max-width: var(--container-max);
  margin-inline: auto;
  height: 58px;
  padding: 0 10px 0 20px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand-sep {
  color: var(--border-strong);
  font-weight: 400;
}

.brand-handle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 180ms var(--ease-ios), color 180ms var(--ease-ios),
    box-shadow 180ms var(--ease-ios);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.nav-links a.active {
  color: var(--text);
  font-weight: 600;
  background: var(--glass-active-bg);
  box-shadow: var(--glass-active-shadow);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Segmented Language Switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--radius-pill);
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 180ms var(--ease-ios), color 180ms var(--ease-ios),
    box-shadow 180ms var(--ease-ios);
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  background: var(--glass-active-bg);
  color: var(--text);
  box-shadow: var(--glass-active-shadow);
}

/* Theme Toggle & Mobile Menu Icon Buttons */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background-color 180ms var(--ease-ios), transform 180ms var(--ease-ios);
}

.icon-btn:hover {
  background: var(--glass-active-bg);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* Sun shown in Dark mode (click to switch to Light); Moon shown in Light mode (click to switch to Dark) */
[data-theme='light'] .icon-sun {
  display: none;
}
[data-theme='light'] .icon-moon {
  display: block;
}
[data-theme='dark'] .icon-sun {
  display: block;
}
[data-theme='dark'] .icon-moon {
  display: none;
}

.menu-toggle {
  display: none;
}

.menu-toggle .icon-close {
  display: none;
}
.menu-toggle[aria-expanded='true'] .icon-menu {
  display: none;
}
.menu-toggle[aria-expanded='true'] .icon-close {
  display: block;
}

/* Mobile Liquid Glass Sheet */
.mobile-drawer {
  pointer-events: auto;
  max-width: var(--container-max);
  margin: 10px auto 0;
  padding: 16px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-drawer-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 500;
  color: var(--text);
  transition: background-color 160ms ease;
}

.mobile-drawer-links a:hover {
  background: var(--accent-soft);
}

.mobile-drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Buttons & Links
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 180ms var(--ease-ios), color 180ms var(--ease-ios),
    border-color 180ms var(--ease-ios), transform 180ms var(--ease-ios);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
}

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

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 160ms ease;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ==========================================================================
   Hero Section (Swiss Editorial Split)
   ========================================================================== */

.hero {
  padding-top: 126px;
  padding-bottom: 84px;
}

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

.hero-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.hero-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.hero-status-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.availability-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status);
  flex-shrink: 0;
}

.hero-greeting-line {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.65rem, 5.2vw, 4.15rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 16px;
}

html.lang-th .hero-name,
html.lang-lo .hero-name {
  line-height: 1.18;
  font-weight: 600;
}

.hero-headline {
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.hero-bio {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   Interactive System Architecture Blueprint (Replaces 3D Scene)
   Single-level hairline architectural panel — zero nested cards
   ========================================================================== */

.blueprint {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.blueprint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.blueprint-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
}

.blueprint-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.blueprint-body {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  background-image: radial-gradient(var(--blueprint-dot) 1px, transparent 1px);
  background-size: 16px 16px;
}

.blueprint-rail {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  padding: 8px 0;
}

.blueprint-svg {
  width: 28px;
  height: 100%;
  min-height: 224px;
}

.bp-line-base {
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

.bp-line-signal {
  stroke: var(--accent-line);
  stroke-width: 1.5;
  stroke-dasharray: 6 10;
  animation: bp-flow 3.2s linear infinite;
}

@keyframes bp-flow {
  from {
    stroke-dashoffset: 32;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.bp-node {
  fill: var(--surface);
  stroke: var(--border-strong);
  stroke-width: 1.8;
  transition: fill 200ms ease, stroke 200ms ease, r 200ms ease;
}

.bp-node.active {
  fill: var(--accent);
  stroke: var(--accent);
}

.blueprint-layers {
  display: flex;
  flex-direction: column;
}

.bp-layer-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 160ms var(--ease-ios);
}

.bp-layer-btn:last-child {
  border-bottom: none;
}

.bp-layer-btn:hover {
  background: var(--surface-hover);
}

.bp-layer-btn.active {
  background: var(--accent-soft);
}

.bp-layer-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.bp-layer-btn.active .bp-layer-num {
  color: var(--accent);
}

.bp-layer-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bp-layer-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.bp-layer-sub {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bp-layer-arrow {
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 160ms ease, transform 160ms ease, color 160ms ease;
}

.bp-layer-btn:hover .bp-layer-arrow,
.bp-layer-btn.active .bp-layer-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent);
}

.blueprint-readout {
  padding: 15px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.blueprint-readout-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.blueprint-readout-top strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.bp-detail-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
}

#bp-detail-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 8px;
}

.bp-detail-stack {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
}

.blueprint-readout-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bp-jump-btn {
  border: none;
  background: transparent;
  padding: 2px 0;
  cursor: pointer;
  font-size: 0.8rem;
}

/* ==========================================================================
   Shared Swiss Editorial Section Layout
   ========================================================================== */

.section {
  padding: 76px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 84px;
}

.section-header {
  margin-bottom: 40px;
  max-width: 68ch;
}

.section-header-row {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.section-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.4vw, 2.65rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 10px;
}

html.lang-th .section-title,
html.lang-lo .section-title {
  font-weight: 600;
  line-height: 1.24;
}

.section-subtitle {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 62ch;
}

/* ==========================================================================
   01: About & Education (Flat Editorial Columns + Hairline Stats Strip)
   ========================================================================== */

.about-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 48px;
  margin-bottom: 48px;
}

.block-heading {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.about-text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.72;
}

.education-block {
  padding-left: 32px;
  border-left: 1px solid var(--border);
}

.edu-degree {
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.edu-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}

.meta-dot {
  color: var(--border-strong);
}

.edu-org {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.edu-faculty {
  font-weight: 600;
  color: var(--text);
}

.edu-native {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Compact Hairline Engineering Timeline */
.about-timeline {
  list-style: none;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.about-timeline li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  font-size: 0.86rem;
}

.tl-year {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.tl-text {
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Horizontal Stats Strip (Zero Boxes Inside Boxes) */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-item {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  padding: 24px 20px 24px 0;
}

.stat-item + .stat-item {
  padding-left: 24px;
  border-left: 1px solid var(--border);
}

.stat-item dd {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.1;
}

.stat-item dt {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   02: Skills Matrix (4-Row Swiss Index Table)
   ========================================================================== */

.skills-table {
  border-top: 1px solid var(--border);
}

.skill-row {
  display: grid;
  grid-template-columns: minmax(0, 0.36fr) minmax(0, 0.64fr);
  gap: 36px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.skill-row-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-row-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.skill-index {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
}

.skill-row-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  padding-top: 2px;
}

.skill-item {
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
}

.skill-item::after {
  content: '·';
  margin-left: 18px;
  color: var(--border-strong);
}

.skill-item:last-child::after {
  content: none;
}

/* Inline Owner Skill Controls (Visible only to verified Owner) */
.skill-item-owner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.skill-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.skill-remove-btn:hover {
  background: rgba(220, 38, 38, 0.14);
  color: #dc2626;
}

.skill-owner-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  max-width: 340px;
}

.skill-owner-input {
  flex: 1;
  min-width: 150px;
  min-height: 34px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 0.82rem;
}

.skill-owner-input:focus {
  outline: none;
  border-style: solid;
  border-color: var(--accent);
}

/* ==========================================================================
   03: Featured Projects (Liquid Glass Tabs + Flat Editorial Grid)
   ========================================================================== */

.filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 180ms var(--ease-ios), color 180ms var(--ease-ios),
    box-shadow 180ms var(--ease-ios);
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  background: var(--glass-active-bg);
  color: var(--text);
  box-shadow: var(--glass-active-shadow);
}

.projects-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.project-item {
  display: flex;
  flex-direction: column;
  padding: 28px 28px 28px 0;
  border-bottom: 1px solid var(--border);
  transition: background-color 180ms var(--ease-ios);
}

.project-item:nth-child(even) {
  padding-left: 28px;
  padding-right: 0;
  border-left: 1px solid var(--border);
}

.project-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.project-meta-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
}

.project-num {
  color: var(--accent);
}

.project-highlight {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
}

.project-title {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.32;
}

.project-desc {
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.62;
  margin-bottom: 18px;
  flex: 1;
}

.project-stack {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.project-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* ==========================================================================
   04: Live GitHub Section (Inline Summary + Directory List)
   ========================================================================== */

.gh-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.gh-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gh-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  object-fit: cover;
}

.gh-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.gh-handle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gh-metrics {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.gh-metric {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.gh-metric strong {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.gh-metric span {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.gh-links-group {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.gh-account-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
}

.repo-owner-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--accent);
}

.gh-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.gh-search-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  flex: 1 1 260px;
  max-width: 380px;
  color: var(--text-muted);
}

.gh-search {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
}

.gh-search::placeholder {
  color: var(--text-muted);
}

.gh-lang-pills {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
}

.gh-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 34px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 160ms var(--ease-ios), color 160ms var(--ease-ios),
    box-shadow 160ms var(--ease-ios);
}

.gh-lang-pill:hover {
  color: var(--text);
}

.gh-lang-pill.active {
  background: var(--glass-active-bg);
  color: var(--text);
  box-shadow: var(--glass-active-shadow);
}

.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gh-directory {
  border-top: 1px solid var(--border);
}

.repo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 28px;
  align-items: center;
  padding: 20px 12px;
  border-bottom: 1px solid var(--border);
  transition: background-color 160ms var(--ease-ios);
}

.repo-row:hover {
  background: var(--surface-hover);
}

.repo-main {
  min-width: 0;
}

.repo-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.repo-name {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.repo-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.repo-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  max-width: 70ch;
}

.repo-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.repo-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.repo-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Loading Skeleton & Fallback */
.repo-skeleton {
  height: 82px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, transparent, var(--surface-subtle), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.gh-fallback {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}

.gh-fallback h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.gh-fallback p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  max-width: 56ch;
}

/* ==========================================================================
   05: Open Editorial Footer (No Card Wrapper)
   ========================================================================== */

.site-footer {
  padding: 72px 0 48px;
  border-top: 1px solid var(--border);
}

.footer-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.footer-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 10px;
}

html.lang-th .footer-title,
html.lang-lo .footer-title {
  font-weight: 600;
  line-height: 1.24;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-bottom {
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Subtle Scroll Reveal & Reduced Motion
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 380ms var(--ease-ios), transform 380ms var(--ease-ios);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Responsive Breakpoints (1024px, 768px, 375px)
   ========================================================================== */

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-columns {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .education-block {
    padding-left: 0;
    padding-top: 28px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .projects-list {
    grid-template-columns: 1fr;
  }

  .project-item,
  .project-item:nth-child(even) {
    padding: 24px 0;
    border-left: none;
  }
}

@media (max-width: 820px) {
  .nav-links,
  .navbar .lang-switcher {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

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

  .stat-item {
    padding: 20px 16px 20px 0;
  }

  .stat-item:nth-child(odd) {
    padding-left: 0;
    border-left: none;
  }

  .stat-item:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .repo-row {
    grid-template-columns: 1fr;
    padding-inline: 0;
  }
}

@media (max-width: 520px) {
  .container {
    width: calc(100% - 28px);
  }

  .site-header {
    top: 10px;
    padding-inline: 14px;
  }

  .navbar {
    height: 54px;
    padding: 0 8px 0 16px;
  }

  .brand-sep,
  .brand-handle {
    display: none;
  }

  .hero {
    padding-top: 96px;
    padding-bottom: 56px;
  }

  .section {
    padding: 56px 0;
  }

  .filter-tabs,
  .gh-lang-pills {
    border-radius: 16px;
  }

  .gh-search-wrap {
    max-width: none;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }
}

/* ==========================================================================
   Optional Project Media, Lightbox, Toast & Owner Local Studio
   ========================================================================== */

.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.82rem;
}

.project-media-btn {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-bottom: 16px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-subtle);
  cursor: zoom-in;
}

.project-media-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms var(--ease-ios);
}

.project-media-btn:hover img {
  transform: scale(1.025);
}

.project-media-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.88;
  transition: opacity 180ms ease, transform 180ms ease;
}

.project-media-btn:hover .project-media-zoom {
  opacity: 1;
  transform: scale(1.06);
}

.projects-expand-row {
  display: flex;
  justify-content: center;
  padding-top: 28px;
}

.projects-expand-row[hidden] {
  display: none;
}

/* iOS Liquid Glass GitHub Profile Picker (<dialog>) */
.gh-picker-dialog {
  margin: auto;
  padding: 0;
  width: min(440px, calc(100vw - 28px));
  border-radius: 22px;
  color: var(--text);
  overflow: hidden;
  animation: gh-picker-in 240ms var(--ease-ios);
}

@keyframes gh-picker-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gh-picker-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme='dark'] .gh-picker-dialog::backdrop {
  background: rgba(3, 5, 10, 0.62);
}

.gh-picker-inner {
  padding: 22px 22px 18px;
}

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

.gh-picker-head h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.18;
  color: var(--text);
}

.gh-picker-sub {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.gh-picker-list {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.gh-picker-option {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 14px;
  padding: 14px 10px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  border-radius: 10px;
  transition: background-color 180ms var(--ease-ios), transform 180ms var(--ease-ios);
}

.gh-picker-option:last-child {
  border-bottom: none;
}

.gh-picker-option:hover {
  background: var(--accent-soft);
}

.gh-picker-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.gh-picker-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gh-picker-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.gh-picker-name-row strong {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text);
}

.gh-picker-role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
}

.gh-picker-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.gh-picker-arrow {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms var(--ease-ios), color 180ms var(--ease-ios);
}

.gh-picker-option:hover .gh-picker-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.gh-picker-foot {
  padding-top: 14px;
  display: flex;
  justify-content: center;
}

.gh-picker-browse {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 0.84rem;
}

/* Native Accessible Lightbox (<dialog>) */
.lightbox-dialog {
  margin: auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  max-width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.45);
}

.lightbox-dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-inner {
  display: flex;
  flex-direction: column;
}

.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.lightbox-caption {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.lightbox-dialog img {
  max-height: calc(100vh - 120px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin-inline: auto;
  background: var(--surface-subtle);
}

/* Floating Toast Feedback */
.site-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.site-toast[hidden] {
  display: none;
}

/* Owner Mode iOS Liquid Glass Floating Dock (Never visible to public visitors) */
.owner-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 180;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 6px 7px 6px 14px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.owner-bar[hidden] {
  display: none;
}

.owner-bar-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.owner-bar-info strong {
  color: var(--text);
  font-weight: 600;
}

.owner-bar-email {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.owner-bar-divider {
  width: 1px;
  height: 20px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.owner-bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.owner-dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 180ms var(--ease-ios), color 180ms var(--ease-ios),
    box-shadow 180ms var(--ease-ios), transform 160ms var(--ease-ios);
}

.owner-dock-btn:hover {
  background: var(--glass-active-bg);
  box-shadow: var(--glass-active-shadow);
}

.owner-dock-btn:active {
  transform: scale(0.97);
}

.owner-dock-primary {
  background: var(--accent);
  color: var(--accent-on);
}

.owner-dock-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-on);
  box-shadow: none;
}

.owner-dock-muted {
  color: var(--text-muted);
}

.owner-dock-muted:hover {
  color: var(--text);
}

@media (max-width: 720px) {
  .owner-bar-email,
  .owner-bar-divider {
    display: none;
  }
}

@media (max-width: 520px) {
  .owner-bar {
    width: calc(100vw - 24px);
    border-radius: 18px;
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .owner-bar-actions {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .owner-dock-btn {
    flex: 1 1 auto;
    height: 38px;
  }
}

.owner-project-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-strong);
}

.owner-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.owner-file-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.owner-file-btn input {
  display: none;
}

.owner-file-btn.is-uploading {
  opacity: 0.6;
  pointer-events: none;
}

.owner-file-btn-danger:hover {
  border-color: #dc2626;
  color: #dc2626;
}

.owner-file-btn-confirm {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.owner-file-btn-confirm:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #ffffff;
}

.owner-caption-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.owner-caption-input {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
}

.owner-caption-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Native Accessible Owner Dialogs (iOS Liquid Glass) */
.owner-login-dialog {
  margin: auto;
  padding: 0;
  width: min(460px, calc(100vw - 28px));
  border-radius: 22px;
  color: var(--text);
  animation: gh-picker-in 240ms var(--ease-ios);
}

.owner-login-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme='dark'] .owner-login-dialog::backdrop {
  background: rgba(3, 5, 10, 0.64);
}

.owner-login-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.owner-login-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.owner-login-head h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--text);
}

.owner-login-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-field input,
.form-field select,
.form-field textarea {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-field textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.55;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.project-editor-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}

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

.editor-lang-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.editor-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: -6px;
}

.editor-bottom-opts {
  align-items: end;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-field input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.footer-gh-links {
  display: contents;
}

.owner-accounts-list {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-height: 220px;
  overflow-y: auto;
}

.owner-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}

.owner-account-row:last-child {
  border-bottom: none;
}

.owner-account-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.owner-account-left img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.owner-account-left strong {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text);
}

.owner-account-left span {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.owner-account-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.owner-add-account-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skills-owner-footer {
  padding-top: 18px;
}

.skills-owner-footer[hidden] {
  display: none;
}

.site-editor-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  align-self: flex-start;
  flex-wrap: wrap;
}

.site-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.site-tab-panel[hidden] {
  display: none;
}

.timeline-add-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
}

.timeline-add-row input {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.84rem;
}

@media (max-width: 560px) {
  .timeline-add-row {
    grid-template-columns: 1fr;
  }
}

.owner-bar-key-ready::after {
  content: ' · OK';
  color: var(--status);
}

@media (max-width: 600px) {
  .editor-grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-error {
  font-size: 0.84rem;
  font-weight: 500;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

[data-theme='dark'] .form-error {
  color: #fca5a5;
  background: rgba(220, 38, 38, 0.16);
}

.form-error[hidden] {
  display: none;
}

.owner-login-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.owner-login-actions .btn-primary {
  flex: 1;
}

.owner-login-actions .btn[disabled] {
  opacity: 0.65;
  cursor: wait;
}

/* ==========================================================================
   Print-Friendly A4 Resume Stylesheet (Ctrl+P / Save CV as PDF)
   ========================================================================== */

@media print {
  @page {
    size: A4;
    margin: 14mm;
  }

  :root,
  [data-theme='dark'] {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --text: #0f172a;
    --text-secondary: #1e293b;
    --text-muted: #475569;
    --border: #cbd5e1;
    --border-strong: #94a3b8;
    --accent: #1e3a5f;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 11pt;
    line-height: 1.48;
  }

  .page-atmosphere,
  .site-header,
  .hero-actions,
  .blueprint,
  .filter-tabs,
  .projects-expand-row,
  .gh-controls,
  .footer-actions,
  .site-toast,
  .owner-bar,
  .owner-login-dialog,
  .project-editor-dialog,
  .gh-picker-dialog,
  #gh-accounts-dialog,
  #site-editor-dialog,
  #skill-cat-dialog,
  .skills-owner-footer,
  .owner-project-controls,
  .skill-remove-btn,
  .skill-owner-add,
  .project-media-zoom {
    display: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .container {
    width: 100%;
    max-width: none;
  }

  .hero {
    padding: 0 0 18pt;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 12pt;
  }

  .hero-name {
    font-size: 24pt;
    margin-bottom: 6pt;
  }

  .section {
    padding: 16pt 0;
    break-inside: avoid-page;
  }

  .section-header {
    margin-bottom: 12pt;
  }

  .section-title {
    font-size: 15pt;
  }

  .about-columns {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18pt;
    margin-bottom: 14pt;
  }

  .stats-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .stat-item {
    padding: 10pt 10pt 10pt 0;
  }

  .stat-item dd {
    font-size: 13pt;
  }

  .skill-row {
    padding: 10pt 0;
    gap: 14pt;
  }

  .projects-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-item {
    padding: 10pt 12pt 10pt 0;
    break-inside: avoid;
  }

  .project-item:nth-child(even) {
    padding-left: 12pt;
    padding-right: 0;
  }

  .project-media-btn {
    max-height: 110pt;
  }

  .repo-row {
    padding: 8pt 0;
    break-inside: avoid;
  }

  .site-footer {
    padding: 14pt 0 0;
  }

  .footer-top {
    padding-bottom: 10pt;
  }

  a[href^="http"]::after {
    content: none;
  }
}
