/* Apah Landing Page CSS — ponytail.dev inspired terminal aesthetic */

:root {
  --bg: #0e0d0b;
  --panel: #161410;
  --fg: #d8d3c5;
  --dim: #8b8270;
  --faint: #3a352b;
  --grn: #83c167;
  --red: #e0705f;
  --amber: #d8a657;
  --orange: #e08a4a;
  --line: #211f19;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", "Cascadia Code", "IBM Plex Mono", Menlo, Consolas, monospace;
}

[data-theme="light"] {
  --bg: #f5f2eb;
  --panel: #e8e2d5;
  --fg: #1c1917;
  --dim: #6b6355;
  --faint: #d1c8b4;
  --grn: #2e7d32;
  --red: #c62828;
  --amber: #b45309;
  --orange: #c2410c;
  --line: #d8d0be;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--amber);
  color: var(--bg);
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
}

a:hover {
  border-color: var(--amber);
}

.cmt {
  color: var(--dim);
  font-style: italic;
}

.grn { color: var(--grn); }
.red { color: var(--red); }
.amber { color: var(--amber); }

/* Editor Chrome Navigation */
.chrome {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #100e0b;
  border-bottom: 1px solid var(--line);
  padding: 9px 16px;
  font-size: 12px;
}

[data-theme="light"] .chrome {
  background: #eae4d6;
}

.dots {
  display: flex;
  gap: 7px;
}

.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}

.dots i:nth-child(1) { background: var(--red); }
.dots i:nth-child(2) { background: var(--amber); }
.dots i:nth-child(3) { background: var(--grn); }

.chrome .file {
  color: var(--dim);
}

.tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}

.tab {
  color: var(--dim);
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 2px 9px;
  white-space: nowrap;
  transition: color .12s, background .12s;
}

a.tab:hover {
  color: var(--amber);
  background: var(--panel);
}

.tab.new {
  color: var(--amber);
}

.tab.new::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  margin-left: 7px;
  vertical-align: middle;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: .35; }
}

.tab.on {
  color: var(--fg);
  background: var(--panel);
  border-color: var(--line);
}

@media(max-width: 560px) {
  .chrome .file { display: none; }
}

.lightbtn {
  margin-left: auto;
  font: inherit;
  font-size: 12px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 10px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
  white-space: nowrap;
}

.lightbtn:hover {
  color: var(--amber);
  border-color: var(--amber);
}

/* Section Labels */
.label {
  color: var(--dim);
  font-size: .82rem;
  margin: 0 0 1.1em;
  letter-spacing: .02em;
}

.label::before {
  content: "## ";
  color: var(--grn);
}

h1, h2 {
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
}

h2 {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  line-height: 1.25;
  margin: 0 0 .9em;
  max-width: 28ch;
}

/* Hero Section */
header {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--line);
}

.hero > * {
  opacity: 0;
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards;
}

.hero > *:nth-child(1) { animation-delay: .05s; }
.hero > *:nth-child(2) { animation-delay: .15s; }
.hero > *:nth-child(3) { animation-delay: .25s; }
.hero > *:nth-child(4) { animation-delay: .35s; }
.hero > *:nth-child(5) { animation-delay: .45s; }
.hero > *:nth-child(6) { animation-delay: .55s; }

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

h1 {
  font-size: clamp(2.6rem, 9vw, 4.4rem);
  line-height: 1;
}

.cur {
  color: var(--amber);
  animation: blink 1.1s steps(1) infinite;
  font-weight: 400;
}

@keyframes blink {
  50% { opacity: 0; }
}

.tag {
  font-size: clamp(1.05rem, 3vw, 1.4rem);
  margin: .55em 0 0;
  color: var(--fg);
  font-weight: 500;
  max-width: 32ch;
}

.sub {
  color: var(--dim);
  max-width: 62ch;
  margin: 1.1em 0 0;
  font-size: .95rem;
  line-height: 1.75;
}

.cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.btn {
  font-family: var(--mono);
  font-size: .92rem;
  font-weight: 500;
  padding: 10px 18px;
  border: 1px solid var(--amber);
  color: var(--amber);
  background: transparent;
  cursor: pointer;
  border-radius: 2px;
  transition: background .12s, color .12s, transform .12s;
}

.btn::before { content: "[ "; }
.btn::after { content: " ]"; }

.btn.fill {
  background: var(--amber);
  color: var(--bg);
  border-color: var(--amber);
}

.btn:hover {
  background: var(--amber);
  color: var(--bg);
  transform: translateY(-1px);
}

section {
  padding: 54px 0;
  border-bottom: 1px solid var(--line);
}

/* Diff Block */
.diff {
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--panel);
}

.diff .bar {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: .74rem;
  color: var(--dim);
}

.diff pre {
  margin: 0;
  padding: 14px 0;
  overflow-x: auto;
  counter-reset: l;
  font-size: .84rem;
  line-height: 1.85;
}

.diff .ln {
  display: block;
  counter-increment: l;
  padding: 0 16px 0 0;
  white-space: pre;
}

.diff .ln::before {
  content: counter(l);
  display: inline-block;
  width: 3.2ch;
  margin-right: 1.2ch;
  text-align: right;
  color: var(--faint);
  border-right: 1px solid var(--line);
  padding-right: 1ch;
}

.diff .del {
  background: rgba(224, 112, 95, .08);
  color: var(--red);
}

.diff .add {
  background: rgba(131, 193, 103, .1);
  color: var(--grn);
}

.vcap {
  margin: 16px 0 0;
}

/* Ladder / Pipeline Steps */
ol.ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: r;
}

ol.ladder li {
  counter-increment: r;
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 13px 0;
}

ol.ladder li + li {
  border-top: 1px solid var(--line);
}

ol.ladder li::before {
  content: counter(r, decimal-leading-zero);
  color: var(--amber);
  font-weight: 700;
  min-width: 2.4ch;
}

ol.ladder b {
  font-weight: 700;
  color: var(--fg);
}

ol.ladder .d {
  color: var(--dim);
}

ol.ladder code {
  color: var(--amber);
}

/* Stats Section */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 30px 50px;
  align-items: flex-end;
}

.stats .n {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 700;
  line-height: .9;
  color: var(--amber);
}

.stats .l {
  color: var(--dim);
  font-size: .85rem;
  margin-top: 8px;
}

.footnote {
  color: var(--dim);
  font-size: .86rem;
  margin-top: 26px;
  line-height: 1.7;
}

/* Terminal / One-Line Install */
.term {
  background: #0a0907;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px 20px;
  font-size: .86rem;
  line-height: 1.95;
  overflow-x: auto;
  position: relative;
}

.term .p { color: var(--grn); }
.term .c { color: var(--dim); font-style: italic; }

.copy-btn-inline {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all .12s;
}

.copy-btn-inline:hover {
  color: var(--amber);
  border-color: var(--amber);
}

.others {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 28px;
  margin-top: 24px;
}

@media(max-width: 560px) {
  .others { grid-template-columns: 1fr; }
}

.others div {
  padding: 12px 0;
  border-top: 1px solid var(--line);
  position: relative;
}

.others h3 {
  font-size: .72rem;
  color: var(--dim);
  margin: 0 0 5px;
  font-weight: 500;
}

.others h3::before { content: "# "; color: var(--amber); }
.others code { font-size: .8rem; color: var(--fg); word-break: break-all; }

/* Commands Table */
table {
  width: 100%;
  border-collapse: collapse;
}

td {
  padding: 12px 4px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  font-size: .92rem;
}

tr:first-child td { border-top: none; }
td:first-child { width: 38%; }
td code { font-size: .84rem; color: var(--amber); font-weight: bold; }
td .s { color: var(--grn); }
td:last-child { color: var(--dim); }

/* Intensity / Security Levels */
.levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media(max-width: 680px) {
  .levels { grid-template-columns: 1fr; }
}

.lvl {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 18px;
  background: var(--panel);
  position: relative;
}

.lvl h3 {
  font-size: .92rem;
  margin: 0 0 .55em;
  color: var(--amber);
}

.lvl h3::before {
  content: "mode = ";
  color: var(--dim);
  font-weight: 400;
}

.lvl p {
  margin: 0;
  font-size: .88rem;
  color: var(--dim);
  line-height: 1.7;
}

.lvl .def {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--amber);
  font-size: .74rem;
  font-style: italic;
}

/* Callout Newsflash */
.newsflash {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin-top: 24px;
  padding: 12px 18px;
  border: 1px solid var(--orange);
  border-radius: 4px;
  background: rgba(224, 138, 74, .1);
  color: var(--fg);
  text-decoration: none;
  font-size: .95rem;
  transition: background .15s, transform .15s;
}

.newsflash:hover {
  background: rgba(224, 138, 74, .18);
  transform: translateY(-2px);
}

.newsflash b { color: var(--orange); font-weight: 700; }
.newsflash .nf-arrow { color: var(--orange); transition: transform .15s; }
.newsflash:hover .nf-arrow { transform: translateX(5px); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex: none; }

/* Footer */
footer {
  padding: 52px 0 64px;
}

footer .q {
  color: var(--dim);
  font-style: italic;
  font-size: 1rem;
  margin: 0 0 1.4em;
}

footer .q::before { content: "// "; }

footer .prompt {
  color: var(--fg);
  font-size: .9rem;
}

footer .prompt .p { color: var(--grn); }

footer .meta {
  color: var(--dim);
  font-size: .84rem;
  margin-top: 1.6em;
}

@media(prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .hero > * { opacity: 1; }
  .cur { opacity: 1; }
}

/* Math & Equation Styling (ponytail.dev terminal spec style) */
.math-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  padding: 16px 20px;
  margin: 1.2em 0;
  overflow-x: auto;
}

.math-title {
  color: var(--dim);
  font-size: .78rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.math-eq {
  color: var(--amber);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.math-inline {
  color: var(--amber);
  background: var(--panel);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--line);
  font-size: .9em;
}

h3.spec-h3 {
  font-size: 1.15rem;
  color: var(--fg);
  margin: 1.8em 0 .6em;
  font-weight: 700;
}

h3.spec-h3::before {
  content: "### ";
  color: var(--amber);
}

