/* ==========================================================================
   Alejandro Gonzalez - site.css
   Dark, cinematic developer portfolio. Vanilla CSS, no build step.
   Light/dark theme via [data-theme] + prefers-color-scheme.
   ========================================================================== */

:root {
  /* Light theme tokens (default / fallback) */
  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --bg-soft: #eef0f3;
  --ink: #0c1016;
  --ink-2: #454e59;
  --ink-3: #737d89;
  --line: #dde1e6;
  --accent: #0d84c9;
  --accent-2: #3da9fc;
  --accent-soft: rgba(13, 132, 201, 0.1);
  --shadow-color: 210, 25%, 45%;
  --particle: 10, 30, 48;
  --particle-alpha: 0.52;
  --aurora: 13, 132, 201;
  --aurora-alpha: 0.20;

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-mono-sm: 0.8125rem;
  --fs-small: 0.9375rem;
  --fs-body: 1.0625rem;
  --fs-h2: clamp(2rem, 1.5rem + 2vw, 3rem);
  --fs-hero: clamp(2.75rem, 1.6rem + 4.6vw, 5.25rem);

  --container: 1180px;
  --nav-height: 72px;
  --radius-sm: 8px;
  --radius-md: 14px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c10;
    --bg-elevated: #12151b;
    --bg-soft: #0e1116;
    --ink: #eef1f4;
    --ink-2: #a6afba;
    --ink-3: #6b7480;
    --line: #1e232b;
    --accent: #3da9fc;
    --accent-2: #7cc9ff;
    --accent-soft: rgba(61, 169, 252, 0.12);
    --shadow-color: 205, 90%, 60%;
    --particle: 124, 201, 255;
    --particle-alpha: 0.5;
    --aurora: 61, 169, 252;
    --aurora-alpha: 0.30;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0c10;
  --bg-elevated: #12151b;
  --bg-soft: #0e1116;
  --ink: #eef1f4;
  --ink-2: #a6afba;
  --ink-3: #6b7480;
  --line: #1e232b;
  --accent: #3da9fc;
  --accent-2: #7cc9ff;
  --accent-soft: rgba(61, 169, 252, 0.12);
  --shadow-color: 205, 90%, 60%;
  --particle: 124, 201, 255;
  --particle-alpha: 0.5;
  --aurora: 61, 169, 252;
  --aurora-alpha: 0.30;
  color-scheme: dark;
}

/* ---- Reset ---------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

@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;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

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

/* Cinematic film-grain texture, sits above everything at near-zero opacity */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%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");
}

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

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

section {
  scroll-margin-top: calc(var(--nav-height) + 12px);
  position: relative;
}

::selection {
  background: var(--accent);
  color: #04101a;
}

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

/* ---- Skip link -------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent);
  color: #04101a;
  padding: 0.7em 1.1em;
  font-size: var(--fs-small);
  font-weight: 700;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* ---- Layout helpers ----------------------------------------------------- */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.75rem;
}

.mono-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

section.band {
  padding: 7rem 0;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 640px) {
  section.band {
    padding: 4rem 0;
  }
}

.section-title {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 2.75rem;
  text-wrap: balance;
  max-width: 30ch;
}

.section-index {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---- Nav ---------------------------------------------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(135deg, var(--accent) 0 10px, var(--accent-2) 10px 20px);
  background-size: 28px 100%;
  animation: barShift 3.2s linear infinite;
}

@keyframes barShift {
  to {
    background-position: 28px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav::before {
    animation: none;
  }
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

.nav-brand:hover .brand-mark {
  transform: rotate(-10deg) scale(1.06);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

@media (max-width: 480px) {
  .brand-name {
    display: none;
  }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.9rem;
}

.nav-menu a {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-2);
  padding: 0.4rem 0.1rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.is-active {
  color: var(--ink);
  border-color: var(--accent);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  color: var(--ink-2);
  transition: border-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle .fa-sun-o {
  display: none;
}

.theme-toggle .fa-moon-o {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .fa-sun-o {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .fa-moon-o {
    display: none;
  }
}

:root[data-theme="dark"] .theme-toggle .fa-sun-o {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .fa-moon-o {
  display: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s 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);
}

@media (max-width: 760px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-menu.is-open {
    max-height: 18rem;
  }

  .nav-menu a {
    width: 100%;
    padding: 1rem 1.75rem;
    border-bottom: 1px solid var(--line);
  }
}

/* ---- Hero ----------------------------------------------------------- */

.hero {
  position: relative;
  padding: 3.5rem 0 5rem;
  overflow: hidden;
}

/* The WebGL field supplies the ambient glow; no CSS blob needed here. */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

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

.hero-badge {
  position: absolute;
  top: 5rem;
  right: 6%;
  width: 168px;
  height: 168px;
  z-index: 1;
  filter: drop-shadow(0 0 34px var(--accent-soft));
}

@media (max-width: 1180px) {
  .hero-badge {
    width: 128px;
    height: 128px;
  }
}

.hero-badge-mark {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: spin 42s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-badge-mark {
    animation: none;
  }
}

@media (max-width: 980px) {
  .hero-badge {
    display: none;
  }
}

.scroll-cue {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 42px;
  background: var(--line);
  z-index: 1;
  overflow: hidden;
}

.scroll-cue::before {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  animation: scrollCue 2.2s ease-in-out infinite;
}

@keyframes scrollCue {
  0% {
    top: -100%;
  }
  60% {
    top: 100%;
  }
  100% {
    top: 100%;
  }
}

@media (max-width: 640px) {
  .scroll-cue {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue::before {
    animation: none;
    top: 0;
  }
}

.hero-eyebrow {
  margin-bottom: 1.5rem;
}

.hero-name {
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 1.5rem;
  max-width: 16ch;
  text-wrap: balance;
}

.hero-name .accent {
  color: var(--accent);
}

.hero-lede {
  max-width: 46ch;
  font-size: 1.1875rem;
  color: var(--ink-2);
  margin: 0 0 2.25rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  align-items: center;
  margin-bottom: 3rem;
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--line);
  max-width: 46rem;
}

.stat {
  padding: 1rem 1.75rem 0 0;
  margin-right: 1.75rem;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: none;
  margin-right: 0;
}

.stat dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.stat dd {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 640px) {
  .hero {
    padding: 2rem 0 3rem;
  }

  .stat {
    padding-right: 1rem;
    margin-right: 1rem;
  }
}

/* Load-in choreography */
.load-in {
  opacity: 0;
  transform: translateY(18px);
  animation: loadIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes loadIn {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .load-in {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ---- Buttons / links ------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-small);
  font-weight: 600;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}

/* Buttons stay put on hover; the only movement is a press. */
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  position: relative;
  background: var(--accent);
  color: #04101a;
  overflow: hidden;
}

.btn-primary:hover {
  background: var(--accent-2);
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 35%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}

.btn-primary:hover::after {
  left: 130%;
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary::after {
    display: none;
  }
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--ink-3);
  padding-bottom: 0.2rem;
  transition: color 0.2s ease, border-color 0.2s ease, gap 0.2s ease;
}

.text-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  gap: 0.7rem;
}

/* ---- About ------------------------------------------------------------ */

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-grid > * {
  min-width: 0;
}

.bio p {
  max-width: 62ch;
  color: var(--ink-2);
  margin-bottom: 1.35rem;
}

.bio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.toolkit-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
  display: block;
}

.marquee {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  gap: 0.75rem;
  width: max-content;
  animation: marquee 32s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
    flex-wrap: wrap;
    width: 100%;
  }

  .marquee-track .tag-dupe {
    display: none;
  }
}

.tag {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ---- Experience ---------------------------------------------------------- */

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline-track {
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--line);
}

.timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 0%;
  background: var(--accent);
  box-shadow: 0 0 12px 0 var(--accent);
}

.experience-item {
  position: relative;
  padding: 0 0 3.5rem 2rem;
}

.experience-item:last-child {
  padding-bottom: 0;
}

.experience-item::before {
  content: "";
  position: absolute;
  left: -2.4rem;
  top: 0.4rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--ink-3);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.experience-item.is-visible::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 10px 1px var(--accent);
  animation: pulseDot 2.6s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% {
    box-shadow: 0 0 10px 1px var(--accent);
  }
  50% {
    box-shadow: 0 0 18px 4px var(--accent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .experience-item.is-visible::before {
    animation: none;
  }
}

.experience-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
}

.experience-company {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}

.experience-dates {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  color: var(--ink-3);
}

.experience-role {
  font-family: var(--font-mono);
  font-size: var(--fs-mono-sm);
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.experience-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.experience-logo svg {
  width: 18px;
  height: 18px;
  color: var(--ink-3);
}

.experience-highlights {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 62ch;
}

.experience-highlights li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.7rem;
  color: var(--ink-2);
}

.experience-highlights li:last-child {
  margin-bottom: 0;
}

.experience-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  background: var(--ink-3);
}

.experience-highlights strong {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 640px) {
  .timeline {
    padding-left: 1.25rem;
  }

  .experience-item {
    padding-left: 1.25rem;
  }

  .experience-item::before {
    left: -1.65rem;
  }
}

/* ---- Projects ------------------------------------------------------------ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.project-grid > li {
  display: flex;
  min-width: 0;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  transition: border-color 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -18px hsl(var(--shadow-color) / 0.55);
}

/* .spot supplies the cursor glow; keep the elevated surface and rounded corners */
.project-card.spot {
  background: var(--bg-elevated);
}

.project-card.spot::before {
  border-radius: var(--radius-md);
  z-index: 0;
}

.project-card > * {
  position: relative;
  z-index: 1;
}

.project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.project-name {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.project-name .fa-github {
  color: var(--ink-3);
  font-size: 1.05rem;
  transition: color 0.2s ease;
}

.project-card:hover .project-name .fa-github {
  color: var(--accent);
}

.project-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.project-desc {
  color: var(--ink-2);
  font-size: var(--fs-small);
  line-height: 1.55;
  flex-grow: 1;
}

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.project-lang,
.project-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-3);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s ease, gap 0.2s ease;
}

.project-card:hover .project-link {
  color: var(--accent);
  gap: 0.6rem;
}

.project-more {
  margin-top: 2.25rem;
}

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

/* ---- Elsewhere / links -------------------------------------------------- */

.elsewhere-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.spot {
  --mx: 50%;
  --my: 50%;
  position: relative;
  background: var(--bg);
}

.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(320px circle at var(--mx) var(--my), var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.spot:hover::before {
  opacity: 1;
}

.elsewhere-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.75rem;
  background: var(--bg);
  transition: background 0.2s ease;
}

.elsewhere-icon {
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.elsewhere-card:hover .elsewhere-icon {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.08);
}

.elsewhere-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.elsewhere-handle {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-top: 0.2rem;
}

.elsewhere-card .fa-arrow-right {
  margin-left: auto;
  color: var(--ink-3);
  transition: transform 0.2s ease, color 0.2s ease;
}

.elsewhere-card:hover .fa-arrow-right {
  transform: translateX(4px);
  color: var(--accent);
}

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

/* ---- Contact ------------------------------------------------------------ */

#contact {
  overflow: hidden;
}

#contact::before {
  content: "";
  position: absolute;
  bottom: -20%;
  left: -8%;
  width: 45vw;
  height: 45vw;
  max-width: 620px;
  max-height: 620px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  filter: blur(70px);
  z-index: 0;
  pointer-events: none;
}

#contact .container {
  position: relative;
  z-index: 1;
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.4fr;
  gap: 4rem;
}

.contact-intro p {
  color: var(--ink-2);
  max-width: 32ch;
  margin-top: 1rem;
}

.contact-intro .text-link {
  margin-top: 1.75rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}

.field-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.field-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}

.field-group input,
.field-group textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  padding: 0.85rem 1rem;
  resize: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-group input:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.floating-label-form-group-with-focus label {
  color: var(--accent);
}

.control-group.error input,
.control-group.error textarea {
  border-color: #e5484d;
}

.control-group.error label {
  color: #e5484d;
}

.help-block {
  margin: 0.4rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #e5484d;
  min-height: 1.1em;
}

.help-block:empty {
  display: none;
}

.g-recaptcha {
  margin: 0.5rem 0 1.5rem;
}

@media (max-width: 760px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Alerts (built by contact_me.js) */

.alert {
  position: relative;
  padding: 0.9rem 2.5rem 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-small);
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
}

.alert-success {
  background: rgba(48, 164, 108, 0.12);
  color: #30a46c;
  border: 1px solid rgba(48, 164, 108, 0.3);
}

.alert-danger {
  background: rgba(229, 72, 77, 0.1);
  color: #e5484d;
  border: 1px solid rgba(229, 72, 77, 0.3);
}

.alert .close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  font-size: 1.1rem;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
}

.alert .close:hover {
  opacity: 1;
}

/* ---- Footer -------------------------------------------------------------- */

.site-footer {
  padding: 2.5rem 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.footer-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 1.05rem;
  color: var(--ink-3);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.back-to-top {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-3);
  transition: color 0.2s ease;
}

.back-to-top:hover {
  color: var(--accent);
}
