/* Anderson Ayres — Personal Site Styles */
:root {
  --bg: #0b1220;
  --bg-elev: #0f172a;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --brand: #0ea5e9;
  --brand-2: #22d3ee;
  --accent: #a78bfa;
  --card: rgba(15, 23, 42, 0.6);
  --ring: rgba(14, 165, 233, 0.4);
  --shadow: rgba(2, 6, 23, 0.6);
  --glow-1: rgba(34, 211, 238, 0.08);
  --glow-2: rgba(167, 139, 250, 0.08);
}

html[data-theme='light'] {
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --card: rgba(255, 255, 255, 0.7);
  --ring: rgba(2, 132, 199, 0.25);
  --shadow: rgba(15, 23, 42, 0.18);
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family:
    'Inter',
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Ubuntu,
    Cantarell,
    Noto Sans,
    Arial,
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--glow-1), transparent 70%),
    radial-gradient(1000px 500px at 10% 10%, var(--glow-2), transparent 70%), var(--bg);
  background-attachment: fixed, fixed;
  background-repeat: no-repeat, no-repeat;
  line-height: 1.6;
}

/* Background canvas */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Layout helpers */
.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}
.section {
  padding: 4.5rem 0;
}
/* Utilities */
.visually-hidden-abs {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.centered-main {
  min-height: 80vh;
  display: flex;
  align-items: center;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(to bottom, rgba(2, 6, 23, 0.7), rgba(2, 6, 23, 0.2) 60%, transparent);
  backdrop-filter: blur(10px);
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
}
.logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: white;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-text {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
}
.site-nav a:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.1);
}
.theme-toggle,
.palette-toggle,
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.theme-toggle .sun {
  display: none;
}
html[data-theme='light'] .theme-toggle .sun {
  display: inline;
}
html[data-theme='light'] .theme-toggle .moon {
  display: none;
}

/* Palette menu */
.palette-menu {
  position: fixed;
  top: 60px;
  right: 12px;
  background: var(--bg-elev);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 0.6rem;
  box-shadow: 0 10px 30px var(--shadow);
  z-index: 30;
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 28px);
  gap: 8px;
}
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(135deg, var(--sw1), var(--sw2));
  cursor: pointer;
}
.swatch:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--ring);
}
/* Palette variable presets (replaces inline styles) */
.swatch[data-palette='ocean'] {
  --sw1: #0ea5e9;
  --sw2: #a78bfa;
}
.swatch[data-palette='electric'] {
  --sw1: #22d3ee;
  --sw2: #06b6d4;
}
.swatch[data-palette='tealPurple'] {
  --sw1: #14b8a6;
  --sw2: #8b5cf6;
}
.swatch[data-palette='sunset'] {
  --sw1: #f97316;
  --sw2: #ef4444;
}
.swatch[data-palette='lime'] {
  --sw1: #84cc16;
  --sw2: #22c55e;
}
.swatch[data-palette='mono'] {
  --sw1: #94a3b8;
  --sw2: #cbd5e1;
}

/* Hero */
.hero {
  padding: 7rem 0 4rem;
}
.hero-inner {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}
.eyebrow {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.4px;
}
.headline {
  font-size: clamp(2.2rem, 4vw + 1rem, 4rem);
  line-height: 1.1;
  margin: 0.6rem 0 0.4rem;
}
.headline .last {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  color: var(--muted);
  font-size: 1.1rem;
}
.avatar-wrap {
  margin: 0.8rem 0;
}
.avatar {
  border-radius: 50%;
  display: block;
  width: 120px;
  height: 120px;
}
.avatar-wrap {
  position: relative;
  display: inline-block;
}
.avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--brand), var(--accent));
  filter: blur(6px);
  opacity: 0.6;
  z-index: -1;
}
.cta {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
}
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #001018;
}
.btn.ghost {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.25);
}
.btn.link {
  color: var(--brand);
  padding: 0;
  border: none;
}
.quick-stats {
  list-style: none;
  display: flex;
  gap: 0.6rem;
  padding: 0;
  margin: 1rem 0 0;
  flex-wrap: wrap;
}
.quick-stats li {
  background: rgba(14, 165, 233, 0.1);
  color: #7dd3fc;
  border: 1px solid var(--ring);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: 0 10px 30px var(--shadow);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
}
.card header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.card .meta {
  color: var(--muted);
  font-size: 0.95rem;
}
.card ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

/* Timeline and grids */
.timeline {
  display: grid;
  gap: 1rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}
.grid .card {
  grid-column: span 12;
}
.span-12 {
  grid-column: span 12;
}
@media (min-width: 700px) {
  .grid .card {
    grid-column: span 6;
  }
}
@media (min-width: 1000px) {
  .grid .card {
    grid-column: span 4;
  }
}

/* Lists */
.bulleted {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
}
.skill-cloud {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 0.6rem 0 0;
  flex-wrap: wrap;
}
.skill-cloud li {
  padding: 0.45rem 0.6rem;
  border-radius: 12px;
  background: rgba(167, 139, 250, 0.12);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

/* Contact */
.contact-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
}
.contact-card {
  grid-column: span 12;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid rgba(148, 163, 184, 0.15);
  padding: 0.9rem 1rem;
  border-radius: 14px;
  transition:
    box-shadow 200ms ease,
    border-color 200ms ease,
    transform 200ms ease;
}
.contact-card:hover {
  border-color: var(--ring);
  box-shadow: 0 0 0 4px var(--ring);
  transform: translateY(-1px);
}
@media (min-width: 980px) {
  .contact-card {
    grid-column: span 4;
  }
}

/* Futuristic contact form card */
.form-card {
  position: relative;
  background: var(--card);
  border-radius: 18px;
  padding: 1.25rem;
  border: 1px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 20px 50px var(--shadow);
  overflow: hidden;
}
.form-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 0deg, var(--brand), var(--accent), var(--brand-2), var(--brand));
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin 14s linear infinite;
  opacity: 0.65;
  pointer-events: none;
}
@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.form-header h3 {
  margin: 0;
  font-size: 1.25rem;
}
.form-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.form-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(12, 1fr);
}
.form-grid > label {
  grid-column: span 12;
  display: block;
}
@media (min-width: 720px) {
  .form-grid.split > label:nth-child(1),
  .form-grid.split > label:nth-child(2) {
    grid-column: span 6;
  }
}

.field {
  display: grid;
  gap: 0.35rem;
}
.field > span {
  color: var(--muted);
  font-size: 0.95rem;
}
.field input,
.field textarea {
  width: 100%;
  color: var(--text);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.06));
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
  backdrop-filter: blur(2px);
}
.field textarea {
  min-height: 160px;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder {
  color: rgba(148, 163, 184, 0.6);
}
.field:focus-within input,
.field:focus-within textarea {
  border-color: var(--ring);
  box-shadow: 0 0 0 4px var(--ring);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.08));
}

.cf-turnstile {
  margin: 0.2rem 0 0.6rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.4rem;
}
.status {
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 1.2em;
}
.status.ok {
  color: #10b981;
}
.status.err {
  color: #ef4444;
}

.btn.primary.loading {
  position: relative;
  pointer-events: none;
}
.btn.primary.loading span {
  opacity: 0;
}
.btn.primary.loading::after {
  content: '';
  position: absolute;
  width: 1.1em;
  height: 1.1em;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(0, 0, 0, 0.35);
  border-top-color: rgba(0, 0, 0, 0.75);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  padding: 1.2rem 0;
  margin-top: 2rem;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--text);
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 600ms ease,
    transform 600ms ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Focus rings */
:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--ring);
  border-radius: 12px;
}
