/*
 * The public pages' whole stylesheet. Hand-written rather than generated: most
 * of what it styles is long-form prose and rendered markdown, which carry no
 * class attributes for a utility framework to hang on.
 *
 * It reproduces the SPA's frosted-glass look (GlassBackground.tsx: the photo, a
 * 40% black overlay, translucent blurred cards) so a reader moving between a
 * public page and the login sees one site. The tokens below are that look,
 * written down once; when GlassBackground or glassCard changes, change them.
 *
 * No remote fonts and no remote images. The backdrop is the same photo the
 * React pages pulled from Unsplash on every view, now served from this origin
 * (/background.jpg): a marketing page should not depend on a third party being
 * up, nor tell one who is reading it.
 */

:root {
  --bg: #020b20;                              /* under the photo, and if it fails */
  --overlay: rgba(0, 0, 0, 0.4);              /* bg-black/40 */
  --glass: rgba(255, 255, 255, 0.1);          /* bg-white/10 */
  --glass-hover: rgba(255, 255, 255, 0.2);
  --glass-border: rgba(255, 255, 255, 0.2);   /* border-white/20 */
  --glass-blur: blur(24px);                   /* backdrop-blur-xl */
  --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* shadow-2xl */
  --hairline: rgba(255, 255, 255, 0.1);
  --text: rgba(255, 255, 255, 0.8);
  --muted: rgba(255, 255, 255, 0.6);          /* text-white/60..70 on the old pages */
  --accent: #22d3ee;                          /* cyan-400 */
  --accent-hover: #67e8f9;                    /* cyan-300 */
  --radius: 1rem;                             /* rounded-2xl */
  --radius-sm: 0.75rem;                       /* rounded-xl */
  --wrap: 48rem;                              /* max-w-3xl */
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.625 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  text-rendering: optimizeLegibility;
}

/* The backdrop. A fixed pseudo-element rather than background-attachment:
   fixed, which iOS Safari ignores (the photo would scroll and stretch to the
   document's height). The overlay is a gradient layer on the same element. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(var(--overlay), var(--overlay)),
    url(/background.jpg) center / cover no-repeat;
}

/* The glass card, once. Everything frosted on these pages is this. */
.card,
.steps > li,
.panel,
table,
.post-list > li,
.prose pre {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* 24px side gutter (px-6), and never a horizontal scrollbar. */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.prose { max-width: var(--wrap); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
/* Inside running text colour alone does not mark a link. */
.panel p a, .panel li a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.panel .back a, .panel .tags a { text-decoration: none; }

h1, h2, h3 { line-height: 1.25; color: #fff; font-weight: 700; }
h1 { font-size: clamp(1.875rem, 5vw, 2.25rem); margin: 0 0 0.5em; }
h2 { font-size: 1.5rem; margin: 2em 0 0.75em; }
h3 { font-size: 1.125rem; font-weight: 600; margin: 1.6em 0 0.4em; }

p, li { color: var(--text); }
strong { color: #fff; }
.muted { color: var(--muted); }
.lede { color: var(--text); margin-bottom: 2.5rem; }

/* Visible only to assistive technology: a heading that structures the list
   below it without repeating a line the reader already saw. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  background: var(--accent);
  color: #001018;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; top: 0; z-index: 10; }

/* Header ------------------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 5;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding-block: 0.75rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  color: #fff;
}
.brand:hover { color: #fff; }
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a { color: var(--muted); font-size: 0.875rem; }
.nav a:hover { color: #fff; }
/* The nav wraps on its own at narrow widths, so there is no toggle button and
   therefore nothing about the navigation that needs JavaScript. */

/* Content ----------------------------------------------------------------- */

main { padding-block: 3rem 3.5rem; }

.hero { padding-block: 1rem 0.5rem; }
.accent { color: var(--accent); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 500;
  transition: background-color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--glass-hover); color: #fff; }
.btn-primary {
  background: rgba(8, 145, 178, 0.8);          /* bg-cyan-600/80 */
  border-color: rgba(34, 211, 238, 0.5);       /* border-cyan-400/50 */
}
.btn-primary:hover { background: rgba(6, 182, 212, 0.8); } /* cyan-500/80 */

.idea-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
}
.idea-list li {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  color: var(--text);
  font-size: 0.875rem;
}

/* Numbered steps: one glass card each, the number in a cyan circle. The
   counter replaces the list marker, so the markup stays an ordinary <ol>. */
.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 1rem;
  padding: 0;
  margin: 0 0 3rem;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 1.5rem 1.5rem 1.5rem 5.25rem;
  min-height: 5.5rem;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 1.5rem;
  top: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.2);          /* bg-cyan-500/20 */
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: var(--accent-hover);
  font-weight: 700;
}
.steps h2 { margin: 0 0 0.25rem; font-size: 1.125rem; font-weight: 600; }
.steps p { margin: 0; }

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0 3rem;
}
/* One column on a phone, three from 40rem (sm:grid-cols-3): auto-fit leaves
   a lone third card on its own row at in-between widths. */
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { padding: 1.25rem; }
section.card { padding: 1.5rem; margin-bottom: 1rem; }
.card h3, .card h2 { margin-top: 0; font-size: 1.125rem; font-weight: 600; }
.card p { font-size: 0.9rem; }
.card > :last-child { margin-bottom: 0; }

/* Long-form text (the legal pages, a blog post) sits in ONE glass panel: a
   page of body copy straight on a photograph is not readable. */
.panel { padding: clamp(1.25rem, 4vw, 2.5rem); }
.panel > :last-child { margin-bottom: 0; }

/* Tables ------------------------------------------------------------------ */

table {
  width: 100%;
  /* separate, not collapse: a collapsed table ignores border-radius. */
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0 2.5rem;
  font-size: 0.875rem;
  overflow: hidden;
}
caption {
  text-align: left;
  color: var(--muted);
  padding-bottom: 0.5rem;
}
th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
thead th { color: var(--muted); font-weight: 500; }
tbody th { color: var(--text); font-weight: 400; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: none; }

/* A price table is wider than phone prose; scroll it rather than letting the
   page scroll sideways. */
table { display: block; overflow-x: auto; }
@media (min-width: 40rem) { table { display: table; } }

/* Blog -------------------------------------------------------------------- */

.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.post-list > li { padding: 1.5rem; }
.post-list > li > :last-child { margin-bottom: 0; }
.post-list h2, .post-list h3 { margin: 0 0 0.25em; font-size: 1.125rem; font-weight: 600; }
.post-meta { color: var(--muted); font-size: 0.875rem; margin: 0 0 0.5em; }

.tags { margin: 0.5rem 0; }
.tag {
  display: inline-block;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  margin-right: 0.35rem;
  font-size: 0.8rem;
  color: var(--text);
}
.tag:hover { color: #fff; border-color: var(--accent); }

.back { margin-bottom: 2rem; font-size: 0.875rem; }

.legal section { margin-bottom: 2rem; }
.legal h2 { font-size: 1.25rem; font-weight: 600; margin-top: 0; }
.address { color: var(--muted); }

.prose pre { padding: 1rem; overflow-x: auto; box-shadow: none; }
.panel pre { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(0, 0, 0, 0.3); }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #fff;
  background: var(--glass);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.prose blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid rgba(34, 211, 238, 0.5);
  color: var(--muted);
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  padding-block: 2rem 3rem;
  color: var(--muted);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.footer-links a { color: var(--muted); font-size: 0.875rem; }
.footer-links a:hover { color: #fff; }
.site-footer p { margin: 0.25rem 0; font-size: 0.875rem; }

@media print {
  body::before, .site-header, .site-footer, .cta-row, .skip { display: none; }
  body { background: #fff; color: #000; }
  h1, h2, h3, p, li, strong, th, td, a { color: #000; }
  .card, .steps > li, .panel, table, .post-list > li, .prose pre {
    background: none; box-shadow: none; border-color: #ccc;
  }
}
