/* live.sugarcube.ch — Sugarcube Live, interactive tools for teaching: one page by hand. Defacto's language: a night band drawn from
   the UniFR blue with two soft glows, the name lit by a gradient; the tools as cards below. The colours are the few
   knobs on :root; every other shade is derived from them. */
@font-face { font-family: "Outfit"; src: url("../fonts/outfit-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }   /* the tools' face (OFL beside it) */
:root {
  --night: #0b1a30;
  --night-text: #f2f6fb;
  --night-muted: #a9b8cc;
  --night-line: color-mix(in oklab, var(--night-text) 14%, transparent);
  --glow: color-mix(in oklab, #0072b2 55%, transparent);
  --glow-2: color-mix(in oklab, #7b68ff 30%, transparent);
  --lit-1: #56b4e9;
  --lit-2: #b39dff;
  --ink: #16202c;
  --muted: #55606d;
  --paper: #f3f7fb;
  --card: #ffffff;
  --line: color-mix(in oklab, var(--ink) 12%, var(--paper));
  --accent: #005395;
  --shadow: color-mix(in oklab, var(--night) 40%, transparent);
  --radius: 18px;
  color-scheme: only light;
  accent-color: var(--accent);
}
@media (prefers-contrast: more) { :root { --muted: #333c46; --line: color-mix(in oklab, var(--ink) 35%, var(--paper)); } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font: 400 1rem/1.6 "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--paper); }
a { color: var(--accent); }
p { text-wrap: pretty; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; padding: .5rem .8rem; border-radius: 8px; background: var(--card); }
.wrap { width: min(64rem, 100% - 2.5rem); margin-inline: auto; }

/* the band */
.band { padding: 3.2rem 0 7rem; text-align: center; color: var(--night-text);
  background: radial-gradient(48rem 22rem at 50% -6rem, var(--glow), transparent 70%),
              radial-gradient(30rem 18rem at 88% 40%, var(--glow-2), transparent 70%), var(--night); }
.band h1 { margin: 0; font-size: clamp(2.2rem, 7vw, 3.2rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.band h1 span { background: linear-gradient(90deg, var(--lit-1), var(--lit-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 38rem; margin: .7rem auto 0; font-size: 1.1rem; color: var(--night-muted); }

/* the tools */
main { flex: 1; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 24rem)); justify-content: center; gap: 1.4rem; margin-top: -4.5rem; padding-bottom: 3rem; }
.tool { display: flex; flex-direction: column; overflow: hidden; color: inherit; text-decoration: none; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 30px 60px -35px var(--shadow); }
.tool img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); }
.tool div { padding: 1rem 1.2rem 1.2rem; }
.tool h2 { margin: 0 0 .3rem; font-size: 1.2rem; }
.tool p { margin: 0; color: var(--muted); }
.tool .open { display: inline-block; margin-top: .8rem; font-weight: 600; color: var(--accent); }
@media (hover: hover) { .tool { transition: transform .2s, box-shadow .2s; }
  .tool:hover { transform: translateY(-3px); box-shadow: 0 36px 70px -32px var(--shadow); } }
.tool:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* the footer */
footer { padding: 1.4rem 0; font-size: .9rem; color: var(--muted); border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }

/* the 404 */
.lost { padding: 5rem 0; text-align: center; }
.lost h1 { margin: 0; font-size: 2rem; }
.lost .lead { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { .tool { transition: none; } }
@media print { .band { background: none; color: var(--ink); padding: 1rem 0; } .lead { color: var(--muted); } .tools { margin-top: 0; } }
@media (forced-colors: active) { .band h1 span { color: CanvasText; background: none; } }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--qry-speed-slow, 0.3s); }
