/* Quiet Ramble — shared site stylesheet.
   Ported from design/homepage-design.dc.html. Class names keep the design's `qr-` prefix. */

/* ---------- Tokens ---------- */
:root {
  /* Brand palette */
  --ink: #0F171C;
  --ivory: #EEEAE3;
  --sage: #9DA597;
  --accent: #61D1A4;
  --white: #FFFFFF;

  /* Text */
  --text-muted: #C9CDC6;    /* body copy, nav */
  --text-subtle: #AEB4AC;   /* app button platform line */
  --text-number: #8F9893;   /* app button index */
  --text-chip: #D6D9D2;     /* platform chips */

  /* Surfaces, darkest to lightest */
  --surface-stage: #101920; /* preview illustration area */
  --surface-panel: #131D24; /* preview card */
  --surface-raised: #16212A;/* selected / hovered app button */
  --surface-chip: #1B2932;  /* platform chip */

  /* Hairlines (ivory at low alpha) */
  --line-faint: rgba(238, 234, 227, 0.08);
  --line-soft: rgba(238, 234, 227, 0.1);
  --line: rgba(238, 234, 227, 0.12);
  --line-strong: rgba(238, 234, 227, 0.2);
  --line-cta: rgba(238, 234, 227, 0.32);
  --dot-idle: rgba(238, 234, 227, 0.25);
  --ink-veil: rgba(15, 23, 28, 0.55);
  --ink-glass: rgba(15, 23, 28, 0.6); /* sticky header surface; light enough to show the hero sky */

  --header-height: 84px;
  --hero-sky: 88px;      /* extra room above the hero copy where the canvas sky shows */

  --font: 'Figtree', 'Helvetica Neue', Helvetica, sans-serif;
  --radius-pill: 999px;
  --focus-ring: 2px solid var(--ivory);
}

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

html {
  scroll-behavior: smooth;
  /* In-page links (#apps, #contact) land below the sticky header */
  scroll-padding-top: var(--header-height);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  /* Keeps the footer at the bottom of short pages (404, etc.) */
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

a { color: var(--ivory); }
a:hover { color: var(--white); }

img { max-width: 100%; }

.qr-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.qr-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Focus ---------- */
.qr-btn:focus-visible,
.qr-cta:focus-visible,
.qr-link:focus-visible,
.qr-skip:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

/* ---------- Skip link ---------- */
.qr-skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--ivory);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.qr-skip:focus { top: 16px; }
.qr-skip:hover { color: var(--ink); }

/* ---------- Header ---------- */
.qr-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line-faint);
  background: var(--ink-glass);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  backdrop-filter: blur(6px) saturate(140%);
}

.qr-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.qr-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.qr-logo {
  display: block;
  height: 46px;
  width: auto;
  margin-left: -10px;
}

.qr-nav {
  display: flex;
  gap: 32px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

/* Explicit colors on nav/footer/CTA links win over the global a:hover, as in the design. */
.qr-nav-link,
.qr-nav-link:hover {
  color: var(--text-muted);
  text-decoration: none;
  padding: 12px 0;
}

/* ---------- Hero ---------- */
/* The hero slides up under the sticky header so the canvas "sky" shows through the glass,
   then adds --hero-sky of open sky before the designed 780px hero area begins. */
.qr-hero {
  position: relative;
  height: calc(780px + var(--header-height) + var(--hero-sky));
  margin-top: calc(-1 * var(--header-height));
  overflow: hidden;
  border-bottom: 1px solid var(--line-faint);
}

.qr-hero-stage {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: pan-y;
}

.qr-hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.qr-hero-overlay {
  position: absolute;
  inset: calc(var(--header-height) + var(--hero-sky)) 0 0 0;
  pointer-events: none;
}

.qr-hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 62%;
  display: flex;
  align-items: center;
}

.qr-hero-copy > .qr-wrap { width: 100%; }

.qr-hero-text { max-width: 600px; }

.qr-hero-title {
  margin: 0;
  font-weight: 600;
  font-size: clamp(44px, 5.8vw, 84px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.qr-hero-lede {
  margin: 26px 0 0;
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 500px;
}

.qr-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
  pointer-events: auto;
}

.qr-cta {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 26px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  text-decoration: none;
}

.qr-cta--primary,
.qr-cta--primary:hover {
  background: var(--ivory);
  color: var(--ink);
  font-weight: 600;
}

.qr-cta--secondary,
.qr-cta--secondary:hover {
  border: 1px solid var(--line-cta);
  color: var(--ivory);
  font-weight: 500;
  background: var(--ink-veil);
}

.qr-hero-hint {
  position: absolute;
  right: 40px;
  bottom: 30px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--sage);
}

/* ---------- Sections ---------- */
.qr-section { padding: 120px 0; }

.qr-eyebrow {
  display: flex;
  align-items: center;
  gap: 18px;
}

.qr-eyebrow-bar {
  display: block;
  width: 36px;
  height: 7px;
  background: var(--accent);
}

.qr-eyebrow-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--sage);
}

.qr-section-title {
  margin: 22px 0 0;
  font-weight: 600;
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.qr-section-intro {
  margin: 20px 0 0;
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 620px;
}

/* ---------- Apps ("Now in the workshop") ---------- */
.qr-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px;
  margin-top: 56px;
  align-items: start;
}

.qr-app-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --app-accent is set per button by apps.js */
.qr-btn {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 74px;
  padding: 14px 20px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ivory);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.qr-btn:hover { background: var(--surface-raised); }
.qr-btn[aria-pressed="true"] {
  border-color: var(--app-accent);
  background: var(--surface-raised);
}

.qr-btn-num {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-number);
}

.qr-btn-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.qr-btn-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.qr-btn-platforms {
  font-size: 14px;
  color: var(--text-subtle);
}

.qr-btn-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--dot-idle);
  flex-shrink: 0;
}
.qr-btn[aria-pressed="true"] .qr-btn-dot { background: var(--app-accent); }

.qr-preview {
  border-radius: 24px;
  border: 1px solid var(--line-soft);
  background: var(--surface-panel);
  color: var(--ivory);
  overflow: hidden;
}

.qr-preview-stage {
  height: 340px;
  background: var(--surface-stage);
  border-bottom: 1px solid var(--line-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.qr-preview-stage > svg {
  width: 100%;
  height: 100%;
}

.qr-preview-body {
  padding: 32px 36px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qr-preview-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.qr-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ivory);
}

.qr-status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--app-accent, var(--accent));
}

.qr-note {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--sage);
}

.qr-preview-name {
  margin: 0;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.qr-preview-blurb {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 560px;
}

.qr-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.qr-platform {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface-chip);
  font-size: 14px;
  color: var(--text-chip);
}

/* Illustration animations */
.qr-spin { animation: qrspin 16s linear infinite; transform-box: fill-box; transform-origin: center; }
.qr-dash { animation: qrdash 1.8s linear infinite; }
.qr-bob { animation: qrbob 3.2s ease-in-out infinite; }
.qr-drift { animation: qrdrift 7s linear infinite; }
.qr-needle { animation: qrneedle 4.5s ease-in-out infinite alternate; transform-box: view-box; transform-origin: 180px 190px; }
.qr-chip { animation: qrbob 2.6s ease-in-out infinite; }

@keyframes qrspin { to { transform: rotate(360deg); } }
@keyframes qrdash { to { stroke-dashoffset: -40; } }
@keyframes qrbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes qrdrift { from { transform: translateX(40px); } to { transform: translateX(-80px); } }
@keyframes qrneedle { from { transform: rotate(-58deg); } to { transform: rotate(38deg); } }

/* ---------- Contact ---------- */
.qr-contact-title {
  margin: 22px 0 0;
  font-weight: 600;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1;
  letter-spacing: -0.035em;
}

.qr-contact-intro {
  margin: 22px 0 0;
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 560px;
}

.qr-email,
.qr-email:hover {
  display: inline-block;
  margin-top: 36px;
  font-size: clamp(24px, 3.2vw, 40px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ivory);
  text-decoration-color: var(--accent);
  text-underline-offset: 8px;
  text-decoration-thickness: 3px;
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */
.qr-footer { border-top: 1px solid var(--line-faint); }

.qr-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 28px;
  padding-bottom: 40px;
}

.qr-footer-logo {
  display: block;
  height: 72px;
  width: auto;
}

.qr-footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--sage);
}

.qr-footer-link,
.qr-footer-link:hover {
  color: var(--text-muted);
  text-decoration: none;
}

/* ---------- Text pages (privacy, support, 404) ---------- */
.qr-page { padding: 96px 0 120px; }

.qr-prose { max-width: 680px; }

.qr-prose h1 {
  margin: 22px 0 0;
  font-weight: 600;
  font-size: clamp(40px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.qr-prose h2 {
  margin: 48px 0 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.qr-prose h3 {
  margin: 28px 0 0;
  font-size: 19px;
  font-weight: 600;
}

.qr-prose p,
.qr-prose ul {
  margin: 16px 0 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-muted);
}

.qr-prose ul { padding-left: 1.25em; }
.qr-prose li + li { margin-top: 6px; }
.qr-prose strong { color: var(--ivory); font-weight: 600; }

.qr-prose a {
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

.qr-prose .qr-meta {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--sage);
}

.qr-prose .qr-hero-actions { margin-top: 34px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  :root { --hero-sky: 40px; }
  .qr-wrap { padding: 0 20px; }
  .qr-split { grid-template-columns: minmax(0, 1fr); }
  .qr-hide-sm { display: none; }
  .qr-hero-copy { height: auto; padding-top: 64px; }
  .qr-page { padding: 64px 0 96px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .qr-spin, .qr-dash, .qr-bob, .qr-drift, .qr-needle, .qr-chip { animation: none; }
  html { scroll-behavior: auto; }
}
