/* ---------------------------------------------
   Far Boundary — design tokens
   Single dark theme throughout. Two background
   tones for section rhythm, one text color for
   body copy, one muted tone for secondary copy.
--------------------------------------------- */
:root {
  --bg-1: #101010;
  --bg-2: #161615;
  --text: #e6e4de;
  --text-muted: #9a9893;
  --line: rgba(230, 228, 222, 0.14);
  --line-strong: rgba(230, 228, 222, 0.28);

  --btn-fill: #e6e4de;
  --btn-fill-text: #101010;

  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --container: 1180px;
  --gutter: clamp(24px, 5vw, 64px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

p { margin: 0; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--btn-fill);
  color: var(--btn-fill-text);
  padding: 12px 20px;
  z-index: 999;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------------------------------------------
   Buttons — two kinds only, always the same
   everywhere, so nothing competes visually.
--------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn-primary {
  background: var(--btn-fill);
  color: var(--btn-fill-text);
}
.btn-primary:hover { background: #fff; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-outline:hover { border-color: var(--text); }

/* ---------------------------------------------
   Header / navigation
--------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(16, 16, 16, 0.72);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(16, 16, 16, 0.92);
  border-bottom-color: var(--line);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
}
.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px dotted var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  flex-shrink: 0;
  transition: border-color 0.3s var(--ease);
}
.brand:hover .brand-badge { border-color: var(--text); }
.brand-mark {
  height: 100%;
  width: 100%;
  object-fit: contain;
}

.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 36px;
  margin: 0;
  padding: 0;
}
.primary-nav a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
}
.primary-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transition: right 0.3s var(--ease);
}
.primary-nav a:hover::after { right: 0; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 28px;
  height: 20px;
  padding: 0;
  position: relative;
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background-color: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 18px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.mobile-nav {
  display: none;
  max-height: 0;
  overflow: hidden;
  background: var(--bg-1);
  border-bottom: 1px solid transparent;
  transition: max-height 0.35s var(--ease), border-color 0.35s var(--ease);
}
.mobile-nav.is-open {
  max-height: 320px;
  border-bottom-color: var(--line);
}
.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 8px var(--gutter) 28px;
}
.mobile-nav li { border-top: 1px solid var(--line); }
.mobile-nav a {
  display: block;
  padding: 16px 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}

/* ---------------------------------------------
   Hero — no image. A quiet field of fine lines
   behind the type instead of a banner graphic.
--------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--bg-1);
  overflow: hidden;
}

.hero-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(230,228,222,0.05) 0, rgba(230,228,222,0.05) 1px, transparent 1px, transparent 96px),
    repeating-linear-gradient(0deg, rgba(230,228,222,0.05) 0, rgba(230,228,222,0.05) 1px, transparent 1px, transparent 96px);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 30% 40%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 90% 70% at 30% 40%, #000 0%, transparent 72%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 var(--gutter) 96px;
  max-width: 760px;
}

.hero-heading {
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  line-height: 0.98;
  font-weight: 600;
}
.reveal-line { display: block; overflow: hidden; }
.reveal-line span {
  display: block;
  transform: translateY(110%);
  opacity: 0;
}

.hero-copy {
  margin-top: 28px;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: 34ch;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(14px);
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(14px);
}

.hero-scroll-cue {
  position: absolute;
  left: var(--gutter);
  bottom: 28px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.cue-line {
  width: 1px;
  height: 34px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}
.cue-line::after {
  content: '';
  position: absolute;
  left: 0; top: -100%;
  width: 100%; height: 100%;
  background: var(--text);
  animation: cueDrop 2.6s var(--ease) infinite;
}
@keyframes cueDrop {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}

/* page-load reveal, orchestrated once */
body.is-ready .reveal-line span {
  animation: lineUp 0.9s var(--ease) forwards;
}
body.is-ready .reveal-line:nth-child(1) span { animation-delay: 0.15s; }
body.is-ready .reveal-line:nth-child(2) span { animation-delay: 0.28s; }
body.is-ready .hero-copy { animation: fadeUp 0.9s var(--ease) forwards; animation-delay: 0.55s; }
body.is-ready .hero-actions { animation: fadeUp 0.9s var(--ease) forwards; animation-delay: 0.7s; }

@keyframes lineUp {
  to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeUp {
  to { transform: translateY(0); opacity: 1; }
}

/* ---------------------------------------------
   Section rhythm — alternating tone, not color
--------------------------------------------- */
.section { padding: clamp(64px, 10vw, 128px) 0; }
.section-head { margin-bottom: clamp(32px, 6vw, 56px); }
.section-head h2, h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
}

.work { background: var(--bg-1); border-top: 1px solid var(--line); }
.work-list { border-top: 1px solid var(--line); }
.work-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 32px;
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.4s var(--ease);
}
.work-row:hover { padding-left: 12px; }
.work-index {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--text-muted);
}
.work-body h3 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin-bottom: 12px;
}
.work-body p {
  max-width: 52ch;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Games */
.games {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}
.games-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}
.games-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.games-empty {
  padding: clamp(56px, 10vw, 96px) 0;
  max-width: 640px;
}
.games-empty p {
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.3;
}
.games-empty-note {
  margin-top: 18px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 46ch;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 40px;
}
.game-card {
  background: var(--bg-2);
  padding: 28px;
}
.game-card img { margin-bottom: 18px; }
.game-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.game-card p { color: var(--text-muted); font-size: 0.95rem; }

/* About */
.about {
  background: var(--bg-1);
  border-top: 1px solid var(--line);
}
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.about-statement p {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.25;
  font-weight: 500;
}
.about-detail p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 46ch;
  padding-top: 8px;
}

/* Team — a small pyramid: CEO at the apex, two COOs at the base,
   connected by dotted lines like a quiet org chart. */
.team {
  background: var(--bg-1);
  border-top: 1px solid var(--line);
}

.pyramid {
  max-width: 720px;
  margin: 0 auto;
}

.pyramid-ceo,
.pyramid-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pyramid-circle {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 1.5px dotted var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.pyramid-circle-lg {
  width: 132px;
  height: 132px;
  font-size: 0.9rem;
  color: var(--text);
  border-color: var(--line-strong);
}
.pyramid-ceo:hover .pyramid-circle,
.pyramid-node:hover .pyramid-circle {
  border-color: var(--text);
  color: var(--text);
}

.pyramid-name {
  margin-top: 22px;
  font-size: 1.15rem;
  font-weight: 600;
}

.pyramid-quote {
  margin: 12px 0 0;
  max-width: 30ch;
}
.pyramid-quote p {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.pyramid-quote p::before { content: '\201C'; }
.pyramid-quote p::after { content: '\201D'; }

.pyramid-connector {
  position: relative;
  height: 64px;
}
.pyramid-connector::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  height: 32px;
  width: 0;
  border-left: 1.5px dotted var(--line-strong);
  transform: translateX(-50%);
}
.pyramid-connector::after {
  content: '';
  position: absolute;
  left: 25%;
  right: 25%;
  top: 32px;
  border-top: 1.5px dotted var(--line-strong);
}
.pyramid-connector::before,
.pyramid-branch { position: relative; }

.pyramid-branch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.pyramid-branch::before,
.pyramid-branch::after {
  content: '';
  position: absolute;
  top: -32px;
  height: 32px;
  width: 0;
  border-left: 1.5px dotted var(--line-strong);
}
.pyramid-branch::before { left: 25%; transform: translateX(-50%); }
.pyramid-branch::after { left: 75%; transform: translateX(-50%); }

.pyramid-branch-connector { display: none; }

/* Acquisitions */
.acquisitions {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}
.acq-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.acquisitions h2 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.15;
}
.acq-body p {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 48ch;
  margin-bottom: 32px;
}

/* Contact */
.contact {
  background: var(--bg-1);
  border-top: 1px solid var(--line);
}
.contact-grid { text-align: left; }
.contact h2 { margin-bottom: 14px; }
.contact-copy {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 42ch;
  margin-bottom: 36px;
}
.contact-cta {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

/* Footer */
.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  padding: 48px 0;
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.brand-badge-footer {
  width: 46px;
  height: 46px;
  padding: 8px;
}
.footer-mark {
  height: 100%;
  width: 100%;
  object-fit: contain;
}
.footer-tagline { color: var(--text-muted); font-size: 0.95rem; }
.footer-copyright {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------------------------------------------
   Responsive
--------------------------------------------- */
@media (max-width: 1024px) {
  .about-grid, .acq-grid { grid-template-columns: 1fr; }
  .about-detail p, .about-statement p { max-width: none; }
}

@media (max-width: 860px) {
  .primary-nav { display: none; }
  .nav-toggle { display: block; }
  .mobile-nav { display: block; }
}

@media (max-width: 640px) {
  .hero { min-height: 100svh; }
  .hero-content { padding-bottom: 72px; }
  .work-row { grid-template-columns: 48px 1fr; gap: 18px; }
  .work-index { font-size: 1.5rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-copyright { margin-left: 0; }

  .pyramid-circle-lg { width: 112px; height: 112px; }
  .pyramid-connector::after { display: none; }
  .pyramid-connector::before { height: 100%; }
  .pyramid-branch {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .pyramid-branch::before,
  .pyramid-branch::after { display: none; }
  .pyramid-branch-connector {
    display: block;
    position: relative;
    height: 56px;
  }
  .pyramid-branch-connector::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1.5px dotted var(--line-strong);
    transform: translateX(-50%);
  }
}

/* ---------------------------------------------
   Reduced motion
--------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-line span,
  .hero-copy,
  .hero-actions {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .cue-line::after { animation: none; display: none; }
  * { transition-duration: 0.01ms !important; }
}
