/* ============================================================================
   LASER EYES // TERMINAL
   Light brutalist terminal UI. One screen, no page scroll, mobile first.
   Hard offset shadows, zero radius, monospace throughout.
   ========================================================================== */

:root {
  --paper:    #f5f5f5;                 /* canvas  */
  --panel:    #ffffff;                 /* surface */
  --ink:      #0a0a0a;
  --ink-mid:  rgba(10, 10, 10, .62);
  --ink-soft: rgba(10, 10, 10, .38);
  --line:     rgba(10, 10, 10, .22);
  --wash:     rgba(10, 10, 10, .045);

  --laser: #ff2d2d;
  --bnb:   #f0b90b;
  --btc:   #f7931a;

  --mono: "Space Mono", ui-monospace, SFMono-Regular, "SF Mono", Consolas,
          "Liberation Mono", Menlo, "PingFang SC", "Microsoft YaHei", monospace;

  --fs-micro: 9px;
  --fs-tiny:  10px;
  --fs-sm:    12px;
  --fs-md:    13px;
  --fs-lg:    16px;

  --pad:    14px;
  --gap:    10px;
  --bar-h:  38px;
  --tw-h:   500px;                     /* uniform tweet-card height */
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;                    /* the page itself never scrolls */
  overscroll-behavior: none;
}

body {
  background: var(--paper);
  /* Faint dot grid, like graph paper under the terminal. */
  background-image: radial-gradient(var(--line) .5px, transparent .5px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* Any display: rule beats the UA sheet's [hidden] { display: none }, so make the
   attribute authoritative — otherwise .modal{display:grid} shows it always. */
[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: var(--laser); color: #fff; }
:focus-visible { outline: 2px solid var(--laser); outline-offset: 2px; }

/* ── Terminal shell ──────────────────────────────────────────────────────── */
.term {
  height: 100dvh;                      /* dvh so mobile browser chrome can't clip */
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  gap: var(--gap);
}
@supports not (height: 100dvh) { .term { height: 100vh; } }

/* ── Bars ────────────────────────────────────────────────────────────────── */
.bar {
  flex: 0 0 auto;
  min-height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap);
  padding: 0 10px;
  border: 2px solid var(--ink);
  background: var(--panel);
  font-size: var(--fs-tiny);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.bar__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bar__right { display: flex; align-items: center; gap: 10px; }
.clock { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* Logo mark. The artwork is a glow on transparency, built for dark backgrounds —
   on the white canvas it would wash out, so it sits in a black tile (the same
   treatment as the favicon) and is scaled up to crop the empty margin. */
.mark {
  width: 26px; height: 26px; flex: 0 0 auto;
  background: var(--ink); overflow: hidden;
  display: grid; place-items: center;
}
.mark img {
  width: 34px; max-width: none; display: block;
  animation: glow 4.5s ease-in-out infinite;
}
@keyframes glow { 0%, 100% { opacity: 1; } 50% { opacity: .72; } }

.bar__status { display: flex; align-items: center; gap: 7px; color: var(--ink-mid); }
.live {
  width: 6px; height: 6px; background: var(--laser);
  animation: pulse 1.6s var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

.bar__keys { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.bar__keys kbd {
  font: inherit; border: 1px solid var(--line); background: var(--wash);
  padding: 1px 4px; margin-left: 4px;
}
.bar__keys kbd:first-child { margin-left: 0; }

/* ── Language switch ─────────────────────────────────────────────────────── */
.lang { display: flex; border: 1px solid var(--ink); }
.lang button {
  font-size: var(--fs-micro); letter-spacing: .1em; font-weight: 700;
  padding: 4px 7px; color: var(--ink-mid);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.lang button + button { border-left: 1px solid var(--ink); }
.lang button:hover { background: var(--wash); color: var(--ink); }
.lang button.is-active { background: var(--laser); color: #fff; }

/* ── Ghost button ────────────────────────────────────────────────────────── */
.ghost {
  font-size: var(--fs-micro); letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; padding: 5px 9px;
  border: 1px solid var(--ink); background: var(--panel);
  white-space: nowrap;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.ghost:hover { background: var(--ink); color: var(--panel); }

/* ── Stage + panel ───────────────────────────────────────────────────────── */
.stage { flex: 1 1 auto; min-height: 0; display: flex; }

.panel {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
}

.panel__head {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border-bottom: 2px solid var(--ink);
  background: var(--panel);
}
.panel__label {
  font-size: var(--fs-tiny); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-mid); font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.panel__head .ghost { margin-left: auto; }

.chip {
  flex: 0 0 auto;
  font-size: var(--fs-micro); letter-spacing: .14em; font-weight: 700;
  padding: 3px 6px; border: 1px solid var(--ink); background: var(--wash);
  text-transform: uppercase;
}
.chip--laser { background: var(--laser); color: #fff; border-color: var(--laser); }
.chip--warn  { background: var(--ink);   color: var(--panel); }

/* The only scrolling region on the site. */
.panel__scroll {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: var(--pad);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.panel__scroll::-webkit-scrollbar { width: 8px; }
.panel__scroll::-webkit-scrollbar-thumb { background: var(--line); }
.panel__scroll:focus { outline: none; }

/* ── Screen transition ───────────────────────────────────────────────────── */
.screen { animation: screenIn .28s var(--ease); }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ══ MENU ════════════════════════════════════════════════════════════════ */
.menu {
  max-width: 640px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 100%;
  justify-content: center;
  padding-block: 8px;
}

.menu__title {
  font-size: clamp(30px, 9vw, 58px);
  line-height: .95; font-weight: 700; letter-spacing: -.02em;
  text-transform: uppercase;
}
/* The motto — CZ, 20 Feb 2021. */
.menu__tag {
  display: flex; align-items: baseline; gap: 8px;
  font-size: var(--fs-sm); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-mid); margin-top: 8px; line-height: 1.4;
}
.menu__tag::before { content: "›"; color: var(--laser); font-weight: 700; }
.menu__hint {
  font-size: var(--fs-micro); letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-soft);
}

.menu__list { display: flex; flex-direction: column; gap: 8px; }

.sector {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 11px 12px;
  border: 2px solid var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease),
              background .16s var(--ease), color .16s var(--ease);
}
.sector__num {
  flex: 0 0 auto;
  font-size: var(--fs-micro); letter-spacing: .12em; font-weight: 700;
  padding: 3px 5px; border: 1px solid currentColor; opacity: .75;
}
.sector__text { flex: 1 1 auto; min-width: 0; }
.sector__title {
  display: block;
  font-size: var(--fs-lg); font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; line-height: 1.15;
}
.sector__sub {
  display: block;
  font-size: var(--fs-micro); letter-spacing: .14em; text-transform: uppercase;
  opacity: .6; margin-top: 2px;
}
.sector__go { flex: 0 0 auto; font-size: var(--fs-lg); font-weight: 700; }

.sector:hover,
.sector.is-cursor {
  background: var(--laser); color: #fff; border-color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

/* ══ Shared content blocks ═══════════════════════════════════════════════ */
.doc { max-width: 780px; margin: 0 auto; }

.h1 {
  font-size: clamp(19px, 4.6vw, 27px);
  line-height: 1.15; font-weight: 700; letter-spacing: -.01em;
  margin-bottom: 16px;
  text-wrap: balance;
}
html[data-lang="zh"] .h1 { letter-spacing: 0; line-height: 1.35; }

.lines { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.lines li {
  display: flex; gap: 9px;
  font-size: var(--fs-md); color: var(--ink-mid); line-height: 1.6;
}
.lines li::before {
  content: ">"; color: var(--laser); font-weight: 700; flex: 0 0 auto;
}
html[data-lang="zh"] .lines li { line-height: 1.8; }

.bang {
  display: block;
  font-size: clamp(15px, 4vw, 22px); font-weight: 700; letter-spacing: -.01em;
  padding: 11px 12px; margin-bottom: 16px;
  border: 2px solid var(--ink); background: var(--laser); color: #fff;
  box-shadow: var(--shadow-sm);
  word-break: break-word;
}

.quote {
  border-left: 3px solid var(--laser);
  padding: 3px 0 3px 12px; margin-bottom: 16px;
}
.quote p { font-size: var(--fs-md); line-height: 1.55; }
.quote p::before { content: "“"; }
.quote p::after  { content: "”"; }
.quote cite {
  display: block; margin-top: 6px; font-style: normal;
  font-size: var(--fs-micro); letter-spacing: .14em; color: var(--ink-soft);
}

.note {
  font-size: var(--fs-sm); color: var(--ink-mid); line-height: 1.6;
  border: 1px dashed var(--line); padding: 10px; background: var(--wash);
}

/* ── Rows (timeline, lexicon, spec) ──────────────────────────────────────── */
.rows { border-top: 1px solid var(--line); }
.row {
  display: grid; align-items: start;
  gap: 4px 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  transition: background .16s var(--ease);
}
.row:hover { background: var(--wash); }

.row--tl { grid-template-columns: 62px 1fr; }
.row__d {
  font-size: var(--fs-micro); letter-spacing: .1em; font-weight: 700;
  color: var(--ink-soft); padding-top: 2px;
}
.row--hot .row__d { color: var(--laser); }
.row__t { font-size: var(--fs-md); font-weight: 700; }
.row--hot .row__t { color: var(--laser); }
.row__b { font-size: var(--fs-sm); color: var(--ink-mid); line-height: 1.5; }

.row--lex { grid-template-columns: 150px 1fr; }
.row__term {
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: .06em;
  color: var(--laser); text-transform: uppercase;
}

/* ── Philosophy grid ─────────────────────────────────────────────────────── */
.grid2 {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.card {
  border: 2px solid var(--ink); background: var(--panel);
  box-shadow: var(--shadow-sm);
  padding: 11px;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.card:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.card__n {
  font-size: var(--fs-micro); letter-spacing: .14em; font-weight: 700;
  color: var(--laser); margin-bottom: 5px;
}
.card__t {
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 5px;
}
.card__b { font-size: var(--fs-sm); color: var(--ink-mid); line-height: 1.55; }
html[data-lang="zh"] .card__b { line-height: 1.75; }

/* ══ SIGNAL / tweets ═════════════════════════════════════════════════════ */
/* X embeds have wildly different intrinsic heights — a portrait photo runs to
   ~800px, a text-only post to ~200px. Every card is therefore given the same
   fixed height and the embed area scrolls inside it, so the grid stays even. */
.tweets {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  grid-auto-rows: var(--tw-h);
  align-items: stretch;
}
.tw {
  display: flex; flex-direction: column; min-height: 0;
  border: 2px solid var(--ink); background: var(--panel); box-shadow: var(--shadow-sm);
}
.tw__note {
  flex: 0 0 auto;
  min-height: 52px;                    /* 1- and 2-line notes occupy the same space */
  display: flex; align-items: center;
  font-size: var(--fs-sm); color: var(--ink-mid); line-height: 1.5;
  padding: 9px 10px; border-bottom: 1px solid var(--line); background: var(--wash);
}
.tw--bnb .tw__note { background: rgba(240, 185, 11, .16); color: #6b5200; }
.tw__embed {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; padding: 10px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.tw__embed::-webkit-scrollbar { width: 6px; }
.tw__embed::-webkit-scrollbar-thumb { background: var(--line); }
.tw__embed .twitter-tweet { margin: 0 !important; }

.twcard__head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.twcard__avatar {
  width: 26px; height: 26px; flex: 0 0 auto;
  border: 1px solid var(--ink); display: grid; place-items: center;
}
.twcard__avatar i { width: 6px; height: 6px; border-radius: 50%; background: var(--laser); }
.twcard__name { font-size: var(--fs-sm); font-weight: 700; line-height: 1.2; }
.twcard__handle { font-size: var(--fs-micro); color: var(--ink-soft); letter-spacing: .08em; }
.twcard__text { font-size: var(--fs-md); font-weight: 700; line-height: 1.45; margin-bottom: 9px; }
.twcard__trans {
  font-size: var(--fs-sm); color: var(--ink-mid); line-height: 1.6;
  border-left: 2px solid var(--line); padding-left: 8px; margin-bottom: 9px;
}
.twcard__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 8px; border-top: 1px solid var(--line);
}
.twcard__date { font-size: var(--fs-micro); color: var(--ink-soft); letter-spacing: .1em; }
.twcard__link {
  font-size: var(--fs-micro); letter-spacing: .12em; font-weight: 700;
  color: var(--laser); text-transform: uppercase;
}
.twcard__link:hover { text-decoration: underline; }

.micro {
  font-size: var(--fs-micro); letter-spacing: .1em; color: var(--ink-soft);
  text-transform: uppercase; margin-top: 12px;
}
/* For sentence-length fine print rather than a single tracked label. */
.micro--wrap { text-transform: none; letter-spacing: .02em; line-height: 1.6; max-width: 62ch; }

/* In-screen section heading. */
.sub {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; margin: 20px 0 8px;
}
.sub::before {
  content: ""; width: 10px; height: 10px; flex: 0 0 auto;
  background: var(--laser);
}

/* ══ TOKEN ═══════════════════════════════════════════════════════════════ */
.row--spec { grid-template-columns: 110px 1fr; align-items: center; }
.row__k {
  font-size: var(--fs-micro); letter-spacing: .14em; font-weight: 700;
  color: var(--ink-soft); text-transform: uppercase;
}
.row__v {
  font-size: var(--fs-sm); font-weight: 700;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  word-break: break-all;
}
.row__v.is-tba { color: var(--ink-soft); font-weight: 400; }
/* Prose values wrap normally instead of breaking mid-word like an address. */
.row__v--plain { font-weight: 400; color: var(--ink-mid); word-break: normal; line-height: 1.55; }
.row__v.is-bnb { color: #8a6a00; }
.mini {
  font-size: var(--fs-micro); letter-spacing: .1em; font-weight: 700;
  border: 1px solid var(--ink); padding: 2px 5px; text-transform: uppercase;
}
.mini:hover { background: var(--ink); color: var(--panel); }

.cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 12px 20px;
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase;
  border: 2px solid var(--ink); background: var(--laser); color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.cta:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.cta.is-off {
  background: var(--panel); color: var(--ink-soft); border-color: var(--line);
  box-shadow: none; pointer-events: none;
}

/* ══ Chinese typography ══════════════════════════════════════════════════ */
/* The wide tracking above is for uppercase Latin. Applied to Chinese it inserts
   a gap between every single character, which reads as broken. */
html[data-lang="zh"] :is(
  .bar, .bar__keys, .panel__label, .chip, .lang button, .ghost, .mini, .cta,
  .menu__tag, .menu__hint, .sector__num, .sector__sub, .sector__title,
  .card__n, .card__t, .row__d, .row__k, .row__term, .micro,
  .twcard__handle, .twcard__date, .twcard__link
) { letter-spacing: .02em; }

html[data-lang="zh"] .menu__title { letter-spacing: 0; }

/* ══ No-JS fallback ══════════════════════════════════════════════════════ */
/* When it is shown, it replaces the terminal entirely and the page may scroll. */
.noscript {
  position: fixed; inset: 0; z-index: 100;
  overflow-y: auto;
  background: var(--panel);
  padding: 24px 18px;
}
.noscript > * { max-width: 660px; margin-inline: auto; }
.noscript h1 { font-size: 34px; letter-spacing: -.02em; margin-bottom: 10px; }
.noscript p { font-size: var(--fs-sm); line-height: 1.65; margin-bottom: 12px; color: var(--ink-mid); }
.noscript strong { color: var(--ink); }

/* ══ Responsive ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .tweets { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root {
    --pad: 10px; --gap: 8px; --bar-h: 34px;
    --shadow: 4px 4px 0 var(--ink); --shadow-sm: 3px 3px 0 var(--ink);
    --fs-md: 12.5px; --fs-lg: 15px;
    --tw-h: 420px;
  }
  /* Keyboard hints are meaningless on touch — the space is worth more. */
  .bar__keys { display: none; }
  .clock { display: none; }
  .bar { padding: 0 8px; letter-spacing: .08em; }

  .grid2 { grid-template-columns: 1fr; }
  .tweets { grid-auto-rows: var(--tw-h); }
  .row--lex { grid-template-columns: 1fr; gap: 2px; }
  .row--tl  { grid-template-columns: 54px 1fr; }
  .row--spec { grid-template-columns: 1fr; align-items: start; gap: 2px; }

  .menu { gap: 12px; }
  .menu__list { gap: 6px; }
  .sector { padding: 10px; }
  /* Comfortable thumb target regardless of text length. */
  .sector { min-height: 52px; }
}

@media (max-width: 380px) {
  .sector__sub { display: none; }
  .menu__title { font-size: 28px; }
}

/* Short landscape phones: the menu must not need scrolling either. */
@media (max-height: 560px) {
  .menu { justify-content: flex-start; gap: 10px; }
  .menu__title { font-size: clamp(24px, 6vw, 34px); }
  .sector { padding: 8px 10px; min-height: 0; }
  .sector__sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .sector:hover, .card:hover, .cta:hover { transform: none; }
}
