/* tetris.codes — minimalist dark. */

:root {
  --bg:       #000;
  --fg:       #fafafa;
  --dim:      #6f6f6f;
  --line:     #1a1a1a;
  --accent:   #ffffff;
  --danger:   #ff6b6b;
  --mono:     ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans:     -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--dim); }
a:hover { border-bottom-color: var(--fg); }

h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2rem, 4.5vw, 3.5rem); line-height: 1.05; }
h2 { font-size: 1.5rem; line-height: 1.2; }
h3 { font-size: 1.05rem; line-height: 1.3; }
h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); font-weight: 500; }

p { margin: 0 0 1rem; }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }

code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }
code { color: var(--fg); }
pre {
  background: transparent;
  border: 1px solid var(--line);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.55;
  margin: 1rem 0;
}
pre code { font-size: 0.88rem; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.75rem 1rem;
  border-radius: 0;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--fg); }

button {
  cursor: pointer;
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  padding: 0.8rem 1.4rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: opacity 120ms;
}
button:hover { opacity: 0.85; }
button.ghost { background: transparent; color: var(--fg); }
button:disabled { opacity: 0.45; cursor: default; }

label { display: block; margin: 1rem 0 0.5rem; color: var(--dim); font-size: 0.85rem; }
label input, label select, label textarea { width: 100%; margin-top: 0.35rem; }
textarea { resize: vertical; min-height: 4rem; }

/* --- Nav --- */
nav.top {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
nav.top .brand {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--fg);
  border: none;
  font-weight: 500;
}
nav.top ul { list-style: none; display: flex; gap: 2rem; margin: 0; padding: 0; }
nav.top a { color: var(--dim); font-size: 0.88rem; border: none; }
nav.top a:hover { color: var(--fg); }

/* --- Container --- */
.container, main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Hero --- */
section.hero {
  max-width: 56rem;
  margin: 0 auto;
  padding: 6rem 2rem 8rem;
  text-align: left;
}
.hero h1 { margin-bottom: 1.5rem; }
.hero .sub {
  font-size: 1.05rem;
  color: var(--dim);
  max-width: 38rem;
  margin-bottom: 3rem;
  line-height: 1.55;
}

/* --- Install command --- */
.install-box {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  font-family: var(--mono);
  max-width: 48rem;
}
.install-box .prompt {
  color: var(--dim);
  padding: 1rem 0 1rem 1.25rem;
  user-select: none;
}
.install-box .cmd {
  flex: 1;
  padding: 1rem 0.5rem;
  color: var(--fg);
  white-space: nowrap;
  overflow-x: auto;
  font-size: 0.92rem;
}
.install-box .copy {
  background: transparent;
  color: var(--dim);
  border: none;
  border-left: 1px solid var(--line);
  padding: 0 1.4rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  cursor: pointer;
  min-width: 7rem;
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.install-box .copy:hover { color: var(--fg); }
.install-hint {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--dim);
  margin-top: 1rem;
  max-width: 48rem;
}
.install-hint code { color: var(--fg); }
.install-hint a { color: var(--dim); border-color: var(--line); }
.install-hint a:hover { color: var(--fg); border-color: var(--dim); }

/* --- Section --- */
section {
  max-width: 72rem;
  margin: 0 auto;
  padding: 6rem 2rem;
  border-top: 1px solid var(--line);
}
section .lede {
  color: var(--dim);
  max-width: 40rem;
  margin-bottom: 3rem;
  font-size: 0.95rem;
}

/* --- Counter --- */
.counter-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
}
.counter-head .live {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.counter-head .live::before { content: "● "; color: var(--fg); }
.counter-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}
.stat .num {
  font-family: var(--mono);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--fg);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat .lbl {
  font-size: 0.78rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.75rem;
}

/* --- Pareto --- */
.pareto-chart {
  max-width: 56rem;
  border: 1px solid var(--line);
  padding: 2rem;
  margin-top: 2rem;
}
.pareto-chart svg { width: 100%; height: auto; display: block; }
.pareto-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--dim);
}
.pareto-legend span strong { color: var(--fg); font-weight: 500; }

/* --- Pricing --- */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  max-width: 68rem;
}
.plan {
  padding: 2.5rem 2rem;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.plan:last-child { border-right: none; }
.plan h3 { margin-bottom: 0.25rem; }
.plan .price {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
}
.plan .price small { font-size: 0.78rem; color: var(--dim); display: block; margin-top: 0.35rem; font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 0.5rem 0 1.5rem; flex: 1; }
.plan li {
  padding: 0.35rem 0;
  color: var(--fg);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.plan li:last-child { border-bottom: none; }
.plan .cta {
  display: inline-block;
  text-align: center;
  padding: 0.8rem 1rem;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.88rem;
  font-weight: 500;
  border: none;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.plan .cta:hover { opacity: 0.85; border: none; }
.plan .cta.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.plan .cta.ghost:hover { border-color: var(--fg); }

/* --- Footer --- */
footer.site {
  max-width: 72rem;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.85rem;
}
footer.site .cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}
footer.site h4 { margin-bottom: 1rem; color: var(--dim); }
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site li { padding: 0.3rem 0; }
footer.site a { color: var(--fg); border: none; }
footer.site a:hover { color: var(--dim); }
footer.site .tag {
  font-family: var(--mono);
  color: var(--fg);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
footer.site .legal {
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  font-size: 0.78rem;
  color: var(--dim);
}

/* --- Article pages --- */
article.page {
  max-width: 42rem;
  margin: 4rem auto 8rem;
  padding: 0 2rem;
}
article.page h1 {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}
article.page .lede { color: var(--dim); font-size: 1rem; margin-bottom: 3rem; }
article.page h2 { margin: 3rem 0 1rem; font-size: 1.3rem; }
article.page h3 { margin: 2rem 0 0.75rem; font-size: 1.05rem; }
article.page ul, article.page ol { padding-left: 1.25rem; margin: 0 0 1rem; }
article.page li { margin: 0.35rem 0; }
article.page table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
article.page th, article.page td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
article.page th {
  color: var(--dim);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
article.page blockquote {
  border-left: 1px solid var(--fg);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--dim);
}

/* --- Auth forms --- */
section.auth {
  max-width: 30rem;
  margin: 4rem auto 6rem;
  padding: 0 2rem;
  border: none;
}
section.auth h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
section.auth h2 { font-size: 1.2rem; margin-top: 0; margin-bottom: 0.75rem; font-weight: 400; }
section.auth .sub { color: var(--dim); margin-bottom: 2.5rem; font-size: 0.92rem; }
section.auth .fine { color: var(--dim); font-size: 0.78rem; margin-top: 2rem; line-height: 1.6; }
section.auth .err { color: var(--danger, #ff6b6b); font-size: 0.85rem; margin-top: 0.75rem; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form label { display: flex; flex-direction: column; gap: 0.35rem; }
.auth-form label > span {
  color: var(--dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-form input, .auth-form select, .auth-form textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: #0a0a0a;
  color: var(--fg);
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus {
  outline: none;
  border-color: var(--fg);
}
.auth-form textarea { resize: vertical; min-height: 4.5rem; }
.auth-form button {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--fg);
  color: #000;
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}
.auth-form button:disabled { opacity: 0.45; cursor: progress; }
.auth-form button:hover:not(:disabled) { opacity: 0.9; }

section.auth > button.ghost {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}
section.auth > button.ghost:hover { border-color: var(--fg); }

.auth-sent { padding: 1rem 0; }
.auth-sent h1 { margin-bottom: 1rem; }
.auth-sent h2 { font-size: 1.2rem; margin-bottom: 0.75rem; font-weight: 400; }
.auth-sent p { color: var(--dim); margin: 0.5rem 0 1rem; line-height: 1.6; }
.auth-sent p b { color: var(--fg); font-weight: 400; }
.auth-sent .cta { display: inline-block; margin-top: 1.5rem; margin-right: 0.75rem; }
.auth-sent .row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.auth-sent .row .cta { margin: 0; }

section.auth .cta {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background: var(--fg);
  color: #000;
  border: none;
  font-size: 0.92rem;
}
section.auth .cta.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
}
section.auth .cta.ghost:hover { border-color: var(--fg); }

details.token { margin-top: 1.5rem; border: 1px solid var(--line); padding: 0.75rem 1rem; }
details.token summary { cursor: pointer; color: var(--dim); font-size: 0.85rem; }
details.token summary:hover { color: var(--fg); }
details.token textarea {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.6rem;
  background: #0a0a0a;
  color: var(--fg);
  border: 1px solid var(--line);
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  resize: none;
}
details.token button {
  margin-top: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
details.token button:hover { color: var(--fg); border-color: var(--fg); }

/* --- Responsive --- */
@media (max-width: 860px) {
  .plans, .counter-row { grid-template-columns: 1fr; }
  .plans { border: none; }
  .plan { border: 1px solid var(--line); border-right: 1px solid var(--line); margin-bottom: -1px; }
  footer.site .cols { grid-template-columns: 1fr 1fr; }
  nav.top ul { gap: 1rem; }
  nav.top ul li:nth-child(3) { display: none; } /* hide github on mobile */
  section.hero { padding-top: 3rem; padding-bottom: 5rem; }
  section { padding: 4rem 2rem; }
}

@media (max-width: 480px) {
  nav.top { padding: 1.25rem 1.5rem; }
  nav.top ul { display: none; }
  footer.site .cols { grid-template-columns: 1fr; }
  .install-box .copy { min-width: 5rem; padding: 0 1rem; }
}
