/* Fine Tuning's website: the game's own paperwork (look.rs's colours, its
   Cabin and Lora), under a wireless's tuning dial for a menu. */

@font-face {
  font-family: "Cabin";
  src: url("/fonts/Cabin.ttf") format("truetype");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Lora";
  src: url("/fonts/Lora.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f2ebd6;
  --paper-deep: #e6d9bd;
  --edge: #8f7557;
  --ink: #26201a;
  --ink-soft: #6e5e4f;
  --green: #335e4a;
  --green-deep: #21402f;
  --needle: #b33021;
  --gold: #cca147;
  --walnut: #3d2618;
  --walnut-light: #5a3a25;
  --scale: #efe3c2;
  --measure: 34rem;
  --wide: 68rem;
  color-scheme: light;
}

@view-transition {
  navigation: auto;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Lora", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--green-deep);
}
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: var(--paper);
  color: var(--ink);
  z-index: 10;
}
.skip:focus {
  left: 1rem;
}

/* The cabinet: walnut, its grain, the signboard and the dial's window. */
.cabinet {
  background:
    repeating-linear-gradient(97deg, rgba(255, 220, 180, 0.035) 0 3px, transparent 3px 11px),
    repeating-linear-gradient(93deg, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 23px),
    linear-gradient(180deg, var(--walnut-light), var(--walnut) 70%);
  border-bottom: 4px solid #2a190f;
  padding: 1.25rem 1rem 1.5rem;
}
.cabinet-inner {
  max-width: var(--wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem 2rem;
  align-items: center;
}
.signboard img {
  width: 15rem;
}

/* The dial: a printed scale behind glass, lit from either end by its two
   pilot lamps; the stations are the pages, the needle on the one you're on. */
.dial {
  position: relative;
  height: 7.2rem;
  border-radius: 1rem;
  border: 3px solid var(--gold);
  box-shadow: inset 0 0 0 2px #7b5a2a, inset 0 3px 10px rgba(0, 0, 0, 0.45);
  background:
    radial-gradient(ellipse 30% 90% at 0% 50%, rgba(255, 196, 92, 0.5), transparent 70%),
    radial-gradient(ellipse 30% 90% at 100% 50%, rgba(255, 196, 92, 0.5), transparent 70%),
    var(--scale);
  overflow: hidden;
}
.dial::after {
  /* The glass. */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.35), transparent 40%, transparent 70%, rgba(255, 255, 255, 0.12));
  pointer-events: none;
}
.scale {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 3.9rem;
  height: 1.1rem;
  border-top: 1.5px solid var(--ink);
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 10%) top left / 100% 0.75rem no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 2%) top left / 100% 0.4rem no-repeat;
}
.scale span {
  position: absolute;
  top: 0.75rem;
  transform: translateX(-50%);
  font-family: "Cabin", sans-serif;
  font-stretch: 80%;
  font-size: 0.75rem;
  line-height: 1;
  color: var(--ink-soft);
}
.stations {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stations li {
  position: absolute;
  top: 0.9rem;
  transform: translateX(-50%);
}
.stations a {
  display: block;
  padding: 0.25rem 0.4rem;
  font-family: "Cabin", sans-serif;
  font-weight: 600;
  font-stretch: 80%;
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.stations a:hover {
  color: var(--needle);
}
.stations a[aria-current="page"] {
  color: var(--green);
}
/* (It runs from under the stations' names down over the scale, so the
   name it's on stays readable.) */
.needle {
  position: absolute;
  top: 2.75rem;
  bottom: 0.45rem;
  width: 3px;
  margin-left: -1.5px;
  background: var(--needle);
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.35);
  view-transition-name: needle;
}
.needle::before {
  /* Its clamp on the cord. */
  content: "";
  position: absolute;
  left: -3px;
  top: 50%;
  width: 9px;
  height: 0.9rem;
  margin-top: -0.45rem;
  background: #2b2b2b;
  border-radius: 2px;
}

::view-transition-group(needle) {
  animation-duration: 0.7s;
  animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.25s;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* The page. */
main {
  padding: 2.5rem 1rem 3rem;
}
.wide {
  max-width: var(--wide);
  margin: 0 auto;
}
.text {
  max-width: var(--measure);
  margin: 0 auto;
}

h1,
h2,
h3 {
  font-family: "Cabin", sans-serif;
  font-weight: 650;
  font-stretch: 82%;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.6rem;
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
}
h2 {
  font-size: 1.85rem;
  margin-top: 2.6rem;
}
h3 {
  font-size: 1.3rem;
  margin-top: 1.8rem;
}
p {
  margin: 0 0 1rem;
}
.lead {
  font-size: 1.3rem;
  line-height: 1.55;
}
.soft {
  color: var(--ink-soft);
}

/* A still from the game, mounted as a print is: a cream border, its edge. */
.print {
  margin: 0 0 2rem;
}
.print img {
  border: 0.55rem solid #faf5e6;
  outline: 1px solid var(--edge);
  box-shadow: 0 2px 0 rgba(61, 38, 24, 0.18);
}
.print figcaption {
  margin-top: 0.55rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.hero {
  display: grid;
  gap: 1.5rem 2.5rem;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: end;
}
.hero .print {
  margin: 0;
}
.hero h1 {
  margin-bottom: 1rem;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.3rem 0.75rem;
  background: var(--green);
  color: var(--paper);
  font-family: "Cabin", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  border: 2px solid var(--green-deep);
}
.button:hover {
  background: var(--green-deep);
  color: var(--paper);
}
/* (Not a link yet: the store page isn't public.) */
.button.soon,
.button.soon:hover {
  background: transparent;
  color: var(--green);
  border-style: dashed;
  cursor: default;
}
.status {
  font-family: "Cabin", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--green);
  margin: 0;
}

/* Each thing the game does: a still and its words beside it, the next the
   other way about. */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem 2.5rem;
  align-items: center;
  margin-top: 3.5rem;
}
.feature:nth-of-type(even) .print {
  order: 2;
}
.feature h2 {
  margin-top: 0;
}
.feature .print {
  margin: 0;
}

/* A line as the trade list prints one: its words, a dotted leader, what
   it comes to. */
.lines {
  list-style: none;
  margin: 1rem 0 2rem;
  padding: 0;
}
.lines li {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0;
}
.lines li::after {
  content: none;
}
.lines .leader {
  flex: 1;
  min-width: 1.5rem;
  border-bottom: 2px dotted var(--edge);
  transform: translateY(-0.3em);
}
.lines .what {
  font-family: "Cabin", sans-serif;
  font-weight: 600;
}
.lines .comes {
  color: var(--ink-soft);
  white-space: nowrap;
}

/* The handbook: its title page, and the download. */
.handbook {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 1.5rem 2.5rem;
  align-items: center;
  margin-top: 3.5rem;
  padding: 2rem;
  background: var(--paper-deep);
  border: 1px solid var(--edge);
}
.handbook h2 {
  margin-top: 0;
}
.handbook .print {
  margin: 0;
}

/* The devlog. */
.post-meta {
  color: var(--ink-soft);
  font-size: 1rem;
  margin-bottom: 1.8rem;
}
.post figure {
  margin: 1.8rem 0;
}
.draft {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--needle);
  color: var(--needle);
  font-family: "Cabin", sans-serif;
  font-size: 0.9rem;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.5rem;
  margin: 1rem 0 2rem;
}
.facts dt {
  font-family: "Cabin", sans-serif;
  font-weight: 600;
}
.facts dd {
  margin: 0;
}

.stills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.stills .print {
  margin: 0;
}

footer {
  border-top: 1px solid var(--edge);
  padding: 1.5rem 1rem 2.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
footer p {
  max-width: var(--wide);
  margin: 0 auto 0.3rem;
}

@media (max-width: 52rem) {
  .cabinet-inner {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .signboard img {
    width: 12rem;
  }
  .dial {
    width: 100%;
  }
  .hero,
  .feature,
  .handbook {
    grid-template-columns: 1fr;
  }
  .feature:nth-of-type(even) .print {
    order: 0;
  }
  .handbook .print {
    max-width: 12rem;
  }
}

@media (max-width: 30rem) {
  body {
    font-size: 1.05rem;
  }
  .dial {
    height: 6rem;
  }
  .stations li {
    top: 0.7rem;
  }
  .stations a {
    font-size: 0.92rem;
    padding: 0.25rem 0.15rem;
  }
  .needle {
    top: 2.3rem;
  }
  .scale {
    top: 3.2rem;
  }
  .scale span {
    font-size: 0.6rem;
  }
  .handbook {
    padding: 1.25rem;
  }
}
