/* ============================================================
   SPACEHUMAN — static copy
   Mobile-first, no JavaScript
   ============================================================ */

:root {
  --accent: #6d28d9;
  --accent-dark: #5b21b6;
  --ink: #1b1b1f;
  --muted: #6b7280;
  --line: #ececf0;
  --bg: #ffffff;
  --bg-soft: #f7f7f9;
  --radius: 16px;
  --maxw: 1120px;
  --font-head: "Poppins", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  background: var(--bg);
}

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

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

h1,
h2,
h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- Skip link (a11y) ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand img {
  width: 38px;
  height: 38px;
}

.brand span {
  font-size: 1.05rem;
}

/* header right-side actions */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* App button (orange pill with code icon) */
.app-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(109, 40, 217, 0.32);
  transition: background 0.15s ease, transform 0.15s ease;
}
.app-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}
.app-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Language switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.82rem;
}
.lang-switch a {
  padding: 6px 11px;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-switch a[aria-current="true"] {
  background: var(--accent);
  color: #fff;
}
.lang-switch a:not([aria-current="true"]):hover {
  background: var(--bg-soft);
  color: var(--ink);
}

@media (max-width: 480px) {
  .brand span {
    display: none;
  }
  .app-btn {
    padding: 9px 13px;
  }
}

/* ---------- Filter bar ---------- */
.filter-bar {
  background: var(--accent);
}

.filter-bar ul {
  list-style: none;
  margin: 0;
  padding: 12px 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.filter-bar a {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.filter-bar a:hover,
.filter-bar a.is-active,
.filter-bar a[aria-current="page"] {
  background: #fff;
  color: var(--accent-dark);
}

/* ---------- App promo banner ---------- */
.app-promo {
  padding: 8px 0 4px;
}
.app-promo__link {
  display: block;
  max-width: 720px;
  margin-inline: auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.app-promo__link:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(27, 27, 31, 0.12);
}
.app-promo__link img {
  width: 100%;
  height: auto;
}

/* ---------- Hero / page title ---------- */
.page-hero {
  padding: 40px 0 8px;
}

.page-hero h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
}

.page-hero p {
  color: var(--muted);
  max-width: 60ch;
  margin: 12px 0 0;
}

/* ---------- Section ---------- */
.section {
  padding: 28px 0 8px;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section__head h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.section__more {
  color: var(--accent-dark);
  font-weight: 600;
  white-space: nowrap;
}
.section__more:hover {
  text-decoration: underline;
}

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(27, 27, 31, 0.1);
}

.card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-soft);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card__media img {
  transform: scale(1.05);
}

.card__body {
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: #f1ebfd;
  padding: 4px 12px;
  border-radius: 999px;
}

.card__title {
  font-size: 1.2rem;
}

.card__meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  gap: 12px;
}

.card__excerpt {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Article page ---------- */
.article {
  padding: 32px 0 12px;
}

.article__wrap {
  max-width: 760px;
  margin-inline: auto;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 18px;
}
.breadcrumb a:hover {
  color: var(--accent-dark);
}

.article h1 {
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  margin-bottom: 14px;
}

.article__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.article__cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--line);
}

.article__cover img {
  width: 100%;
  height: auto;
}

.article__body p {
  margin: 0 0 18px;
  font-size: 1.05rem;
  color: #33333a;
}

.container--narrow {
  max-width: 780px;
}

.article .tag {
  margin-bottom: 14px;
}

.article__title {
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  line-height: 1.2;
  margin: 6px 0 10px;
  text-wrap: balance;
}

.article__date {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 22px;
}

.article__hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 28px;
  border: 1px solid var(--line);
}
.article__hero img {
  width: 100%;
  height: auto;
  display: block;
}

.article__body h2 {
  font-size: 1.5rem;
  margin: 30px 0 12px;
}
.article__body h3 {
  font-size: 1.2rem;
  margin: 24px 0 10px;
}
.article__body ul,
.article__body ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: #33333a;
  font-size: 1.05rem;
}
.article__body li {
  margin-bottom: 8px;
}
.article__body blockquote {
  margin: 0 0 20px;
  padding: 12px 20px;
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink);
  font-style: italic;
}
.article-figure {
  margin: 0 0 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.article-figure img {
  width: 100%;
  height: auto;
  display: block;
}
.article-figure figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 8px 12px;
  text-align: center;
}

.video-embed {
  margin: 0 0 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}
.video-embed__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}
.video-embed__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.back-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent-dark);
  font-weight: 600;
}
.back-link:hover {
  text-decoration: underline;
}

/* ---------- About page ---------- */
.prose {
  max-width: 760px;
  margin-inline: auto;
}
.prose p {
  font-size: 1.05rem;
  color: #33333a;
  margin: 0 0 18px;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 56px;
  background: var(--ink);
  color: #d7d7dc;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-block: 32px;
}

.site-footer .brand span {
  color: #fff;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-nav a {
  color: #d7d7dc;
}
.footer-nav a:hover {
  color: #fff;
}

.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: 16px;
  font-size: 0.85rem;
  color: #9a9aa2;
  text-align: center;
}

@media (min-width: 720px) {
  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
