/* alienspaces.com — fresh modern theme, light + dark, responsive.
   Static site, progressively enhanced. No framework. */

/* ---------------------------------------------------------------- Tokens */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --ink: #1a1d24;
  --muted: #5b6472;
  --faint: #8b93a1;
  --border: #e3e6eb;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.06), 0 10px 28px rgba(16, 24, 40, 0.1);
  --radius: 14px;
  --maxw: 820px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1319;
    --surface: #171b22;
    --surface-2: #1f242d;
    --ink: #e6e8ec;
    --muted: #9aa4b2;
    --faint: #6b7480;
    --border: #262b34;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: rgba(129, 140, 248, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.45);
  }
}

/* Explicit override from the JS theme toggle wins over the OS preference. */
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --ink: #1a1d24;
  --muted: #5b6472;
  --faint: #8b93a1;
  --border: #e3e6eb;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.06), 0 10px 28px rgba(16, 24, 40, 0.1);
}
:root[data-theme="dark"] {
  --bg: #0f1319;
  --surface: #171b22;
  --surface-2: #1f242d;
  --ink: #e6e8ec;
  --muted: #9aa4b2;
  --faint: #6b7480;
  --border: #262b34;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.45);
}

/* ---------------------------------------------------------------- Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

.icon {
  display: block;
}

/* ---------------------------------------------------------------- Hero */
.hero {
  background:
    radial-gradient(1200px 400px at 20% -10%, var(--accent-soft), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 1.25rem 2.5rem;
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.hero__avatar {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.hero__name {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero__realname {
  font-weight: 400;
  color: var(--muted);
  font-size: 1.4rem;
}

.hero__tagline {
  margin-top: 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}

.hero__blurb {
  margin-top: 0.75rem;
  color: var(--muted);
  max-width: 56ch;
}

.hero__social {
  display: flex;
  gap: 0.35rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}
.social-link:hover {
  color: var(--accent);
  background: var(--surface-2);
  border-color: var(--border);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ---------------------------------------------------------------- Content */
.content {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.section-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-bottom: 1.25rem;
}

/* ---------------------------------------------------------------- Role card */
.role {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.role:hover {
  box-shadow: var(--shadow-hover);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  transform: translateY(-2px);
}

.role__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.role__position {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.role__years {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.role__employer {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.role__project {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--accent);
}
a.role__project:hover {
  text-decoration: underline;
}

.role__desc {
  margin-top: 0.6rem;
  color: var(--muted);
}

.role__list {
  margin-top: 0.6rem;
  padding-left: 1.15rem;
  color: var(--ink);
}
.role__list li {
  margin: 0.2rem 0;
}
.role__list li::marker {
  color: var(--accent);
}

/* ---------------------------------------------------------------- Tech chips */
.role__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.65rem 0.28rem 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.chip:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--surface);
}
.chip__icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
}
.chip__label {
  color: var(--muted);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
}
.site-footer__links {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.9;
}
.site-footer a {
  color: var(--accent);
}
.build-info {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--faint);
  opacity: 0.75;
}

/* ---------------------------------------------------------------- Theme toggle */
.theme-toggle {
  position: fixed;
  top: 0.85rem;
  right: 0.85rem;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 50;
  transition: color 0.15s, transform 0.15s;
}
.theme-toggle:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 600px) {
  .hero__inner {
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: 2.5rem 1.1rem 2rem;
    gap: 1.1rem;
  }
  .hero__blurb {
    text-align: left;
  }
  .hero__social {
    justify-content: center;
  }
  .hero__name {
    font-size: 1.7rem;
  }
  .role {
    padding: 1.25rem 1.15rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
