/* ==========================================================================
   stvdwell.com goodies pages: /koala-skins/, /loflow/ and /keyflow/
   Standalone pages in the main site's look: black, Anton headings with the
   white underline bar, Cousine labels, Roboto text. They do not load the
   template's bootstrap.css or main.css.
   ========================================================================== */

/* ---------- Fonts (the same self-hosted files as the main site) ---------- */

@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/anton-400-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Cousine';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/cousine-400-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Cousine';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/cousine-700-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/roboto-400-latin.woff2') format('woff2');
}

/* ---------- Tokens ---------- */

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --line: #262626;
  --line-strong: #4d4d4d;
  --text: #f5f5f5;
  --text-soft: #cfcfcf;
  --muted: #a3a3a3;

  --font-display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --font-mono: 'Cousine', ui-monospace, Menlo, Consolas, monospace;
  --font-body: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Type scale */
  --step-label: 13px;
  --step-body: 17px;
  --step-h3: clamp(21px, 2.2vw, 26px);
  --step-h2: clamp(40px, 6vw, 64px);
  --step-h1: clamp(52px, 10vw, 120px);

  /* Spacing scale */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-section: clamp(80px, 11vw, 144px);

  --gutter: clamp(16px, 4vw, 40px);
  --radius: 4px;
}

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

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html:has(.viewer[open]) {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-body)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  padding: 12px 16px;
  background: #fff;
  color: #000;
  font: 700 var(--step-label)/1 var(--font-mono);
  text-transform: uppercase;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: calc(1160px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Small uppercase mono label, used above titles and in captions */
.kicker {
  font: 400 var(--step-label)/1.4 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Headings: Anton with the main site's 5px underline ---------- */

.display,
.title {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  text-wrap: balance;
}

.display::after,
.title::after {
  content: '';
  display: block;
  height: 5px;
  margin-top: 10px;
  background: #fff;
}

.display {
  margin-top: var(--space-3);
  font-size: var(--step-h1);
  line-height: 0.95;
}

.display::after {
  margin-top: 18px;
}

.title {
  font-size: var(--step-h2);
  line-height: 1;
}

.title-wrap {
  margin-bottom: var(--space-6);
  text-align: center;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #fff;
  border-radius: var(--radius);
  font: 700 var(--step-label)/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn-solid {
  background: #fff;
  color: #000;
}

.btn-solid:hover {
  background: #d4d4d4;
  border-color: #d4d4d4;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: #fff;
}

/* Download arrow */
.btn[download]::after {
  content: '';
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M5.25 0h1.5v7.19l2.47-2.47 1.06 1.06L6 10.06 1.72 5.78l1.06-1.06 2.47 2.47zM0 10.5h12V12H0z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M5.25 0h1.5v7.19l2.47-2.47 1.06 1.06L6 10.06 1.72 5.78l1.06-1.06 2.47 2.47zM0 10.5h12V12H0z'/%3E%3C/svg%3E") no-repeat center / contain;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 10, 10, 0.92);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand img {
  width: 128px;
}

.site-nav {
  display: flex;
  gap: var(--space-3);
}

.site-nav a {
  display: block;
  padding: 10px 0;
  font: 400 14px/1 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--muted);
}

@media (min-width: 768px) {
  .site-header-inner {
    height: 80px;
  }

  .brand img {
    width: 156px;
  }

  .site-nav {
    gap: var(--space-4);
  }
}

/* ---------- Intro ---------- */

.hero {
  padding-top: clamp(56px, 9vw, 112px);
  padding-bottom: clamp(48px, 7vw, 88px);
  text-align: center;
}

.lede {
  max-width: 34em;
  margin: var(--space-4) auto 0;
  font-size: clamp(17px, 1.7vw, 20px);
  color: var(--text-soft);
  text-wrap: pretty;
}

.specs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-1);
  margin-top: var(--space-4);
}

.specs li {
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font: 400 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* Keep the three on one line on phones */
@media (max-width: 479px) {
  .specs {
    gap: 6px;
  }

  .specs li {
    padding: 8px 11px;
    font-size: 11px;
    letter-spacing: 0.06em;
  }
}

/* ---------- Skins ---------- */

.skin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-2);
}

@media (min-width: 900px) {
  .skin-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6) var(--space-4);
  }
}

.skin {
  display: flex;
  flex-direction: column;
  container-type: inline-size;
}

/* Each skin sits in a thin iPad-style frame */
.skin-shot {
  position: relative;
  display: block;
  padding: 3%;
  background: #000;
  border: 1px solid #2e2e2e;
  border-radius: 7.5%/5.2%;
  box-shadow: 0 30px 60px -32px rgba(0, 0, 0, 0.9);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.skin-shot img {
  width: 100%;
  aspect-ratio: 1067 / 1536;
  object-fit: cover;
  border-radius: 4.6%/3.2%;
  background: var(--surface);
}

.skin-hint {
  position: absolute;
  left: 50%;
  bottom: 7%;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  font: 700 12px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.2s;
  pointer-events: none;
}

@media (hover: hover) {
  .skin-shot:hover {
    border-color: #5c5c5c;
    transform: translateY(-4px);
  }

  .skin-shot:hover .skin-hint {
    opacity: 1;
  }
}

.skin-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-top: var(--space-3);
}

.skin-name {
  font: 400 var(--step-h3)/1.1 var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.skin-meta {
  margin-top: 6px;
  font: 400 12px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.skin-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

/* Side by side once the card is wide enough for both labels */
@container (min-width: 300px) {
  .skin-actions {
    flex-direction: row;
  }

  .skin-actions .btn {
    flex: 1;
  }
}

/* ---------- Install ---------- */

.install {
  margin-top: var(--space-section);
  padding-block: var(--space-section);
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.install-grid {
  display: grid;
  gap: var(--space-5);
  max-width: 1000px;
  margin-inline: auto;
}

@media (min-width: 900px) {
  .install-grid {
    grid-template-columns: 1.35fr 1fr;
    gap: var(--space-6);
    align-items: start;
  }
}

.steps {
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: baseline;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  font-size: 18px;
}

.steps li:last-child {
  border-bottom: 1px solid var(--line);
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font: 400 28px/1 var(--font-display);
  color: var(--muted);
}

.note {
  padding: var(--space-4);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-soft);
}

.note-title {
  margin-bottom: var(--space-2);
  font: 700 var(--step-label)/1.2 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.note p + p {
  margin-top: 12px;
}

/* ---------- More from stvdwell ---------- */

.more {
  padding-block: var(--space-section);
}

.more-grid {
  display: grid;
  gap: var(--space-3);
  max-width: 1000px;
  margin-inline: auto;
}

@media (min-width: 900px) {
  .more-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Both panels end with their button on the same baseline */
.panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: clamp(24px, 3.5vw, 40px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-soft);
}

.panel-title {
  margin-top: 12px;
  font: 400 clamp(36px, 4.5vw, 52px)/1 var(--font-display);
  text-transform: uppercase;
  color: var(--text);
}

.panel-lede {
  margin-top: var(--space-2);
  font-size: 19px;
  line-height: 1.45;
  color: var(--text);
}

.panel-lede + p {
  margin-top: 12px;
}

.panel-body {
  flex: 1;
}

.panel-cta {
  align-self: flex-start;
}

.spotify {
  margin-top: var(--space-3);
  overflow: hidden;
  border-radius: 12px;
  background: #282828;
}

.spotify iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
}

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

.site-footer {
  padding-block: var(--space-6) var(--space-4);
  border-top: 1px solid var(--line);
  text-align: center;
}

.share {
  font-size: clamp(18px, 2vw, 21px);
  color: var(--text);
  text-wrap: balance;
}

.fineprint {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-6);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font: 400 12px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
}

.footer-links a {
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

@media (max-width: 599px) {
  .footer-bar {
    flex-direction: column-reverse;
    justify-content: center;
  }

  .footer-links {
    justify-content: center;
  }
}

/* ---------- Preview ---------- */

.viewer {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 16px;
  border: 0;
  background: transparent;
  color: var(--text);
}

.viewer[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer::backdrop {
  background: rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

@media (prefers-reduced-motion: no-preference) {
  .viewer[open] {
    animation: viewer-in 0.2s ease-out;
  }
}

@keyframes viewer-in {
  from {
    opacity: 0;
  }
}

.viewer-figure {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  /* As wide as the screenshot can be while the caption still fits below it */
  width: min(100%, calc((100dvh - 140px) * 1640 / 2360));
}

.viewer-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1640 / 2360;
  padding: 2.5%;
  background: #000;
  border: 1px solid #2e2e2e;
  border-radius: 6.5%/4.5%;
  object-fit: contain;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.viewer-title {
  margin-top: 4px;
  font: 400 clamp(22px, 3vw, 30px)/1.1 var(--font-display);
  text-transform: uppercase;
}

.viewer-close {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: border-color 0.2s;
}

.viewer-close::before,
.viewer-close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  margin: -1px 0 0 -9px;
  background: #fff;
  transform: rotate(45deg);
}

.viewer-close::after {
  transform: rotate(-45deg);
}

.viewer-close:hover {
  border-color: #fff;
}

/* ==========================================================================
   LoFlow (/loflow/)
   ========================================================================== */

/* ---------- Intro: copy beside the plugin window ---------- */

.plugin-hero {
  display: grid;
  gap: var(--space-5);
  align-items: center;
  padding-top: clamp(48px, 8vw, 104px);
  padding-bottom: clamp(56px, 8vw, 96px);
}

@media (min-width: 900px) {
  .plugin-hero {
    grid-template-columns: 1.15fr 0.85fr;
    gap: var(--space-6);
  }
}

.plugin-hero .display {
  margin-top: var(--space-2);
}

.plugin-tagline {
  max-width: 22em;
  margin-top: var(--space-4);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.35;
  text-wrap: balance;
}

.plugin-lede {
  max-width: 30em;
  margin-top: var(--space-2);
  color: var(--text-soft);
  text-wrap: pretty;
}

.plugin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-4);
}

.plugin-meta {
  margin-top: var(--space-3);
  font: 400 12px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.plugin-window {
  justify-self: center;
  width: min(100%, 430px);
  overflow: hidden;
  background: #1e1f22;
  border: 1px solid #333;
  border-radius: 10px;
  box-shadow: 0 40px 80px -36px rgba(0, 0, 0, 0.95);
}

.plugin-window img {
  width: 100%;
}

/* PumpFlow's window is wide: give it the bigger column */
@media (min-width: 900px) {
  .plugin-hero--wide {
    grid-template-columns: 0.85fr 1.15fr;
  }
}

.plugin-window--wide {
  width: min(100%, 600px);
}

/* ---------- Features ---------- */

.feature-grid {
  display: grid;
  gap: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

@media (min-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
  }
}

.feature-title {
  font: 400 var(--step-h3)/1.1 var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.feature-grid p {
  margin-top: var(--space-1);
  color: var(--text-soft);
}

/* ---------- Demo ---------- */

.demo {
  padding-block: var(--space-section);
}

.demo-figure {
  max-width: 1000px;
  margin-inline: auto;
}

.demo-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid #333;
  border-radius: 10px;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.95);
}

.demo-caption {
  margin-top: var(--space-2);
  font: 400 12px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
}

/* ---------- Specs ---------- */

.specs-section {
  padding-block: var(--space-section);
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.specs-grid {
  display: grid;
  gap: var(--space-5);
  max-width: 1000px;
  margin-inline: auto;
}

@media (min-width: 900px) {
  .specs-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

.spec-title {
  margin-bottom: var(--space-2);
  font: 700 var(--step-label)/1.2 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.spec-list {
  margin: 0;
}

.spec-list div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.spec-list div:last-child {
  border-bottom: 1px solid var(--line);
}

.spec-list dt {
  font: 400 var(--step-label)/1.6 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.spec-list dd {
  margin: 0;
  text-align: right;
}

/* ---------- Download & install ---------- */

/* On this page the install band follows the grey specs band directly */
.specs-section + .install {
  margin-top: 0;
  background: var(--bg);
  border-top: 0;
}

.steps code,
.trouble code {
  padding: 2px 6px;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 400 0.82em/1.5 var(--font-mono);
  overflow-wrap: anywhere;
}

.paths {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.paths span {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.paths b {
  min-width: 72px;
  font: 700 12px/1.6 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.download-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-soft);
}

.download-card-title {
  margin: 10px 0 12px;
  font: 400 clamp(36px, 4.5vw, 52px)/1 var(--font-display);
  text-transform: uppercase;
  color: var(--text);
}

.download-card-actions {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-3);
}

.download-card-fine {
  margin-top: var(--space-2);
  font-size: 14px;
  color: var(--muted);
}

.trouble {
  max-width: 1000px;
  margin: var(--space-5) auto 0;
  background: var(--surface);
}

.trouble ul {
  display: grid;
  gap: 10px;
  padding-left: 1.1em;
  list-style: disc;
}

.trouble li::marker {
  color: var(--muted);
}

/* ==========================================================================
   KeyFlow (/keyflow/)
   Shares the LoFlow page's intro, features, specs and install sections.
   ========================================================================== */

/* ---------- How it works: the ways to play beside the black keys ---------- */

.how {
  padding-block: var(--space-section);
}

.how-grid {
  display: grid;
  gap: var(--space-5);
  align-items: center;
  max-width: 1000px;
  margin-inline: auto;
}

@media (min-width: 900px) {
  .how-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

.how-list li + li {
  margin-top: var(--space-4);
}

.how-list p {
  margin-top: var(--space-1);
  color: var(--text-soft);
}

.how-figure .plugin-window {
  width: 100%;
}

/* ---------- Motion preferences ---------- */

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