:root,
html[data-theme='dark'] {
  --bg: #07080b;
  --surface-hover: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.1);
  --corner: rgba(255, 255, 255, 0.16);
  --grid-line: rgba(255, 255, 255, 0.028);
  --text: #f4f4f5;
  --text-soft: #a1a1aa;
  --text-muted: #71717a;
  --role-grad: linear-gradient(95deg, #e2e8f0 0%, #67e8f9 52%, #a5b4fc 100%);
  --underline: rgba(103, 232, 249, 0.42);
  --underline-active: #67e8f9;
  --accent-bar: linear-gradient(180deg, #22d3ee 0%, rgba(165, 180, 252, 0.25) 100%);
  --dot: #10b981;
  --focus: #22d3ee;
  --logo-filter: none;
  --glow: rgba(56, 189, 248, 0.065);
  --aurora-a: rgba(34, 211, 238, 0.09);
  --aurora-b: rgba(99, 102, 241, 0.08);
}

html[data-theme='light'] {
  --bg: #f8fafc;
  --surface-hover: rgba(15, 23, 42, 0.045);
  --border: rgba(15, 23, 42, 0.1);
  --corner: rgba(15, 23, 42, 0.18);
  --grid-line: rgba(15, 23, 42, 0.035);
  --text: #09090b;
  --text-soft: #475569;
  --text-muted: #64748b;
  --role-grad: linear-gradient(95deg, #0f172a 0%, #0284c7 55%, #4338ca 100%);
  --underline: rgba(2, 132, 199, 0.35);
  --underline-active: #0284c7;
  --accent-bar: linear-gradient(180deg, #0284c7 0%, rgba(67, 56, 202, 0.2) 100%);
  --dot: #059669;
  --focus: #0284c7;
  --logo-filter: invert(1);
  --glow: rgba(14, 165, 233, 0.05);
  --aurora-a: rgba(14, 165, 233, 0.08);
  --aurora-b: rgba(79, 70, 229, 0.06);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

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

/* Precision grid + pointer illumination */
.precision-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(640px circle at var(--mx, 50%) var(--my, 24%), var(--glow), transparent 65%),
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 56px 56px, 56px 56px;
  mask-image: radial-gradient(ellipse 85% 80% at 50% 45%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 80% at 50% 45%, #000 35%, transparent 100%);
}

/* Subtle architectural aurora behind headline */
.ambient-aurora {
  position: fixed;
  top: -18vh;
  left: 50%;
  width: min(820px, 95vw);
  height: 420px;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 32% 45%, var(--aurora-a), transparent 60%),
    radial-gradient(ellipse at 68% 55%, var(--aurora-b), transparent 60%);
  filter: blur(55px);
  animation: auroraDrift 14s ease-in-out infinite alternate;
}

@keyframes auroraDrift {
  from {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  to {
    transform: translateX(-48%) translateY(18px) scale(1.06);
  }
}

::selection {
  background: var(--text);
  color: var(--bg);
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

.serif-accent {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-weight: 400;
}

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

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 24px;
}

.container {
  position: relative;
  width: 100%;
  max-width: 688px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* Subtle precision viewfinder corner ticks */
.corner {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  border-color: var(--corner);
  border-style: solid;
  border-width: 0;
}

.corner.tl {
  top: 0;
  left: 0;
  border-top-width: 1px;
  border-left-width: 1px;
}

.corner.tr {
  top: 0;
  right: 0;
  border-top-width: 1px;
  border-right-width: 1px;
}

.corner.bl {
  bottom: 0;
  left: 0;
  border-bottom-width: 1px;
  border-left-width: 1px;
}

.corner.br {
  bottom: 0;
  right: 0;
  border-bottom-width: 1px;
  border-right-width: 1px;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 48px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}

.brand-domain {
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.brand:hover .brand-domain {
  color: var(--text);
}

.controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.clock {
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}

.icon-btn,
.lang-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 11.5px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

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

.lang-btn .active {
  color: var(--text);
  font-weight: 500;
}

/* Identity & Editorial Typography */
.identity-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.avatar-frame {
  padding: 2px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--surface-hover), transparent);
  overflow: hidden;
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.avatar-frame:hover {
  transform: scale(1.12);
  border-color: var(--underline-active);
  box-shadow: 0 12px 28px -8px rgba(34, 211, 238, 0.28);
}

.avatar {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center;
  filter: contrast(1.03);
  transition: filter 0.3s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.avatar-frame:hover .avatar {
  filter: contrast(1.06);
  transform: scale(1.04);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--dot);
  box-shadow: 0 0 10px var(--dot);
}

.display-name {
  margin: 0;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(32px, 5.2vw, 44px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text);
}

.display-role {
  margin: 6px 0 30px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(22px, 3.8vw, 31px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.025em;
  background: var(--role-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.prose {
  transition: opacity 0.16s ease;
}

.prose.switching {
  opacity: 0.35;
}

.prose p {
  margin: 0 0 18px;
  font-size: 16.5px;
  line-height: 1.78;
  color: var(--text-soft);
}

.prose p:first-child {
  color: var(--text);
}

.prose em {
  font-size: 18px;
  color: var(--text);
}

/* Tactile sweeping underline & micro-arrow */
.inline-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  background-image: linear-gradient(var(--underline-active), var(--underline-active)),
    linear-gradient(var(--underline), var(--underline));
  background-size: 0% 1px, 100% 1px;
  background-position: 0 100%, 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 1px;
  transition: background-size 0.25s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}

.inline-link:hover {
  background-size: 100% 1px, 100% 1px;
}

.inline-link .ext {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.inline-link:hover .ext {
  color: var(--underline-active);
  transform: translate(2px, -2px);
}

.motto {
  position: relative;
  margin: 28px 0 0;
  padding: 2px 0 2px 16px;
  font-size: 16.5px;
  color: var(--text-soft);
}

.motto::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 2px;
  border-radius: 999px;
  background: var(--accent-bar);
}

/* Minimal Footer */
.site-footer {
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.email-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  cursor: pointer;
}

.copy-pill {
  font-size: 11px;
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.copy-pill.copied {
  color: var(--dot);
  border-color: var(--dot);
}

.social-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.social-nav a {
  font-size: 14px;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.social-nav:hover a:not(:hover) {
  opacity: 0.45;
}

.social-nav a:hover {
  color: var(--text);
}

/* Entrance Animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: fadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--delay, 0ms);
}

@media (max-width: 600px) {
  .page {
    justify-content: flex-start;
    padding: 18px 14px 28px;
  }

  .container {
    padding: 18px 16px;
  }

  .site-header {
    margin-bottom: 24px;
  }

  .clock {
    display: none;
  }

  .identity-mark {
    gap: 10px;
    margin-bottom: 16px;
  }

  .avatar {
    width: 42px;
    height: 42px;
  }

  .status-pill {
    font-size: 10px;
    letter-spacing: 0.015em;
    gap: 6px;
  }

  .display-role {
    margin: 4px 0 20px;
  }

  .prose p {
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.66;
  }

  .prose em {
    font-size: 16px;
  }

  .motto {
    margin-top: 20px;
    font-size: 15px;
  }

  .site-footer {
    margin-top: 28px;
    padding-top: 16px;
  }

  .links-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .ambient-aurora {
    animation: none;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
