/* ===========================================================================
   Megapaint Corporation — Public design system
   Premium, iOS-inspired, mobile-first. Vanilla CSS, no framework.
   Original visual identity (not a copy of Apple's proprietary UI).
   =========================================================================== */

/* ---------------------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Brand */
  --brand: #2f6bff;
  --brand-dark: #1e4fd0;
  --brand-light: #eaf1ff;
  --indigo: #4a4fce;

  /* Ink / text */
  --ink: #0b1220;
  --ink-soft: #3b4453;
  --muted: #6b7280;
  --muted-light: #98a1b0;

  /* Surfaces */
  --bg: #f5f6fa;
  --bg-elev: #eef0f6;
  --card: #ffffff;
  --card-2: #ffffff;
  --border: #e7e9f0;
  --border-strong: #d6dae4;

  /* Status */
  --success: #0f9d63;
  --success-bg: #e6f7ef;
  --warning: #b7791f;
  --warning-bg: #fdf3e2;
  --danger: #e03131;
  --danger-bg: #fdecec;

  /* Glass */
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);

  /* Radii — generous, iOS-like */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  /* Soft, layered shadows (never heavy/glossy) */
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.05), 0 1px 3px rgba(11, 18, 32, 0.04);
  --shadow: 0 6px 20px rgba(11, 18, 32, 0.07);
  --shadow-lg: 0 18px 48px rgba(11, 18, 32, 0.12);

  /* Motion */
  --t-fast: 140ms;
  --t: 220ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Touch targets */
  --tap: 48px;

  /* Font: system stack, no proprietary downloads */
  --ff: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
        "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;

  /* Safe areas */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* Dark mode — automatic, plus manual override via [data-theme] on <html> */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #5b8bff;
    --brand-dark: #3f74f5;
    --brand-light: #16233f;
    --indigo: #7a7fe6;
    --ink: #f2f4f9;
    --ink-soft: #c3cad6;
    --muted: #9aa3b2;
    --muted-light: #6d7686;
    --bg: #0a0e17;
    --bg-elev: #121826;
    --card: #141a27;
    --card-2: #1a2130;
    --border: #232b3b;
    --border-strong: #2f3849;
    --success: #37c98b;
    --success-bg: #10281e;
    --warning: #e0a94a;
    --warning-bg: #2a2113;
    --danger: #ff6b6b;
    --danger-bg: #2c1616;
    --glass: rgba(18, 24, 38, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  }
}

/* Manual dark mode (toggle sets data-theme="dark") */
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #5b8bff;
  --brand-dark: #3f74f5;
  --brand-light: #16233f;
  --indigo: #7a7fe6;
  --ink: #f2f4f9;
  --ink-soft: #c3cad6;
  --muted: #9aa3b2;
  --muted-light: #6d7686;
  --bg: #0a0e17;
  --bg-elev: #121826;
  --card: #141a27;
  --card-2: #1a2130;
  --border: #232b3b;
  --border-strong: #2f3849;
  --success: #37c98b;
  --success-bg: #10281e;
  --warning: #e0a94a;
  --warning-bg: #2a2113;
  --danger: #ff6b6b;
  --danger-bg: #2c1616;
  --glass: rgba(18, 24, 38, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--ff);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-left: var(--sal);
  padding-right: var(--sar);
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px);
}
.container-narrow { max-width: 920px; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.2rem); }
h2 { font-size: clamp(1.35rem, 3.2vw, 1.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.text-muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---------------------------------------------------------------------------
   Buttons — rounded, touch-friendly, clear states
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  min-height: var(--tap);
  padding: .7rem 1.3rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--brand-light); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(47, 107, 255, .28); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-outline { background: var(--card); color: var(--brand); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--brand-light); border-color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-elev); }

.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: .45rem .9rem; font-size: .85rem; }
.btn-lg { min-height: 54px; padding: .95rem 1.8rem; font-size: 1.05rem; }
.btn svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------------------
   Badges / chips
   --------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .74rem; font-weight: 600;
  padding: .3rem .65rem; border-radius: var(--radius-pill);
  background: var(--bg-elev); color: var(--ink-soft);
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-brand { background: var(--brand-light); color: var(--brand); }

.chip {
  display: inline-block;
  padding: .45rem .85rem;
  margin: 0 .4rem .4rem 0;
  border-radius: var(--radius-pill);
  background: var(--brand-light);
  color: var(--brand);
  font-size: .82rem;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Cards — soft & elevated
   --------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: clamp(1.2rem, 3vw, 1.6rem); }
.card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; }

/* ---------------------------------------------------------------------------
   Public header / navbar — glass, sticky, safe-area aware
   --------------------------------------------------------------------------- */
.site-header {
  /* Solid white to match the Megapaint logo background (no glass/translucency). */
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: var(--sat);
}
/* On the white header the brand/link text must stay dark, even in dark mode. */
.site-header .brand,
.site-header .nav-links a { color: #1a1d24; }
.site-header .theme-toggle { color: #3d4453; }
.navbar { display: flex; align-items: center; gap: 1rem; min-height: 60px; }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--indigo));
  color: #fff; display: grid; place-items: center; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.brand-logo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.brand--logo { gap: 0; }
.brand--logo .brand-logo { width: auto; height: 42px; max-width: 210px; border-radius: 0; object-fit: contain; }
/* Platform wordmark (VeriTap) used on the homepage header instead of the company logo. */
.brand--platform { gap: .55rem; }
.brand--platform .brand-word { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; color: var(--ink); }

.nav-search { flex: 1; max-width: 420px; position: relative; }
.nav-search input {
  width: 100%; min-height: 44px;
  padding: .6rem .9rem .6rem 2.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  color: var(--ink);
  font: inherit; font-size: .9rem;
}
.nav-search input:focus { outline: none; background: var(--card); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.nav-search svg { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 1.3rem; margin-left: auto; }
.nav-links a { color: var(--ink-soft); font-weight: 600; font-size: .92rem; }
.nav-links a:hover { color: var(--brand); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; min-width: var(--tap); min-height: var(--tap); align-items: center; justify-content: center; }
.nav-toggle svg { width: 26px; height: 26px; color: var(--ink); }

/* Theme toggle button */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--card);
  color: var(--ink-soft); cursor: pointer; flex: 0 0 auto;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.theme-toggle:hover { background: var(--bg-elev); color: var(--brand); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }
.navbar > .theme-toggle { margin-left: auto; }
.navbar > .nav-links { margin-left: .8rem; }
@media (max-width: 767px) { .navbar > .nav-links { margin-left: 0; } }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, #1e4fd0 0%, #2f6bff 55%, #4a4fce 100%);
  color: #fff;
  padding: clamp(3rem, 8vw, 5rem) 0;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -120px; top: -120px;
  width: 380px; height: 380px; background: rgba(255,255,255,.08); border-radius: 50%;
}
/* Hero background video */
.hero--video .container { position: relative; z-index: 2; }
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; border: 0;
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(135deg, rgba(30,79,208,.82) 0%, rgba(47,107,255,.72) 55%, rgba(74,79,206,.82) 100%);
}
.hero--video::after { z-index: 1; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 6vw, 2.8rem); max-width: 680px; }
.hero p { color: rgba(255,255,255,.92); font-size: clamp(1rem, 2.5vw, 1.15rem); max-width: 580px; }
.hero .btn-primary { background: #fff; color: var(--brand-dark); box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.hero .btn-primary:hover { background: #eef2ff; }
.hero .btn-outline { border-color: rgba(255,255,255,.6); color: #fff; background: rgba(255,255,255,.06); }
.hero .btn-outline:hover { background: rgba(255,255,255,.14); }

/* ---------------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------------- */
.section { padding: clamp(2.5rem, 6vw, 3.5rem) 0; }
.section-head { text-align: center; margin-bottom: 2.2rem; }
.section-head h2 { font-size: clamp(1.5rem, 4vw, 1.9rem); }
.section-head p { color: var(--muted); max-width: 560px; margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .76rem; font-weight: 700; color: var(--brand); margin-bottom: .5rem; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.4rem; }
.feature {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.7rem; box-shadow: var(--shadow-sm);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-icon { width: 52px; height: 52px; border-radius: 15px; background: var(--brand-light); color: var(--brand); display: grid; place-items: center; margin-bottom: 1rem; }
.feature-icon svg { width: 26px; height: 26px; }

/* ---------------------------------------------------------------------------
   Directory
   --------------------------------------------------------------------------- */
.page-head { padding: 2.2rem 0 1.4rem; }
.page-head h1 { margin-bottom: .25rem; }

.toolbar { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.8rem; }
.toolbar .search-field { flex: 1; min-width: 220px; position: relative; }
.toolbar .search-field input, .toolbar select {
  width: 100%; min-height: var(--tap);
  padding: .75rem .95rem; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font: inherit; background: var(--card); color: var(--ink);
}
.toolbar .search-field input { padding-left: 2.5rem; }
.toolbar .search-field svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.toolbar select { max-width: 220px; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }

.employee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.4rem; }

.emp-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.emp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.emp-card-banner { height: 80px; background: linear-gradient(135deg, var(--brand), var(--indigo)); }
.emp-card-body { padding: 0 1.3rem 1.4rem; text-align: center; margin-top: -40px; flex: 1; display: flex; flex-direction: column; }
.emp-avatar, .emp-avatar-fallback {
  width: 80px; height: 80px; border-radius: 50%; border: 4px solid var(--card);
  margin: 0 auto .8rem; box-shadow: var(--shadow-sm);
}
.emp-avatar { object-fit: cover; background: var(--brand-light); }
.emp-avatar-fallback { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--indigo)); color: #fff; font-weight: 700; font-size: 1.5rem; }
.emp-name { font-weight: 700; font-size: 1.1rem; margin: 0; }
.emp-role { color: var(--ink-soft); font-size: .92rem; margin: .15rem 0 0; }
.emp-dept { color: var(--muted); font-size: .85rem; margin: .1rem 0 .5rem; }
.emp-id { font-size: .72rem; color: var(--muted-light); letter-spacing: .04em; }
.emp-bio { color: var(--muted); font-size: .85rem; margin: .6rem 0; flex: 1; }
.emp-skills { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; margin-bottom: 1rem; }
.emp-skills .chip { font-size: .72rem; padding: .28rem .65rem; margin: 0; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: .4rem; margin: 2.4rem 0 1rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  padding: .5rem .7rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink-soft); font-weight: 600; font-size: .9rem;
}
.pagination a:hover { background: var(--brand-light); text-decoration: none; }
.pagination .active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled { opacity: .5; pointer-events: none; }

/* Empty state */
.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty-state svg { width: 56px; height: 56px; color: var(--muted-light); margin-bottom: 1rem; }
.empty-state h3 { color: var(--ink); }

/* ---------------------------------------------------------------------------
   Skeleton loaders
   --------------------------------------------------------------------------- */
.skeleton { position: relative; overflow: hidden; background: var(--bg-elev); border-radius: var(--radius-sm); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
:root[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
.skeleton-line { height: 12px; margin: .5rem 0; }
.skeleton-line.short { width: 55%; }
.skeleton-circle { width: 80px; height: 80px; border-radius: 50%; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------------------------------------------------------------------------
   Employee profile — detailed, premium, responsive
   --------------------------------------------------------------------------- */
.profile-wrap { padding: 1.5rem 0 3rem; }
.profile-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1.4rem;
}
.profile-cover {
  height: clamp(140px, 28vw, 220px);
  background: linear-gradient(135deg, #1e4fd0, #2f6bff 55%, #4a4fce);
  background-size: cover; background-position: center;
  position: relative;
}
.cover-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.28) 100%); }
.profile-cover--video { background: #0b1220; }
.cover-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

.profile-header { padding: 0 clamp(1.2rem, 4vw, 2rem) 1.4rem; position: relative; }

/* Identity row: avatar + name/headline/meta */
.profile-idrow { display: flex; align-items: flex-end; gap: clamp(1rem, 3vw, 1.6rem); }
.profile-avatar-wrap { position: relative; flex: 0 0 auto; }
.profile-photo, .profile-photo-fallback {
  width: clamp(104px, 26vw, 152px); height: clamp(104px, 26vw, 152px);
  border-radius: 50%; border: 5px solid var(--card);
  margin-top: calc(clamp(104px, 26vw, 152px) / -2);
  box-shadow: var(--shadow);
}
.profile-photo { object-fit: cover; background: var(--card); }
.profile-photo-fallback { display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--indigo)); color: #fff; font-weight: 800; font-size: clamp(2rem, 8vw, 3rem); }
.avatar-badge {
  position: absolute; right: 4px; bottom: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  border: 3px solid var(--card); box-shadow: var(--shadow-sm);
}
.avatar-badge svg { width: 16px; height: 16px; }

.profile-headtext { flex: 1; min-width: 0; padding-bottom: .2rem; }
.profile-name { font-size: clamp(1.4rem, 5vw, 1.9rem); margin: .9rem 0 .15rem; display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.verified-chip {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .02em;
  padding: .22rem .55rem; border-radius: var(--radius-pill);
  background: var(--success-bg); color: var(--success);
}
.verified-chip svg { width: 13px; height: 13px; }
.profile-headline { color: var(--ink-soft); font-size: clamp(1rem, 3vw, 1.1rem); margin: 0 0 .55rem; }
.profile-meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .9rem; }
.profile-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.profile-meta svg { width: 16px; height: 16px; color: var(--muted-light); flex: 0 0 auto; }

/* "Add me to your contacts" button — premium full-width card button */
.save-contact-btn {
  display: flex; align-items: center; gap: .9rem;
  margin-top: 1.1rem; width: 100%;
  padding: .9rem 1.1rem; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), var(--indigo));
  color: #fff; text-decoration: none;
  box-shadow: 0 6px 20px rgba(47,107,255,.3);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.save-contact-btn:hover { text-decoration: none; filter: brightness(1.05); box-shadow: 0 10px 28px rgba(47,107,255,.4); transform: translateY(-2px); }
.save-contact-btn:active { transform: translateY(0) scale(.99); }
.save-contact-btn:focus-visible { outline: 3px solid var(--brand-light); outline-offset: 2px; }
.save-contact-ic {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center; background: rgba(255,255,255,.18);
}
.save-contact-ic svg { width: 22px; height: 22px; }
.save-contact-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.save-contact-title { font-weight: 700; font-size: 1rem; }
.save-contact-sub { font-size: .8rem; color: rgba(255,255,255,.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-contact-chevron { flex: 0 0 auto; opacity: .9; }
@media (prefers-reduced-motion: reduce) { .save-contact-btn { transition: none; } }

/* At-a-glance stat tiles */
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; margin-top: 1.3rem; }
.pstat { display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pstat-ic { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: var(--brand-light); color: var(--brand); display: grid; place-items: center; }
.pstat-text { display: flex; flex-direction: column; min-width: 0; }
.pstat-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.pstat-value { font-weight: 700; font-size: .95rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Action buttons row — horizontally scrollable on small screens */
.profile-actions { display: flex; flex-wrap: wrap; gap: .6rem; padding: 1.2rem clamp(1.2rem, 4vw, 2rem) 0; }
.action-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: var(--tap);
  padding: .65rem 1.15rem; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--card); color: var(--ink-soft);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.action-btn:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand); text-decoration: none; }
.action-btn:active { transform: scale(.97); }
.action-btn svg { width: 18px; height: 18px; }
.action-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 4px 14px rgba(47,107,255,.28); }
.action-btn.primary:hover { background: var(--brand-dark); color: #fff; }

.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.4rem; align-items: start; }
.profile-main { min-width: 0; }
.profile-aside { min-width: 0; }
.profile-aside-sticky { position: sticky; top: 84px; }
.profile-bio { white-space: pre-line; margin: 0; color: var(--ink-soft); }
.skill-cloud { display: flex; flex-wrap: wrap; gap: .1rem; }
.contact-list .cwrap { display: flex; flex-direction: column; min-width: 0; }
.qr-url { word-break: break-all; margin: .2rem 0 .8rem; }
.qr-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-bottom: .3rem; }

/* Collapsible QR card — hidden by default, smooth expand/collapse */
.qr-collapsible { text-align: center; }
.qr-toggle {
  display: flex; align-items: center; gap: .8rem;
  width: 100%; min-height: var(--tap);
  background: none; border: 0; cursor: pointer; padding: 0; margin: 0;
  font: inherit; text-align: left; color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast) var(--ease);
}
.qr-toggle:hover { background: var(--bg-elev); }
.qr-toggle:focus-visible { outline: 3px solid var(--brand-light); outline-offset: 2px; }
.qr-toggle-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; background: var(--brand-light); color: var(--brand);
}
.qr-toggle-icon svg { width: 20px; height: 20px; }
.qr-toggle-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qr-toggle-title { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.qr-toggle-sub { font-size: .78rem; color: var(--muted); }
.qr-toggle-chevron { flex: 0 0 auto; display: inline-flex; color: var(--muted); transition: transform var(--t) var(--ease); }
.qr-collapsible.open .qr-toggle-chevron { transform: rotate(180deg); }
.qr-collapsible.open .qr-toggle-icon { background: var(--brand); color: #fff; }

/* Collapse animation. Robust across browsers: the panel is display:none when
   closed (guaranteed to hide/show), with a max-height + opacity transition
   layered on for a smooth reveal where supported. */
.qr-collapse { display: none; }
.qr-collapsible.open .qr-collapse { display: block; }
.qr-collapse > .qr-panel {
  padding-top: 1rem;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height var(--t) var(--ease), opacity var(--t) var(--ease);
}
.qr-collapsible.open .qr-collapse > .qr-panel {
  max-height: 640px;
  opacity: 1;
}

/* QR image framing */
.qr-frame { display: inline-block; }
.qr-frame img { margin: 0 auto; }

@media (prefers-reduced-motion: reduce) {
  .qr-toggle-chevron,
  .qr-collapse > .qr-panel { transition: none; }
}

.section-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: clamp(1.3rem, 3vw, 1.7rem); margin-bottom: 1.4rem;
}
.section-card h2 { font-size: 1.2rem; margin: 0 0 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .55rem; }
.section-card h2 svg { width: 20px; height: 20px; color: var(--brand); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.4rem 1.6rem; border-left: 2px solid var(--border); }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid var(--card); box-shadow: 0 0 0 2px var(--brand-light); }
.timeline .t-title { font-weight: 700; }
.timeline .t-sub { color: var(--brand); font-size: .9rem; }
.timeline .t-date { color: var(--muted); font-size: .82rem; margin: .1rem 0 .3rem; }
.timeline .t-desc { color: var(--ink-soft); font-size: .92rem; }

/* Contact list */
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; align-items: center; gap: .8rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list .ci { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-light); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.contact-list .ci svg { width: 18px; height: 18px; }
.contact-list .cl { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.contact-list .cv { font-weight: 600; word-break: break-word; }

/* QR / NFC */
.qr-box { text-align: center; }
.qr-box img { margin: 0 auto .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem; background: #fff; width: min(240px, 70vw); height: auto; }
.nfc-indicator { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: var(--radius-pill); background: var(--success-bg); color: var(--success); font-weight: 600; font-size: .85rem; }
.nfc-indicator svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------------------
   Portfolio builder (.pf) — layouts: sidebar | classic | compact
   Accent comes from inline --accent / --accent-rgb on .pf
   --------------------------------------------------------------------------- */
.pf { --accent: #2f6bff; --accent-rgb: 47,107,255; --accent-soft: rgba(var(--accent-rgb), .12); padding: 1.5rem 0 2.5rem; }
.pf-container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 clamp(12px, 4vw, 24px); }
.pf-layout { display: grid; gap: 1.1rem; align-items: start; }
.pf-main { min-width: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.pf-side { min-width: 0; display: flex; flex-direction: column; gap: 1.1rem; }
.pf-aside-sections { display: flex; flex-direction: column; gap: 1.1rem; }

.pf-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: clamp(1.1rem, 3vw, 1.4rem);
}
.pf-card-title { font-size: 1rem; font-weight: 800; margin: 0 0 .8rem; letter-spacing: -.01em; }
.pf-muted { color: var(--muted); font-size: .88rem; margin: 0; }
.pf-bio { white-space: pre-line; margin: 0; color: var(--ink-soft); font-size: .92rem; }

/* Identity card */
.pf-id { padding: 0; overflow: hidden; }
.pf-banner {
  position: relative; height: 112px; background-color: #0f2557;
  background-size: cover; background-position: center;
}
.pf-banner--accent { background-image: linear-gradient(120deg, #0b1220 0%, var(--accent) 100%); }
.pf-banner-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pf-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; }
.pf-theme-btn.theme-toggle {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; z-index: 2;
  background: rgba(255,255,255,.88); border: 0; color: #1a1d24; box-shadow: var(--shadow-sm);
}
.pf-theme-btn.theme-toggle svg { width: 16px; height: 16px; }
.pf-id-body { padding: 0 1.2rem 1.3rem; text-align: center; }
.pf-avatar {
  position: relative; width: 104px; height: 104px; margin: -52px auto .7rem; border-radius: 50%;
  border: 4px solid var(--card); background: var(--accent-soft); box-shadow: var(--shadow);
  display: grid; place-items: center; z-index: 1;
}
.pf-avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pf-avatar-initials { font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: .02em; }
.pf-avatar-badge { position: absolute; right: 0; bottom: 4px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; border: 3px solid var(--card); }
.pf-avatar-badge svg { width: 13px; height: 13px; }
.pf-name { font-size: clamp(1.25rem, 4vw, 1.45rem); margin: 0 0 .3rem; font-weight: 800; }
.pf-verified { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; font-weight: 700; padding: .18rem .55rem; border-radius: var(--radius-pill); background: var(--success-bg); color: var(--success); }
.pf-verified svg { width: 12px; height: 12px; }
.pf-headline { margin: .55rem 0 .2rem; color: var(--ink-soft); font-size: .9rem; }
.pf-role { margin: .3rem 0 .1rem; color: var(--accent); font-weight: 700; font-size: .92rem; }
.pf-meta { margin: 0; color: var(--muted); font-size: .8rem; }

.pf-actions { display: flex; flex-direction: column; gap: .55rem; margin-top: 1rem; }
.pf-btn-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .55rem; }
.pf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem .9rem; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .86rem; cursor: pointer; text-decoration: none;
  transition: filter var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.pf-btn:hover { text-decoration: none; }
.pf-btn:active { transform: scale(.98); }
.pf-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.pf-btn--primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(var(--accent-rgb), .3); }
.pf-btn--primary:hover { filter: brightness(1.07); color: #fff; }
.pf-btn--ghost { background: var(--card); color: var(--ink); border-color: var(--border-strong); }
.pf-btn--ghost:hover { background: var(--bg-elev); }
.pf-btn--soft { background: var(--accent-soft); color: var(--accent); }
.pf-btn--soft:hover { filter: brightness(.97); }
.pf-btn--sm { min-height: 36px; font-size: .8rem; padding: .4rem .75rem; }
.pf-btn--block { width: 100%; }
.pf-btn-row .pf-btn { white-space: nowrap; padding-left: .5rem; padding-right: .5rem; min-width: 0; }
.pf--sidebar .pf-btn-row .pf-btn svg { display: none; }
.pf-aside-sections .pf-qr { flex-direction: column; text-align: center; }
.pf-aside-sections .pf-qr-actions { justify-content: center; }

/* What I do */
.pf-bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.pf-bullets li { display: flex; gap: .65rem; align-items: baseline; font-size: .9rem; color: var(--ink-soft); }
.pf-bullet { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; transform: translateY(-1px); }

/* Skills */
.pf-skill-group + .pf-skill-group { margin-top: .9rem; }
.pf-skill-head { font-size: .78rem; font-weight: 700; color: var(--muted); margin: 0 0 .45rem; letter-spacing: .01em; }
.pf-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.pf-chip {
  --chip: var(--accent);
  display: inline-flex; align-items: center; padding: .32rem .7rem; border-radius: 7px;
  font-size: .8rem; font-weight: 600; color: var(--ink);
  background: var(--bg-elev); border: 1px solid var(--border); border-left: 3px solid var(--chip);
}

/* Contact details */
.pf-contact { list-style: none; margin: 0; padding: 0; }
.pf-contact li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.pf-contact li:first-child { padding-top: 0; }
.pf-contact li:last-child { border-bottom: 0; padding-bottom: 0; }
.pf-contact-text { display: flex; flex-direction: column; min-width: 0; }
.pf-contact-label { font-size: .72rem; color: var(--muted); }
.pf-contact-val { font-weight: 600; font-size: .9rem; color: var(--ink); word-break: break-word; }
a.pf-contact-val:hover { color: var(--accent); }
.pf-copy { flex: 0 0 auto; font: inherit; font-size: .75rem; font-weight: 700; padding: .35rem .7rem; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--card); color: var(--ink); cursor: pointer; }
.pf-copy:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* QR */
.pf-qr { display: flex; gap: 1rem; align-items: center; }
.pf-qr-img { flex: 0 0 auto; padding: .5rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.pf-qr-img img { width: 130px; height: 130px; }
.pf-qr-text strong { display: block; font-size: .92rem; margin-bottom: .25rem; }
.pf-qr-text p { font-size: .82rem; color: var(--muted); margin: 0 0 .7rem; }
.pf-qr-actions { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: .5rem; }

/* CV */
.pf-card--cv { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.pf-card--cv .pf-card-title { margin-bottom: .2rem; }

.pf .timeline li::before { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pf .timeline .t-sub { color: var(--accent); }

.pf-foot { text-align: center; color: var(--muted); font-size: .75rem; margin-top: 1.6rem; line-height: 1.6; }
.pf-foot strong { color: var(--ink); }

/* Layout: sidebar (default) */
.pf--sidebar .pf-layout { grid-template-columns: 300px minmax(0, 1fr); }
.pf--sidebar .pf-side { position: sticky; top: 84px; }
.is-live-preview .pf--sidebar .pf-side { top: 12px; }

/* Layout: classic — wide identity header, body with aside */
.pf--classic .pf-layout { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "id id" "main aside"; }
.pf--classic .pf-side { display: contents; }
.pf--classic .pf-id { grid-area: id; }
.pf--classic .pf-aside-sections { grid-area: aside; }
.pf--classic .pf-main { grid-area: main; }
.pf--classic .pf-banner { height: clamp(140px, 24vw, 210px); }
.pf--classic .pf-id-body { display: grid; grid-template-columns: auto minmax(0, 1fr) 260px; gap: 0 1.4rem; align-items: end; text-align: left; padding: 0 1.6rem 1.4rem; }
.pf--classic .pf-avatar { width: 136px; height: 136px; margin: -68px 0 0; }
.pf--classic .pf-avatar-initials { font-size: 2.6rem; }
.pf--classic .pf-name { margin-top: .8rem; font-size: clamp(1.4rem, 4vw, 1.8rem); }
.pf--classic .pf-actions { margin-top: 0; }

/* Layout: compact — one centered card */
.pf--compact .pf-container { max-width: 560px; }
.pf--compact .pf-layout { grid-template-columns: minmax(0, 1fr); }
.pf--compact .pf-banner { height: 96px; }
.pf--compact .pf-main .pf-card { box-shadow: none; }

@media (max-width: 900px) {
  .pf--sidebar .pf-layout, .pf--classic .pf-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "id" "main" "aside"; }
  .pf--sidebar .pf-btn-row .pf-btn svg { display: inline; }
  .pf--sidebar .pf-side { position: static; }
  .pf--classic .pf-id-body { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 0 1.2rem 1.3rem; }
  .pf--classic .pf-avatar { width: 112px; height: 112px; margin: -56px auto .7rem; }
  .pf--classic .pf-actions { margin-top: 1rem; width: 100%; }
}
@media (max-width: 480px) {
  .pf { padding-top: .8rem; }
  .pf-qr { flex-direction: column; text-align: center; }
  .pf-qr-actions { justify-content: center; }
}

/* ---------------------------------------------------------------------------
   Mobile sticky bottom action bar (profile) — glass + safe area
   --------------------------------------------------------------------------- */
.mobile-actionbar { display: none; }
.mobile-actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: .55rem clamp(12px, 4vw, 20px);
  padding-bottom: calc(.55rem + var(--sab));
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border);
  gap: .5rem;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .mobile-actionbar { background: var(--card); }
}
/* Side icon buttons (Call / Email) — compact, stacked icon + label. */
.mobile-actionbar a, .mobile-actionbar button {
  flex: 0 0 auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  min-width: 60px; min-height: var(--tap); padding: .35rem .5rem; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
  font: inherit; font-size: .68rem; font-weight: 600; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-actionbar a:active, .mobile-actionbar button:active { background: var(--bg-elev); }
.mobile-actionbar svg { width: 22px; height: 22px; }
.mobile-actionbar a.primary, .mobile-actionbar button.primary { color: var(--brand); }

/* Centered, emphasized "Add to Contacts" — a filled pill, icon beside the text. */
.mobile-actionbar .primary-center {
  flex: 1 1 auto; max-width: 300px;
  flex-direction: row; gap: .5rem;
  background: var(--brand); color: #fff;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(47,107,255,.35);
  padding: .7rem 1rem; min-height: 52px;
  font-size: .95rem; font-weight: 700;
}
.mobile-actionbar .primary-center svg { width: 22px; height: 22px; flex: 0 0 auto; }
.mobile-actionbar .primary-center:active { background: var(--brand-dark); }

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.site-footer { background: #0a0e17; color: #c4cbd8; padding: 2.6rem 0 calc(1.6rem + var(--sab)); margin-top: 2rem; }
.site-footer a { color: #dfe4ee; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-brand { font-weight: 800; color: #fff; font-size: 1.15rem; display: flex; align-items: center; gap: .6rem; }
.footer-brand--logo { display: inline-flex; }
.footer-logo { height: 54px; width: auto; max-width: 240px; object-fit: contain; background: #fff; padding: 8px 12px; border-radius: 12px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 1.8rem; padding-top: 1.2rem; font-size: .85rem; color: #93a0b4; }

/* ---------------------------------------------------------------------------
   Toast
   --------------------------------------------------------------------------- */
.toast-wrap { position: fixed; right: 20px; bottom: calc(20px + var(--sab)); z-index: 100; display: flex; flex-direction: column; gap: .6rem; max-width: calc(100vw - 40px); }
.toast { background: var(--ink); color: var(--bg); padding: .9rem 1.2rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: .9rem; font-weight: 500; opacity: 0; transform: translateY(12px) scale(.98); transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }

/* Alerts */
.alert { padding: .9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .92rem; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-aside-sticky { position: static; }
}
@media (max-width: 560px) {
  /* Center the identity block on phones for a cleaner, app-like header */
  .profile-idrow { flex-direction: column; align-items: center; text-align: center; gap: .2rem; }
  .profile-photo, .profile-photo-fallback { margin-top: calc(clamp(104px, 26vw, 152px) / -2); }
  .profile-name { justify-content: center; }
  .profile-meta { justify-content: center; }
  .profile-stats { grid-template-columns: 1fr 1fr; }
  .pstat-value { white-space: normal; }
}
@media (max-width: 767px) {
  .nav-search { display: none; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #ffffff; flex-direction: column; align-items: stretch;
    gap: 0; padding: .5rem 0; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .9rem 20px; min-height: var(--tap); display: flex; align-items: center; color: #1a1d24; }
  /* Brand pushes the controls to the right; toggle + hamburger sit together at the far right. */
  .navbar > .brand { margin-right: auto; }
  .navbar > .theme-toggle { margin-left: 0; }
  .nav-toggle { display: inline-flex; margin-left: 0; }
  .brand--logo .brand-logo { height: 38px; max-width: 160px; }

  /* Profile actions become a horizontal scroll strip; sticky bar covers primary actions */
  .profile-actions { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: .3rem; }
  .profile-actions::-webkit-scrollbar { display: none; }
  .action-btn { flex: 0 0 auto; }

  /* Show the sticky bottom bar on phones */
  .mobile-actionbar { display: flex; }
  /* Give content clearance so the bar never covers it */
  body.has-actionbar .profile-wrap { padding-bottom: calc(4.5rem + var(--sab)); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
