/*
 * spazio17 site styles, shared byte-for-byte between muralis-site and
 * spazio17.github.io. Pages cannot share an asset across repos, so this file is
 * copied; keep the copies identical so a fix lands in both.
 *
 * The custom properties below are copied verbatim from the app's own palette
 * (KioskTheme.java on the tablet, PAGE_CSS in HttpAdminServer.java for the web
 * admin): Catppuccin Mocha for dark, Latte for light, accents pushed further
 * towards saturation. Same names, same values, same light/dark mechanism, so
 * the site, the tablet UI and the web admin read as one product. If a colour
 * changes in the app, change it here too.
 */
:root {
  color-scheme: light dark;
  --base: #eff1f5;
  --mantle: #e6e9ef;
  --surface: #dce0e8;
  --surface-alt: #ccd0da;
  --border: #bcc0cc;
  --text: #4c4f69;
  --subtext: #6c6f85;
  --accent: #8226ef;
  --accent-alt: #1e66f5;
  --ok: #2fa019;
  --warn: #d68000;
  --bad: #d20f39;
  --radius: 14px;
  --measure: 68ch;
  --page: 1120px;
  --hero-grid: rgba(76, 79, 105, .10);
  --hero-glow-1: rgba(130, 38, 239, .10);
  --hero-glow-2: rgba(30, 102, 245, .08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --base: #1e1e2e;
    --mantle: #181825;
    --surface: #313244;
    --surface-alt: #45475a;
    --border: #585b70;
    --text: #cdd6f4;
    --subtext: #a6adc8;
    --accent: #c08cff;
    --accent-alt: #7aa2ff;
    --ok: #8ee88a;
    --warn: #ffdf8f;
    --bad: #ff6f91;
    --hero-grid: rgba(205, 214, 244, .07);
    --hero-glow-1: rgba(192, 140, 255, .16);
    --hero-glow-2: rgba(122, 162, 255, .12);
  }
}

html[data-theme="light"] { color-scheme: light; }

html[data-theme="dark"] {
  color-scheme: dark;
  --base: #1e1e2e;
  --mantle: #181825;
  --surface: #313244;
  --surface-alt: #45475a;
  --border: #585b70;
  --text: #cdd6f4;
  --subtext: #a6adc8;
  --accent: #c08cff;
  --accent-alt: #7aa2ff;
  --ok: #8ee88a;
  --warn: #ffdf8f;
  --bad: #ff6f91;
  --hero-grid: rgba(205, 214, 244, .07);
  --hero-glow-1: rgba(192, 140, 255, .16);
  --hero-glow-2: rgba(122, 162, 255, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* Footer pinned to the bottom on pages shorter than the viewport. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--base);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

main { flex: 1 0 auto; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent-alt); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- masthead */

.masthead {
  border-bottom: 1px solid var(--border);
  background: var(--mantle);
  position: sticky;
  top: 0;
  z-index: 5;
}
.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.brand:hover { color: var(--text); }
.brand img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.masthead nav { display: flex; align-items: center; gap: 1.1rem; font-size: .9rem; }
.masthead nav a { color: var(--subtext); text-decoration: none; }
.masthead nav a:hover { color: var(--accent); }

/* The same pill-shaped segmented control the web admin uses for its theme pick. */
.themepick {
  display: inline-flex;
  gap: .15rem;
  padding: .2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.themepick button {
  margin: 0;
  padding: .3rem .7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--subtext);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.themepick button[aria-pressed="true"] { background: var(--surface-alt); color: var(--text); }

/* -------------------------------------------------------------------- hero
 *
 * The backdrop is drawn, not photographed: a square grid standing in for a
 * tiled wall and a dashboard's tiles, lit by two soft accent glows. Pure
 * gradients, so it costs no request, ships no binary, and recolours itself with
 * the theme instead of needing a second file for dark mode. The mask fades it
 * out before it reaches the text, which is what keeps it an accent rather than
 * a pattern competing with the copy.
 *
 * To put a real photograph behind the hero later, add it as the first layer of
 * the background shorthand below and drop the grid's two repeating gradients.
 */

.hero { position: relative; overflow: hidden; padding: 6rem 0 3.5rem; }

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(38rem 22rem at 10% -15%, var(--hero-glow-1), transparent 70%),
    radial-gradient(32rem 20rem at 88% 5%, var(--hero-glow-2), transparent 70%),
    repeating-linear-gradient(to right, var(--hero-grid) 0 1px, transparent 1px 4.5rem),
    repeating-linear-gradient(to bottom, var(--hero-grid) 0 1px, transparent 1px 4.5rem);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 92%);
}

.hero > * { position: relative; }
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.9rem 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  font-size: .8rem;
  color: var(--subtext);
  background: var(--mantle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .32rem .8rem;
  white-space: nowrap;
}

.hero .status {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--subtext);
  font-size: .8rem;
  letter-spacing: .02em;
}
.hero .status .dot {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--warn);
}
.hero h1 {
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1.1;
  margin: 1.2rem 0 0;
  color: var(--accent);
  font-weight: 650;
  letter-spacing: -.02em;
}
.hero .lede {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--text);
  max-width: var(--measure);
  margin: 1rem 0 0;
}
.hero .sub { color: var(--subtext); max-width: var(--measure); margin: .9rem 0 0; }

/* ---------------------------------------------------------------- sections */

section { padding: 4rem 0; border-top: 1px solid var(--border); }
section > .wrap > h2 {
  font-size: 1.5rem;
  margin: 0 0 .4rem;
  font-weight: 650;
  letter-spacing: -.01em;
}
section > .wrap > .intro { color: var(--subtext); max-width: var(--measure); margin: 0 0 2rem; }

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
/* For a section holding only one or two cards, so they don't stretch into slabs. */
.cards.narrow { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 26rem)); }

.card {
  background: var(--mantle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
}
.card h3 {
  margin: 0 0 .45rem;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text);
}
.card p { margin: 0; color: var(--subtext); font-size: .92rem; }
.card p + p { margin-top: .6rem; }
.card .tag {
  display: inline-block;
  margin-bottom: .55rem;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* -------------------------------------------------------------- screenshots
 *
 * Each figure is a fixed-ratio slot so the gallery keeps its shape whether the
 * real capture is in place or not. A slot still waiting for one carries
 * class="pending" and shows its caption inside the frame; to fill it, replace
 * the .placeholder div with <img src="..." alt="..."> and drop the class.
 */
.shots {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
}
figure.shot { margin: 0; }
figure.shot .frame {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--mantle);
  overflow: hidden;
  display: flex;
}
figure.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
figure.shot.pending .frame {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
}
figure.shot.pending .placeholder { color: var(--subtext); font-size: .85rem; }
figure.shot.pending .placeholder strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: .3rem;
}
figure.shot figcaption {
  margin-top: .6rem;
  color: var(--subtext);
  font-size: .85rem;
}
figure.shot figcaption b { color: var(--text); font-weight: 600; }

/* Portrait captures (the tablet's own screens) want a taller slot. */
figure.shot.portrait .frame { aspect-ratio: 10 / 16; }

/* --------------------------------------------------------------- spec table */

.spec { width: 100%; border-collapse: collapse; font-size: .92rem; }
.spec caption { text-align: left; color: var(--subtext); padding-bottom: .75rem; }
.spec th, .spec td {
  text-align: left;
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.spec th { width: 15rem; font-weight: 600; color: var(--text); }
.spec td { color: var(--subtext); }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em;
  background: var(--surface);
  padding: .1em .35em;
  border-radius: 6px;
}

/* ----------------------------------------------------------------- notices */

.notice {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem 1.1rem;
  color: var(--subtext);
  font-size: .92rem;
}
.notice strong { color: var(--text); }
.notice.warn { border-color: var(--warn); }
.notice.warn strong { color: var(--warn); }
.notice p { margin: 0; }
.notice p + p { margin-top: .6rem; }

/* -------------------------------------------------------------------- prose
 *
 * Used by the privacy and terms pages, which are rendered from the same source
 * text the app bundles.
 */
.prose { max-width: var(--measure); padding: 3rem 0 4rem; }
.prose h1 { font-size: 2rem; margin: 0 0 .3rem; color: var(--accent); font-weight: 650; }
.prose .updated { color: var(--subtext); font-size: .85rem; margin: 0 0 2rem; }
.prose h2 {
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.4rem 0 .6rem;
}
.prose p { margin: 0 0 1rem; }
.prose ul { margin: 0 0 1rem; padding-left: 1.2rem; color: var(--subtext); }
.prose li { margin-bottom: .35rem; }
.prose .bullet-lead { color: var(--text); font-weight: 600; }

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

footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--mantle);
  padding: 2rem 0 3rem;
  color: var(--subtext);
  font-size: .88rem;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: baseline; }
footer nav { display: flex; flex-wrap: wrap; gap: 1rem; margin-left: auto; }
footer a { color: var(--subtext); }
footer a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
