/* ─────────────────────────────────────────────────────────────────────────────
   robroy.online — shared site stylesheet
   Design tokens lifted from the Station Insight page (the newest generation)
   and generalised so every page on the site shares one system.

   EXCEPTIONS — two pages deliberately keep their own self-contained <style>
   and do NOT read this file: netsolver/index.html (dark landing page with a
   hand-built device mock) and evidr/index.htm (its own type + layout system).
   They were kept because their designs are stronger than the generic template.
   If you change a token here, check those two by hand — they will not follow.

   Per-app identity: an app page overrides --accent/--accent-hover in its own
   <style> block, and MUST declare its dark value inside its own
   @media (prefers-color-scheme: dark) block — a bare :root override would
   otherwise beat this file's dark block on source order and leak the light
   accent onto a black background. See any app page for the pattern.
   ──────────────────────────────────────────────────────────────────────────── */

:root {
  /* Brand — overridden per app page */
  --accent:      #0071e3;
  --accent-hover:#0058b9;

  /* Neutrals */
  --ink:      #1d1d1f;
  --ink-soft: #3a3a3c;
  --muted:    #6e6e73;
  --faint:    #86868b;
  --line:     rgba(0,0,0,.10);
  --card:     #ffffff;
  --bg:       #f5f5f7;
  --bg-raise: #ffffff;

  --radius:    16px;
  --radius-lg: 22px;
  --shadow:    0 1px 3px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.06), 0 18px 48px rgba(0,0,0,.10);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
          system-ui, Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent:      #4aa3ff;
    --accent-hover:#6fb6ff;

    --ink:      #f2f2f7;
    --ink-soft: #c7c7cc;
    --muted:    #98989f;
    --faint:    #8e8e93;
    --line:     rgba(255,255,255,.14);
    --card:     #1c1c1e;
    --bg:       #000000;
    --bg-raise: #1c1c1e;

    --shadow:    0 1px 3px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.4);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.6), 0 18px 48px rgba(0,0,0,.5);
  }
}

/* ── Base ─────────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

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

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

/* Available to screen readers, absent from the visual layout. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* Skip link for keyboard/VoiceOver users */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--card); color: var(--ink);
  padding: 12px 18px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ── Layout ───────────────────────────────────────────────────────────────── */

.wrap      { max-width: 780px;  margin: 0 auto; padding: 0 22px 72px; }
.wrap-wide { max-width: 1120px; margin: 0 auto; padding: 0 22px 72px; }

/* ── Site nav (every page) ────────────────────────────────────────────────── */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 15px;
}
.site-nav .brand {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.site-nav .brand:hover { text-decoration: none; opacity: .7; }
.site-nav nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.site-nav nav a { color: var(--muted); }
.site-nav nav a:hover { color: var(--accent); text-decoration: none; }

/* ── Type ─────────────────────────────────────────────────────────────────── */

h1 {
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  font-weight: 600;
}
h2 { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 14px; font-weight: 600; }
h3 { font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; margin: 0 0 8px; font-weight: 600; }

.kicker {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.lede {
  font-size: 19px;
  color: var(--muted);
  max-width: 60ch;
  margin: 0 auto 26px;
}

.section-label {
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 56px 0 18px;
  text-align: center;
}

.note { color: var(--muted); font-size: 14px; }

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

.hero { text-align: center; padding: 40px 0 8px; }

.hero .app-icon {
  width: 104px; height: 104px;
  border-radius: 23.5%;          /* iOS squircle approximation */
  margin: 0 auto 22px;
  display: block;
  box-shadow: var(--shadow);
  background: var(--card);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 12px 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 980px;          /* pill, per current Apple styling */
  font-weight: 500;
  font-size: 16px;
  transition: background .2s ease, transform .2s ease;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; transform: translateY(-1px); }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--card); border-color: var(--accent); }

.btn-row {
  display: flex; gap: 12px; flex-wrap: wrap;
  align-items: center; justify-content: center;
  margin-top: 6px;
}

.app-store-badge { display: inline-block; }
.app-store-badge img { height: 44px; width: auto; display: block; }

/* ── Cards ────────────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin: 0 0 6px; }
.card p  { margin: 0; color: var(--ink-soft); font-size: 15px; }

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

/* ── App directory (root index) ───────────────────────────────────────────── */

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 22px;
  margin: 0 0 12px;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.app-card .app-icon {
  width: 84px; height: 84px;
  border-radius: 23.5%;
  display: block;
  margin: 0 0 18px;
  box-shadow: var(--shadow);
}

.app-card h3 { font-size: 21px; margin: 0 0 4px; }

.app-card .tagline {
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 12px;
}

.app-card .description {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 18px;
}

.app-card ul {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}
.app-card li {
  position: relative;
  padding: 5px 0 5px 24px;
  color: var(--ink-soft);
  font-size: 15px;
}
.app-card li::before {
  content: "";
  position: absolute;
  left: 2px; top: 12px;
  width: 11px; height: 6px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* Push the action row to the bottom so cards in a row line up */
.app-card .card-actions { margin-top: auto; }
.app-card .card-actions .btn-row { justify-content: flex-start; }

.app-card .meta {
  font-size: 13px;
  color: var(--faint);
  margin: 14px 0 0;
}
.app-card .meta a { color: var(--faint); }

/* ── Press / review note ─────────────────────────────────────────────────── */
/* Quiet by design — it should read as an aside, not compete with the app cards. */

.review-note {
  margin: 34px 0 8px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.review-note p { margin: 0; }

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

.app-card .badge {
  position: absolute;
  top: 22px;
  right: 22px;
  margin: 0;
}

.badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 980px;
  margin-bottom: 12px;
}
.badge-new {
  background: var(--accent);
  color: #fff;
}
.badge-soon {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* ── Section headers on the directory page ────────────────────────────────── */

.section-head {
  margin: 56px 0 20px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.section-head:first-of-type { border-top: none; padding-top: 0; }
.section-head h2 { margin: 0 0 4px; font-size: 24px; }
.section-head p  { margin: 0; color: var(--muted); font-size: 15px; }

/* ── Media ────────────────────────────────────────────────────────────────── */

.shots {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}
.shots figure { margin: 0; width: 250px; }
.shots img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
  background: var(--card);
}
.shots figcaption {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

/* Wider frames for Mac screenshots */
.shots.shots-wide figure { width: 100%; max-width: 620px; }

.demo-video {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border-radius: var(--radius);
  display: block;
  margin: 0 auto;
  border: 1px solid var(--line);
}

/* ── Prose (privacy / help / terms pages) ─────────────────────────────────── */

.prose h2 { margin: 40px 0 12px; font-size: 22px; }
.prose h3 { margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-soft); font-size: 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose .updated { color: var(--muted); font-size: 14px; margin-top: -6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }

/* ── Punch card (About) ───────────────────────────────────────────────────── */

.punchcard {
  margin: 26px 0 0;
  text-align: center;
}
.punchcard img {
  width: 100%;
  max-width: 620px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
  /* It's a physical object — a soft drop shadow reads better than a border,
     and the manila stock stands on its own in both themes. */
  box-shadow: 0 2px 6px rgba(0,0,0,.18), 0 12px 30px rgba(0,0,0,.14);
}
.punchcard figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}

/* ── Photo (About) ────────────────────────────────────────────────────────── */

.about-photo { margin: 30px 0 0; text-align: center; }
.about-photo img {
  width: 100%;
  max-width: 620px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.about-photo figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}
.about-photo .credit {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 12px;
  color: var(--faint);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 26px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.site-footer p { margin: 6px 0; }
.site-footer nav { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer .sep { color: var(--line); }

/* ── Open-source repositories ─────────────────────────────────────────────── */
/* Lighter than .app-card: these are code, not products — no icon, no CTA row. */

.repo-grid {
  display: grid;
  /* Same track width as .app-grid so both grids line up down the page. */
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 18px;
}

.repo-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .2s ease, transform .2s ease;
}
.repo-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.repo-card h3 {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 16px;
  margin: 0 0 10px;
  word-break: break-word;
}
.repo-card h3 a { color: var(--ink); }
.repo-card h3 a:hover { color: var(--accent); text-decoration: none; }

.repo-card p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  font-size: 12px;
  color: var(--faint);
}

.repo-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 980px;
  padding: 3px 10px;
}

/* Language dot — GitHub's convention, set per card. */
.lang-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lang-python { background: #3572A5; }
.lang-swift  { background: #F05138; }

/* Status tag for unreleased work — no repo to link to yet. */
.repo-tag.status {
  border-color: var(--accent);
  color: var(--accent);
}

.repo-link {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}
.repo-link::after { content: " ↗"; font-size: 12px; }

@media (max-width: 560px) {
  .repo-grid { grid-template-columns: 1fr; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 560px) {
  body { font-size: 16px; }
  .app-grid { grid-template-columns: 1fr; }
  .app-card { padding: 24px; }
  .lede { font-size: 17px; }
  .shots figure { width: 100%; max-width: 320px; }
  .site-nav { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Apple's black badge sits on a black page in dark mode — give it an edge so it
   reads as a deliberate element. The badge URL itself is left untouched. */
@media (prefers-color-scheme: dark) {
  .app-store-badge img {
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 9px;
  }
}
