/* ==========================================================================
   Midnight Aurora — Personal Brand Design System
   Zero dependencies • System typography • WCAG 2.2 AA • Reduced-motion aware
   ========================================================================== */

@property --spot-r {
  syntax: "<length-percentage>";
  inherits: true;
  initial-value: 0px;
}

:root {
  color-scheme: dark;
  --in-oklab: ;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);

  /* Surfaces & Background */
  --bg-canvas: #060913;
  --bg-card: rgba(13, 20, 38, 0.76);
  --bg-card-hover: rgba(20, 31, 56, 0.9);
  --bg-icon: rgba(255, 255, 255, 0.045);
  --bg-icon-hover: rgba(56, 189, 248, 0.12);
  --bg-badge: rgba(20, 184, 166, 0.11);

  /* Borders (calibrated >= 3:1 non-text contrast against --bg-canvas) */
  --border-card: #4d607d;
  --border-card-hover: #38bdf8;
  --border-icon: rgba(148, 163, 184, 0.22);
  --border-badge: rgba(45, 212, 191, 0.44);

  /* Typography colors (>= 4.5:1 AA contrast) */
  --text-primary: #f8fafc;
  --text-secondary: #dbe4f0;
  --text-muted: #94a3b8;
  --text-badge: #5eead4;

  /* Accents & Focus */
  --accent-teal: #2dd4bf;
  --accent-sky: #38bdf8;
  --accent-violet: #a78bfa;
  --focus-ring: #5eead4;

  /* Layout & Radii */
  --container-max: 33rem;
  --radius-card: 1rem;
  --radius-icon: 0.75rem;
  --radius-pill: 9999px;

  /* System font stack */
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@supports (background: linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
  }
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(
      0, 0.072 4%, 0.232 8%, 0.466 13%, 0.714 19%, 0.907 26%,
      1.011 34%, 1.038 42%, 1.028 52%, 1.009 64%, 0.999 78%, 0.999 90%, 1
    );
  }
}

/* Reset & Box Sizing (NOTE: root font-size intentionally left untouched
   so <meta name="text-scale" content="scale"> and browser preferences scale) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-block-size: 100vh;
  min-block-size: 100dvh;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   Ambient Midnight Aurora Background
   ========================================================================== */

.aurora-bg {
  position: fixed;
  inset: -24px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg-canvas);
}

.aurora-bg::before {
  content: "";
  position: absolute;
  inset: -38%;
  background:
    radial-gradient(
      ellipse 46% 38% at 30% 28% var(--in-oklab),
      rgba(45, 212, 191, 0.11) 0%,
      rgba(45, 212, 191, 0.045) 46%,
      transparent 78%
    ),
    radial-gradient(
      ellipse 50% 42% at 68% 24% var(--in-oklab),
      rgba(56, 189, 248, 0.12) 0%,
      rgba(56, 189, 248, 0.05) 46%,
      transparent 78%
    ),
    radial-gradient(
      ellipse 48% 42% at 62% 72% var(--in-oklab),
      rgba(139, 92, 246, 0.12) 0%,
      rgba(139, 92, 246, 0.05) 46%,
      transparent 78%
    );
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.82;
}

.aurora-orb--teal {
  width: clamp(28rem, 60vw, 48rem);
  height: clamp(22rem, 44vw, 36rem);
  top: -8rem;
  left: -8rem;
  background: radial-gradient(
    ellipse closest-side var(--in-oklab),
    rgba(20, 184, 166, 0.24) 0%,
    rgba(45, 212, 191, 0.15) 32%,
    rgba(20, 184, 166, 0.05) 64%,
    transparent 100%
  );
}

.aurora-orb--blue {
  --orb-w: clamp(32rem, 68vw, 54rem);
  width: var(--orb-w);
  height: clamp(24rem, 46vw, 38rem);
  top: 2rem;
  left: calc(50% - var(--orb-w) / 2);
  background: radial-gradient(
    ellipse closest-side var(--in-oklab),
    rgba(56, 189, 248, 0.22) 0%,
    rgba(56, 189, 248, 0.13) 32%,
    rgba(56, 189, 248, 0.045) 64%,
    transparent 100%
  );
}

.aurora-orb--violet {
  width: clamp(30rem, 64vw, 50rem);
  height: clamp(24rem, 48vw, 38rem);
  bottom: -9rem;
  right: -8rem;
  background: radial-gradient(
    ellipse closest-side var(--in-oklab),
    rgba(139, 92, 246, 0.24) 0%,
    rgba(167, 139, 250, 0.14) 32%,
    rgba(139, 92, 246, 0.045) 64%,
    transparent 100%
  );
}

/* Local SVG noise texture for subtle OLED anti-banding tactile depth */
.aurora-grain {
  position: absolute;
  inset: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Page Shell & Responsive Centered Container
   ========================================================================== */

.page-shell {
  position: relative;
  z-index: 1;
  min-block-size: 100vh;
  min-block-size: 100dvh;
  max-inline-size: var(--container-max);
  margin-inline: auto;
  padding-block: clamp(1.75rem, 4vh, 3rem) 1.5rem;
  padding-inline: clamp(1.125rem, 4vw, 1.75rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.75rem;
}

.profile-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

/* ==========================================================================
   Profile Header & Avatar Ring
   ========================================================================== */

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar-frame {
  appearance: none;
  position: relative;
  width: 7.25rem;
  height: 7.25rem;
  border: 0;
  border-radius: 50%;
  padding: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  display: grid;
  place-items: center;
  margin-block-end: 1rem;
  cursor: pointer;
  box-shadow:
    0 14px 36px -10px rgba(2, 6, 23, 0.85),
    0 0 32px -8px rgba(45, 212, 191, 0.25);
  transition: box-shadow 0.26s ease;
}

.avatar-frame:hover:not(:disabled) {
  box-shadow:
    0 18px 42px -10px rgba(2, 6, 23, 0.9),
    0 0 42px -6px rgba(56, 189, 248, 0.38);
}

.avatar-frame:disabled {
  cursor: default;
}

.avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--accent-teal),
    var(--accent-sky),
    var(--accent-violet)
  );
}

.avatar-ring::before {
  content: "";
  position: absolute;
  inset: -25%;
  background: conic-gradient(
    from 0deg,
    var(--accent-teal),
    var(--accent-sky),
    var(--accent-violet),
    var(--accent-sky),
    var(--accent-teal)
  );
}

.profile-avatar {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-canvas);
  background-color: #0f172a;
}

.profile-name {
  margin: 0;
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.18;
  color: var(--text-primary);
  text-wrap: balance;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .profile-name {
    background: linear-gradient(
      180deg var(--in-oklab),
      #ffffff 18%,
      #e8eff8 68%,
      #c5d3e6 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.profile-headline {
  margin: 0.45rem 0 0;
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-secondary);
  text-wrap: balance;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-block-start: 0.85rem;
}

.badge-pill {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-block-size: 1.875rem;
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-pill);
  background-color: var(--bg-badge);
  border: 1px solid var(--border-badge);
  color: var(--text-badge);
  font-size: 0.84375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.35;
  box-shadow: inset 0 1px 0 rgba(94, 234, 212, 0.14);
}

.badge-pill--link {
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.22s ease;
}

.badge-pill--link:hover,
.badge-pill--link:focus-visible {
  background-color: rgba(20, 184, 166, 0.19);
  border-color: var(--accent-teal);
  box-shadow:
    0 8px 22px -8px rgba(45, 212, 191, 0.4),
    inset 0 1px 0 rgba(94, 234, 212, 0.24);
}

.badge-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    105deg,
    transparent 24%,
    rgba(94, 234, 212, 0.24) 50%,
    transparent 76%
  );
  transform: translateX(-120%);
}

.badge-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.profile-location {
  margin: 0.7rem 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.location-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.profile-description {
  margin: 0.85rem 0 0;
  max-inline-size: 42ch;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* ==========================================================================
   Social & Custom Link Buttons
   ========================================================================== */

.links-nav {
  width: 100%;
}

.links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6875rem;
}

.links-item {
  margin: 0;
  padding: 0;
}

.link-card {
  --card-accent: var(--border-card-hover);
  --card-icon-bg: var(--bg-icon-hover);
  --card-icon-border: rgba(56, 189, 248, 0.36);
  --card-shadow: rgba(14, 165, 233, 0.28);
  --card-spot: rgba(56, 189, 248, 0.14);
  --card-rim: rgba(56, 189, 248, 0.62);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.95rem;
  width: 100%;
  min-block-size: 3.9375rem;
  padding: 0.75rem 1.05rem;
  border-radius: var(--radius-card);
  corner-shape: squircle;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  text-decoration: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 4px 16px -4px rgba(2, 6, 23, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    background-color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.24s ease;
}

/* Platform-tuned Midnight Aurora hover accents (>= 3:1 non-text contrast) */
.link-card[data-link-id="linkedin"] {
  --card-accent: #38bdf8;
  --card-icon-bg: rgba(56, 189, 248, 0.15);
  --card-icon-border: rgba(56, 189, 248, 0.44);
  --card-shadow: rgba(14, 165, 233, 0.32);
  --card-spot: rgba(56, 189, 248, 0.15);
  --card-rim: rgba(56, 189, 248, 0.65);
}

.link-card[data-link-id="instagram"] {
  --card-accent: #f472b6;
  --card-icon-bg: rgba(244, 114, 182, 0.14);
  --card-icon-border: rgba(244, 114, 182, 0.44);
  --card-shadow: rgba(236, 72, 153, 0.28);
  --card-spot: rgba(244, 114, 182, 0.14);
  --card-rim: rgba(244, 114, 182, 0.62);
}

.link-card[data-link-id="facebook"] {
  --card-accent: #60a5fa;
  --card-icon-bg: rgba(96, 165, 250, 0.15);
  --card-icon-border: rgba(96, 165, 250, 0.44);
  --card-shadow: rgba(59, 130, 246, 0.3);
  --card-spot: rgba(96, 165, 250, 0.15);
  --card-rim: rgba(96, 165, 250, 0.64);
}

.link-card[data-link-id="x"] {
  --card-accent: #e2e8f0;
  --card-icon-bg: rgba(226, 232, 240, 0.12);
  --card-icon-border: rgba(226, 232, 240, 0.38);
  --card-shadow: rgba(148, 163, 184, 0.24);
  --card-spot: rgba(226, 232, 240, 0.11);
  --card-rim: rgba(226, 232, 240, 0.56);
}

.link-card[data-link-id="bluesky"] {
  --card-accent: #38bdf8;
  --card-icon-bg: rgba(14, 165, 233, 0.16);
  --card-icon-border: rgba(56, 189, 248, 0.46);
  --card-shadow: rgba(14, 165, 233, 0.32);
  --card-spot: rgba(56, 189, 248, 0.16);
  --card-rim: rgba(56, 189, 248, 0.66);
}

.link-card[data-link-id="github"] {
  --card-accent: #a78bfa;
  --card-icon-bg: rgba(167, 139, 250, 0.15);
  --card-icon-border: rgba(167, 139, 250, 0.44);
  --card-shadow: rgba(139, 92, 246, 0.3);
  --card-spot: rgba(167, 139, 250, 0.15);
  --card-rim: rgba(167, 139, 250, 0.64);
}

.link-card[data-link-id="youtube"] {
  --card-accent: #fb7185;
  --card-icon-bg: rgba(251, 113, 133, 0.14);
  --card-icon-border: rgba(251, 113, 133, 0.44);
  --card-shadow: rgba(244, 63, 94, 0.28);
  --card-spot: rgba(251, 113, 133, 0.14);
  --card-rim: rgba(251, 113, 133, 0.62);
}

.link-card > *,
.action-pill > *,
.modal-btn > * {
  position: relative;
  z-index: 1;
}

.link-icon-wrap {
  display: grid;
  place-items: center;
  width: 2.625rem;
  height: 2.625rem;
  flex-shrink: 0;
  border-radius: var(--radius-icon);
  corner-shape: squircle;
  background-color: var(--bg-icon);
  border: 1px solid var(--border-icon);
  transition:
    background-color 0.22s ease,
    border-color 0.22s ease;
}

.link-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.link-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1 1 auto;
  min-inline-size: 0;
  text-align: start;
}

.link-label {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text-primary);
  overflow-wrap: break-word;
}

.link-description {
  font-size: 0.84375rem;
  line-height: 1.4;
  color: var(--text-muted);
  overflow-wrap: break-word;
}

.link-arrow-wrap {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.link-arrow {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
  opacity: 0.78;
  transition: opacity 0.2s ease;
}

/* Hover & Active States (color/shadow feedback always active) */
.link-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--card-accent);
  box-shadow:
    0 14px 30px -10px var(--card-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.link-card:hover .link-icon-wrap {
  background-color: var(--card-icon-bg);
  border-color: var(--card-icon-border);
}

.link-card:hover .link-arrow {
  opacity: 1;
}

/* Keyboard Focus Indicators (WCAG 2.4.7 & 1.4.11 >= 3:1 contrast) */
:where(a:any-link, button):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.link-card:focus-visible {
  background-color: var(--bg-card-hover);
  border-color: var(--card-accent);
}

.noscript-notice {
  margin: 1rem 0 0;
  padding: 1rem;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  background-color: var(--bg-card);
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Accessibility Utility & Quick Contact Actions
   ========================================================================== */

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.action-pill-wrap {
  position: relative;
  display: inline-flex;
  flex: 1 1 8.5rem;
  min-inline-size: 0;
}

.action-pill {
  --card-spot: rgba(56, 189, 248, 0.13);
  --card-rim: rgba(56, 189, 248, 0.58);
  appearance: none;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-inline-size: 24px;
  min-block-size: 2.625rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-card);
  corner-shape: squircle;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 4px 14px -4px rgba(2, 6, 23, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.22s ease;
}

.quick-actions > .action-pill {
  flex: 1 1 8.5rem;
}

.action-pill:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-card-hover);
  color: var(--text-primary);
  box-shadow:
    0 10px 24px -10px rgba(14, 165, 233, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.action-pill[data-copied],
.modal-btn[data-copied] {
  --card-spot: rgba(45, 212, 191, 0.16);
  --card-rim: rgba(45, 212, 191, 0.65);
  border-color: var(--accent-teal);
  color: var(--text-badge);
  background-color: rgba(20, 184, 166, 0.14);
}

.action-pill[data-failed],
.modal-btn[data-failed] {
  border-color: #f87171;
  color: #fecaca;
}

.btn-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  display: block;
}

.btn-icon--copied {
  display: none;
}

:is(.action-pill, .modal-btn)[data-copied] .btn-icon--default {
  display: none;
}

:is(.action-pill, .modal-btn)[data-copied] .btn-icon--copied {
  display: block;
}

/* Accessible live status bubble (shown/hidden via opacity, never display:none) */
.copy-tip {
  position: absolute;
  inset-block-end: calc(100% + 0.45rem);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  background-color: #0f172a;
  border: 1px solid var(--border-badge);
  color: var(--text-badge);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease;
  z-index: 5;
}

.copy-tip[data-visible] {
  opacity: 1;
}

/* ==========================================================================
   QR Code & Share Modal (<dialog>)
   ========================================================================== */

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgba(2, 6, 23, 0);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition-property: background-color, display, overlay;
  transition-duration: 0.26s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

.qr-dialog {
  padding: 0;
  border: 1px solid var(--border-card);
  border-radius: 1.25rem;
  corner-shape: squircle;
  background-color: rgba(10, 16, 31, 0.96);
  color: var(--text-primary);
  inline-size: min(24.5rem, calc(100vw - 2rem));
  max-block-size: calc(100dvh - 2rem);
  box-shadow:
    0 28px 64px -12px rgba(2, 6, 23, 0.9),
    0 0 40px -12px rgba(56, 189, 248, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.24s, 0.42s, 0.26s, 0.26s;
  transition-timing-function: ease-out, var(--ease-spring), ease-out, ease-out;
  transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
  .qr-dialog {
    transform: scale(0.94) translateY(8px);
  }
}

.qr-dialog[open]:where(:not([data-closing])) {
  opacity: 1;
}

@starting-style {
  .qr-dialog[open]:where(:not([data-closing])) {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .qr-dialog[open]:where(:not([data-closing])) {
    transform: scale(1) translateY(0);
  }

  @starting-style {
    .qr-dialog[open]:where(:not([data-closing])) {
      transform: scale(0.94) translateY(8px);
    }
  }
}

.qr-dialog[open]:where(:not([data-closing]))::backdrop {
  background-color: rgba(2, 6, 23, 0.72);
}

@starting-style {
  .qr-dialog[open]:where(:not([data-closing]))::backdrop {
    background-color: rgba(2, 6, 23, 0);
  }
}

.qr-dialog-panel {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.qr-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.qr-dialog-heading-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.qr-dialog-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-primary);
}

.qr-dialog-subtitle {
  margin: 0;
  font-size: 0.84375rem;
  color: var(--text-muted);
}

.dialog-close-btn {
  appearance: none;
  display: grid;
  place-items: center;
  min-inline-size: 2.25rem;
  min-block-size: 2.25rem;
  padding: 0.375rem;
  border-radius: 0.65rem;
  background-color: var(--bg-icon);
  border: 1px solid var(--border-icon);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.dialog-close-btn:hover {
  background-color: var(--bg-icon-hover);
  border-color: var(--border-card-hover);
}

.qr-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1rem 0.95rem;
  border-radius: 1rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.11), transparent 70%),
    rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.qr-code-mount {
  display: grid;
  place-items: center;
  padding: 0.5rem;
  border-radius: 0.875rem;
  background-color: #ffffff;
  box-shadow: 0 10px 28px -8px rgba(2, 6, 23, 0.75);
}

.qr-svg {
  display: block;
  inline-size: min(13.5rem, 62vw);
  block-size: auto;
  aspect-ratio: 1 / 1;
}

.qr-url-display {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  text-align: center;
}

.qr-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.copy-action-wrap {
  position: relative;
  display: flex;
  flex: 1 1 100%;
}

.modal-btn {
  --card-spot: rgba(56, 189, 248, 0.14);
  --card-rim: rgba(56, 189, 248, 0.58);
  appearance: none;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 1 1 7.5rem;
  min-inline-size: 24px;
  min-block-size: 2.75rem;
  padding: 0.6rem 0.95rem;
  border-radius: 0.8rem;
  corner-shape: squircle;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.modal-btn--primary {
  width: 100%;
  background-color: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.52);
  color: var(--text-primary);
}

.modal-btn--primary:hover {
  background-color: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-sky);
}

.modal-btn--secondary {
  background-color: var(--bg-icon);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
}

.modal-btn--secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-card-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   Persistent Manual-Popover Toast Notifications
   ========================================================================== */

.toast-region {
  position: fixed;
  inset-block-end: 1.25rem;
  inset-inline: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-inline: 0.75rem;
  pointer-events: none;
}

.toast {
  position: relative;
  inset: auto;
  margin: 0;
  display: none;
  align-items: center;
  gap: 0.6rem;
  max-inline-size: min(26rem, calc(100vw - 1.5rem));
  padding: 0.65rem 0.75rem 0.65rem 0.9rem;
  border-radius: 0.9rem;
  corner-shape: squircle;
  background-color: rgba(13, 22, 42, 0.96);
  border: 1px solid var(--border-badge);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow:
    0 16px 36px -8px rgba(2, 6, 23, 0.85),
    0 0 24px -8px rgba(45, 212, 191, 0.35);
  pointer-events: auto;
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

.toast--error {
  border-color: #f87171;
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    transform: translateY(8px);
  }
}

.toast[popover]:is(:popover-open, .\:popover-open),
.toast.is-fallback-open {
  display: inline-flex;
}

:is(.toast[popover]:is(:popover-open, .\:popover-open), .toast.is-fallback-open):where(:not([data-closing])) {
  opacity: 1;
}

@starting-style {
  :is(.toast[popover]:is(:popover-open, .\:popover-open), .toast.is-fallback-open):where(:not([data-closing])) {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  :is(.toast[popover]:is(:popover-open, .\:popover-open), .toast.is-fallback-open):where(:not([data-closing])) {
    transform: translateY(0);
  }

  @starting-style {
    :is(.toast[popover]:is(:popover-open, .\:popover-open), .toast.is-fallback-open):where(:not([data-closing])) {
      transform: translateY(8px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .qr-dialog,
  .qr-dialog::backdrop,
  .toast {
    transition-duration: 0.1s;
  }
}

.toast-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.toast-text {
  overflow-wrap: anywhere;
}

.toast-close {
  appearance: none;
  display: grid;
  place-items: center;
  min-inline-size: 1.75rem;
  min-block-size: 1.75rem;
  margin-inline-start: 0.15rem;
  padding: 0.25rem;
  border-radius: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.toast-close:hover {
  background-color: var(--bg-icon);
  border-color: var(--border-icon);
  color: var(--text-primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding-block-start: 0.75rem;
  text-align: center;
  font-size: 0.84375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.footer-inner {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.65rem;
}

.footer-sep {
  opacity: 0.45;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: rgba(148, 163, 184, 0.5);
  text-underline-offset: 0.22em;
  transition:
    color 0.18s ease,
    text-decoration-color 0.18s ease;
}

.footer-link:hover {
  color: var(--accent-teal);
  text-decoration-color: var(--accent-teal);
}

/* ==========================================================================
   Motion & Subtle Interactions (Opt-in via prefers-reduced-motion)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  /* 1. Slow ambient gradient mesh & smooth orbital aurora drift */
  .aurora-bg::before {
    animation: aurora-mesh-spin 42s linear infinite;
  }

  .aurora-orb--teal {
    animation:
      aurora-orbit-teal 24s linear infinite,
      aurora-breathe-a 15s ease-in-out infinite alternate;
  }

  .aurora-orb--blue {
    animation:
      aurora-orbit-blue 28s linear infinite,
      aurora-breathe-b 19s ease-in-out infinite alternate;
  }

  .aurora-orb--violet {
    animation:
      aurora-orbit-violet 25s linear infinite,
      aurora-breathe-c 17s ease-in-out infinite alternate;
  }

  /* 2. Profile header upward fade-in */
  .profile-header {
    animation: fade-up 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  /* 3. Subtle rotating gradient ring around avatar */
  .avatar-ring::before {
    animation: ring-spin 16s linear infinite;
  }

  /* Staggered social link card entrance (sibling-index() with --sibling-index fallback) */
  .links-item {
    --stagger-step: 0.055s;
    animation: fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(0.055s + var(--sibling-index, 1) * var(--stagger-step));
    animation-delay: calc(0.055s + sibling-index() * var(--stagger-step));
  }

  .site-footer {
    animation: fade-in 0.7s ease 0.35s both;
  }

  /* 4 & 5. Tactile spring hover lift, micro-press, arrow shift & 3D avatar depth */
  .avatar-frame {
    transform-style: preserve-3d;
    translate: var(--tilt-shift-x, 0px) var(--tilt-shift-y, 0px);
    scale: 1;
    transform: perspective(520px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition:
      scale 0.28s var(--ease-spring),
      box-shadow 0.26s ease;
  }

  .avatar-ring {
    transform: translateZ(-2px);
  }

  .profile-avatar {
    transform: translateZ(8px);
  }

  .avatar-frame:hover:not(:disabled) {
    scale: 1.035;
  }

  .avatar-frame:active:not(:disabled) {
    scale: 0.97;
  }

  .badge-pill::after {
    animation: badge-sheen 1.4s var(--ease-out) 0.9s 1 both;
  }

  .badge-pill--link {
    transition:
      transform 0.36s var(--ease-spring),
      scale 0.26s var(--ease-spring),
      background-color 0.2s ease,
      border-color 0.2s ease,
      box-shadow 0.22s ease;
  }

  .badge-pill--link:hover,
  .badge-pill--link:focus-visible {
    transform: translateY(-1.5px);
  }

  .badge-pill--link:active {
    scale: 0.975;
  }

  .link-card {
    transition:
      transform 0.42s var(--ease-spring),
      scale 0.28s var(--ease-spring),
      background-color 0.22s ease,
      border-color 0.22s ease,
      box-shadow 0.24s ease;
  }

  .action-pill,
  .modal-btn {
    transition:
      transform 0.38s var(--ease-spring),
      scale 0.26s var(--ease-spring),
      background-color 0.2s ease,
      border-color 0.2s ease,
      color 0.2s ease,
      box-shadow 0.22s ease;
  }

  .link-arrow {
    transition:
      transform 0.42s var(--ease-spring),
      opacity 0.2s ease;
  }

  .link-card:hover,
  .link-card:focus-visible {
    transform: translateY(-2px);
  }

  .action-pill:hover,
  .action-pill:focus-visible {
    transform: translateY(-1.5px);
  }

  .link-card:active,
  .action-pill:active,
  .modal-btn:active {
    scale: 0.985;
  }

  .link-card:hover .link-arrow,
  .link-card:focus-visible .link-arrow {
    transform: translateX(4px);
  }
}

/* Pointer-following spotlight sheen & hairline rim light (fine pointer only) */
@media (hover: hover) and (pointer: fine) {
  .link-card,
  .action-pill,
  .modal-btn {
    --spot-r: 0px;
  }

  .link-card::before,
  .action-pill::before,
  .modal-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(
      circle var(--spot-r, 200px) at var(--mouse-x, 50%) var(--mouse-y, 50%) var(--in-oklab),
      var(--card-spot, rgba(56, 189, 248, 0.14)),
      transparent 75%
    );
    transition:
      opacity 0.26s ease,
      --spot-r 0.34s var(--ease-out);
  }

  .link-card::after,
  .action-pill::after,
  .modal-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    padding: 1px;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(
      circle 170px at var(--mouse-x, 50%) var(--mouse-y, 50%) var(--in-oklab),
      var(--card-rim, rgba(56, 189, 248, 0.62)),
      transparent 72%
    );
    -webkit-mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
      linear-gradient(#fff 0 0) content-box,
      linear-gradient(#fff 0 0);
    mask-composite: exclude;
    transition: opacity 0.26s ease;
  }

  .link-card:hover,
  .action-pill:hover,
  .modal-btn:hover {
    --spot-r: 220px;
  }

  .link-card:hover::before,
  .link-card:hover::after,
  .action-pill:hover::before,
  .action-pill:hover::after,
  .modal-btn:hover::before,
  .modal-btn:hover::after {
    opacity: 1;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .aurora-bg {
    translate: var(--parallax-x, 0px) var(--parallax-y, 0px);
    transition: translate 0.85s var(--ease-out);
  }
}

@media (prefers-reduced-motion: reduce) {
  .link-card::before,
  .link-card::after,
  .action-pill::before,
  .action-pill::after,
  .modal-btn::before,
  .modal-btn::after {
    transition: none;
  }
}

@keyframes aurora-mesh-spin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.08);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes aurora-orbit-teal {
  0%, 100% { translate: 0 0; }
  12.5% { translate: 4vw 8vh; }
  25% { translate: 12vw 15vh; }
  37.5% { translate: 20vw 13vh; }
  50% { translate: 23vw 5vh; }
  62.5% { translate: 17vw -1vh; }
  75% { translate: 9vw -2vh; }
  87.5% { translate: 3vw 1vh; }
}

@keyframes aurora-orbit-blue {
  0%, 100% { translate: 0 0; }
  12.5% { translate: 12.5vw 3vh; }
  25% { translate: 18vw 10vh; }
  37.5% { translate: 12.5vw 17vh; }
  50% { translate: 0vw 14vh; }
  62.5% { translate: -12.5vw 17vh; }
  75% { translate: -18vw 10vh; }
  87.5% { translate: -12.5vw 3vh; }
}

@keyframes aurora-orbit-violet {
  0%, 100% { translate: 0 0; }
  12.5% { translate: -4vw -8vh; }
  25% { translate: -12vw -16vh; }
  37.5% { translate: -20vw -15vh; }
  50% { translate: -24vw -8vh; }
  62.5% { translate: -19vw -1vh; }
  75% { translate: -11vw 2vh; }
  87.5% { translate: -4vw 1vh; }
}

@keyframes aurora-breathe-a {
  0% {
    scale: 1 1;
    rotate: -6deg;
    opacity: 0.72;
  }
  100% {
    scale: 1.16 0.94;
    rotate: 14deg;
    opacity: 0.96;
  }
}

@keyframes aurora-breathe-b {
  0% {
    scale: 0.96 1.06;
    rotate: 8deg;
    opacity: 0.74;
  }
  100% {
    scale: 1.12 0.92;
    rotate: -12deg;
    opacity: 0.94;
  }
}

@keyframes aurora-breathe-c {
  0% {
    scale: 1.04 0.96;
    rotate: 10deg;
    opacity: 0.72;
  }
  100% {
    scale: 0.94 1.14;
    rotate: -14deg;
    opacity: 0.96;
  }
}

@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes badge-sheen {
  0% {
    opacity: 0;
    transform: translateX(-120%);
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

/* ==========================================================================
   Responsive Adjustments (Mobile-first)
   ========================================================================== */

@media (max-width: 25rem) {
  .avatar-frame {
    width: 6.5rem;
    height: 6.5rem;
  }

  .link-card {
    padding: 0.75rem 0.875rem;
    gap: 0.75rem;
  }

  .link-icon-wrap {
    width: 2.375rem;
    height: 2.375rem;
  }
}

@media (pointer: coarse) {
  .link-card {
    min-block-size: 4.25rem;
  }

  .action-pill,
  .modal-btn {
    min-block-size: 2.75rem;
  }

  .dialog-close-btn,
  .toast-close {
    min-inline-size: 2.5rem;
    min-block-size: 2.5rem;
  }

  .footer-link {
    display: inline-block;
    padding-block: 0.25rem;
  }
}

/* ==========================================================================
   Bottom Personal Site Button
   ========================================================================== */

.personal-site-action {
  width: 100%;
}

.quick-actions:not([hidden]) + .personal-site-action {
  margin-block-start: -0.75rem;
}

.personal-site-btn {
  --card-spot: rgba(45, 212, 191, 0.14);
  --card-rim: rgba(45, 212, 191, 0.62);
  text-decoration: none;
  color: var(--text-primary);
  background-color: rgba(13, 24, 42, 0.82);
  border-color: var(--border-badge);
}

.personal-site-btn:hover {
  border-color: var(--accent-teal);
  box-shadow:
    0 10px 24px -10px rgba(45, 212, 191, 0.32),
    inset 0 1px 0 rgba(94, 234, 212, 0.14);
}

.personal-site-btn .btn-arrow {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  display: block;
  opacity: 0.82;
  transition: opacity 0.2s ease;
}

.personal-site-btn:hover .btn-arrow {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .personal-site-btn .btn-arrow {
    transition:
      transform 0.38s var(--ease-spring),
      opacity 0.2s ease;
  }

  .personal-site-btn:hover .btn-arrow,
  .personal-site-btn:focus-visible .btn-arrow {
    transform: translateX(3px);
  }
}

/* ==========================================================================
   Windows High Contrast / Forced Colors Mode Support
   ========================================================================== */

@media (forced-colors: active) {
  .aurora-bg,
  .avatar-ring,
  .badge-pill::after,
  .link-card::before,
  .link-card::after,
  .action-pill::before,
  .action-pill::after,
  .modal-btn::before,
  .modal-btn::after {
    display: none;
  }

  .profile-name {
    background: none;
    color: CanvasText;
  }

  .profile-avatar {
    border: 2px solid CanvasText;
  }

  .badge-pill,
  .qr-dialog,
  .toast {
    border: 1px solid CanvasText;
  }

  .action-pill,
  .modal-btn,
  .dialog-close-btn,
  .toast-close {
    border: 1px solid ButtonText;
  }

  .link-card,
  .badge-pill--link,
  .personal-site-btn {
    border: 1px solid LinkText;
  }

  .link-card:hover,
  .link-card:focus-visible,
  .action-pill:focus-visible,
  .modal-btn:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}

