:root {
  --bg: #0B0A09;
  --surface: #141210;
  --line: #2A2520;
  --ink: #F4EDE0;
  --muted: #A89F92;
  --faint: #6E665C;
  --orange: #FF8A1F;
  --yellow: #FFC23A;
  --green: #8CC63F;
  --stripe: #1A1714;

  --display: 'Archivo', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --pad: clamp(28px, 5vw, 64px);
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--yellow); }
::selection { background: var(--orange); color: var(--bg); }
p { text-wrap: pretty; }

/* ---------- Utilities ---------- */
.accent { color: var(--orange); }
.ink { color: var(--ink); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.green { color: var(--green); }
.mono { font-family: var(--mono); font-size: 12px; }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--faint);
}
.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: block;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  color: var(--ink);
}
.chip--link:hover { border-color: var(--orange); color: var(--orange); }

/* ---------- Type ---------- */
.h1, .h2, .h3 {
  margin: 0;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}
.h1 {
  font-stretch: 120%;
  font-size: clamp(56px, 9vw, 148px);
  line-height: 0.86;
  letter-spacing: -0.02em;
}
.h2 {
  font-stretch: 115%;
  font-size: clamp(34px, 4.5vw, 60px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.h2--xl {
  font-stretch: 120%;
  font-size: clamp(48px, 7vw, 104px);
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.h2__count {
  font-family: var(--mono);
  font-style: normal;
  font-weight: 400;
  font-size: 0.4em;
  color: var(--faint);
}
.h3 {
  font-stretch: 115%;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 0.95;
}
.lede {
  margin: 0;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.45;
  color: var(--muted);
  max-width: 30ch;
}

/* ---------- Layout ---------- */
.shell {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.main { flex: 1 1 100%; min-width: 0; }

.sidebar {
  position: relative;
  top: 0;
  align-self: flex-start;
  width: 100%;
  height: auto;
  box-sizing: border-box;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
  background: rgba(11, 10, 9, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 5;
}

@media (min-width: 960px) {
  .sidebar { position: sticky; width: 300px; height: 100vh; }
  .main { flex-basis: 0px; }
}

.section {
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 32px;
  border-bottom: 1px solid var(--line);
}
.section--last { border-bottom: 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 24px;
}
.section-head .h2 { line-height: 1; }
.section-head__num { font-family: var(--mono); font-size: 12px; color: var(--orange); }
.section-head__aside { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* ---------- Sidebar ---------- */
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__logo { width: 44px; height: 44px; border-radius: 50%; display: block; }
.brand__name {
  font-weight: 900;
  font-stretch: 115%;
  font-style: italic;
  font-size: 20px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.sidebar__tagline { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }

.nav { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.nav__item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
.nav__item.is-active { color: var(--orange); }
.nav__num { font-family: var(--mono); font-size: 11px; color: var(--faint); width: 18px; }
.nav__label { flex: 1; }
.nav__mark { font-family: var(--mono); font-size: 12px; }
.nav__mark::before { content: '→'; }
.nav__item.is-active .nav__mark::before { content: '●'; }

.now-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.now-card__title {
  font-weight: 900;
  font-stretch: 110%;
  font-size: 22px;
  text-transform: uppercase;
  font-style: italic;
}
.now-card__meta { font-size: 13px; color: var(--muted); }

.find-us { display: flex; flex-direction: column; gap: 10px; }

.sidebar__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}
.sidebar__foot a { color: var(--ink); }
.sidebar__foot a:hover { color: var(--orange); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  box-sizing: border-box;
  gap: 40px;
  background: radial-gradient(circle at 78% 42%, rgba(255, 138, 31, 0.10), transparent 55%);
}
.hero__row {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}
.hero__text { flex: 1 1 380px; display: flex; flex-direction: column; gap: 28px; }

.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.btn--primary {
  background: var(--orange);
  color: var(--bg);
  font-weight: 800;
  padding: 14px 22px;
}
.btn--primary:hover { background: var(--yellow); color: var(--bg); }
.btn--ghost {
  border: 1px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
  padding: 13px 22px;
}
.btn--ghost:hover { border-color: var(--orange); color: var(--orange); }

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.meta-strip__end { margin-left: auto; color: var(--faint); }

/* ---------- Coin ---------- */
.coin-wrap {
  flex: 0 1 460px;
  min-width: 220px;
  perspective: 900px;
  position: relative;
}
.coin-sparks {
  position: absolute;
  left: -25%;
  top: -25%;
  width: 150%;
  height: 150%;
  pointer-events: none;
  z-index: 2;
}
.coin {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out;
  will-change: transform;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.coin:focus-visible { outline: 2px solid var(--orange); outline-offset: 8px; border-radius: 50%; }
.coin__spin {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.coin__edge {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD27A 0%, #E07400 40%, #7A3500 75%, #FFB347 100%);
}
.coin__edge--dark {
  background: linear-gradient(135deg, #FFD27A 0%, #C85F00 40%, #7A3500 75%, #FFB347 100%);
}
.coin__edge--back {
  background: #3A1C00;
  box-shadow: 0 30px 120px rgba(255, 138, 31, 0.25);
}
.coin__face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  transform: translateZ(1px);
  -webkit-user-drag: none;
}
/* Mirror of the face just behind the last edge disc, so a flip shows the crest. */
.coin__face--back { transform: translateZ(-23.4px) rotateY(180deg); }
.coin__shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform: translateZ(2px);
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,244,220,0.22) 46%, rgba(255,255,255,0.05) 52%, rgba(255,255,255,0) 64%);
  background-size: 250% 250%;
  background-position: 50% 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 210, 140, 0.35), inset 0 -10px 30px rgba(0, 0, 0, 0.35);
}

/* ---------- Games ---------- */
.game-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.game-card:hover { border-color: var(--orange); color: var(--ink); }
.game-card__art {
  aspect-ratio: 16 / 10;
  background: repeating-linear-gradient(135deg, var(--stripe) 0 12px, var(--surface) 12px 24px);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 14px;
  box-sizing: border-box;
  position: relative;
}
.game-card__placeholder {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  border: 1px dashed #3A332C;
  padding: 6px 10px;
}
.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  background: var(--green);
  color: var(--bg);
  padding: 4px 8px;
  font-weight: 700;
}
.game-card__body {
  padding: clamp(22px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.game-card__meta { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.game-card__pitch { margin: 0; font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 44ch; }
.game-card__cta { margin-top: auto; font-family: var(--mono); font-size: 13px; color: var(--orange); }

/* ---------- Studio ---------- */
.studio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 40px 64px;
}
.studio__intro { display: flex; flex-direction: column; gap: 22px; }
.definition { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--faint); line-height: 1.6; }
.lines {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.lines li {
  display: flex;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  font-size: 19px;
  line-height: 1.5;
  text-wrap: pretty;
}
.lines__num { font-family: var(--mono); font-size: 12px; color: var(--orange); padding-top: 4px; }

/* ---------- Devlog ---------- */
.posts { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.post-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 10px 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  align-items: baseline;
}
.post-row:hover { color: var(--orange); }
.post-row__date { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.post-row__main { display: flex; flex-direction: column; gap: 6px; grid-column: span 2; }
.post-row__title { font-weight: 800; font-size: 22px; }
.post-row__desc { font-size: 15px; color: var(--muted); line-height: 1.5; }
.post-row__tag { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }

/* Post page (design TBD — reuses section styling) */
.post-head { display: flex; flex-direction: column; gap: 18px; }
.prose { max-width: 68ch; font-size: 17px; line-height: 1.65; color: var(--ink); }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3 { font-stretch: 110%; font-style: italic; text-transform: uppercase; }
.prose h2 { font-size: 26px; line-height: 1.1; margin: 48px 0 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.prose h3 { font-size: 18px; margin: 28px 0 8px; color: var(--orange); }
.prose p, .prose ul { color: var(--muted); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--orange); }
.prose img { max-width: 100%; height: auto; }
.prose code { font-family: var(--mono); font-size: 0.9em; }

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}
.link-rows { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.link-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.link-row:hover { color: var(--orange); }
.link-row__label { font-family: var(--mono); font-size: 12px; color: var(--faint); width: 70px; }
.link-row__value { flex: 1; font-size: 18px; font-weight: 600; }

.discord-card {
  display: flex;
  gap: 20px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 22px;
  color: var(--ink);
}
.discord-card:hover { border-color: var(--orange); color: var(--ink); }
.discord-card__img { width: 104px; height: 104px; border-radius: 50%; flex-shrink: 0; display: block; }
.discord-card__body { display: flex; flex-direction: column; gap: 8px; }
.discord-card__title {
  font-weight: 900;
  font-style: italic;
  font-stretch: 110%;
  text-transform: uppercase;
  font-size: 26px;
  line-height: 1;
}
.discord-card__text { font-size: 14px; color: var(--muted); line-height: 1.5; }
.discord-card__cta { font-family: var(--mono); font-size: 13px; color: var(--orange); }

.foot-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 24px;
}
.foot-strip__top { margin-left: auto; color: var(--muted); }
.foot-strip__link, .sidebar__foot .sidebar__legal { color: var(--faint); }
.foot-strip__link:hover, .sidebar__foot .sidebar__legal:hover { color: var(--orange); }

/* ---------- Animated background ---------- */
@keyframes tgStreak { from { transform: translateX(0) rotate(-24deg); } to { transform: translateX(-160vw) rotate(-24deg); } }
@keyframes tgGlow { 0%, 100% { opacity: .55; transform: translate(0, 0) scale(1); } 50% { opacity: 1; transform: translate(-4vw, 3vh) scale(1.12); } }
@keyframes tgTwinkle { 0%, 100% { opacity: 0; } 50% { opacity: .5; } }
@keyframes tgGrid { from { background-position: 0 0; } to { background-position: -64px 64px; } }

.tg-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.tg-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 237, 224, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 237, 224, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  animation: tgGrid 12s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 75%);
}
.tg-bg__orb { position: absolute; border-radius: 50%; }
.tg-bg__orb--orange {
  width: 60vw;
  height: 60vw;
  right: -15vw;
  top: -10vw;
  background: radial-gradient(circle, rgba(255, 138, 31, 0.16), transparent 62%);
  animation: tgGlow 18s ease-in-out infinite;
}
.tg-bg__orb--green {
  width: 45vw;
  height: 45vw;
  left: -12vw;
  bottom: -18vw;
  background: radial-gradient(circle, rgba(140, 198, 63, 0.05), transparent 62%);
  animation: tgGlow 24s ease-in-out infinite reverse;
}
.tg-bg__dot { position: absolute; border-radius: 50%; opacity: 0; animation-name: tgTwinkle; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
.tg-bg__streak { position: absolute; left: 110vw; border-radius: 2px; transform: rotate(-24deg); animation-name: tgStreak; animation-timing-function: linear; animation-iteration-count: infinite; }

.no-motion .tg-bg * { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tg-bg * { animation: none !important; }
}
