/* SendKey landing page layout, 1-bit edition. Depends on brand.css. */

section[id] { scroll-margin-top: 76px; }
#compose { scroll-margin-top: 86px; }

body > section { padding: 88px 0; }

/* ---- nav ---------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.nav-in {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 58px;
}
.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-links a {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: 2px 4px;
}
@media (hover: hover) {
  .nav-links a:hover { background: var(--ink); color: var(--paper); }
}
.nav-cta { display: flex; align-items: center; gap: 12px; }

/* ---- hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 72px 0 88px;
  border-bottom: 2px solid var(--ink);
}
/* texture lives in a restrained strip at the very top, not behind the text */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 88px;
  background: url("/assets/px/fade.png") repeat-x top / 8px 64px;
  image-rendering: pixelated;
  transform: scaleY(-1);
  opacity: 0.5;
  pointer-events: none;
}
.hero-in { position: relative; }
.hero-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero h1 {
  margin: 36px 0 0;
  font-size: clamp(18px, 8px + 3.2vw, 36px);
  line-height: 1.5;
}
.hero h1 .hl {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 6px 12px 5px;
  margin-top: 14px;
}
.hero-sub {
  max-width: 600px;
  margin-top: 26px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-2);
}
.hero-sub strong { color: var(--ink); }

/* ---- composer ------------------------------------------------------------ */

.composer {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin-top: 44px;
  text-align: left;
}
.win-tag {
  position: absolute;
  right: 12px;
  top: 50%;
  translate: 0 -50%;
  background: var(--paper);
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.win-tag .dot {
  width: 6px;
  height: 6px;
  background: var(--ink);
  animation: blink 1.1s steps(1) infinite;
}

.meter {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: right;
  margin-top: 6px;
}

.composer .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}
.composer .check { margin-bottom: 12px; }
.composer #pass { margin-bottom: 16px; }
.composer #go { margin-top: 6px; }

.compose-note {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.compose-note span { padding: 0 6px; }

.ask-cta {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#compose-result .note { margin-top: 6px; }
#compose-result #again { margin-top: 16px; }

/* ---- section scaffolding -------------------------------------------------- */

.section-head {
  max-width: 620px;
  margin: 0 auto 52px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(13px, 7px + 1.7vw, 21px);
  line-height: 1.6;
  margin-bottom: 16px;
  text-wrap: balance;
}
.section-head p { color: var(--ink-2); font-size: 14px; text-wrap: balance; }

.band {
  background: var(--paper-2);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

/* thick-ruled grid, like a printed table */
.hgrid {
  display: grid;
  gap: 2px;
  background: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.hgrid > div { background: var(--paper); padding: 24px; }
.hgrid-3 { grid-template-columns: repeat(3, 1fr); }

/* ---- how it works --------------------------------------------------------- */

.step-n {
  display: inline-block;
  font-family: var(--font-px);
  font-size: 11px;
  background: var(--ink);
  color: var(--paper);
  padding: 5px 7px 4px;
  margin-bottom: 16px;
}
.step h3 { font-size: 11px; line-height: 1.7; margin-bottom: 10px; }
.step p { font-size: 13px; line-height: 1.7; color: var(--ink-2); }

/* link anatomy */
.anatomy { max-width: 680px; margin: 48px auto 0; }
.anatomy-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 22px;
}
.anatomy-link {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  background: var(--field);
  border: 2px solid var(--ink);
  padding: 12px 14px;
  white-space: nowrap;
  overflow-x: auto;
}
.al-dim { color: var(--ink-3); font-weight: 400; }
.al-id { color: var(--ink); }
.al-key {
  background: var(--ink);
  color: var(--paper);
  padding: 3px 5px;
  margin-left: 2px;
}
.anatomy-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.anatomy-legend > div {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  padding-left: 20px;
  position: relative;
}
.anatomy-legend .swatch {
  position: absolute;
  left: 0;
  top: 4px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--ink);
}
.swatch-id { background: var(--checker) 0 0 / 4px 4px, var(--field); }
.swatch-key { background: var(--ink); }
.anatomy-legend strong {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-size: 12px;
}
.anatomy-cap {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: center;
}

/* ---- security grid --------------------------------------------------------- */

.sec-cell svg {
  width: 32px;
  height: 32px;
  fill: var(--ink);
  margin-bottom: 16px;
  image-rendering: pixelated;
}
.sec-cell h3 { font-size: 11px; line-height: 1.7; margin-bottom: 9px; }
.sec-cell p { font-size: 13px; line-height: 1.7; color: var(--ink-2); }

/* ---- CLI ------------------------------------------------------------------- */

.dev-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 52px;
  align-items: center;
}
/* grid items default to min-width auto, so the nowrap install command would
   size the track to its full unwrapped width and push the page sideways on
   phones; zeroing it lets the code block's own overflow-x take over */
.dev-grid > * { min-width: 0; }
.dev-copy h2 {
  font-size: clamp(14px, 8px + 1.4vw, 19px);
  line-height: 1.65;
  margin-bottom: 16px;
}
.dev-copy > p { font-size: 14px; color: var(--ink-2); margin-bottom: 22px; }
.dev-list { display: grid; gap: 12px; margin-bottom: 26px; }
.dev-list > div {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--ink-2);
}
.dev-list svg {
  width: 14px;
  height: 14px;
  fill: var(--ink);
  flex: none;
  margin-top: 4px;
}
.install-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.install-row .install { flex: 1; min-width: 0; }
.install-row .btn { flex: none; }
.install-prompt { color: var(--ink-3); }

.install {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--ink);
  padding: 11px 14px;
  white-space: nowrap;
  overflow-x: auto;
}

.terminal {
  /* pinned: a terminal is dark in both themes. Scoping the tokens keeps
     every descendant rule working unchanged, while the outer edge uses
     --edge, which resolved at the root and still follows the theme. */
  --ink: #0d0d0b;
  --paper: #f2efe9;
  --ink-dim: #b9b5a9;
  background: var(--ink);
  border: 2px solid var(--edge);
  box-shadow: 6px 6px 0 var(--edge);
  overflow: hidden;
}
.terminal-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-bottom: 2px solid var(--paper);
}
.tdot { width: 9px; height: 9px; border: 2px solid var(--paper); background: var(--ink); }
.terminal-title {
  margin-left: auto;
  font-family: var(--font-px);
  font-size: 9px;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.terminal pre {
  margin: 0;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 12.8px;
  line-height: 1.85;
  overflow-x: auto;
  color: var(--paper);
}
.t-prompt { font-weight: 700; }
.t-cmd { color: var(--paper); font-weight: 700; }
.t-str { color: var(--ink-dim); }
.t-flag { color: var(--ink-dim); }
.t-out { color: var(--ink-dim); }
.t-key { background: var(--paper); color: var(--ink); padding: 1px 4px; font-weight: 700; }

/* ---- FAQ -------------------------------------------------------------------- */

.faq { max-width: 660px; margin: 0 auto; border: 2px solid var(--ink); background: var(--paper); box-shadow: 6px 6px 0 var(--ink); }
.faq details { border-bottom: 2px solid var(--ink); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink);
}
@media (hover: hover) {
  .faq summary:hover { background: var(--paper-2); }
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-px);
  font-size: 12px;
  flex: none;
}
.faq details[open] summary { background: var(--ink); color: var(--paper); }
.faq details[open] summary::after { content: "-"; }
.faq-body {
  padding: 16px 18px 20px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

/* ---- inverted tail: CTA + footer --------------------------------------------- */

.tail { background: var(--ink); color: var(--ink-dim); }

.cta-band { padding: 88px 0 96px; text-align: center; }
.cta-band h2 {
  color: var(--paper);
  font-size: clamp(14px, 8px + 1.7vw, 22px);
  line-height: 1.6;
  margin-bottom: 18px;
  text-wrap: balance;
}
.cta-band p {
  color: var(--ink-dim);
  max-width: 460px;
  margin: 0 auto 30px;
  text-wrap: balance;
}
.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.tail .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); box-shadow: 3px 3px 0 var(--paper); }
.tail .btn:hover { box-shadow: 4px 4px 0 var(--paper); }
.tail .btn:active { box-shadow: 1px 1px 0 var(--paper); }
.tail .btn-ghost { background: var(--ink); color: var(--paper); }

.footer { border-top: 2px solid var(--ink-dim); padding: 44px 0 40px; }
.footer .logo-mark { width: auto; height: 26px; }
.footer .logo { color: var(--paper); }
.footer .wordmark { color: var(--paper); }
.footer-in { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-tag { margin-top: 14px; font-size: 12.5px; color: var(--ink-dim); max-width: 320px; line-height: 1.7; }
.footer-links { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.footer-links a {
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  padding: 2px 3px;
}
@media (hover: hover) {
  .footer-links a:hover { background: var(--paper); color: var(--ink); }
  .footer .logo:hover .wordmark { background: var(--paper); color: var(--ink); }
}
.footer-fine {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 2px solid var(--ink-dim);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  /* ink-dim, not ink-3: this text sits on the inverted tail, and ink-3 is
     tuned for the page background, not the panel */
  color: var(--ink-dim);
}
.footer-fine a { color: inherit; }

/* ---- responsive --------------------------------------------------------------- */

/* dark theme swaps the ink-pixel fade for the paper-pixel one */
:root[data-theme="dark"] .hero::before,
:root[data-theme="dark"] .dither-fade {
  background-image: url("/assets/px/fade-inv.png");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero::before,
  :root:not([data-theme="light"]) .dither-fade {
    background-image: url("/assets/px/fade-inv.png");
  }
}

@media (max-width: 920px) {
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .hgrid-3 { grid-template-columns: 1fr; }
  .dev-grid { grid-template-columns: 1fr; gap: 36px; }
  body > section { padding: 64px 0; }
  .hero { padding: 56px 0 72px; }
  .cta-band { padding: 72px 0 80px; }
}

/* tablets: the six security cells pair up instead of stacking into a tower;
   the three steps stay stacked, they read as a sequence anyway */
@media (min-width: 561px) and (max-width: 920px) {
  #security .hgrid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .pill-more { display: none; }
  .win-tag { display: none; }
  .composer .row { grid-template-columns: 1fr; gap: 14px; margin: 14px 0; }
  .anatomy-legend { grid-template-columns: 1fr; }
  .linkbox { flex-direction: column; }
  .nav-in { gap: 14px; }
  body > section { padding: 56px 0; }
  .hero { padding: 44px 0 60px; }
  .hero h1 { margin-top: 24px; }
  .hero-sub { margin-top: 20px; font-size: 14px; }
  .composer { margin-top: 36px; }
  .win-body { padding: 18px 16px; }
  .hgrid > div { padding: 20px 18px; }
  .anatomy-card { padding: 16px; }
  .faq summary { padding: 14px 14px; font-size: 12.5px; }
  .faq-body { padding: 14px 14px 18px; }
  .cta-band { padding: 60px 0 68px; }
  .cta-actions .btn { width: 100%; max-width: 320px; }
  .terminal pre { font-size: 12px; padding: 14px 14px; }
  .section-head { margin-bottom: 40px; }
}

/* the narrowest phones: drop the secondary nav button (GitHub stays in the
   footer and the CTA) and trim the gutters so the primary action fits */
@media (max-width: 480px) {
  .wrap { padding: 0 18px; }
  .nav-cta .btn-ghost { display: none; }
}

@media (max-width: 360px) {
  .wordmark { font-size: 11px; }
  .logo-mark { height: 21px; }
  .nav-cta { gap: 8px; }
  .nav-cta .btn-sm { padding: 6px 9px; }
}
