/* ============================================================
   asensios.com — design system
   Identity: a calm orbital system. Movement, crossings, trust.
   ============================================================ */

:root {
  /* Night sky, warm humanity */
  --bg: #0e1118;
  --bg-soft: #131725;
  --card: #161b2a;
  --card-2: #1a2033;
  --ink: #ede8dc;
  --ink-dim: #c9c3b4;
  --muted: #8f8fa3;
  --line: rgba(237, 232, 220, 0.09);
  --line-strong: rgba(237, 232, 220, 0.18);

  --sun: #e8a24c;        /* amber — the traveller */
  --sun-soft: rgba(232, 162, 76, 0.14);
  --teal: #72b8a6;       /* teal — cooperation */
  --teal-soft: rgba(114, 184, 166, 0.13);
  --rose: #d98d7e;       /* terracotta — warmth */

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;

  --radius: 16px;
  --radius-lg: 24px;
  --maxw: 1060px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--sun); color: #191104; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0;
}

p { margin: 0 0 1em; }

/* ---------- focus / a11y ---------- */
:focus-visible {
  outline: 2px solid var(--sun);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--sun); color: #191104;
  padding: 8px 14px; border-radius: 8px; z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 8px; }

/* ============================================================
   ORBITAL BACKGROUND — fixed field of ellipses + drifting dots
   ============================================================ */
.orbit-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.orbit-field svg {
  position: absolute;
  top: 50%; left: 50%;
  width: 160vmax; height: 160vmax;
  transform: translate(-50%, -50%);
  opacity: 0.55;
  transition: transform 1.4s var(--ease);
}
.orbit-ellipse {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}
.orbit-ellipse.bright { stroke: var(--line-strong); }
.orbit-sat { fill: var(--sun); opacity: 0.8; }
.orbit-sat.teal { fill: var(--teal); }
.orbit-sat.rose { fill: var(--rose); }

/* content sits above the field */
.page { position: relative; z-index: 1; }

/* ============================================================
   LANGUAGE SWITCHER — small orbital pills
   ============================================================ */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(14, 17, 24, 0.72);
  backdrop-filter: blur(8px);
}
.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 12.5px/1 var(--font-body);
  letter-spacing: 0.08em;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] {
  background: var(--sun-soft);
  color: var(--sun);
}
/* the little orbiting dot micro-interaction */
.lang-switch button[aria-pressed="true"]::after {
  content: "";
  display: inline-block;
  width: 4px; height: 4px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--sun);
  vertical-align: middle;
  animation: sat-pulse 2.4s ease-in-out infinite;
}
@keyframes sat-pulse {
  0%, 100% { transform: translateY(-2px); opacity: 1; }
  50% { transform: translateY(2px); opacity: 0.55; }
}

/* top bar shared by inner pages */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 22px;
}
.topbar .brand {
  font: 600 14px/1 var(--font-body);
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(14, 17, 24, 0.72);
  backdrop-filter: blur(8px);
  transition: border-color 0.3s;
}
.topbar .brand:hover { border-color: var(--line-strong); }
.topbar .brand .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sun);
}

/* ============================================================
   HOME
   ============================================================ */
.home {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 20px 56px;
}
.home-top {
  width: 100%;
  max-width: 620px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.home-loc {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero {
  text-align: center;
  margin-top: clamp(28px, 7vh, 72px);
  max-width: 620px;
}

/* avatar wrapped in its own orbital system */
.avatar-orbit {
  position: relative;
  width: 216px;
  height: 216px;
  margin: 0 auto 26px;
}
.avatar-orbit svg {
  position: absolute;
  inset: -52px;
  width: calc(100% + 104px);
  height: calc(100% + 104px);
  overflow: visible;
}
.avatar {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 0 8px rgba(232, 162, 76, 0.05), 0 24px 60px rgba(0, 0, 0, 0.45);
  background: var(--card);
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero .kicker {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sun);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 46px);
}
.hero .headline {
  font-family: var(--font-display);
  font-size: clamp(19px, 3vw, 23px);
  font-weight: 400;
  font-style: italic;
  color: var(--ink-dim);
  margin: 16px auto 10px;
  max-width: 30ch;
  line-height: 1.4;
}
.hero .support {
  color: var(--muted);
  font-size: 15.5px;
  max-width: 46ch;
  margin: 0 auto;
}

/* next-chapter chip */
.chip-next {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  padding: 9px 16px;
  border: 1px solid rgba(114, 184, 166, 0.35);
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
}
.chip-next .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal);
  animation: chip-pulse 2.6s ease-in-out infinite;
}
@keyframes chip-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(114, 184, 166, 0.5); }
  60% { box-shadow: 0 0 0 7px rgba(114, 184, 166, 0); }
}

/* link stack — the premium linktree */
.links {
  width: 100%;
  max-width: 480px;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.35s var(--ease), border-color 0.3s, background 0.3s;
  overflow: hidden;
}
.link-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--card-2);
}
/* orbital trace on hover */
.link-card::after {
  content: "";
  position: absolute;
  top: 50%; right: -34px;
  width: 90px; height: 90px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transform: translateY(-50%) scale(0.6);
  opacity: 0;
  transition: opacity 0.4s, transform 0.6s var(--ease);
}
.link-card:hover::after { opacity: 1; transform: translateY(-50%) scale(1); }

.link-card .ico {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--sun-soft);
  color: var(--sun);
}
.link-card.teal .ico { background: var(--teal-soft); color: var(--teal); }
.link-card .txt { flex: 1; min-width: 0; }
.link-card .txt strong {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.link-card .txt span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-card .arr {
  color: var(--muted);
  transition: transform 0.35s var(--ease), color 0.3s;
}
.link-card:hover .arr { transform: translateX(4px); color: var(--sun); }

/* primary cards (business / games) */
.link-card.primary {
  background: linear-gradient(120deg, rgba(232, 162, 76, 0.13), rgba(232, 162, 76, 0.04) 55%), var(--card);
  border-color: rgba(232, 162, 76, 0.32);
}
.link-card.primary:hover { border-color: rgba(232, 162, 76, 0.55); }

.home-foot {
  margin-top: 48px;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-align: center;
}

/* ============================================================
   BUSINESS — the journey
   ============================================================ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.biz-hero {
  padding: clamp(52px, 10vh, 110px) 0 30px;
  max-width: 720px;
}
.biz-hero .kicker {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sun);
  margin-bottom: 16px;
}
.biz-hero h1 { font-size: clamp(36px, 6.4vw, 60px); }
.biz-hero .lede {
  font-size: clamp(17px, 2.4vw, 19.5px);
  color: var(--ink-dim);
  margin-top: 22px;
  max-width: 58ch;
}

/* metrics — quiet, factual */
.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 44px 0 0;
}
.metric {
  background: var(--bg-soft);
  padding: 26px 24px;
}
.metric b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 560;
  color: var(--sun);
}
.metric span {
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* chapters along an orbital rail */
.chapters {
  position: relative;
  margin: clamp(64px, 12vh, 120px) 0 0;
  padding-left: 42px;
}
.chapters::before {
  content: "";
  position: absolute;
  left: 10px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(var(--line-strong), var(--line) 70%, transparent);
}
.chapter {
  position: relative;
  max-width: 640px;
  padding-bottom: clamp(54px, 9vh, 96px);
}
.chapter::before {
  content: "";
  position: absolute;
  left: -37px; top: 9px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--sun);
  box-shadow: 0 0 0 5px var(--bg);
}
.chapter.next::before {
  background: var(--teal);
  border-color: var(--teal);
  animation: chip-pulse 2.6s ease-in-out infinite;
}
.chapter .where {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.chapter .where em { color: var(--sun); font-style: normal; }
.chapter h2 { font-size: clamp(25px, 3.6vw, 33px); margin-bottom: 14px; }
.chapter p { color: var(--ink-dim); }
.chapter p.note {
  color: var(--muted);
  font-size: 15px;
  border-left: 2px solid var(--teal);
  padding: 4px 0 4px 16px;
  margin-top: 18px;
}
.chapter.next {
  background: linear-gradient(130deg, rgba(114, 184, 166, 0.07), transparent 60%);
  border: 1px solid rgba(114, 184, 166, 0.22);
  border-radius: var(--radius-lg);
  padding: 30px 30px 26px;
  margin-left: -30px;
}
.chapter.next::before { left: -7px; }

/* photos woven into the story */
.story-photo {
  margin: 26px 0 6px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  position: relative;
}
.story-photo img { width: 100%; height: auto; }
.story-photo figcaption {
  position: absolute;
  left: 14px; bottom: 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(10, 12, 18, 0.55);
  backdrop-filter: blur(6px);
  padding: 6px 12px;
  border-radius: 999px;
}

/* pillars */
.pillars-head { margin: clamp(60px, 11vh, 110px) 0 34px; max-width: 640px; }
.pillars-head h2 { font-size: clamp(28px, 4.4vw, 40px); }
.pillars-head p { color: var(--muted); margin-top: 14px; }
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.pillar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.3s;
}
.pillar:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.pillar .orb {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  position: relative;
}
.pillar .orb::after {
  content: "";
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--sun);
  top: -3px; left: 50%;
  transform-origin: 0 25px;
  animation: orb-spin 9s linear infinite;
}
.pillar:nth-child(2) .orb::after { background: var(--teal); animation-duration: 12s; }
.pillar:nth-child(3) .orb::after { background: var(--rose); animation-duration: 15s; }
@keyframes orb-spin { to { transform: rotate(360deg); } }
.pillar h3 { font-size: 20px; margin-bottom: 10px; }
.pillar p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* contact */
.contact {
  margin: clamp(64px, 12vh, 120px) 0 0;
  padding: clamp(40px, 7vh, 64px) clamp(26px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 120% at 85% 0%, rgba(232, 162, 76, 0.08), transparent),
    var(--bg-soft);
  text-align: center;
}
.contact h2 { font-size: clamp(26px, 4vw, 36px); }
.contact p { color: var(--muted); max-width: 52ch; margin: 14px auto 26px; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--line-strong);
  transition: transform 0.3s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn.solid { background: var(--sun); border-color: var(--sun); color: #191104; }
.btn.solid:hover { background: #f0b163; }
.btn.ghost:hover { border-color: var(--sun); color: var(--sun); }

footer.site {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px 22px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
footer.site a:hover { color: var(--sun); }

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   GAMES
   ============================================================ */
.games-hero {
  text-align: center;
  padding: clamp(44px, 8vh, 80px) 0 18px;
}
.games-hero h1 { font-size: clamp(32px, 5.6vw, 50px); }
.games-hero p {
  color: var(--muted);
  max-width: 52ch;
  margin: 16px auto 0;
}
.game-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 760px;
  margin: 40px auto 0;
}
.game-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 28px 26px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-body);
  transition: transform 0.4s var(--ease), border-color 0.3s;
  overflow: hidden;
}
.game-card:hover { transform: translateY(-4px); border-color: rgba(232, 162, 76, 0.4); }
.game-card .planet {
  font-size: 38px;
  line-height: 1;
  margin-bottom: 16px;
  display: inline-block;
  animation: float 5s ease-in-out infinite;
}
.game-card:nth-child(2) .planet { animation-delay: -2.5s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.game-card h2 { font-size: 23px; margin-bottom: 8px; }
.game-card p { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }
.game-card .hs {
  font-size: 12.5px;
  color: var(--sun);
  letter-spacing: 0.06em;
  font-weight: 600;
}
.game-card::after {
  content: "";
  position: absolute;
  width: 150px; height: 150px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  top: -60px; right: -60px;
  transition: transform 1s var(--ease);
}
.game-card:hover::after { transform: rotate(40deg) scale(1.08); }

/* play area */
.stage-wrap {
  max-width: 760px;
  margin: 34px auto 0;
  display: none;
}
.stage-wrap.on { display: block; }
.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.stage-head .hud {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--ink-dim);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stage-head .hud b { color: var(--sun); }
canvas.stage {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(#151a28, #10141f);
  display: block;
  touch-action: none;
}
.stage-note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}
.stage-note kbd {
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 8px;
  font-family: var(--font-body);
  font-size: 12px;
}
.touch-controls {
  display: none;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
}
.touch-controls button {
  flex: 1;
  max-width: 170px;
  padding: 16px 0;
  font: 700 15px var(--font-body);
  color: var(--ink);
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  cursor: pointer;
}
.touch-controls button:active { background: var(--sun-soft); border-color: var(--sun); }
@media (pointer: coarse) { .touch-controls { display: flex; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .pillars { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .game-menu { grid-template-columns: 1fr; }
  .chapters { padding-left: 30px; }
  .chapter::before { left: -25px; }
  .chapters::before { left: 4px; }
  .chapter.next { margin-left: -18px; padding: 24px 20px 20px; }
  .chapter.next::before { left: -1px; top: -18px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .avatar-orbit { width: 180px; height: 180px; }
}

/* ============================================================
   MOTION SENSITIVITY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .reveal { opacity: 1; transform: none; }
}
