/* Supermimio Inc. Fonts are self-hosted (SIL OFL 1.1, licences in /fonts). */

@font-face {
  font-family: "Fraunces Soft";
  src: url("/fonts/fraunces-soft.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* Studio colours */
  --marigold: #ffbf2e;
  --ink: #1a1444;
  --tomato: #c8321a;
  --paper: #fff6e3;

  /* GrooveDojo's own colours */
  --gd-bg: #0e1012;
  --gd-surface: #14171a;
  --gd-line: #2a3037;
  --gd-fg: #e8eaed;
  --gd-muted: #a7aeb7;
  --gd-early: #6ba6f2;
  --gd-late: #ee8751;

  /* Rhythm Farm's night, sampled from the bottom edge of its cover art */
  --night: #2d2d54;
  --mint: #8df5c8;

  --display: "Fraunces Soft", "Cooper Black", Georgia, serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --section: clamp(3.5rem, 8vw, 7rem);
  --focus: var(--ink);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.16em; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.015em;
}

.wrap {
  width: min(100%, 84rem);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nowrap { white-space: nowrap; }

.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0.5rem;
}
.skip:focus { top: 1rem; }

/* ---------- Wordmark ---------- */

.wordmark {
  --dot: var(--tomato);
  width: auto;
  height: 2.25rem;
  aspect-ratio: 10679 / 1892;
  color: currentColor;
  fill: currentColor;
}

/* ---------- Hero ---------- */

.site-bar,
.hero-block { background: var(--marigold); }

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.25rem;
}

.brand { display: block; border-radius: 4px; }

.site-header ul { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.site-header nav a {
  display: inline-block;
  padding-block: 0.4rem;
  font-weight: 600;
  text-decoration: none;
}
.site-header nav a:hover { text-decoration: underline; text-decoration-thickness: 0.14em; }

.hero { padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(2.5rem, 5vw, 3.5rem); }

.eyebrow {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.eyebrow .sep { margin-inline: 0.3em; color: var(--tomato); font-weight: 700; }

h1 {
  margin-block: 0.25em 0.32em;
  max-width: 11em;
  font-size: clamp(3.5rem, min(10.8vw, 17.5vh), 11rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.025em;
}

.lede {
  max-width: 44em;
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
  line-height: 1.4;
}

/* ---------- The groove ---------- */

.groove:empty { display: none; }

.groove {
  margin-top: clamp(1.75rem, 3vw, 2.25rem);
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
}

.groove-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.groove-play {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: 2.75rem;
  padding: 0.35rem 1.15rem 0.35rem 0.95rem;
  border: 0;
  border-radius: 99px;
  background: var(--ink);
  color: var(--paper);
  font: 600 1rem/1 var(--body);
  cursor: pointer;
}
.groove-play:hover { background: #2c2470; }
.groove-play svg { width: 0.9em; height: 0.9em; fill: currentColor; }

.groove-hint { font-size: 0.95rem; }

.groove-grid {
  display: grid;
  /* A label, then four beats of four steps with a small spacer between beats, so the bar reads in fours. */
  grid-template-columns:
    3.5rem
    repeat(4, minmax(0, 1fr)) 0.4rem
    repeat(4, minmax(0, 1fr)) 0.4rem
    repeat(4, minmax(0, 1fr)) 0.4rem
    repeat(4, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 0.25rem;
  align-items: center;
}

.groove-label {
  grid-column: 1;
  grid-row: var(--row);
  font-size: 0.85rem;
  font-weight: 600;
}

.groove-beat {
  grid-column: var(--col);
  grid-row: 1;
  padding-left: 0.2rem;
  font: 700 0.85rem/1.2 var(--body);
  font-variant-numeric: tabular-nums;
}

.step {
  grid-column: var(--col);
  grid-row: var(--row);
  position: relative;
  height: clamp(2.25rem, 2.8vw, 2.5rem);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 0.5rem;
}

/* An unlit step is a small dot; a lit step is a full pad. The shape says it as well as the colour. */
.step::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.6;
  transform: translate(-50%, -50%);
}

.step:hover::before { opacity: 1; }

.step[aria-pressed="true"]::before {
  inset: 0.1rem;
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  opacity: 1;
  transform: none;
  background: var(--pad);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.step[data-voice="hat"] { --pad: var(--paper); }
.step[data-voice="snare"] { --pad: var(--tomato); }
.step[data-voice="kick"] { --pad: var(--ink); }

/* The playhead: a soft band down the current column. */
.step.now { background: rgb(26 20 68 / 0.18); }

@media (max-width: 44rem) {
  /* Two lines of eight steps, so each pad is big enough for a thumb. */
  .groove-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  .groove-label { display: none; }
  .groove-beat { grid-row: var(--m-row); grid-column: var(--m-col); }
  .step { grid-row: var(--m-row); grid-column: var(--m-col); height: 2.5rem; }
  .groove-beat[data-second-line] { margin-top: 0.75rem; }
}

/* ---------- Project intro ---------- */

.projects-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1rem 3rem;
  align-items: end;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.projects-intro h2,
.about h2 { font-size: clamp(2.75rem, 7vw, 5.5rem); }

.projects-intro p {
  max-width: 28em;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  line-height: 1.4;
}

/* ---------- Project blocks, shared ---------- */

.side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.side-label { font-weight: 600; }

.status {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border-radius: 99px;
  font-weight: 600;
}

.project h3 { font-size: clamp(2.75rem, 6vw, 5rem); }

.tagline {
  margin-block: 0.55em 0.9em;
  font-family: var(--display);
  font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
}

.project p + p { margin-top: 0.9em; }
.project .tagline + p { margin-top: 0; }

.button {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15em 0.5em;
  margin-top: 1.75rem;
  padding: 0.8rem 1.4rem;
  border-radius: 99px;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.25;
  text-decoration: none;
}
.button-url { font-weight: 500; }
.arrow { transition: transform 0.15s ease-out; }
.button:hover { text-decoration: none; }
.button:hover .arrow { transform: translateX(0.2em); }
@media (prefers-reduced-motion: reduce) { .arrow { transition: none; } }

/* ---------- GrooveDojo ---------- */

.gd {
  --focus: var(--gd-fg);
  background: var(--gd-bg);
  color: var(--gd-fg);
  padding-block: var(--section);
}

/* The copy with the wide screen under it, beside the tall screen. */
.gd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "copy improve"
    "focus improve";
  grid-template-rows: auto 1fr;
  gap: 2.5rem clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}

.gd-copy { grid-area: copy; }
.shot-improve { grid-area: improve; }
.shot-focus { grid-area: focus; }

.gd h3 { font-family: var(--body); font-weight: 700; letter-spacing: -0.03em; }

.gd-name { display: flex; align-items: center; gap: 0.25em; }
.gd-mark { width: 0.85em; height: 0.85em; flex: none; }

.gd .side-label { color: var(--gd-muted); }
.status-live { background: var(--gd-fg); color: var(--gd-bg); }

.gd .tagline { font-family: var(--body); font-weight: 600; letter-spacing: -0.015em; }

.early { color: var(--gd-early); font-weight: 600; }
.late { color: var(--gd-late); font-weight: 600; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 1.25rem;
  color: var(--gd-muted);
  font-size: 0.95rem;
}
.facts li { display: flex; align-items: center; gap: 0.5em; }
.facts li::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--gd-late);
}
.facts li:nth-child(even)::before { background: var(--gd-early); }

.button-gd { background: var(--gd-fg); color: var(--gd-bg); }
.button-gd:hover { background: #fff; }

.shot img {
  width: 100%;
  border: 1px solid var(--gd-line);
  border-radius: 0.875rem;
  background: var(--gd-surface);
}

.shot figcaption {
  margin-top: 0.75rem;
  color: var(--gd-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

/* ---------- Rhythm Farm ---------- */

.rf {
  --focus: var(--paper);
  background: var(--night);
  color: var(--paper);
  padding-bottom: var(--section);
}

.rf-cover { width: 100%; }

.rf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

.status-dev { background: var(--mint); color: var(--night); }

.rf-note {
  padding-left: 0.9rem;
  border-left: 3px solid var(--mint);
  font-size: 0.95rem;
}

.button-rf { background: var(--mint); color: var(--night); }
.button-rf:hover { background: #b1fadb; }

.rf-shot img {
  width: 100%;
  border-radius: 0.875rem;
  box-shadow: 0 1.25rem 3rem rgb(0 0 0 / 0.35);
}

.rf-shot figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

/* ---------- About ---------- */

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

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  gap: 2.5rem 3rem;
}

.about-copy { grid-column: 2; max-width: 44rem; }

.about-lead {
  margin-bottom: 0.75em;
  font-family: var(--display);
  font-size: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.about-copy p:last-child { font-size: 1.15rem; }

.company {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.25rem 2rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
}

@media (min-width: 60rem) {
  .company { grid-template-columns: repeat(4, auto); justify-content: space-between; }
}

.company dt { font-size: 0.875rem; font-weight: 600; opacity: 0.8; }
.company dd { font-weight: 600; font-size: 1.1rem; }

/* ---------- Contact ---------- */

.contact {
  --focus: var(--paper);
  background: var(--tomato);
  color: var(--paper);
  padding-block: var(--section);
}

.contact h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); }

.contact p {
  max-width: 34em;
  margin-top: 0.75rem;
  font-size: 1.15rem;
}

.email {
  display: inline-block;
  margin-top: clamp(1.25rem, 3vw, 2rem);
  font-family: var(--display);
  font-size: clamp(1.8rem, 8.6vw, 8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-decoration-thickness: 0.05em;
}
.email:hover { text-decoration-thickness: 0.09em; }

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

.site-footer {
  --focus: var(--paper);
  background: var(--ink);
  color: var(--paper);
  padding-block: 2.5rem;
}

.site-footer .wordmark { --dot: var(--marigold); height: 1.75rem; }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem 3rem;
  align-items: start;
}

.legal { margin-top: 0.5rem; font-weight: 600; }

.site-footer ul { display: grid; gap: 0.25rem; }
.site-footer nav a { display: inline-block; padding-block: 0.1rem; }

.quiet { justify-self: end; max-width: 20em; font-size: 0.95rem; opacity: 0.85; }

/* ---------- Smaller screens ---------- */

@media (max-width: 60rem) {
  .gd-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "improve" "focus";
    grid-template-rows: none;
  }
  .shot-improve { max-width: 34rem; }

  .rf-grid { grid-template-columns: minmax(0, 1fr); }

}

@media (max-width: 44rem) {
  .site-header .wordmark { height: 1.5rem; }
  .site-header ul { gap: 0.85rem; }
  .site-header nav a { font-size: 0.975rem; }

  /* Sized to the screen so "Software made" always fills the line without overflowing it. */
  h1 { font-size: clamp(2.5rem, 14.2vw, 6rem); }

  .projects-intro { grid-template-columns: minmax(0, 1fr); }

  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .about-copy, .company { grid-column: 1; }

  /* Keep the artwork's logo a good size: crop in on the middle instead of shrinking the whole banner. */
  .rf-cover {
    aspect-ratio: 5 / 3;
    object-fit: cover;
    object-position: 52% 50%;
  }

  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .quiet { justify-self: start; }

}

/* ---------- 404 ---------- */

.not-found {
  display: grid;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--marigold);
}
