:root {
  --ink: #11110f;
  --paper: #f6f1e8;
  --muted: #6d665c;
  --line: #d9cfbf;
  --panel: #fffaf1;
  --accent: #c7ff45;
  --accent-2: #ff5a3d;
  --accent-3: #25c7c2;
  --shadow: 0 24px 80px rgba(17, 17, 15, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 17, 15, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(17, 17, 15, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(17, 17, 15, 0.12);
  background: rgba(246, 241, 232, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--accent);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.site-header nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.95rem;
}

.site-header nav a,
.site-footer nav a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-header nav a:hover,
.site-footer nav a:hover {
  border-color: currentColor;
}

main {
  overflow: hidden;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.78fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
  min-height: min(560px, calc(100svh - 88px));
  padding: clamp(24px, 4vw, 48px) clamp(18px, 4vw, 56px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 840px;
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 5.6vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: clamp(1.25rem, 2.3vw, 2rem);
  line-height: 1.08;
}

.lede {
  max-width: 720px;
  color: #3f3a34;
  font-size: clamp(1.05rem, 2vw, 1.34rem);
  line-height: 1.55;
}

.hero-actions,
.tool-actions,
.key-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 11px 18px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover,
.icon-button:hover,
.tap-button:hover {
  transform: translateY(-2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.primary {
  background: var(--accent);
  color: var(--ink);
  font-weight: 900;
}

.secondary {
  background: var(--panel);
}

.full {
  width: 100%;
}

.studio-panel {
  min-height: 360px;
  padding: 28px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 20% 15%, rgba(199, 255, 69, 0.42), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(37, 199, 194, 0.35), transparent 22%),
    #191713;
  color: var(--paper);
  box-shadow: var(--shadow);
}

.meter-topline,
.control-row,
.tool-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.meter-topline {
  margin-bottom: 40px;
  color: rgba(246, 241, 232, 0.72);
}

.meter-topline strong {
  color: var(--accent);
}

.waveform {
  display: flex;
  height: 180px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 0;
}

.waveform span {
  width: 100%;
  height: var(--h);
  min-height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-3));
  animation: wave 1.2s ease-in-out infinite alternate;
  animation-delay: calc(var(--h) * -0.012);
}

.step-row {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 8px;
}

.step-row span {
  aspect-ratio: 1;
  border: 1px solid rgba(246, 241, 232, 0.28);
  background: rgba(246, 241, 232, 0.08);
}

.step-row .active {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.section-shell,
.content-band {
  padding: clamp(48px, 7vw, 96px) clamp(18px, 4vw, 56px);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 28px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tool-card,
.guide-grid article,
.page-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 8px 8px 0 rgba(17, 17, 15, 0.92);
}

.tool-card {
  display: flex;
  min-height: 500px;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.tool-card p {
  color: var(--muted);
  line-height: 1.5;
}

.tool-kicker {
  display: inline-grid;
  min-width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--ink);
  background: var(--accent-3);
  font-weight: 900;
}

.tap-button {
  display: grid;
  width: min(100%, 260px);
  aspect-ratio: 1;
  place-items: center;
  align-self: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
}

.tap-button span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 10vw, 6.8rem);
  line-height: 0.82;
}

.tap-button small {
  margin-top: -28px;
  font-weight: 900;
}

.fine-print,
#tap-count {
  font-size: 0.9rem;
}

.icon-button {
  background: var(--panel);
}

input,
select {
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fffdf8;
  color: var(--ink);
}

input[type="number"] {
  width: 104px;
  padding: 8px 10px;
  text-align: right;
}

select {
  padding: 8px 36px 8px 10px;
}

.range {
  width: 100%;
  accent-color: var(--accent-2);
}

.pulse-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
}

.pulse-dot {
  height: 18px;
  border: 2px solid var(--ink);
  background: #fffdf8;
}

.pulse-dot.active {
  background: var(--accent-2);
}

.key-controls label {
  display: grid;
  flex: 1 1 160px;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.note-output {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note-output span,
.chord-output span {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--accent);
  font-weight: 900;
}

.chord-output {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chord-output span {
  background: #fffdf8;
}

.content-band {
  background: #1b1915;
  color: var(--paper);
}

.content-band .eyebrow {
  color: var(--accent);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.guide-grid article {
  background: #27241e;
  color: var(--paper);
  box-shadow: 8px 8px 0 rgba(199, 255, 69, 0.82);
  padding: 24px;
}

.guide-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.guide-card-link article {
  height: 100%;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.guide-card-link:hover article {
  transform: translateY(-3px);
  box-shadow: 10px 10px 0 rgba(199, 255, 69, 0.92);
}

.guide-grid.light article {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 8px 8px 0 rgba(17, 17, 15, 0.92);
}

.guide-grid.light p {
  color: var(--muted);
}

.guide-grid p {
  color: rgba(246, 241, 232, 0.78);
  line-height: 1.6;
}

.article-list {
  display: grid;
  gap: 20px;
}

.article-list section {
  border-top: 2px solid var(--line);
  padding-top: 20px;
}

.article-list h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.resource-list a {
  min-height: 112px;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--accent-3);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 900;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 2px solid var(--ink);
  background: var(--panel);
}

.site-footer p {
  margin: 6px 0 0;
  color: var(--muted);
}

.deerflow-signature {
  color: rgba(17, 17, 15, 0.56);
  font-size: 0.78rem;
  text-decoration: none;
}

.page-main {
  max-width: 900px;
  min-height: calc(100svh - 210px);
  padding: clamp(48px, 8vw, 96px) clamp(18px, 4vw, 56px);
}

.page-card {
  padding: clamp(24px, 5vw, 52px);
}

.page-card p,
.page-card li {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.page-card ul {
  padding-left: 22px;
}

@keyframes wave {
  from {
    transform: scaleY(0.72);
  }
  to {
    transform: scaleY(1.08);
  }
}

@media (max-width: 980px) {
  .workbench,
  .tool-grid,
  .guide-grid,
  .resource-list {
    grid-template-columns: 1fr;
  }

  .workbench {
    min-height: auto;
  }

  .tool-card {
    min-height: auto;
  }

  .resource-list a {
    min-height: 84px;
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .studio-panel {
    min-height: 340px;
    padding: 20px;
  }

  .waveform {
    height: 160px;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}
