/* Bastet Labs. Tokens are copied from DESIGN.md in the bastet-labs repo;
   change them there first, then here. */

:root {
  --bg: #F4EDE0;
  --ink: #1A1814;
  --ink-muted: #5C564C;
  --lapis: #1E3A5F;
  --ochre: #C9893A;
  --ochre-text: #8A5A1F;
  --carnelian: #A33838;

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* ~64ch of body Inter. In rem, not ch, so the smaller footer text lines up. */
  --page: 40rem;

  /* Fraunces SOFT axis: open decision. Swap the active line to compare. */
  --soft: 50;
  /* --soft: 0; */
  /* --soft: 100; */

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1814;
    --ink: #F4EDE0;
    --ink-muted: #A89F90;
    /* Dark-mode lapis: open comparison, like --soft. If this changes, mirror it
       in the favicon SVGs' dark-mode fill. */
    --lapis: #8FB0D9;
    /* --lapis: #9AAFC8; */  /* warmer, greyer (7.9:1 on Basalt) */
    /* --lapis: #A3B5C9; */  /* warmer still, softer (8.5:1) */
    --ochre: #C9893A;
    --ochre-text: #C9893A;
    --carnelian: #D9706A;
  }
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem); /* 17–18px */
  line-height: 1.6;
}

main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--page) + 3rem);
  margin: 0 auto;
  padding: clamp(4rem, 14vh, 9rem) 1.5rem 3rem;
}

h1, h2, h3, .display {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" var(--soft), "WONK" 0;
  color: var(--lapis);
  line-height: 1.1;
  margin: 0;
}

.wordmark {
  font-size: clamp(3rem, 2rem + 5vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.lede {
  margin: 1.5rem 0 0;
  max-width: 40ch;
  font-size: 1.2em;
  line-height: 1.5;
}

h2 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

/* Tight for the placeholder phase, where sections are one line. Open this (and
   .ornament below) back up to clamp(3.5rem, 10vh, 6rem) once real app entries
   fill the Apps section. */
section {
  margin-top: clamp(2rem, 6vh, 3.5rem);
  padding-top: 2rem;
  border-top: 1px solid color-mix(in srgb, var(--ochre) 40%, transparent);
}

p { margin: 0 0 1em; }

.muted { color: var(--ink-muted); }

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

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

/* "What we do": numbered rows, numerals in Fraunces. Small, so ochre-text,
   not Ochre (that's for display sizes only). */
.practice {
  list-style: none;
  margin: 0;
  padding: 0;
}
.practice li {
  display: grid;
  grid-template-columns: 2.5rem 6rem 1fr;
  align-items: baseline;
  padding: 0.7rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ochre) 25%, transparent);
}
.practice li:last-child { border-bottom: 0; }
.practice .num {
  font-family: var(--display);
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 0.9375rem;
  color: var(--ochre-text);
}
.practice b {
  font-family: var(--display);
  font-variation-settings: "SOFT" var(--soft), "WONK" 0;
  font-weight: 500;
  font-size: 1.125rem;
  color: var(--lapis);
}
@media (max-width: 30rem) {
  .practice li { grid-template-columns: 2.25rem 1fr; row-gap: 0.1rem; }
  .practice li > span:last-child { grid-column: 2; }
}

/* App plate: a catalogue entry. The device is a line drawing in Lapis, CSS
   only, no image, so it follows the colour scheme. Placeholder screen until
   the first app has a real screenshot to put in it. */
.plate {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 6vw, 3.5rem);
  margin-top: 1.5rem;
}
.phone {
  --w: clamp(8.5rem, 26vw, 10.5rem);
  flex: none;
  position: relative;
  width: var(--w);
  aspect-ratio: 9 / 19.5;
  padding: calc(var(--w) * 0.045);
  border: 1.5px solid var(--lapis);
  border-radius: calc(var(--w) * 0.17);
}
/* Side buttons: action + volume on the left, power on the right. */
.phone::before, .phone::after {
  content: "";
  position: absolute;
  width: 2px;
  background: var(--lapis);
  border-radius: 1px 0 0 1px;
}
.phone::before {
  left: -3.5px;
  top: 19%;
  height: 7%;
  box-shadow: 0 calc(var(--w) * 0.22) 0 var(--lapis), 0 calc(var(--w) * 0.4) 0 var(--lapis);
}
.phone::after { right: -3.5px; top: 27%; height: 12%; border-radius: 0 1px 1px 0; }
.screen {
  position: relative;
  height: 100%;
  border-radius: calc(var(--w) * 0.13);
  border: 1px solid color-mix(in srgb, var(--lapis) 30%, transparent);
  /* A light left on: something is in there. */
  background: radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--ochre) 16%, var(--bg)), var(--bg) 70%);
  overflow: hidden;
}
.island {
  position: absolute;
  top: 3.2%;
  left: 50%;
  width: 30%;
  height: 3.9%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #1A1814; /* Basalt in both schemes: the island is hardware */
}
.status {
  position: absolute;
  top: 3.4%;
  left: 10%;
  font-size: calc(var(--w) * 0.062);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
}
.home {
  position: absolute;
  bottom: 2.2%;
  left: 50%;
  width: 36%;
  height: 1.2%;
  min-height: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--ink);
  opacity: 0.55;
}
.mystery {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 400;
  font-size: calc(var(--w) * 0.62);
  line-height: 1;
  color: var(--ochre); /* display size, so Ochre is allowed */
  padding-bottom: 6%;
}
.plate-num {
  display: block;
  font-family: var(--display);
  font-variant-numeric: lining-nums;
  font-size: 0.9375rem;
  color: var(--ochre-text);
  margin-bottom: 0.35rem;
}
.plate h3 {
  font-size: 1.75rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.plate p { margin: 0; }

/* House ornament. Ochre is decoration only, never text (2.5:1 on Papyrus). */
.ornament {
  display: block;
  margin: clamp(2rem, 6vh, 3.5rem) 0 0; /* matches section margin-top */
  color: var(--ochre);
  font-size: 1.25rem;
  line-height: 1;
}

footer {
  width: 100%;
  max-width: calc(var(--page) + 3rem);
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
}
footer p { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  a { transition: text-decoration-thickness 120ms ease; }
  /* The question mark tips its head now and then. */
  .mystery { animation: tilt 9s ease-in-out 2s infinite; transform-origin: 50% 70%; }
  @keyframes tilt {
    0%, 88%, 100% { transform: rotate(0); }
    91% { transform: rotate(-9deg); }
    95% { transform: rotate(4deg); }
  }
}
