:root {
  --bg: #070b14;
  --bg-elevated: rgba(16, 23, 40, 0.92);
  --bg-panel: rgba(18, 26, 45, 0.98);
  --text: #f4f7fb;
  --text-soft: rgba(244, 247, 251, 0.96);
  --text-muted: rgba(244, 247, 251, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #89d6ff;
  --accent-strong: #d7b46c;
  --accent-soft: rgba(137, 214, 255, 0.14);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --container: 1180px;
  --font-sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

body[data-theme="light"] {
  --bg: #edf1f7;
  --bg-elevated: rgba(255, 255, 255, 0.84);
  --bg-panel: rgba(255, 255, 255, 0.92);
  --text: #101522;
  --text-soft: rgba(16, 21, 34, 0.92);
  --text-muted: rgba(16, 21, 34, 0.78);
  --line: rgba(16, 21, 34, 0.08);
  --line-strong: rgba(16, 21, 34, 0.14);
  --accent: #0b79c9;
  --accent-strong: #9b6a17;
  --accent-soft: rgba(11, 121, 201, 0.11);
  --shadow: 0 24px 54px rgba(16, 21, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(137, 214, 255, 0.16), transparent 32%),
    radial-gradient(circle at 82% 14%, rgba(215, 180, 108, 0.14), transparent 24%),
    linear-gradient(180deg, #080d17 0%, #060910 100%);
  color: var(--text);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at top left, rgba(11, 121, 201, 0.13), transparent 30%),
    radial-gradient(circle at 82% 14%, rgba(155, 106, 23, 0.1), transparent 24%),
    linear-gradient(180deg, #eef3f9 0%, #e8edf4 100%);
}

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

button,
a.button {
  font: inherit;
}

.page-shell {
  position: relative;
  width: min(calc(100vw - 32px), var(--container));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(transparent 0 0),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 64px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.022) 0,
      rgba(255, 255, 255, 0.022) 1px,
      transparent 1px,
      transparent 64px
    );
  opacity: 0.34;
  mask-image: radial-gradient(circle at center, black 38%, transparent 100%);
}

body[data-theme="light"] .page-backdrop {
  background:
    linear-gradient(transparent 0 0),
    repeating-linear-gradient(
      90deg,
      rgba(16, 21, 34, 0.04) 0,
      rgba(16, 21, 34, 0.04) 1px,
      transparent 1px,
      transparent 64px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(16, 21, 34, 0.03) 0,
      rgba(16, 21, 34, 0.03) 1px,
      transparent 1px,
      transparent 64px
    );
}

body[data-theme="light"] .topbar,
body[data-theme="light"] .panel,
body[data-theme="light"] .section {
  backdrop-filter: none;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.26), transparent 40%),
    linear-gradient(160deg, rgba(137, 214, 255, 0.18), rgba(215, 180, 108, 0.12));
  color: var(--text);
  font: 700 0.9rem/1 var(--font-sans);
  letter-spacing: 0.12em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--text-soft);
}

.topnav a {
  position: relative;
  font-size: 0.94rem;
  transition: color 180ms ease;
}

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

.topnav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.topnav a:hover::after {
  transform: scaleX(1);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.content {
  display: grid;
  gap: 26px;
}

.panel,
.section {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.8fr);
  gap: 28px;
  padding: 30px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 76% 18%, rgba(137, 214, 255, 0.2), transparent 30%),
    radial-gradient(circle at 20% 72%, rgba(215, 180, 108, 0.12), transparent 26%);
  pointer-events: none;
}

.hero-copy,
.portrait-panel {
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-width: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 8vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-wrap: balance;
  color: var(--text);
  font-weight: 700;
}

.role {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.lede {
  max-width: 58ch;
  color: var(--text-soft);
  font-size: clamp(1.02rem, 1.45vw, 1.12rem);
  line-height: 1.72;
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.meta-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.meta-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.meta-value {
  color: var(--text);
  font-size: 0.98rem;
}

.stack-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1;
}

.stack-badge img,
.stack-badge svg {
  width: 16px;
  height: 16px;
  display: block;
  flex: none;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.button-primary {
  background: linear-gradient(135deg, rgba(137, 214, 255, 0.22), rgba(215, 180, 108, 0.14));
  color: var(--text);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
}

.social-links {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.social-links a {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.social-links a:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.social-links svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: currentColor;
}

.portrait-panel {
  display: grid;
  gap: 14px;
  align-content: center;
}

.portrait-card,
.mini-card,
.tool-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.portrait-card {
  padding: 18px;
  border-radius: 28px;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 1 / 1.08;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 50% 22%, rgba(137, 214, 255, 0.22), transparent 34%),
    radial-gradient(circle at 50% 78%, rgba(215, 180, 108, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(120deg, transparent 0 46%, rgba(255, 255, 255, 0.12) 50%, transparent 54%),
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.02) 100%);
  pointer-events: none;
}

.portrait-image,
.portrait-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.portrait-image {
  object-fit: cover;
  object-position: center top;
  display: none;
}

.portrait-fallback {
  display: grid;
  place-items: center;
  color: rgba(244, 247, 251, 0.72);
  font: 700 clamp(3.2rem, 10vw, 4.8rem) / 1 var(--font-display);
  letter-spacing: 0.12em;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.15), transparent 28%),
    linear-gradient(160deg, rgba(12, 17, 31, 0.92), rgba(26, 32, 49, 0.72));
}

.portrait-photo-loaded .portrait-image {
  display: block;
}

.portrait-photo-loaded .portrait-fallback {
  display: none;
}

.portrait-copy {
  padding: 16px 4px 2px;
}

.mini-label,
.section-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 700;
}

.mini-card p,
.section-copy,
.tool-card p {
  color: var(--text-soft);
  line-height: 1.65;
}

.portrait-text {
  margin-top: 8px;
  font-size: 0.96rem;
}

.mini-card {
  padding: 18px 18px 20px;
  border-radius: 22px;
}

.mini-card p {
  margin-top: 8px;
  font-size: 0.96rem;
}

.section {
  padding: 26px 24px 28px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 24px;
  margin-bottom: 20px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.35vw, 2.2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-top: 6px;
  max-width: 18ch;
}

.section-copy {
  max-width: 48ch;
  font-size: 0.98rem;
}

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

.tool-card {
  min-height: 196px;
  padding: 18px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(137, 214, 255, 0.14), rgba(215, 180, 108, 0.08));
  color: var(--text);
}

.tool-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

.tool-card h3 {
  font-size: 1.04rem;
  letter-spacing: -0.02em;
}

.tool-meta {
  display: inline-flex;
  align-self: start;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-meta img {
  width: 11px;
  height: 11px;
  display: block;
}

.tool-card p {
  font-size: 0.96rem;
}

@media (max-width: 980px) {
  .topbar {
    position: static;
    border-radius: var(--radius-lg);
  }

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

  .portrait-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

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

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100vw - 20px), var(--container));
    padding-top: 10px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }

  .brand {
    justify-content: center;
  }

  .topnav {
    order: 3;
    justify-content: center;
    gap: 10px 16px;
    font-size: 0.9rem;
  }

  .theme-toggle {
    align-self: center;
  }

  .hero,
  .section {
    padding: 18px;
  }

  .meta-row,
  .portrait-panel,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 18px;
  }

  .hero-copy {
    gap: 14px;
  }

  h1 {
    font-size: clamp(2.8rem, 14vw, 4rem);
  }

  .section-head {
    flex-direction: column;
    align-items: start;
    gap: 8px;
  }

  .meta-item {
    padding: 14px 16px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-actions {
    gap: 10px;
  }

  .social-links {
    width: 100%;
    justify-content: center;
  }

  .social-links a {
    width: 42px;
    height: 42px;
  }

  .portrait-card {
    padding: 14px;
  }

  .tool-card {
    border-radius: 20px;
  }

  .tool-card {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .panel,
  .section,
  .topbar,
  .tool-card {
    animation: lift-in 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .hero {
    animation-delay: 40ms;
  }

  .section:nth-of-type(2) {
    animation-delay: 90ms;
  }
}

@keyframes lift-in {
  from {
    transform: translateY(14px);
  }

  to {
    transform: translateY(0);
  }
}
