/* aphros.hartle.tech — the landing page.
 *
 * This file names no colour. Every one comes from theme.css, which is
 * generated at build time from code/nix/theme.nix — the same attrset the
 * compositor, the bar, the lock screen and the terminal wordmark read. The
 * geometry tokens (--radius, --border-width, --gap-*) come from there too, so
 * the page's corners are the desktop's corners rather than a taste decision
 * made twice.
 *
 * No @import of a font service and no inline style block: the CSP is
 * `default-src 'self'` with no 'unsafe-inline', and both fail silently.
 */

/* ── Elements ──────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* The bar is sticky; without this an in-page jump lands under it. */
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, pre, .mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono",
               Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

code {
  font-size: 0.88em;
  color: var(--aegean);
  background: var(--mantle);
  padding: 0.1em 0.35em;
  border-radius: calc(var(--radius) / 3);
}

:focus-visible {
  outline: var(--border-width) solid var(--accent);
  outline-offset: 3px;
  border-radius: calc(var(--radius) / 2);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--surface0);
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
}

/* ── Bar ───────────────────────────────────────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem max(1.4rem, calc((100vw - var(--shell-max)) / 2));
  background: color-mix(in srgb, var(--crust) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--surface0);
}

.bar .home {
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}
.bar .home:hover { text-decoration: none; color: var(--accent); }

.bar nav {
  margin-left: auto;
  display: flex;
  gap: 1.35rem;
  flex-wrap: wrap;
}
.bar nav a { color: var(--subtext); font-size: 0.92rem; }
.bar nav a:hover { color: var(--text); text-decoration: none; }

.theme {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--surface1);
  border-radius: 999px;
  cursor: pointer;
}
.theme:hover { color: var(--text); border-color: var(--surface2); }

.theme-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--info));
}

/* ── Shell ─────────────────────────────────────────────────────────── */

main {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

section { scroll-margin-top: 5rem; }

h1, h2, h3 { text-wrap: balance; margin: 0; }

h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 600;
}

h2 {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 600;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.section-lede {
  margin: 0.9rem 0 0;
  max-width: 34rem;
  color: var(--subtext);
}

/* ── Hero ──────────────────────────────────────────────────────────── */

.hero {
  padding-top: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

/* The wordmark is the terminal's, character for character. line-height 1 and
   no letter-spacing are load-bearing: the letters are built from half-block
   glyphs that must meet at the cell edges, and any leading opens seams
   straight through them. */
.wordmark {
  margin: 0;
  font-size: clamp(0.62rem, 1.75vw, 1.05rem);
  line-height: 1;
  letter-spacing: 0;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
}

.wordmark .foam   { color: var(--subtext); }
.wordmark .mark-a { color: var(--rose);     font-weight: 700; }
.wordmark .mark-b { color: var(--coral);    font-weight: 700; }
.wordmark .wave-a { color: var(--aegean); }
.wordmark .wave-b { color: var(--surface2); }

.lede {
  margin: 0;
  max-width: 36rem;
  font-size: 1.14rem;
  color: var(--subtext);
}

.cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 0.4rem 0 0; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius);
  border: var(--border-width) solid var(--surface2);
  color: var(--text);
  font-weight: 500;
  font-size: 0.96rem;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--crust);
}
.btn.primary:hover { background: var(--accent-alt); border-color: var(--accent-alt); }

.status-chip {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.5rem 0.85rem;
  border-left: var(--border-width) solid var(--warn);
  background: var(--mantle);
  border-radius: 0 calc(var(--radius) / 2) calc(var(--radius) / 2) 0;
}
.status-chip b { color: var(--subtext); }

/* ── Screenshots ───────────────────────────────────────────────────── */

.shot { margin: 0; }

.shot img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--surface1);
}

.shot figcaption {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.shot.wide { margin: 0; }

/* ── Claim grid ────────────────────────────────────────────────────── */

.grid {
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--gap-outer);
}

.grid article {
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.6rem;
}

.grid p { margin: 0.6rem 0 0; color: var(--subtext); font-size: 0.97rem; }

/* ── Feature rows ──────────────────────────────────────────────────── */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.feature.reverse .feature-text { order: 2; }

.feature-text p { margin: 1rem 0 0; color: var(--subtext); }

.feature-text .aside {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.9;
}

.keys { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.keys li { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.keys span { color: var(--subtext); font-size: 0.95rem; margin-left: 0.35rem; }

kbd {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.78rem;
  color: var(--text);
  background: var(--surface0);
  border: 1px solid var(--surface2);
  border-bottom-width: var(--border-width);
  border-radius: calc(var(--radius) / 2);
}

/* ── Status ────────────────────────────────────────────────────────── */

.phases {
  list-style: none;
  counter-reset: none;
  margin: 2.2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.phases li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.75rem 1rem;
  border-left: var(--border-width) solid var(--surface1);
  color: var(--muted);
}

.phases li b {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  min-width: 2.6rem;
  color: var(--muted);
}

.phases li.done { border-left-color: var(--ok); color: var(--subtext); }
.phases li.done b { color: var(--ok); }

.phases li.now {
  border-left-color: var(--accent);
  background: var(--mantle);
  color: var(--text);
}
.phases li.now b { color: var(--accent); }

.gaps {
  margin-top: 2.4rem;
  padding: 1.5rem 1.6rem;
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-radius: var(--radius);
}

.gaps ul { margin: 1rem 0 0; padding-left: 1.1rem; color: var(--subtext); }
.gaps li { margin-bottom: 0.6rem; }
.gaps li:last-child { margin-bottom: 0; }
.gaps b { color: var(--text); }

/* ── Support ───────────────────────────────────────────────────────── */

.support p { margin: 1rem 0 0; max-width: 34rem; color: var(--subtext); }

.pills { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem !important; }

.pill {
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
  color: var(--subtext);
  border: 1px solid var(--surface1);
  border-radius: 999px;
}
.pill:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }

/* ── Footer ────────────────────────────────────────────────────────── */

.foot {
  max-width: var(--shell-max);
  margin: 6rem auto 0;
  padding: 2.2rem 1.4rem 3.5rem;
  border-top: 1px solid var(--surface0);
  color: var(--muted);
  font-size: 0.9rem;
}
.foot p { margin: 0 0 0.4rem; }
.foot b { color: var(--subtext); }

/* ── Narrow ────────────────────────────────────────────────────────── */

@media (max-width: 820px) {
  main { gap: 4rem; }
  .feature { grid-template-columns: 1fr; gap: 1.8rem; }
  .feature.reverse .feature-text { order: 0; }
  .bar nav { display: none; }
  .hero { padding-top: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
