/* ============================================================
   ObjectState — warm graphite, amber status lights, mono state
   ============================================================ */

:root {
  --bg: #0e0d0b;
  --bg-raise: #14130f;
  --surface: #191712;
  --line: rgba(242, 239, 232, 0.09);
  --line-strong: rgba(242, 239, 232, 0.16);
  --text: #f2efe8;
  --muted: #a29c8e;
  --faint: #6e6a5f;
  --amber: #ffb224;
  --amber-soft: rgba(255, 178, 36, 0.14);
  --display: "Bricolage Grotesque", "Instrument Sans", sans-serif;
  --body: "Instrument Sans", sans-serif;
  --mono: "Fragment Mono", monospace;
  --radius: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* graph-paper ground + grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 75%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--amber); color: #100c02; }

a { color: inherit; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ---------- shared bits ---------- */

.kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--amber);
  letter-spacing: 0.08em;
  margin: 0 0 1rem;
}

.led {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  animation: pulse 2.4s ease-in-out infinite;
}
.led-amber  { background: var(--amber);  box-shadow: 0 0 10px var(--amber); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #100c02;
  font-weight: 600;
  box-shadow: 0 0 0 0 rgba(255, 178, 36, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 178, 36, 0.35);
}
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { border-color: var(--amber); color: var(--text); }
.btn-big { font-size: 1.05rem; padding: 1.1rem 2.2rem; }

/* dots used in every window chrome */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1.2rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}
.brace {
  font-family: var(--mono);
  color: var(--amber);
  font-weight: 400;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 1.8rem);
  font-family: var(--mono);
  font-size: 0.85rem;
}
.site-nav a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--text); }
.site-nav .nav-cta {
  color: var(--amber);
  border: 1px solid rgba(255, 178, 36, 0.45);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.site-nav .nav-cta:hover { background: var(--amber); color: #100c02; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(4.5rem, 10vw, 8rem) clamp(1.2rem, 4vw, 3rem) clamp(4rem, 8vw, 6.5rem);
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero-glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 100vw);
  height: 640px;
  background: radial-gradient(ellipse at center, rgba(255, 178, 36, 0.09) 0%, transparent 65%);
  pointer-events: none;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.4rem;
  animation: rise 0.7s ease both;
}

.hero-title {
  font-size: clamp(3rem, 8.5vw, 6.2rem);
  font-weight: 800;
  font-variation-settings: "opsz" 96;
  max-width: 14ch;
  animation: rise 0.7s 0.08s ease both;
}
.hero-title em {
  font-style: normal;
  color: var(--amber);
  position: relative;
}
.hero-title em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.04em;
  height: 0.09em;
  background: var(--amber);
  opacity: 0.35;
  border-radius: 2px;
}

.hero-sub {
  max-width: 56ch;
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--muted);
  margin: 1.6rem 0 2.4rem;
  animation: rise 0.7s 0.16s ease both;
}
.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-products {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--faint);
  margin: 0;
  animation: rise 0.7s 0.24s ease both;
}
.hero-products a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.hero-products a:hover { color: var(--amber); }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.4rem;
  animation: rise 0.7s 0.32s ease both;
}

/* ---------- sections ---------- */

.section {
  padding: clamp(4rem, 9vw, 7.5rem) clamp(1.2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}

.section-head {
  max-width: var(--max);
  margin: 0 auto clamp(3rem, 6vw, 4.5rem);
}
.section-head h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  font-variation-settings: "opsz" 60;
}
.section-lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 1.3rem 0 0;
}
.section-lede strong { color: var(--text); }

/* ---------- products ---------- */

.product {
  max-width: var(--max);
  margin: 0 auto clamp(4rem, 8vw, 6.5rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.product:last-child { margin-bottom: 0; }
.product-flip .product-media { order: 2; }
.product-flip .product-copy  { order: 1; }

.shot {
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.shot:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 178, 36, 0.5);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), 0 0 0 4px var(--amber-soft);
}
.shot-chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.shot-light .shot-chrome { background: #ecebe6; border-bottom-color: rgba(0,0,0,0.08); }
.shot-light .shot-url { color: #6b675e; }
.shot-url {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}
.shot img { width: 100%; height: auto; }

.product-copy h3 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 800;
}
.product-tag {
  font-size: 1.08rem;
  color: var(--text);
  font-weight: 600;
  margin: 0.7rem 0 1rem;
}
.product-copy > p:not(.product-tag):not(.state-line) {
  color: var(--muted);
  font-size: 0.98rem;
  margin: 0 0 1.4rem;
}
.product-copy strong { color: var(--text); }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0 0 1.6rem;
}
.chips li {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: var(--bg-raise);
  white-space: nowrap;
}

.product-link {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 178, 36, 0.4);
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}
.product-link:hover { border-color: var(--amber); }
.product-link span { display: inline-block; transition: transform 0.2s ease; }
.product-link:hover span { transform: translateX(4px); }

/* ---------- games ---------- */

.section-games { background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.03) 30%, transparent); }

.games-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.6rem);
}

.game {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.game:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}
.game img { width: 100%; height: auto; }
.game-copy { padding: 1.1rem 1.2rem 1.3rem; }
.game-copy h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 0.5rem; }
.game-copy p { margin: 0; font-size: 0.86rem; color: var(--muted); line-height: 1.55; }

/* ---------- the lab ---------- */

.lab-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 560px);
  gap: clamp(1rem, 2.5vw, 1.6rem);
}

.lab-card {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.5rem;
  background: repeating-linear-gradient(
    -45deg,
    var(--bg-raise) 0px,
    var(--bg-raise) 14px,
    var(--surface) 14px,
    var(--surface) 28px
  );
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.lab-card:hover { border-color: rgba(248, 113, 113, 0.5); transform: translateY(-4px); }
.lab-card h3 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.lab-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.redacted { color: var(--faint); letter-spacing: 0.05em; user-select: none; }

/* ---------- free code ---------- */

.code-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.6rem);
}

.code-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.5rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.code-card:hover { transform: translateY(-4px); border-color: rgba(255, 178, 36, 0.4); }
.code-card h3 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.code-card h3 a {
  font-family: var(--mono);
  font-weight: 400;
  color: var(--amber);
  text-decoration: none;
}
.code-card h3 a:hover { text-decoration: underline; }
.code-card p { margin: 0 0 1.1rem; color: var(--muted); font-size: 0.9rem; flex: 1; }
.code-lang {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}

/* ---------- studio ---------- */

.studio-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.6rem);
}

.studio-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.7rem 1.5rem 1.6rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.studio-card:hover { transform: translateY(-4px); border-color: rgba(255, 178, 36, 0.4); }
.studio-num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--amber);
  display: block;
  margin-bottom: 1rem;
}
.studio-card h3 { font-size: 1.25rem; margin-bottom: 0.6rem; }
.studio-card p { margin: 0; color: var(--muted); font-size: 0.94rem; }

.services-strip {
  max-width: var(--max);
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  background: var(--bg-raise);
}
.services-strip strong { color: var(--text); font-weight: 600; }

/* ---------- contact ---------- */

.section-contact {
  text-align: center;
  background:
    radial-gradient(ellipse 60% 80% at 50% 100%, rgba(255, 178, 36, 0.07), transparent 70%);
}
.contact-inner { max-width: 760px; margin: 0 auto; }
.contact-inner .kicker { justify-content: center; }
.contact-inner h2 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
}
.contact-inner .section-lede { margin: 1.3rem auto 2.4rem; }

/* ---------- founder card ---------- */

.founder {
  display: flex;
  align-items: flex-start;
  gap: clamp(1.4rem, 3vw, 2rem);
  text-align: left;
  max-width: 780px;
  margin: clamp(2.6rem, 5vw, 3.6rem) auto 0;
  padding: clamp(1.4rem, 3vw, 1.9rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.founder-photo { flex: none; display: block; }
.founder-photo img {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line-strong);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.founder-photo:hover img { border-color: var(--amber); transform: scale(1.03); }
.founder-bio h3 { font-size: 1.35rem; }
.founder-role {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--amber);
  margin: 0.45rem 0 0.9rem;
}
.founder-bio p:not(.founder-role):not(.founder-links) {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.2rem;
}
.founder-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin: 0;
}

@media (max-width: 640px) {
  .founder { flex-direction: column; align-items: center; }
  .founder-bio { text-align: left; }
  .founder-bio h3, .founder-role { text-align: center; }
  .founder-links { justify-content: center; }
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.6rem clamp(1.2rem, 4vw, 3rem) 3rem;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.footer-brand p {
  flex-basis: 100%;
  margin: 0.5rem 0 0;
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.88rem;
  color: var(--faint);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--amber); }
.footer-note {
  flex-basis: 100%;
  margin: 1.6rem 0 0;
  font-size: 0.8rem;
  color: var(--faint);
}

/* ---------- scroll reveal ---------- */

/* hidden initial state only when JS is running (html.js), so content
   is never lost if the script doesn't load */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-code .ln { opacity: 1; }
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-grid, .studio-grid, .code-grid { grid-template-columns: 1fr; }
  .product {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
  .product-flip .product-media { order: 0; }
  .product-flip .product-copy  { order: 1; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .games-grid { grid-template-columns: 1fr; }
  .services-strip { border-radius: var(--radius); }
}
