/* LucidDream website
   One stylesheet, no build step, no external requests.
   Palette sampled from the owl painting by Galina Landes; the application's
   own tint (#3C87F7) is reserved for interactive elements. */

:root {
  /* Painting palette */
  --ink: #373f6b;
  --night: #3e5581;
  --slate: #536e98;
  --periwinkle: #81849d;
  --haze: #9c9dae;
  --parchment: #ddceb9;
  --chalk: #f2efe9;
  --sage: #b4b59b;

  /* Interactive — application tint, plus an AA-contrast variant for fills
     and text links, since #3C87F7 alone is too light against white. */
  --action: #3c87f7;
  --action-strong: #1f63c9;

  /* Roles */
  --ground: var(--chalk);
  --ground-alt: #ece7dd;
  --surface: #fbfaf7;
  --text: var(--ink);
  --text-muted: var(--slate);
  --text-faint: var(--periwinkle);
  --border: #d9d3c6;
  --border-strong: #c2bbaa;
  --link: var(--action-strong);
  --focus: var(--action);
  --shadow: 0 1px 2px rgb(55 63 107 / 6%), 0 8px 24px rgb(55 63 107 / 8%);

  --serif:
    "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;

  --measure: 68ch;
  --wide: 1080px;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1a1f38;
    --ground-alt: #202745;
    --surface: #242c4d;
    --text: #e9e7f2;
    --text-muted: #b9bcd2;
    --text-faint: var(--haze);
    --border: #333c63;
    --border-strong: #45507e;
    --link: #8fbaff;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px rgb(0 0 0 / 35%);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem);
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.05rem);
}

h3 {
  font-size: 1.15rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

img,
svg {
  max-width: 100%;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

pre {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

pre .c {
  color: var(--text-faint);
}

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}

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

.band {
  padding: clamp(2.75rem, 1.5rem + 5vw, 5rem) 0;
  border-top: 1px solid var(--border);
}

.band--alt {
  background: var(--ground-alt);
}

.band__lede {
  max-width: var(--measure);
  color: var(--text-muted);
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 0.6rem;
  z-index: 20;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand svg,
.brand img {
  width: 28px;
  height: 28px;
  color: var(--ink);
}

@media (prefers-color-scheme: dark) {
  .brand svg,
  .brand img {
    color: #b9c4ea;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-left: auto;
  font-size: 0.94rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
}

.site-nav .btn {
  margin-left: 0.4rem;
}

/* `.site-nav a` would otherwise win on specificity and repaint the button's
   label in the muted link colour, on top of the filled background. */
.site-nav a.btn--primary,
.site-nav a.btn--primary:hover {
  color: #fff;
  text-decoration: none;
}

@media (max-width: 860px) {
  .site-nav {
    gap: 0.85rem;
    font-size: 0.88rem;
  }

  .site-nav__more {
    display: none;
  }
}

/* Below this width the brand, the links and the call to action no longer fit
   on one line — they overflowed the page by ~10px on a 375px screen. Give the
   navigation its own full-width row, and let it scroll horizontally rather
   than widen the document. */
@media (max-width: 560px) {
  .site-header__inner {
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }

  .site-nav {
    width: 100%;
    /* Without min-width the flex item refuses to shrink below its content,
       so the row pushes the document wider instead of scrolling — visible
       at 320px. */
    min-width: 0;
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  /* About returns; the in-page anchor goes, since the brand links home
     anyway and dropping it is what lets the row fit without scrolling. */
  .site-nav__more {
    display: inline;
  }

  .site-nav__anchor {
    display: none;
  }

  .site-nav .btn {
    margin-left: auto;
    padding: 0.5rem 0.8rem;
    font-size: 0.88rem;
  }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn--primary {
  background: var(--action-strong);
  color: #fff;
}

.btn--primary:hover {
  background: #17529f;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--text-muted);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
}

.btn-note {
  margin: 0;
  font-size: 0.87rem;
  color: var(--text-muted);
}

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

.hero {
  padding: clamp(2.5rem, 1rem + 6vw, 4.5rem) 0 clamp(2.5rem, 1rem + 5vw, 4rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

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

.hero__lede {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.22rem);
  color: var(--text-muted);
  max-width: 46ch;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.7rem;
  margin-bottom: 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--action);
}

/* The painting is presented as a framed picture rather than cut out: it is a
   physical artwork with white in its own highlights, so keying the background
   would damage the plumage. */
.frame {
  margin: 0;
  padding: 0.9rem;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.frame figcaption {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: #6b6f86;
  text-align: center;
}

.frame--sm {
  max-width: 320px;
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
  margin-top: 2rem;
}

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

.card h3 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
  color: var(--text-muted);
}

/* ---------- steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem 1.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding-top: 0.9rem;
  border-top: 2px solid var(--border-strong);
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--text-faint);
}

.steps strong {
  display: block;
  margin-bottom: 0.15rem;
}

.steps p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- screenshots ---------- */

.shots {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

.shot {
  margin: 0;
  flex: 0 1 auto;
}

.shot__media {
  display: block;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.shot--phone .shot__media {
  width: 270px;
  height: 585px;
}

.shot--wide .shot__media {
  width: 640px;
  max-width: 100%;
  aspect-ratio: 16 / 10;
}

.shot figcaption {
  margin-top: 0.6rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  max-width: 270px;
}

.shot--wide figcaption {
  max-width: 640px;
}

.shot__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* ---------- notes / honesty ---------- */

.notes {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
  max-width: var(--measure);
}

.notes li {
  padding-left: 1.15rem;
  border-left: 3px solid var(--sage);
  color: var(--text-muted);
}

.notes strong {
  color: var(--text);
}

/* ---------- tables ---------- */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--ground-alt);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td code {
  white-space: nowrap;
}

/* ---------- published library ---------- */

.library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1.1rem;
  margin-top: 1.75rem;
}

.library__item {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.library__item h3 {
  margin: 0;
  font-size: 1.02rem;
}

.library__url {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  word-break: break-all;
}

.library__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.4rem;
}

.library__actions .btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.library__empty {
  color: var(--text-muted);
}

/* ---------- download panel ---------- */

.channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.1rem;
  margin-top: 2rem;
  align-items: start;
}

.channel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.channel h3 {
  margin-top: 0;
}

.channel p {
  color: var(--text-muted);
}

.channel .btn-row {
  margin-top: auto;
  margin-bottom: 0.6rem;
}

.channel--muted {
  background: transparent;
  border-style: dashed;
}

.meta {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-faint);
}

/* ---------- credits ---------- */

.credit-artwork {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
}

@media (max-width: 720px) {
  .credit-artwork {
    grid-template-columns: 1fr;
  }
}

.credit-artwork__name {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem);
  margin: 0 0 0.4rem;
}

.credit-dev {
  margin-top: 2.5rem;
}

.credit-dev h3 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.credit-dev ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
}

.credit-dev strong {
  color: var(--text);
  font-weight: 600;
}

/* ---------- placeholder slot (contact, pending assets) ---------- */

.pending {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  color: var(--text-faint);
  font-size: 0.9em;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--border);
  background: var(--ground-alt);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem 2rem;
}

.site-footer h2 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.6rem;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.site-footer__base {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  color: var(--text-faint);
  font-size: 0.85rem;
}
