/* Nifty Widget account site.
   One stylesheet, no framework. Palette echoes the desktop widget:
   near-black ground, white text, the same green accent. */

:root {
  --bg:        #0d0d10;
  --surface:   #16161b;
  --surface-2: #1e1e25;
  --border:    #2c2c36;
  --text:      #f2f2f4;
  --muted:     #8b8b98;
  --accent:    #00cc44;
  --accent-dk: #00a337;
  --danger:    #ff4444;
  --radius:    10px;
  --maxw:      780px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

h1 { font-size: 1.6rem; margin: 0 0 .6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
h2:first-child { margin-top: 0; }

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .92em;
  background: var(--surface-2);
  padding: .12em .4em;
  border-radius: 4px;
}

pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

/* ---------- Layout ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  font-weight: 600;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: #1a1a2e;
  border-bottom: 3px solid var(--accent);
  font-weight: 700;
  font-size: .85rem;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .93rem;
  flex-wrap: wrap;
}
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--text); }
.topbar nav a.cta {
  color: var(--bg);
  background: var(--accent);
  padding: .35rem .8rem;
  border-radius: 6px;
  font-weight: 600;
}
.topbar nav a.cta:hover { background: var(--accent-dk); text-decoration: none; }

.who {
  color: var(--muted);
  font-size: .87rem;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  max-width: var(--maxw);
  margin: 2rem auto;
  padding: 0 1.25rem;
}

footer {
  max-width: var(--maxw);
  margin: 3rem auto 2rem;
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .85rem;
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.cardhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.cardhead h1 { margin: 0; }
.count { color: var(--muted); font-size: .85rem; white-space: nowrap; }

.prose h2 { border-top: 1px solid var(--border); padding-top: 1.4rem; }
.prose h2:first-of-type { border-top: 0; padding-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .35rem 0; }

/* ---------- Hero ---------- */

.hero { padding: 1.5rem 0 .5rem; }
.hero h1 { font-size: 2.1rem; line-height: 1.2; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 54ch; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.steps ol { padding-left: 1.2rem; }
.steps li { margin: .5rem 0; }

/* ---------- Forms ---------- */

label {
  display: block;
  margin: 1rem 0 .35rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: .65rem .75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: .97rem;
}
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hint { color: var(--muted); font-size: .85rem; margin: .45rem 0 0; }
.alt  { color: var(--muted); font-size: .9rem; margin: 1rem 0 0; }
.muted { color: var(--muted); }
.empty { color: var(--muted); margin: 0; }

.rowform { display: flex; gap: .6rem; flex-wrap: wrap; align-items: stretch; }
.rowform input { flex: 1 1 16rem; }
.inline { display: inline; margin: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: .62rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: #26262f; text-decoration: none; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #062;
  color: #04340f;
}
.btn-primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); }

.btn-danger { color: var(--danger); border-color: #402028; background: transparent; }
.btn-danger:hover { background: #2a1419; }

.btn-small { padding: .34rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; margin-top: 1.4rem; }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: .93rem;
  cursor: pointer;
}
.linkish:hover { color: var(--text); text-decoration: underline; }

/* ---------- Flash messages ---------- */

.flashes { margin-bottom: 1.25rem; }
.flash {
  margin: 0 0 .6rem;
  padding: .7rem 1rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .93rem;
}
.flash-success { border-color: #1c5c33; background: #0f2417; }
.flash-error   { border-color: #5c1c22; background: #240f12; }

/* ---------- Keys ---------- */

.newkey { border-color: var(--accent); }
.warn { color: var(--text); font-size: .93rem; }

.keyreveal { display: flex; gap: .6rem; margin: 1rem 0 .75rem; flex-wrap: wrap; }

.keyfield {
  flex: 1 1 22rem;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .9rem;
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-copy { min-width: 5.5rem; }

table.keys {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
table.keys th {
  text-align: left;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
  padding: 0 .6rem .5rem 0;
  border-bottom: 1px solid var(--border);
}
table.keys td {
  padding: .7rem .6rem .7rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.keys tr:last-child td { border-bottom: 0; }
table.keys .right { text-align: right; padding-right: 0; }
.ip { display: block; font-size: .8rem; }

.errcode { font-size: 2.4rem; color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 620px) {
  main { margin: 1.25rem auto; }
  .card { padding: 1.15rem; }
  .hero h1 { font-size: 1.7rem; }
  table.keys thead { display: none; }
  table.keys tr {
    display: block;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
  }
  table.keys td { display: block; border: 0; padding: .15rem 0; }
  table.keys .right { text-align: left; padding-top: .6rem; }
}

/* ============================================================
   Landing page
   ============================================================ */

.eyebrow {
  margin: 0 0 .5rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(2.1rem, 7vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -.025em;
  margin: 0 0 1rem;
}

.hero .lede {
  font-size: 1.14rem;
  max-width: 46ch;
  color: var(--muted);
}

.hero-cta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }

.btn-disabled {
  opacity: .55;
  cursor: not-allowed;
  display: inline-block;
  padding: .8rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  font-weight: 600;
}

.dl-meta {
  margin: .9rem 0 0;
  font-size: .87rem;
  color: var(--muted);
}

/* ---------- The overlay mock ---------- */

.showcase { margin: 3.5rem 0; }

.mock-desktop {
  /* Suggests a desktop behind the overlay without shipping a screenshot. */
  background:
    linear-gradient(135deg, #1b2233 0%, #131a28 45%, #1a1526 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem 1.25rem;
  display: flex;
  justify-content: center;
}

.mock-overlay {
  background: #000;
  border: 1px solid #333;
  border-radius: 4px;
  padding: .5rem .75rem;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: .93rem;
  line-height: 1.55;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .65);
  max-width: 100%;
  overflow-x: auto;
}

.mock-row { white-space: nowrap; }
.mock-sym { color: #fff; }
.mock-arrow { margin-left: .55rem; }
.mock-up { color: var(--accent); }
.mock-down { color: #ff3333; }
.mock-exp { color: #888; margin-left: .45rem; }

.showcase-caption {
  text-align: center;
  color: var(--muted);
  font-size: .92rem;
  margin: 1rem auto 0;
  max-width: 48ch;
}

/* ---------- Features ---------- */

.features { margin: 3.5rem 0; }
.features h2,
.steps h2,
.closer h2 {
  font-size: 1.5rem;
  letter-spacing: -.015em;
  margin: 0 0 1.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1rem;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.feature h3 {
  margin: 0 0 .5rem;
  font-size: 1rem;
  color: var(--text);
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.62;
}

/* ---------- Steps ---------- */

.steps { margin: 3.5rem 0; }

.step-list {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .75rem;
}

.step-list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .25rem 1rem;
  align-items: baseline;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.step-list li::before {
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: #04340f;
  font-weight: 700;
  font-size: .95rem;
}

.step-list strong { font-size: 1rem; }
.step-list span { color: var(--muted); font-size: .93rem; }

/* ---------- Download ---------- */

.download-card {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin: 3.5rem 0;
}

.download-card h2 { margin: 0 0 .6rem; font-size: 1.4rem; }
.dl-action { margin: 1.25rem 0; }

.dl-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .4rem 1.25rem;
  margin: 0 0 1.1rem;
  font-size: .89rem;
}

.dl-facts dt { color: var(--muted); font-weight: 600; }
.dl-facts dd { margin: 0; }

.hashline {
  font-size: .78rem;
  word-break: break-all;
  line-height: 1.45;
}

/* ---------- Closing CTA ---------- */

.closer {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 3.5rem;
}

.closer h2 { max-width: 22ch; margin: 0 auto 1.5rem; }
.closer .actions { justify-content: center; }

@media (max-width: 620px) {
  .mock-desktop { padding: 1.5rem .6rem; }
  .mock-overlay { font-size: .82rem; }
  .hero-cta .btn { width: 100%; text-align: center; }
  .dl-facts { grid-template-columns: 1fr; gap: .15rem; }
  .dl-facts dd { margin-bottom: .5rem; }
}

.footlinks { display: flex; gap: 1.25rem; }
