/* ==========================================================================
   HUXLI — huxli.io
   One stylesheet for every page. No external fonts, no scripts, no trackers.

   Colours are taken from the app artwork:
     charcoal, sky blue, amber  -> HUXLI splash / spectrum analyzer icon
     indigo, gold               -> Dr. Alphonso's Rule of 4 icon
   ========================================================================== */

:root {
  color-scheme: dark;

  --ink: #0e0f10;          /* page ground (HUXLI splash) */
  --ink-raised: #15171a;   /* panels (analyzer icon) */
  --night: #15142e;        /* indigo (Rule of 4 icon) */
  --night-glow: #2b2960;   /* indigo, lit */
  --gold: #e9c583;         /* the "4" */
  --amber: #f5a524;        /* spectrum peaks */
  --sky: #89cafb;          /* spectrum line */

  --text: #edebf2;
  --muted: #a9a8b8;
  --rule: rgba(255, 255, 255, 0.11);

  /* Each app can override --accent and --stage with a body class (see below). */
  --accent: var(--sky);
  --stage: var(--ink);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 68rem;
  --measure: 40rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --radius: 1.125rem;
}

/* ---- App themes: one class per app folder -------------------------------- */

.app-rule-of-4 {
  --accent: var(--gold);
  --stage: radial-gradient(120% 95% at 50% -10%, var(--night-glow) 0%, var(--night) 46%, var(--ink) 100%);
}

/* ---- Base ---------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

main { flex: 1; }

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

h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 6.2vw, 3.5rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.75rem); font-weight: 750; letter-spacing: -0.01em; }
h3 { font-size: 1.0625rem; font-weight: 700; line-height: 1.35; }

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

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

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.9rem;
  background: var(--text);
  color: var(--ink);
  border-radius: 0.4rem;
  font-weight: 600;
}
.skip:focus { top: 0.6rem; }

/* ---- Header -------------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--rule);
  background: var(--ink);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}

.wordmark {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.site-nav { display: flex; gap: clamp(1rem, 4vw, 1.75rem); }

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
  padding-block: 0.6rem;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: #fff; }

/* ---- Home hero: the brand screen ----------------------------------------- */

/* One full, black screen that holds only the name. It stays pinned while the
   bright apps section slides up over it like a curtain. */
.home .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  border-bottom-color: transparent;
  background: transparent;
}

.hero {
  position: sticky;
  top: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: 4.5rem; /* room for the cue at the foot of the screen */
  overflow: hidden;
  background: radial-gradient(120% 85% at 50% 58%, #06080c 0%, #000 62%);
}

.hero-mark {
  width: min(87vw, 116rem, 140vh);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 clamp(3px, 0.55vw, 11px) clamp(5px, 0.9vw, 18px) rgba(0, 0, 0, 0.75));
}

.hero-mark text { font-family: var(--font); }
.hero-mark .mark-name { font-size: 310px; font-weight: 800; }
.hero-mark .mark-line { font-size: 38px; font-weight: 500; fill: #b9bdc9; }
.hero-mark .mark-name,
.hero-mark .mark-beam { transform-box: fill-box; transform-origin: center; }
.hero-mark .mark-beam { opacity: 0.4; }
.hero-mark .mark-trace { transform-box: fill-box; transform-origin: 50% 100%; }
.hero-mark .trace-glow { stroke-width: 7; opacity: 0.9; }
.hero-mark .trace-line { stroke-width: clamp(1.5px, 0.2vw, 3px); vector-effect: non-scaling-stroke; }

.hero-stage { text-align: center; }

.hero-for {
  margin-top: clamp(1.1rem, 3vw, 2.5rem);
  color: var(--gold);
  font-size: clamp(0.72rem, 1.5vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
}

.hero-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  translate: -50% 0;
  padding: 0.5rem 0.75rem 2.6rem;
  color: #8f93a0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero-cue::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 2rem;
  background: linear-gradient(180deg, #8f93a0, rgba(143, 147, 160, 0));
}
.hero-cue:hover { color: #fff; }
/* Short screens (a phone on its side): no room for the cue under the name */
@media (max-height: 30rem) {
  .hero { padding-bottom: 0; }
  .hero-cue { display: none; }
}

/* The opening: a line of light strikes first, the name arrives, and the line
   rises into a spectrum trace. Runs once. Without animation support, or with
   reduced motion, the finished screen is simply shown. */
@media (prefers-reduced-motion: no-preference) {
  .hero-mark .mark-beam {
    animation: beam 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s both, settle 1.6s ease-out 2s forwards;
  }
  .hero-mark .mark-bloom { animation: appear 2.2s ease-out 1s both; }
  .hero-mark .mark-name { animation: arrive 2.4s cubic-bezier(0.16, 0.7, 0.2, 1) 0.8s both; }
  .hero-mark .mark-trace { animation: rise 1.9s cubic-bezier(0.2, 0.7, 0.2, 1) 1.5s both; }
  .hero-mark .mark-line { animation: appear 1.4s ease-out 2.7s both; }
  .hero-for { animation: appear 1.4s ease-out 3.5s both; }
  .hero-cue { animation: appear 1.2s ease-out 4.2s both; }
}

@keyframes beam { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: scaleX(1); } }
@keyframes settle { to { opacity: 0.4; } }
@keyframes rise { from { opacity: 0; transform: scaleY(0); } 12% { opacity: 1; } to { opacity: 1; transform: scaleY(1); } }
@keyframes arrive { from { opacity: 0; transform: scale(1.09); } to { opacity: 1; transform: scale(1); } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* Where supported, the name recedes as the apps section rises over it. */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-stage {
      animation: recede linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 90vh;
    }
  }
}
@keyframes recede { to { opacity: 0.15; transform: scale(0.9); } }

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

/* ---- Home: app list ------------------------------------------------------ */

/* The showroom: bright, calm and ordinary-sized, in deliberate contrast with
   the black brand screen above it. */
.apps {
  position: relative;
  z-index: 1;
  padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(4rem, 10vw, 7.5rem);
  border-radius: clamp(1.25rem, 3vw, 2.25rem) clamp(1.25rem, 3vw, 2.25rem) 0 0;
  background: linear-gradient(180deg, #f6f6f8 0%, #e8e9ed 100%);
  color: #111216;
  scroll-margin-top: 0;
}
.apps > .wrap > h2 {
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
  font-size: clamp(0.95rem, 2.3vw, 1.3rem);
  font-weight: 650;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  text-transform: uppercase;
  text-align: center;
}

/* Every app gets the same card, all the same size.
   The order of the <li> items in index.html is the order on the page. */
.app-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 1.75rem 3rem -1.5rem rgba(10, 12, 20, 0.28);
}

/* The app's own artwork, shown whole and square. No added backdrop. */
.app-card-art { flex: none; aspect-ratio: 1 / 1; }

.app-card-art img { width: 100%; height: 100%; object-fit: cover; }

.app-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 1.2rem 1.3rem 1.3rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.app-card h3 { font-size: 1.3rem; line-height: 1.25; }
.app-card-kind { margin-top: 0.15rem; color: #5a5c66; font-size: 0.95rem; }
.app-card h3 a { color: inherit; text-decoration: none; }
.app-card h3 a:hover { text-decoration: underline; }

.app-card-text { color: #4c4e58; font-size: 0.95rem; line-height: 1.5; }
.app-card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Who makes the apps */
.maker {
  max-width: 40rem;
  margin: clamp(2.75rem, 7vw, 4.5rem) auto 0;
  color: #33353d;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}

.app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.25rem;
  margin-top: auto;
  padding: 0.35rem 0 0;
  list-style: none;
}
.app-links a { display: inline-block; padding-block: 0.2rem; color: #111216; font-weight: 650; }

.status {
  display: inline-block;
  padding: 0.12rem 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 999px;
  color: #111216;
  font-size: 0.85rem;
  font-weight: 600;
}
/* The wording carries the meaning; the colour only reinforces it. */
.status--testing { border-color: rgba(20, 96, 143, 0.45); color: #14608f; }
.status--soon { border-color: rgba(122, 90, 18, 0.5); color: #7a5a12; }
.status--live { border-color: #111216; background: #111216; color: #fff; }

.button {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  background: var(--gold);
  color: #17142b;
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: #f4d79f; }

.app-icon {
  width: clamp(6.5rem, 22vw, 11rem);
  aspect-ratio: 1;
  height: auto;
  border-radius: 22.5%;
  box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.5);
}

/* ---- App pages: stage (title band) ---------------------------------------- */

.stage { background: var(--stage); border-bottom: 1px solid var(--rule); }

.stage .wrap { padding-block: clamp(2.5rem, 7vw, 4.5rem); }

.stage h1 { color: var(--accent); max-width: 18ch; }
.stage .lede { margin-top: 0.9rem; font-size: clamp(1.1rem, 2.6vw, 1.3rem); max-width: 36rem; }
.stage .fine { margin-top: 0.5rem; color: var(--muted); }

.crumb { margin-bottom: 1.1rem; font-size: 0.95rem; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: #fff; }

.stage--app .wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(1.25rem, 5vw, 3.5rem);
}
.stage--app .app-icon { width: clamp(7rem, 26vw, 14rem); }

/* ---- App pages: content ---------------------------------------------------- */

.content { padding-block: clamp(2.5rem, 7vw, 4rem) clamp(3.5rem, 9vw, 5.5rem); }

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1rem; }
.prose > h2 { margin-top: 2.75rem; }
.prose > h2:first-child { margin-top: 0; }
.prose > h3 { margin-top: 1.75rem; }
.prose > h3 + * { margin-top: 0.3rem; }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.3rem; }
.prose strong { color: #fff; font-weight: 650; }

.callout {
  padding: 1.15rem 1.3rem;
  border: 1px solid rgba(233, 197, 131, 0.35);
  border-radius: 0.8rem;
  background: rgba(233, 197, 131, 0.07);
  font-size: 1.15rem;
  line-height: 1.45;
}

.contact-line { font-size: clamp(1.25rem, 4.2vw, 1.6rem); font-weight: 700; overflow-wrap: anywhere; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Screenshots: a row that scrolls sideways on small screens */
.shots {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0 0 0.75rem;
  list-style: none;
  scroll-snap-type: x mandatory;
}
.prose .shots { padding-left: 0; margin-top: 1.25rem; }
.shots li { flex: none; width: min(62vw, 14rem); scroll-snap-align: start; }
.prose .shots li + li { margin-top: 0; }
.shots img { width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 1.4rem; }

/* Finger numbers: Index 1, Middle 2, Ring 3, Little 4 */
.fingers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 30rem;
  padding: 0;
  list-style: none;
  border-block: 1px solid var(--rule);
}
.prose .fingers { padding-left: 0; margin-top: 1.4rem; }
.fingers li { padding: 1rem 0 0.9rem; text-align: center; }
.prose .fingers li + li { margin-top: 0; border-left: 1px solid var(--rule); }
.fingers b {
  display: block;
  color: var(--gold);
  font-size: clamp(2.6rem, 11vw, 4rem);
  font-weight: 800;
  line-height: 1;
}
.fingers span { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.95rem; }

/* ---- Footer ---------------------------------------------------------------- */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--rule);
  background: #0a0b0c;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 4rem;
  padding-block: 2.5rem;
}
.site-footer .wrap > div { flex: 1 1 16rem; }
.site-footer .wrap > nav { flex: 0 1 15rem; }

.site-footer .wordmark { font-size: 1.15rem; }
.site-footer p + p { margin-top: 0.35rem; }
.site-footer h2 { color: var(--text); font-size: 0.95rem; font-weight: 650; letter-spacing: 0; line-height: 1.6; }
.site-footer ul { margin-top: 0.35rem; padding: 0; list-style: none; }
.site-footer li a { display: inline-block; padding-block: 0.3rem; }
.site-footer a { color: var(--muted); overflow-wrap: anywhere; }
.site-footer a:hover,
.site-footer a.wordmark { color: #fff; }

/* ---- Small screens ----------------------------------------------------------- */

/* App list: two columns on tablets, one on phones */
@media (max-width: 52rem) {
  .app-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 34rem) {
  .app-list { grid-template-columns: 1fr; }
}

@media (max-width: 40rem) {
  .stage--app .wrap { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd + dt { margin-top: 0.6rem; }
}

/* ---- Print (privacy and support pages) ------------------------------------- */

@media print {
  :root { color-scheme: light; }
  body, .stage, .site-header, .site-footer { background: #fff !important; color: #000 !important; }
  .stage h1, .prose strong, a, .site-footer h2, .wordmark { color: #000 !important; }
  .site-nav, .skip { display: none; }
  .callout { background: none; border-color: #000; }
}
