@layer pages {
  /* ===== Home Hero — Sphere Alignment ===== */

  .home-hero-sphere {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--color-background);
  }

  .home-hero-sphere-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
  }

  .home-hero-sphere-bg canvas {
    display: block;
    width: 100%;
    height: 100%;
  }

  /* Soft vignette at edges */
  .home-hero-sphere::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
      radial-gradient(
        ellipse at 50% 40%,
        transparent 0%,
        transparent 30%,
        rgba(10, 12, 16, 0.5) 70%,
        rgba(10, 12, 16, 0.85) 100%
      );
    pointer-events: none;
  }

  .home-hero-sphere-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Nudge up to align with sphere center */
    margin-top: -6vh;
  }

  .home-hero-sphere-portrait-wrap {
    width: clamp(7rem, 14vw, 10rem);
    height: clamp(7rem, 14vw, 10rem);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-5);
    /* Glow that blends with the sphere's light */
    box-shadow:
      0 0 40px rgba(78, 205, 196, 0.25),
      0 0 80px rgba(108, 155, 255, 0.15),
      0 0 0 2px rgba(108, 155, 255, 0.3);
    /* Slight transparency so the glow bleeds through */
    border: 2px solid rgba(200, 220, 255, 0.2);
  }

  .home-hero-sphere-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .home-hero-sphere .page-hero-title {
    text-shadow: 0 2px 30px rgba(10, 12, 16, 0.8);
  }

  .home-hero-sphere .page-hero-subtitle {
    text-shadow: 0 1px 20px rgba(10, 12, 16, 0.8);
  }

  @media (max-width: 640px) {
    .home-hero-sphere {
      min-height: 85svh;
    }

    .home-hero-sphere-content {
      margin-top: -4vh;
    }
  }

  /* ===== Home Hero (body text section below) ===== */
  .home-hero {
    padding-block: var(--space-9) var(--space-7);
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    align-items: center;
  }

  .home-hero .container {
    position: relative;
    z-index: 1;
  }

  .home-hero-portrait {
    width: 8rem;
    height: 8rem;
    border-radius: var(--radius-full);
    object-fit: cover;
    margin-inline: auto;
    margin-bottom: var(--space-5);
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow-lg);
  }

  .home-hero-name {
    font-family: var(--font-heading);
    font-size: clamp(var(--text-5xl), 6vw, var(--text-7xl));
    font-weight: 400;
    line-height: var(--leading-tight);
    color: var(--color-foreground);
    letter-spacing: -1px;
    margin-bottom: var(--space-3);
  }

  .home-hero-tagline {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 300;
    line-height: var(--leading-relaxed);
    color: var(--color-muted-foreground);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    max-width: 50ch;
    margin-inline: auto;
    margin-bottom: var(--space-6);
  }

  .home-hero-body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-neutral-300);
    max-width: 58ch;
    margin-inline: auto;
  }

  .home-hero-body p + p {
    margin-top: var(--space-3);
  }

  /* ===== Domain Cards ===== */
  .domains-section {
    padding-block: var(--space-7);
    position: relative;
  }

  .domains-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
  }

  @media (max-width: 768px) {
    .domains-grid { grid-template-columns: 1fr; }
  }

  .domain-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
  }

  .domain-card .card-content { flex: 1; }

  .domain-card .card-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--space-3);
  }

  .domain-card .card-title {
    font-size: var(--text-2xl);
    letter-spacing: -0.5px;
  }

  .domain-card .card-body {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    color: var(--color-muted-foreground);
  }

  .domain-card .card-footer { border-top-color: var(--color-border); }

  .card-link {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 400;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .card-link::after {
    content: '\2192';
    transition: transform var(--transition-fast);
  }

  .domain-card:hover .card-link::after { transform: translateX(4px); }

  /* Per-domain accent colors */
  .domain-card--ai .card-label { color: var(--color-secondary-300); }
  .domain-card--ai .card-link { color: var(--color-secondary-300); }
  .domain-card--ai:hover { border-color: rgba(108, 155, 255, 0.3); }

  .domain-card--7b .card-label { color: var(--color-gold-300); }
  .domain-card--7b .card-link { color: var(--color-gold-300); }
  .domain-card--7b:hover { border-color: rgba(255, 209, 102, 0.3); }

  .domain-card--neuro .card-label { color: var(--color-purple-300); }
  .domain-card--neuro .card-link { color: var(--color-purple-300); }
  .domain-card--neuro:hover { border-color: rgba(192, 132, 252, 0.3); }

  .domain-card--physics .card-label { color: var(--color-accent-300); }
  .domain-card--physics .card-link { color: var(--color-accent-300); }
  .domain-card--physics:hover { border-color: rgba(255, 107, 107, 0.3); }

  .domain-card--mtb .card-label { color: var(--color-primary-300); }
  .domain-card--mtb .card-link { color: var(--color-primary-300); }
  .domain-card--mtb:hover { border-color: rgba(78, 205, 196, 0.3); }

  /* ===== Elsewhere ===== */
  .elsewhere-section {
    padding-block: var(--space-7) var(--space-8);
    border-top: 1px solid var(--color-border);
  }

  .elsewhere-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    max-width: var(--content-width);
  }

  .elsewhere-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
  }

  .elsewhere-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .elsewhere-item a {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 400;
    color: var(--color-foreground);
    text-decoration: none;
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .elsewhere-item a:hover { color: var(--color-primary-300); }

  .elsewhere-icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
  }

  .elsewhere-item a:hover .elsewhere-icon { opacity: 1; }

  .elsewhere-item p {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-muted-foreground);
    line-height: var(--leading-normal);
  }

  /* ===== Responsive ===== */
  @media (max-width: 640px) {
    .home-hero-portrait { width: 6rem; height: 6rem; }
    .home-hero { min-height: auto; padding-block: var(--space-7) var(--space-6); }
  }
}
