/* ============ Fonts ============ */
@font-face {
  font-family: "Inter Display";
  src: url("../fonts/InterDisplay-ExtraLight-subset.woff2") format("woff2");
  font-weight: 200;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("../fonts/InterDisplay-Light-subset.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("../fonts/InterDisplay-Regular-subset.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("../fonts/InterDisplay-Medium-subset.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ============ Tokens ============ */
:root {
  --c-orange: #ff5400;
  --c-cyan: #00ccff;
  --c-purple: #31006f;
  --c-heading: #333333;
  --c-muted: #808080;
  --c-dark-text: #cccccc;
  --c-card-light: #f2f2f2;
  --radius: 24px;
  --gap: 32px;
  --pad-card: 32px;
  --fs-h: clamp(34px, 3.5vw, 56px);
  --fs-card-title: clamp(20px, 1.6vw, 24px);
  --fs-body: clamp(17px, 1.3vw, 20px);
  --fs-spec: 14px;
  --container: 1312px;
}

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

body {
  margin: 0;
  font-family: "Inter Display", "Inter", system-ui, sans-serif;
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--c-heading);
  background: #ffffff;
}

img { max-width: 100%; }

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: 24px;
}

h2 {
  font-size: var(--fs-h);
  font-weight: 500;
  line-height: 1.2;
  color: var(--c-heading);
}

.section-title span {
  font-weight: 300;
  color: var(--c-muted);
}

/* ============ Photo sections (hero, break, footer) ============ */
.photo-section {
  position: relative;
  background: #000;
  overflow: hidden;
}

.photo-wrap {
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
}

.photo-wrap img {
  display: block;
  width: 100%;
}

/* side fade into black, like the design */
.photo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #000 0%, transparent 15%, transparent 85%, #000 100%);
  pointer-events: none;
}

.photo-title {
  position: absolute;
  top: 14%;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: var(--fs-h);
  font-weight: 300;
  line-height: 1.2;
  padding-inline: 24px;
  color: #ffffff;
}

.photo-title strong {
  font-weight: 500;
  color: var(--c-orange);
}

.outro .photo-title { color: #ffffff; }

.photo-caption {
  position: absolute;
  bottom: 6%;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: clamp(15px, 1.05vw, 20px);
  font-weight: 500;
  color: #ffffff;
  padding-inline: 24px;
}

/* ============ Intro ============ */
.intro {
  padding: clamp(48px, 5vw, 72px) 0 0;
  text-align: center;
}

.intro-text {
  max-width: 1240px;
  margin: clamp(24px, 2.5vw, 40px) auto 0;
  color: var(--c-muted);
}

.doodle {
  display: block;
  margin: clamp(20px, 2vw, 32px) auto 0;
  width: clamp(90px, 6.5vw, 120px);
  height: auto;
}

/* ============ Bento grid ============ */
.hard { padding-top: clamp(48px, 5vw, 88px); }

.hard .section-title,
.soft .section-title,
.dreamz .section-title {
  margin-bottom: clamp(24px, 2.2vw, 40px);
}

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--gap);
}

.span-3 { grid-column: span 3; }
.span-2 { grid-column: span 2; }
.span-1 { grid-column: span 1; }

/* ============ Cards ============ */
.card { border-radius: var(--radius); min-width: 0; }

.card-dark {
  background: #000;
  color: var(--c-dark-text);
  padding: var(--pad-card);
}

.card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.card-title-row h3 {
  font-size: var(--fs-card-title);
  font-weight: 500;
  color: #ffffff;
}

.price {
  font-size: var(--fs-card-title);
  font-weight: 500;
  color: var(--c-muted);
  white-space: nowrap;
}

.specs {
  margin-top: 16px;
  font-size: var(--fs-spec);
  font-weight: 500;
  line-height: 1.8;
  color: var(--c-muted);
}

.specs p + p { margin-top: 10px; }

.spec-label { color: var(--c-dark-text); }
.spec-label + p { margin-top: 0; }

.card-body {
  color: var(--c-dark-text);
  margin-top: 20px;
}

/* big & mid cards: illustration on the left, title/specs on the right */
.card-big, .card-mid {
  display: grid;
  grid-template-columns: 160px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: var(--gap);
}

.card-thumb {
  grid-row: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.card-thumb img { width: 100%; height: auto; max-width: 164px; }
.card-mid .card-thumb img { max-width: 110px; }

.card-head { grid-row: 1; }

.card-big .card-body,
.card-mid .card-body {
  grid-column: 1 / -1;
  align-self: end;
}

.card-mid { grid-template-columns: 150px 1fr; column-gap: 26px; }

/* small text-only cards */
.card-small .specs { margin-top: 12px; }

/* on wide screens keep titles and short specs on one line, as in the design */
@media (min-width: 1101px) {
  .card-title-row h3 { white-space: nowrap; }
  .card-small .specs p, .card-mid .specs p { white-space: nowrap; }
}
.card-small .card-body { margin-top: 24px; }

/* photo cards (keycaps / knobs) */
.card-photo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 248px;
  overflow: hidden;
}

.card-photo .fill-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px 24px 56px;
}

.card-photo .card-title-row { position: relative; }

/* ============ Total ============ */
.total {
  padding-top: clamp(48px, 5vw, 88px);
  text-align: center;
}

/* ============ Soft / Dreamz ============ */
.soft, .dreamz { padding-top: clamp(48px, 5vw, 88px); }
.dreamz { padding-bottom: clamp(56px, 6vw, 100px); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: start;
}

.card-light {
  background: var(--c-card-light);
  padding: var(--pad-card);
}

.card-light h3 {
  font-size: var(--fs-card-title);
  font-weight: 500;
  color: var(--c-heading);
}

.card-light p, .card-light ul {
  margin-top: 16px;
  color: var(--c-muted);
}

.card-light p + p { margin-top: 8px; }

.card-light strong { font-weight: 500; color: #000; }

.card-light ul {
  list-style: none;
  padding-left: 0;
}

.card-light li { padding-left: 18px; position: relative; }

.card-light li::before {
  content: "•";
  position: absolute;
  left: 4px;
}

/* ============ Codec ============ */
.codec {
  margin-top: clamp(56px, 6vw, 100px);
  background: var(--c-purple) url("../images/codec-bg.jpg") center / cover no-repeat;
  color: #fff;
  text-align: center;
  padding: clamp(56px, 6vw, 100px) 0 clamp(48px, 5vw, 80px);
}

.codec h2 {
  color: #fff;
  font-weight: 300;
  letter-spacing: -1px;
}

.codec h2 strong { font-weight: 500; }

.codec-text {
  max-width: 1312px;
  margin: clamp(28px, 3vw, 48px) auto 0;
  line-height: 1.8;
}

.codec-text a {
    color: inherit;
    font-weight: 600;
}

.players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-top: clamp(32px, 3.5vw, 56px);
  text-align: left;
}

.player {
  background: #000;
  border-radius: var(--radius);
  padding: var(--pad-card);
  display: flex;
  align-items: center;
  gap: var(--gap);
}

.play-btn {
  flex: none;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.play-btn svg {
  width: 26px;
  height: 26px;
  fill: #000;
}

.play-btn .icon-play { margin-left: 4px; }
.play-btn .icon-pause { display: none; }

.player.playing .icon-play { display: none; }
.player.playing .icon-pause { display: block; }
.player.playing .track-knob { transition: transform 0.5s linear; }

.player-body { flex: 1; min-width: 0; }

.player-label {
  font-size: clamp(16px, 1.05vw, 20px);
  color: #cccccc;
}

.size-orange { color: var(--c-orange); font-weight: 500; }
.size-cyan { color: var(--c-cyan); font-weight: 500; }

.track {
  position: relative;
  height: 17px;
  margin-top: 12px;
  cursor: pointer;
}

.track-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #f9f9f9;
}

.track-knob {
  position: absolute;
  top: 0;
  left: 0;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #f9f9f9;
}

.codec-github {
  margin-top: clamp(40px, 4vw, 64px);
  text-align: right;
}

.codec-github img { display: inline-block; width: clamp(140px, 9.5vw, 177px); height: auto; }

/* ============ Why ============ */
.why { padding: clamp(56px, 6vw, 100px) 0 clamp(56px, 6vw, 100px); }

.why p {
  margin-top: clamp(24px, 2.5vw, 40px);
  color: var(--c-muted);
}

.why ul {
  list-style: none;
  padding-left: 0;
  margin-top: 8px;
  color: var(--c-muted);
}

.why li {
  padding-left: 22px;
  position: relative;
  margin-top: 8px;
}

.why li::before {
  content: "•";
  position: absolute;
  left: 6px;
}

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .span-3 { grid-column: span 6; }
  .span-2 { grid-column: span 3; }
  .span-1 { grid-column: span 2; }
  :root { --gap: 24px; --pad-card: 24px; }
}

@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  .players { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 6; }
  .span-1 { grid-column: span 3; }

  .card-big, .card-mid { grid-template-columns: 1fr; }
  .card-thumb { justify-content: flex-start; margin-bottom: 20px; }
  .card-head { grid-row: auto; }

  .photo-section { display: flex; flex-direction: column; }
  .photo-title { position: static; order: -1; padding-top: 32px; padding-bottom: 20px; }
  .photo-caption { position: static; padding: 22px 24px 22px; }

  .codec-github { text-align: center; }
}

@media (max-width: 480px) {
  .span-1 { grid-column: span 6; }
  .card-photo { min-height: 220px; }
}
