/* ============================================================
   Macterm — site styles
   Palette: deep cool slate ground + warm amber-phosphor accent.
   The terminal cursor is the through-line motif.
   ============================================================ */

:root {
  --ground:    #0c0d0f;   /* near-black, slightly lifted */
  --ground-1:  #141519;   /* raised surface (cards) */
  --ground-2:  #1c1e23;   /* hairlines / inset */
  /* translucent card fill so the body grid shows through (paired with blur) */
  --card:      rgba(20, 21, 25, 0.18);
  --line:      #2a2c33;   /* borders */
  /* card border in the bg grid's hue, stronger alpha so it reads as a crisp
     line that visually belongs to the same grid */
  --grid-line: rgba(140, 143, 150, 0.18);
  --text:      #f4f5f6;   /* near-white */
  --text-dim:  #9da1a8;   /* secondary copy */
  --text-faint:#62666d;   /* captions */
  --steel:     #868b93;   /* neutral gray secondary */
  --accent:    #ededee;   /* near-white — the cursor / markers / CTA */
  --accent-ink:#0a0a0a;   /* text on the light accent */

  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans:  "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --cell: 28px;           /* terminal cell grid unit */
  --pad:  28px;           /* content gutter — one cell, keeps edges grid-aligned */
  --maxw: 1120px;
  --radius: 14px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--ground);
  /* faint terminal cell grid, echoing the icon's tiled glyph. Anchored to the
     page's horizontal center so it's symmetric about the centered content
     column — paired with a cell-quantized content width, card edges land on
     grid lines (see --maxw / .wrap / .feature-grid). */
  background-image:
    linear-gradient(to right,  rgba(140, 143, 150, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(140, 143, 150, 0.07) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  /* Anchor the lattice to the content column's left edge so card borders land
     on grid lines. Both grid and .wrap derive from the same centering math
     (50% - maxw/2 + pad), keeping them locked at every viewport width. */
  /* Lattice anchored to page center; the content box is rounded to an even
     number of cells (2*--cell) and centered, so both its edges fall on
     center-symmetric grid lines at every width. */
  background-position-x: center;
  background-position-y: top;
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }

code, pre, kbd { font-family: var(--mono); }

::selection { background: var(--accent); color: var(--accent-ink); }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  font-family: var(--mono);
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap {
  /* Content width snapped DOWN to a whole number of grid cells so both card
     edges land on lines; centered, so the two gutters stay symmetric and each
     sits on a line too (--pad is one cell). Falls back to padded full-width if
     round() is unsupported. */
  width: 100%;
  max-width: calc(var(--maxw) - 2 * var(--pad));
  margin-inline: auto;
  padding-inline: var(--pad);
}
@supports (width: round(down, 100px, 28px)) {
  /* Grid-snap only above mobile: rounding the content box to 2 cells forces the
     remainder into the gutters, which is too wide on small screens. Mobile keeps
     a plain small padding (set below) and skips the snap. */
  @media (min-width: 561px) {
    .wrap {
      width: round(down, calc(100vw - 2 * var(--pad)), calc(2 * var(--cell)));
      max-width: round(down, calc(var(--maxw) - 2 * var(--pad)), calc(2 * var(--cell)));
      padding-inline: 0;
    }
  }
}

/* ===================== shared primitives ===================== */


.eyebrow,
.section-eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--steel);
  margin: 0;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.7vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin: 0.7rem 0 0;
  color: var(--text);
}

.section {
  padding-block: clamp(4.5rem, 10vw, 8rem);
  position: relative;
}

.section-head {
  max-width: 60ch;
  margin: 0 0 clamp(2.5rem, 5vw, 3.5rem);
  text-align: left;
}

/* terminal command chip with copy button */
.command {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--ground-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.7rem 0.7rem 0.95rem;
  font-family: var(--mono);
  font-size: 0.92rem;
  min-width: 0;
}
.command-sigil { color: var(--accent); font-weight: 600; flex: none; }
.command code {
  color: var(--text);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1 1 auto;
  min-width: 0;
}
.command code::-webkit-scrollbar { display: none; }

.copy-btn {
  flex: none;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  background: var(--ground-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--steel); }
.copy-btn.is-copied {
  color: var(--accent);
  border-color: var(--accent);
}
.copy-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
}
.copy-icon { display: block; }
.copy-icon--check { display: none; }
.copy-btn--icon.is-copied .copy-icon--copy { display: none; }
.copy-btn--icon.is-copied .copy-icon--check { display: block; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--steel);
  border-radius: 10px;
  padding: 0.85rem 1.4rem;
}
.btn-ghost:hover { border-color: var(--text); color: var(--text); }
.btn-ghost--block { display: flex; margin-top: auto; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 0.95rem 1.1rem;
}
.btn-primary:hover { background: #ffffff; border-color: #ffffff; }
.btn-primary-count {
  margin-left: 0.6rem;
  padding-left: 0.6rem;
  border-left: 1px solid color-mix(in srgb, var(--accent-ink) 30%, transparent);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.85;
}
.btn-primary-count[hidden] { display: none; }

/* ========================== topbar ========================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ground);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.wordmark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.wordmark-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.topnav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); }
.topnav a {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--text-dim);
}
.topnav a:hover { color: var(--text); }
.topnav-repo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text) !important;
}
.topnav-repo:hover { color: var(--text-dim) !important; }
.topnav-repo-icon { display: block; flex: none; }
.topnav-stars {
  display: inline-flex;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
}
.topnav-stars[hidden] { display: none; }

/* =========================== hero =========================== */
.hero { padding-top: clamp(3.5rem, 8vw, 6rem); text-align: left; }
/* .hero-inner spans the full .wrap width so its left edge aligns with the
   screenshot below; individual text blocks cap their own measure. */

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 1.4rem 0 0;
  color: var(--text);
}

.lede {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 42ch;
  margin: 1.5rem 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  margin-top: 2.2rem;
}
.command--hero {
  max-width: 440px;
  text-align: left;
}

.shot-wrap { margin-top: clamp(3rem, 7vw, 5rem); }
.shot {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ground-1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 40px 80px -40px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(0, 0, 0, 0.3);
}
.shot img { width: 100%; height: auto; }

/* ========================= features ========================= */
.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.feature {
  background: var(--card);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
}
.feature-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 0.55rem;
  color: var(--text);
}
.feature p { margin: 0; color: var(--text-dim); font-size: 0.97rem; }
.feature code {
  font-size: 0.86em;
  color: var(--steel);
  background: var(--ground-2);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}
kbd {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--text);
  background: var(--ground-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1em 0.45em;
}

/* ========================== layouts ========================= */
.layouts-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.layouts-copy { padding-top: 0.5rem; }
.layouts-lede {
  color: var(--text-dim);
  margin: 1.1rem 0 1.6rem;
}
.layouts-lede code,
.layouts-points code {
  font-size: 0.88em;
  color: var(--steel);
  background: var(--ground-2);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}
.layouts-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.layouts-points li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--text-dim);
  font-size: 0.97rem;
}
.layouts-points li::before {
  content: "›";
  position: absolute;
  left: 0.2rem;
  top: -0.05rem;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 600;
}
.layouts-points strong { color: var(--text); font-weight: 600; }

.code-card {
  margin: 0;
  background: var(--card);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.7);
}
.code-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--ground-2);
}
.code-dots { display: inline-flex; gap: 0.4rem; }
.code-dots i {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--line);
}
.code-path {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.code-body {
  margin: 0;
  padding: 1.25rem 1.4rem;
  overflow-x: auto;
  font-size: 0.83rem;
  line-height: 1.7;
  color: var(--text);
  tab-size: 2;
}
.code-body code { white-space: pre; }
.c-comment { color: var(--text-faint); font-style: italic; }
.c-key { color: var(--steel); }
.c-str { color: var(--text); }
.c-val { color: #c3c7cd; }
.c-num { color: #c3c7cd; }

/* ========================== install ========================= */
.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.install-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--card);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
}
.install-card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 0;
}
.install-card-note { margin: 0; color: var(--text-dim); font-size: 0.95rem; }
.install-card-note code {
  font-size: 0.85em;
  color: var(--steel);
  background: var(--ground-2);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

/* ========================== footer ========================= */
.footer { border-top: 1px solid var(--line); padding-block: 3rem; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
}
.footer-brand {
  font-family: var(--sans);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.footer-line { margin: 0; color: var(--text-faint); font-size: 0.9rem; flex: 1 1 auto; }
.footer-nav { display: flex; gap: 1.5rem; }
.footer-nav a {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}
.footer-nav a:hover { color: var(--text); }

/* ====================== responsive ======================== */
@media (max-width: 820px) {
  .layouts-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  /* Tighter side gutters on mobile — half a cell. The grid-snap math keys off
     --pad, so card edges stay aligned at the smaller gutter. */
  :root { --pad: 14px; }
  .topnav { gap: 1rem; }
  .topnav a:not(.topnav-repo) { display: none; }
  .hero-actions .command { flex-basis: 100%; }
}

