/* 101studio public front page + /login/. Black, white, one red. Gilroy for words, Roboto Mono (slashed zero) for system meta. */
@font-face { font-family: "Gilroy"; src: url("/assets/fonts/gilroy-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gilroy"; src: url("/assets/fonts/gilroy-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
/* Roboto Mono 400 (Apache License 2.0), subset: Latin + Cyrillic incl. Ө ө Ү ү. Zero is slashed by default. */
@font-face { font-family: "Mono"; src: url("/assets/fonts/robotomono-400.woff") format("woff"); font-weight: 400; font-display: swap; }

:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --red: #e70024;
  --red-ink: #c4001e;
  --mute: #5f5f5f;
  --line: #e3e3e3;
  --wash: #f2f2f2;

  --sans: "Gilroy", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --wrap: 1360px;
  --gutter: clamp(16px, 3.2vw, 40px);
  --col-gap: 24px;
  --head-h: 64px;
  --tap: 44px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --mech: cubic-bezier(.7, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: 500; letter-spacing: 0; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--paper); }

/* Focus: nothing on mouse click, a quiet 1px mark for keyboard only. */
:focus { outline: none; }
a:focus-visible, button:focus-visible { outline: 1px solid rgba(10, 10, 10, .35); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* System meta text: monospace, slashed zero, small, never tracked. */
.meta {
  font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--mute);
  text-transform: uppercase; font-variant-numeric: tabular-nums; font-feature-settings: "zero" 1;
}
.meta-plain { text-transform: none; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Logo: the official wordmark, star always red. */
.logo { display: block; width: 104px; height: auto; aspect-ratio: 801.45 / 125; color: var(--ink); }

/* Buttons: icon + label pill, 44px. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 20px;
  border: 1px solid var(--ink); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-size: 15px; font-weight: 500; line-height: 1;
  white-space: nowrap; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--red); border-color: var(--red); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- header ---------- */
.head { position: relative; z-index: 2; background: var(--paper); }
.head-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--head-h); }

/* ---------- intro (first visit per session) ---------- */
.intro-screen { display: none; }
.intro .intro-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 24px var(--gutter);
  background: var(--ink); color: var(--paper);
  transition: transform .95s var(--mech);
  /* If the script never runs, the screen still clears itself. */
  animation: intro-failsafe 0s linear 7s forwards;
}
.intro-screen .meta { color: #9a9a9a; }
.intro-row { display: flex; justify-content: space-between; gap: 16px; }
.intro-logo { width: min(440px, 72vw); margin: 0 auto; color: var(--paper); }
.intro-logo .word { clip-path: inset(0 100% 0 0); }
.intro-logo .star { opacity: 0; transform-origin: 779.5px 20.8px; transform-box: view-box; }
.intro.intro-run .intro-logo .word { animation: wipe 1s var(--mech) .15s forwards; }
.intro.intro-run .intro-logo .star { animation: settle .5s var(--ease) 1s forwards; }
.intro.intro-out .intro-screen { transform: translateY(-100%); }
.intro-screen .intro-count { color: var(--paper); }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }
@keyframes settle { from { opacity: 0; transform: scale(.2) rotate(-90deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes intro-failsafe { to { visibility: hidden; } }
.intro.intro-done .intro-screen { display: none; }

/* Elements that step in once, after the intro. */
.step { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.step.in { opacity: 1; transform: none; }
.no-js .step { opacity: 1; transform: none; }

/* ---------- front page: one screen ---------- */
.hero { min-height: calc(100svh - var(--head-h)); display: flex; }
.hero > .wrap { display: flex; flex-direction: column; gap: 40px; padding-top: 28px; padding-bottom: 28px; }
.hero-meta, .hero-foot { display: flex; justify-content: space-between; gap: 24px; }
.hero-meta > div, .hero-foot > div { display: flex; gap: 24px; }
.hero-body {
  flex: 1 1 auto;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 56px;
  align-items: end;
}
.hero-text { grid-column: 1 / span 7; }
.hero h1 { font-size: 40px; line-height: 1.1; max-width: 16em; }
.hero-sub { margin-top: 20px; max-width: 30em; font-size: 17px; line-height: 1.55; color: #2b2b2b; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* What we do: a plain indexed list. */
.hero-list { grid-column: 9 / span 4; }
.hero-list > .meta { display: block; margin-bottom: 12px; }
.hero-list ol { border-bottom: 1px solid var(--line); }
.hero-list li {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: baseline;
  padding: 12px 0; border-top: 1px solid var(--line); font-size: 16px;
}

/* ---------- /login/ : 101studio protocol ---------- */
.gate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100svh; }
.gate-side {
  display: flex; flex-direction: column; gap: 24px;
  padding: 28px 40px 32px; background: var(--ink); color: var(--paper);
}
.gate-side .meta { color: #9a9a9a; }
.gate-side-row { display: flex; justify-content: space-between; gap: 16px; }
.pixel-wrap { position: relative; flex: 1 1 auto; min-height: 0; }
.pixel-board { position: absolute; inset: 0; width: 100%; height: 100%; }
.gate-main { display: flex; flex-direction: column; padding: 28px var(--gutter) 32px; }
.gate-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: var(--tap); }
.gate-logo { display: none; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); margin-left: auto; font-size: 14px; color: var(--ink); }
.back:hover { color: var(--mute); }
.gate-box { width: 100%; max-width: 360px; margin: auto; padding: 48px 0; }
.gate-box .meta { margin-bottom: 12px; }
.gate-box h1 { font-size: 36px; line-height: 1.1; }
.gate-note { margin-top: 12px; color: var(--mute); font-size: 15px; }
.gate-form { display: grid; gap: 16px; margin-top: 40px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; color: var(--ink); }
.field input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid #cfcfcf; border-radius: 6px; background: var(--paper);
  font-size: 16px; transition: border-color .2s var(--ease);
}
.field input:hover { border-color: #8a8a8a; }
.field input:focus { outline: none; border-color: var(--ink); }
.gate-err { font-size: 14px; color: var(--red-ink); }
.gate-err:empty { display: none; }
.gate-form .btn { width: 100%; min-height: 48px; margin-top: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .hero-text { grid-column: 1 / span 7; }
  .hero-list { grid-column: 8 / span 5; }
}
@media (max-width: 900px) {
  .hero-body { grid-template-columns: minmax(0, 1fr); }
  .hero-text, .hero-list { grid-column: 1; }
  .hero-list { max-width: 520px; }
  .gate { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .gate-side { height: max(240px, 34svh); padding: 20px var(--gutter); gap: 16px; }
  .gate-main { padding-top: 12px; }
  .gate-box { padding: 32px 0 40px; margin-top: 0; }
}
@media (max-width: 640px) {
  .hero > .wrap { gap: 32px; padding-top: 20px; }
  .hero-meta > div:last-child > span:first-child { display: none; }
  .hero-meta > div:first-child > span:last-child { display: none; }
  .hero-foot > div:last-child { display: none; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .hero-cta .btn { flex: 1 1 auto; }
  .hero-body { row-gap: 40px; }
  .gate-box h1 { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .step { opacity: 1; transform: none; }
  .intro .intro-screen { display: none; }
}
