/*
  Shared layout for Max for Live product pages (/software/<slug>/).
  Loaded after ../../styles.css and reuses its tokens and components.
*/

/* Unconfirmed facts. Every .tbd must be gone before a page is published. */
.tbd {
  outline: 1px dashed rgba(74, 222, 128, 0.55);
  outline-offset: 2px;
  border-radius: 2px;
  background: rgba(74, 222, 128, 0.06);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  color: var(--muted-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  list-style: none;
  text-transform: uppercase;
}

.breadcrumb li + li::before {
  margin-right: 10px;
  color: var(--line-strong);
  content: "/";
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--green);
}

/* Hero */

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
  width: min(100%, var(--page));
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--gutter) 0;
}

.product-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.product-hero h1 {
  margin: 0;
  font-size: clamp(44px, 5.6vw, 84px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.92;
}

.product-lede {
  max-width: 26em;
  margin: 0;
  color: #d4d4d8;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5;
  text-wrap: pretty;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag-host {
  border-color: transparent;
  background: var(--panel-2);
  color: var(--text);
}

.download-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.platform-note {
  max-width: 440px;
  margin: 4px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.platform-note strong {
  color: var(--text);
  font-weight: 600;
}

/* The download button is a POST form so the ZIP is only served from the page. */
.download-form {
  display: contents;
}

button.button {
  cursor: pointer;
}

.download-meta {
  margin: 0;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}

/*
  Device stage. By default the device is a narrow portrait panel (AirEffect,
  PhaseRotate): the stage sets its height and the width follows the image.
  Add .is-wide to .device-frame for a wide device (StereoImage).
*/
.device-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
}

.device-frame {
  /* Capped near the screenshot's own pixel height so it is not blown up. */
  --device-height: clamp(280px, 30vw, 360px);
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 48px) 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: var(--bg-alt);
  background-image:
    radial-gradient(circle at 50% 45%, rgba(74, 222, 128, 0.07), transparent 60%),
    repeating-linear-gradient(90deg, var(--panel-2) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(0deg, var(--panel-2) 0 1px, transparent 1px 40px);
}

.device-frame a {
  display: block;
  border-radius: 6px;
}

.device-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  height: var(--device-height);
  border-radius: 6px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 30px 60px -24px rgba(0, 0, 0, 0.95);
}

/* Wide devices (StereoImage): width drives the size instead of height. */
.device-frame.is-wide img {
  width: 100%;
  height: auto;
}

.device-frame.is-wide .device-placeholder {
  width: 100%;
  height: auto;
  aspect-ratio: 2.4 / 1;
}

/* Shown until the real screenshot exists. */
.device-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: var(--device-height);
  aspect-ratio: 211 / 380;
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.device-placeholder strong {
  color: var(--muted);
  font-weight: 500;
}

.device-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* Sections */

.product-section {
  width: min(100%, var(--page));
  margin: 0 auto;
  padding: clamp(80px, 10vw, 128px) var(--gutter) 0;
}

.product-section .section-heading {
  margin-bottom: clamp(28px, 4vw, 44px);
}

.product-section h2 {
  max-width: 14em;
  margin: 0;
  font-size: clamp(32px, 4.2vw, 52px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  text-wrap: balance;
}

/* In use */

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 24px;
  align-items: start;
}

.demo-media {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
}

.demo-media video,
.demo-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
}

.demo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.demo-media figcaption {
  padding: 18px 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.observe {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.observe h3,
.compare h3 {
  margin: 0;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.observe ol {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  counter-reset: observe;
  list-style: none;
}

.observe li {
  position: relative;
  padding-left: 28px;
  color: #d4d4d8;
  font-size: 15px;
  line-height: 1.5;
  counter-increment: observe;
}

.observe li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  line-height: 2;
  content: counter(observe, decimal-leading-zero);
}

/* Level-matched A/B comparison (audio products only). */
.compare {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.compare-row {
  display: grid;
  gap: 6px;
}

.compare-row span {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.compare audio {
  width: 100%;
  height: 36px;
  color-scheme: dark;
}

.compare-note {
  margin: 0;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.5;
}

/* How it works: one card per real UI control. */
.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.control-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.control-name {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.control-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

/* Quick start */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  counter-reset: step;
  list-style: none;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 20px 0 0;
  color: #d4d4d8;
  font-size: 15px;
  line-height: 1.55;
  counter-increment: step;
}

.steps li::before {
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  content: counter(step, decimal-leading-zero);
}

.steps strong {
  color: var(--text);
  font-size: 16px;
}

.usage-note {
  max-width: 44em;
  margin: 28px 0 0;
  padding: 16px 18px;
  border-left: 2px solid var(--green);
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Requirements and release details */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.spec-panel {
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
}

.spec-panel h3 {
  margin: 0 0 18px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.spec-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0 24px;
  margin: 0;
}

.spec-list dt,
.spec-list dd {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.5;
}

.spec-list dt {
  color: var(--muted-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.9;
  text-transform: uppercase;
}

.spec-list dd {
  color: #d4d4d8;
}

.changelog {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.changelog li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.changelog li::before {
  margin-right: 10px;
  color: var(--green);
  content: "+";
}

.text-link {
  color: var(--green);
}

.text-link:hover {
  color: #61e38d;
}

/* Other tools */

.other-tools .tool-grid > li > a.tool-card {
  height: 100%;
}

.other-tools .tool-grid a.tool-card {
  transition: border-color 160ms ease;
}

.other-tools .tool-grid a.tool-card:hover {
  border-color: var(--green);
}

@media (max-width: 900px) {
  .product-hero,
  .demo-grid,
  .spec-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .download-actions,
  .download-actions .button {
    width: 100%;
  }

  .spec-list {
    grid-template-columns: 1fr;
  }

  .spec-list dd {
    padding-top: 0;
    border-top: 0;
  }
}

.spec-panel-single {
  max-width: 760px;
}

/* Button variants used only by product pages (removed from styles.css). */
.button-secondary,
.button-outline {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}

.button-outline {
  border-color: var(--green);
  color: var(--green);
}

.button-secondary:hover,
.button-outline:hover {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}
