@font-face {
  font-family: Urbanist;
  src: url('./fonts/Urbanist-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Urbanist;
  src: url('./fonts/Urbanist-SemiBold.ttf') format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Urbanist;
  src: url('./fonts/Urbanist-Bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans SC';
  src: url('./fonts/NotoSansSC-Regular.otf') format('opentype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans JP';
  src: url('./fonts/NotoSansJP-Regular.otf') format('opentype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans KR';
  src: url('./fonts/NotoSansKR-Regular.otf') format('opentype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Departure Mono';
  src: url('./fonts/DepartureMono-Regular.otf') format('opentype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* MASS Foundation Light: semantic values from supplement-tokens.md. */
:root {
  color-scheme: light;
  --surface-base: #ffffff;
  --surface-raised: #eceff2;
  --surface-accent: #c1ff56;
  --text-primary: #141619;
  --text-secondary: #2c3135;
  --text-muted: #4d535a;
  --border-subtle: #ccd2d7;
  --border-strong: #141619;
  --focus-ring: #6e3cef;
  --warning-surface: #fff4ef;
  --warning-text: #7d3a07;
  --warning-border: #d96500;
  --error-surface: #ffe9e6;
  --error-text: #970810;
  --error-border: #c12d2a;
  --success-text: #095e49;
  --success-surface: #eaf7f2;
  font-family: Urbanist, sans-serif;
  font-synthesis: none;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--surface-raised);
}

html[lang='zh-CN'] {
  font-family: Urbanist, 'Noto Sans SC', sans-serif;
}

html[lang='ja'] {
  font-family: Urbanist, 'Noto Sans JP', sans-serif;
}

html[lang='ko'] {
  font-family: Urbanist, 'Noto Sans KR', sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 26px; }
[hidden] { display: none !important; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

.page {
  width: min(1120px, calc(100% - 96px));
  margin: 0 auto;
}

/* Departure Mono strict 11px integer multiples per MASS VIS */
.mono {
  font-family: 'Departure Mono', monospace;
  font-size: 11px;
  line-height: 16px;
  font-weight: 400;
  letter-spacing: 0;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 24px;
}

.product-name {
  font-family: Urbanist, sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 30px;
  letter-spacing: -0.2px;
}

.masthead-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.platform-summary {
  color: var(--text-secondary);
}

.channel-badge {
  font-size: 12px;
  line-height: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}

.channel-badge[data-channel='internal-test'] {
  color: var(--warning-text);
  border-color: var(--warning-border);
  background: var(--warning-surface);
}

/* 4-language switcher */
.lang-switcher {
  position: relative;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-primary);
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.lang-trigger:hover {
  background: rgb(20 22 25 / 4%);
}

.lang-trigger:active {
  background: rgb(20 22 25 / 8%);
}

.lang-chevron {
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.lang-trigger[aria-expanded='true'] .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 156px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgb(20 22 25 / 8%);
}

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
}

.lang-option:hover {
  background: rgb(20 22 25 / 4%);
  color: var(--text-primary);
}

.lang-option:active {
  background: rgb(20 22 25 / 8%);
}

.lang-option .lang-check {
  visibility: hidden;
  color: var(--text-primary);
}

.lang-option[aria-selected='true'] {
  color: var(--text-primary);
  background: var(--surface-raised);
}

.lang-option[aria-selected='true'] .lang-check {
  visibility: visible;
}

main {
  padding-top: 56px;
}

/* Centered clean hero without explanatory text clutter */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.accent-marker {
  display: block;
  width: 24px;
  height: 6px;
  background: var(--surface-accent);
}

h1 {
  font-family: Urbanist, sans-serif;
  font-size: 60px;
  line-height: 64px;
  font-weight: 700;
  letter-spacing: -1.5px;
  margin: 0;
}

.lead {
  font-size: 20px;
  line-height: 30px;
  color: var(--text-secondary);
  margin: 16px 0 0;
}

/* Adaptive platform grid: 1 centered card today, 2 or 3 cards side-by-side when macOS/Linux ship */
.platforms-section {
  display: flex;
  justify-content: center;
}

.platform-grid {
  width: 100%;
  display: grid;
  gap: 24px;
  align-items: start;
}

.platform-grid[data-platform-count='1'] {
  max-width: 520px;
  grid-template-columns: minmax(0, 1fr);
}

.platform-grid[data-platform-count='2'] {
  max-width: 920px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.platform-grid[data-platform-count='3'] {
  max-width: 1120px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.download-panel {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 32px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.platform-grid:not([data-platform-count='1']) .download-panel[data-recommended='true'] {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px var(--border-strong);
}

/* Prominent OS & architecture header */
.platform-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.platform-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.os-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.platform-name {
  font-family: Urbanist, sans-serif;
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin: 0;
}

.platform-req {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.platform-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.arch-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--text-primary);
  color: var(--surface-base);
  white-space: nowrap;
}

.recommended-tag {
  font-size: 12px;
  line-height: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--success-surface);
  color: var(--success-text);
  white-space: nowrap;
}

/* Version & release facts */
.release-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px 0;
}

.version {
  font-size: 33px;
  line-height: 44px;
  margin: 0;
  overflow-wrap: anywhere;
}

.release-facts {
  margin: 0;
  min-width: 184px;
}

.release-facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  line-height: 22px;
}

.release-facts div + div {
  margin-top: 4px;
}

.release-facts dt {
  color: var(--text-muted);
}

.release-facts dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

/* Single primary download button per platform card */
.download-button {
  width: 100%;
  min-height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border: 0;
  border-radius: 4px;
  color: var(--text-primary);
  background: var(--surface-accent);
  cursor: pointer;
  text-align: left;
}

.download-button-text {
  font-size: 16px;
  line-height: 24px;
}

html[lang='en'] .download-button-text {
  font-weight: 600;
}

.download-button svg {
  flex: 0 0 22px;
}

.download-button:hover:enabled {
  background: #ace645;
}

.download-button:active:enabled {
  background: #94c835;
}

.download-button:disabled {
  background: var(--surface-raised);
  color: #9ea5ad;
  cursor: wait;
}

.download-panel[data-phase='error'] .download-button:disabled {
  cursor: not-allowed;
}

/* Minimal inline text link for offline / alternate architecture package */
.offline-fallback {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 20px;
  color: var(--text-muted);
  text-align: center;
}

.text-link {
  display: inline;
  padding: 0;
  margin-left: 4px;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 20px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.text-link:hover:enabled {
  color: var(--text-primary);
}

.text-link:disabled {
  color: #9ea5ad;
  cursor: wait;
}

/* Status area: hidden when ready; visible only during load, handoff, or actionable error */
.status-area {
  margin-top: 16px;
}

.status {
  font-size: 12px;
  line-height: 18px;
  margin: 0;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.download-panel[data-phase='error'] .status {
  padding: 12px;
  background: var(--error-surface);
  border-left: 2px solid var(--error-border);
  color: var(--error-text);
}

.download-panel[data-phase='downloaded'] .status {
  color: var(--success-text);
  text-align: center;
}

.retry-button {
  min-height: 40px;
  margin-top: 12px;
  padding: 8px 16px;
  font-size: 14px;
  line-height: 22px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
}

.retry-button:hover:enabled {
  background: rgb(20 22 25 / 4%);
}

.retry-button:active:enabled {
  background: rgb(20 22 25 / 8%);
}

/* Checksum verification collapsible */
.checksum {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 18px;
}

.checksum summary {
  cursor: pointer;
  min-height: 28px;
  user-select: none;
}

.checksum p {
  margin: 8px 0 6px;
}

.checksum code {
  display: block;
  font-family: 'Departure Mono', monospace;
  font-size: 11px;
  line-height: 16px;
  overflow-wrap: anywhere;
  user-select: all;
  color: var(--text-secondary);
}

.offline-checksum {
  margin-top: 12px;
}

.script-notice {
  color: var(--error-text);
  font-size: 14px;
  line-height: 22px;
  margin: 16px 0 0;
}

/* 3-step getting started */
.getting-started {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}

.steps-heading {
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  margin: 0;
}

html[lang='en'] .steps-heading,
html[lang='en'] .steps h3 {
  font-weight: 600;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 16px;
}

.step-number {
  color: var(--text-muted);
  padding-top: 5px;
}

.steps h3 {
  margin: 0;
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
}

.steps p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--text-muted);
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  margin-top: 64px;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .page { width: min(680px, calc(100% - 48px)); }
  .platform-grid[data-platform-count='2'],
  .platform-grid[data-platform-count='3'] {
    max-width: 520px;
    grid-template-columns: minmax(0, 1fr);
  }
  .steps { gap: 24px; }
}

@media (max-width: 560px) {
  .page { width: calc(100% - 32px); }
  .masthead { min-height: 80px; gap: 12px; }
  .product-name { font-size: 20px; line-height: 26px; }
  .platform-summary { display: none; }
  main { padding-top: 36px; }
  .hero { margin-bottom: 32px; }
  h1 { font-size: 48px; line-height: 52px; letter-spacing: -1px; }
  .lead { font-size: 18px; line-height: 28px; }
  .download-panel { padding: 24px; }
  .platform-header { flex-direction: column; gap: 12px; }
  .platform-badges { justify-content: flex-start; }
  .release-summary { flex-direction: column; align-items: flex-start; gap: 12px; }
  .release-facts { width: 100%; }
  .download-button { padding: 16px; }
  .getting-started { margin-top: 56px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  footer { align-items: flex-start; flex-direction: column; gap: 8px; margin-top: 48px; }
}
