/* ==========================================================================
   bsdnme.me — clean personal homepage
   System: CSS custom properties, dark theme, responsive, reduced-motion aware
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Popolette */
  --bg: #0b1020;
  --bg-deep: #060811;
  --bg-accent: #131b35;
  --panel: rgba(16, 24, 48, 0.72);
  --panel-solid: #101830;
  --card: rgba(10, 15, 29, 0.72);
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-border-strong: rgba(255, 255, 255, 0.14);

  --text: #f5f7ff;
  --muted: #aeb7d4;
  --faint: #8b93b5;

  --primary: #8ab4ff;
  --primary-strong: #6e9bff;
  --primary-soft: rgba(138, 180, 255, 0.14);

  --green: #7ee0b2;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.28);

  /* Typography */
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --shell: min(1080px, calc(100% - 32px));
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1000px 620px at 50% -10%, rgba(104, 145, 255, 0.3), transparent 60%),
    radial-gradient(720px 520px at 90% 20%, rgba(126, 224, 178, 0.08), transparent 55%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

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

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

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

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

/* Skip link (accessibility) */
.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #08101f;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

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

/* ==========================================================================
   Header / nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
    backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(7, 10, 20, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--panel-border);
}

.nav {
  width: var(--shell);
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #08101f;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(110, 155, 255, 0.35);
}

.brand-name {
  letter-spacing: 0.01em;
}

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

.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

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

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

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

/* ==========================================================================
   Shell & sections
   ========================================================================== */

main {
  width: var(--shell);
  margin: 0 auto;
  padding: 24px 0 0;
}

.section {
  padding: 88px 0 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 36px;
}

.section-head h2,
.contact h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-sub {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.section-kicker,
.eyebrow {
  margin: 0 0 14px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr);
  gap: 40px;
  align-items: center;
  padding: 72px 48px;
  margin-top: 28px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    480px 300px at 85% 0%,
    var(--primary-soft),
    transparent 70%
  );
  pointer-events: none;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 9vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 8px 16px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-pill);
  background: rgba(126, 224, 178, 0.08);
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 500;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(126, 224, 178, 0.6);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(126, 224, 178, 0.55);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(126, 224, 178, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(126, 224, 178, 0);
  }
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Hero profile card */
.hero-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.hero-card-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-soft), transparent);
  border: 1px solid var(--panel-border-strong);
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 800;
}

.hero-card-name {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
}

.hero-card-role {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 0.9rem;
}

.hero-card-bio {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.hero-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.hero-card-tags span {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease),
    background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #08101f;
  box-shadow: 0 12px 30px rgba(110, 155, 255, 0.28);
}

.button.primary:hover {
  box-shadow: 0 18px 36px rgba(110, 155, 255, 0.38);
}

.button.secondary {
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
}

.button.secondary:hover {
  border-color: var(--panel-border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.button.large {
  min-width: 240px;
  padding: 18px 32px;
  font-size: 1.05rem;
}

/* ==========================================================================
   About
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.about-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.85;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.fact-list {
  list-style: none;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 18px;
}

.fact-list li {
  display: grid;
  gap: 6px;
}

.fact-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fact-list li {
  font-size: 1rem;
  color: var(--text);
}

/* ==========================================================================
   Stack
   ========================================================================== */

.stack-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.stack-group {
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.stack-group h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
}

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

.pill {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--panel-border);
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 500;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.pill:hover {
  transform: translateY(-2px);
  border-color: var(--panel-border-strong);
}

/* ==========================================================================
   Now
   ========================================================================== */

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

.now-card {
  padding: 28px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}

.now-card:hover {
  transform: translateY(-4px);
  border-color: var(--panel-border-strong);
}

.now-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-accent);
  font-size: 1.4rem;
}

.now-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.now-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact {
  padding-bottom: 88px;
}

.contact-inner {
  padding: 56px 40px;
  text-align: center;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 320px at 50% 0%, var(--primary-soft), transparent 70%),
    var(--card);
  box-shadow: var(--shadow);
}

.contact .section-kicker {
  justify-content: center;
}

.contact h2 {
  margin-top: 0;
}

.contact .section-sub {
  margin-inline: auto;
  max-width: 520px;
}

.contact-actions {
  margin-top: 32px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.social-links a {
  padding: 10px 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.social-links a:hover {
  color: var(--text);
  border-color: var(--panel-border-strong);
  background: var(--primary-soft);
}

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

.site-footer {
  width: var(--shell);
  margin: 0 auto;
  padding: 40px 0 64px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--faint);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.footer-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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

/* Stagger delays (applied via inline style by script.js) */
.reveal[data-delay="1"] {
  transition-delay: 0.08s;
}

.reveal[data-delay="2"] {
  transition-delay: 0.16s;
}

.reveal[data-delay="3"] {
  transition-delay: 0.24s;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 48px 28px;
  }
}

@media (max-width: 820px) {
  :root {
    --shell: calc(100% - 36px);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    margin: 0 auto;
    max-width: var(--shell);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    background: rgba(10, 15, 29, 0.97);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease),
      visibility 0.25s var(--ease);
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-links a {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
  }

  .section {
    padding-top: 60px;
  }

  .about-grid,
  .stack-cols,
  .now-grid {
    grid-template-columns: 1fr;
  }

  .contact-inner {
    padding: 44px 24px;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 40px 22px;
  }

  .meta-list {
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions,
  .contact-actions {
    flex-direction: column;
  }

  .button,
  .button.large {
    width: 100%;
    min-width: 0;
  }
}
