@font-face {
  font-family: 'Archivo Black';
  src: url('assets/fonts/ArchivoBlack-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('assets/fonts/DMSans-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('assets/fonts/DMSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fbf8f1;
  --sheet: #fffcf7;
  --studio: #f4e6d7;
  --ink: #221d1a;
  --muted: #625850;
  --red: #ad241b;
  --line: #dbd0c4;
  --type: 'DM Sans', system-ui, sans-serif;
  --display: 'Archivo Black', 'DM Sans', sans-serif;
  --gutter: clamp(16px, 4vw, 64px);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--type); }
a { color: inherit; }
button { color: inherit; font: inherit; cursor: pointer; }
img { display: block; width: 100%; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.wrap {
  width: min(100%, 1440px);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  margin-inline: auto;
}

.preview { background: var(--ink); color: var(--sheet); font-size: .75rem; }
.preview-inner, .header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-inner { min-height: 38px; }
.preview-modes { display: flex; gap: 4px; }
.preview-modes button { min-height: 30px; padding: 2px 10px; border: 0; border-radius: 3px; background: transparent; }
.preview-modes button[aria-pressed='true'] { background: var(--paper); color: var(--ink); }
.preview-modes button:focus-visible { outline-color: var(--sheet); outline-offset: 2px; }

.header { position: sticky; top: 0; z-index: 3; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 60px; }
.wordmark { display: flex; width: clamp(112px, 20vw, 162px); flex: none; align-items: center; min-height: 44px; }
.wordmark img { height: auto; }
.header-side { color: var(--muted); font-size: .875rem; }
.header-side strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.site-nav { display: flex; align-self: stretch; gap: clamp(12px, 3vw, 36px); }
.site-nav a { display: flex; align-items: center; border-bottom: 2px solid transparent; font-size: .875rem; font-weight: 600; text-decoration: none; }
.site-nav a[aria-current='page'] { color: var(--red); border-color: currentColor; }
.site-nav a:hover { color: var(--red); }

h1, .dialog-title { font-family: var(--display); font-weight: 400; letter-spacing: -.056em; }
h1[tabindex='-1']:focus, .dialog-title:focus { outline: none; }
.site-page, .catalog, .product { padding-block: clamp(20px, 3.4vw, 50px) 64px; }
.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.17fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px clamp(16px, 4vw, 58px);
  padding-bottom: clamp(16px, 3vw, 40px);
  border-bottom: 2px solid var(--red);
}
.app-hero h1 { margin: 0; color: var(--red); font-size: clamp(2.5rem, 5.75vw, 5.25rem); line-height: .94; }
.app-hero h1 span { display: block; }
.app-hero-copy p { max-width: 43ch; margin: 12px 0 0; font-size: clamp(1rem, 1.4vw, 1.15rem); }
.hero-open, .secondary-action {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}
.hero-open:hover, .secondary-action:hover { text-decoration: underline; text-underline-offset: 4px; }
.release-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 48%);
  align-items: stretch;
  min-height: clamp(190px, 17vw, 252px);
  background: #f7e6d3;
  text-decoration: none;
}
.release-copy {
  align-self: center;
  padding: clamp(12px, 2vw, 27px) 0 clamp(12px, 2vw, 27px) clamp(12px, 2vw, 27px);
}
.release-label { margin: 0 0 6px; color: var(--red); font-size: .75rem; font-weight: 600; }
.release-copy h2 { margin: 0; font: 400 clamp(1.125rem, 2.55vw, 2.2rem)/1.03 var(--display); letter-spacing: -.045em; }
.release-teaser { margin: 8px 0 0; font-size: .9rem; line-height: 1.35; }
.release-action { display: inline-flex; gap: .45em; margin-top: 10px; color: var(--red); font-size: .8rem; font-weight: 600; }
.release-feature:hover .release-action { text-decoration: underline; text-underline-offset: 3px; }
.release-art { position: relative; overflow: hidden; }
.release-art img {
  position: absolute;
  inset: -17% 0 auto;
  width: 100%;
  height: 124%;
  object-fit: contain;
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 92%, transparent);
}
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block: 8px; }
.section-heading h2 { margin: 0; font: 400 clamp(1.35rem, 2.5vw, 2.1rem)/1.1 var(--display); letter-spacing: -.055em; }

.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  margin-bottom: clamp(10px, 2vw, 24px);
}
.catalog-title { margin: 0; font-size: clamp(2.6rem, 6vw, 5.2rem); line-height: .98; }
.catalog-intro { margin: 12px 0 0; color: var(--muted); }
.catalog-nav { display: flex; flex-wrap: wrap; gap: 2px clamp(12px, 2.1vw, 26px); }
.catalog-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .875rem;
}
.catalog-nav a:hover, .catalog-nav a[aria-current='page'] { color: var(--red); }
.catalog-nav a[aria-current='page'] { border-color: currentColor; }
.lineup { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.5vw, 22px); }
.device-card { min-width: 0; }
.device-image {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: clamp(226px, 23vw, 362px);
  background: var(--studio);
}
.device-image img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  transition: transform 200ms ease;
}
@media (hover: hover) { .device-image:hover img { transform: scale(1.035); } }
.card-heading { margin: 10px 0 0; font: 400 clamp(1.2rem, 2.25vw, 1.9rem)/1.1 var(--display); letter-spacing: -.053em; }
.card-heading a { text-decoration: none; }
.card-heading a:hover { text-decoration: underline; text-underline-offset: 3px; }
.kind { margin: 2px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.35; }
.card-options { list-style: none; padding: 0; margin: 9px 0 0; border-top: 1px solid var(--line); }
.card-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 8px;
  align-items: baseline;
  min-height: 44px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: .875rem;
  line-height: 1.25;
}
.card-option:hover { color: var(--red); }
.card-option strong { font-weight: 600; }
.card-option small { color: var(--muted); grid-column: 1 / -1; font-size: .75rem; }
.price { white-space: nowrap; color: var(--red); font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.app-workflow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 30px; margin: 36px 0 8px; padding-top: 19px; border-top: 1px solid var(--line); }
.app-workflow h2 { margin: 0 0 4px; font-size: 1.05rem; }
.app-workflow p { margin: 0; color: var(--muted); }
.app-banner { background: var(--sheet); border-top: 1px solid var(--line); }
.app-banner-inner { display: flex; align-items: center; gap: 12px; padding-block: 14px; }
.app-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; }
.app-banner-copy { flex: 1; margin: 0; font-size: .875rem; line-height: 1.3; }
.app-banner-copy strong { font-size: 1rem; }

.guide-list { max-width: 54rem; margin-top: 30px; border-top: 1px solid var(--line); }
.guide-list details { padding-inline: 4px; border-bottom: 1px solid var(--line); }
.guide-list summary { padding: 16px 0; font-size: clamp(1.06rem, 3vw, 1.3rem); font-weight: 600; cursor: pointer; }
.guide-list summary:hover { color: var(--red); }
.guide-list ol { margin: 0; padding-left: 22px; color: var(--muted); }
.guide-list li + li { margin-top: 6px; }
.guide-list a { display: inline-flex; min-height: 44px; margin: 5px 0 8px; align-items: center; font-weight: 600; text-underline-offset: 3px; }

.product { padding-top: 8px; }
.back { display: inline-flex; gap: .55em; min-height: 44px; align-items: center; color: var(--muted); font-size: .875rem; text-decoration: none; }
.back:hover { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.product-grid {
  display: grid;
  grid-template: 'gallery heading' auto 'gallery options' auto 'gallery details' 1fr / minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 22px clamp(24px, 4vw, 64px);
  align-items: start;
  margin-top: 8px;
}
.product-heading { grid-area: heading; padding-top: clamp(4px, 2vw, 28px); }
.product-heading h1 { margin: 5px 0 9px; font-size: clamp(2.2rem, 4.55vw, 4.65rem); line-height: .98; overflow-wrap: anywhere; }
.product-feature { margin: 0; color: var(--red); font-size: clamp(1rem, 1.55vw, 1.25rem); font-weight: 600; }
.gallery { grid-area: gallery; min-width: 0; margin: 0; }
.slides {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  background: var(--studio);
}
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; height: clamp(264px, 41vw, 550px); overflow: hidden; scroll-snap-align: start; }
.slide img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  margin-inline: auto;
  mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
}
.slide-angled img { height: 124%; transform: translateY(-14%); }
.thumbs { display: flex; gap: 6px; margin-top: 7px; padding: 0 0 3px; overflow-x: auto; }
.thumbs button { flex: 0 0 44px; height: 46px; padding: 1px; border: 1px solid var(--line); background: var(--studio); }
.thumbs button:focus-visible { outline-offset: -3px; }
.thumbs button[aria-current='true'] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.thumbs img { height: 100%; object-fit: cover; }
.gallery-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 3px; color: var(--muted); font-size: .75rem; }

.product-options { grid-area: options; }
.versions { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.version {
  display: flex;
  min-height: 57px;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: var(--sheet);
  text-decoration: none;
  line-height: 1.3;
}
.version:hover { border-color: var(--red); }
.version[aria-current='page'] { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.version strong { font-weight: 600; }
.version .price { margin-top: 2px; }
.buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 6px 6px 6px 12px;
  background: var(--ink);
  color: var(--sheet);
}
.buy .price { color: inherit; font-size: .95rem; }
.cta, .app-open {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--red);
  color: var(--sheet);
  font-size: .875rem;
  font-weight: 600;
}
.cta:hover, .app-open:hover { background: #8e1e17; }
.cta:disabled { background: var(--line); color: var(--ink); cursor: default; }
.buy .cta { max-width: 70%; }
.buy .cta:focus-visible { outline-color: var(--sheet); outline-offset: 2px; }
.purchase-note { margin: 7px 0 0; color: var(--muted); font-size: .8rem; }
.device-details { grid-area: details; border-top: 1px solid var(--line); padding-top: 15px; }
.device-details h2 { margin: 0; font: 600 1.15rem/1.3 var(--type); }
.edition-details { padding-top: 0; border-bottom: 1px solid var(--line); }
.edition-details[open] { padding-bottom: 12px; }
.edition-details summary { min-height: 44px; padding: 10px 2px; cursor: pointer; font-weight: 600; }
.edition-details summary:hover, .edition-details summary::marker { color: var(--red); }
.edition-feature { margin: 3px 0 0; font-weight: 600; }
.summary { color: var(--muted); margin: 6px 0 12px; max-width: 54ch; }
.device-details ul { padding-left: 19px; margin: 0; color: var(--muted); font-size: .9rem; }
.device-details li + li { margin-top: 5px; }

#order { width: min(420px, calc(100% - 28px)); max-height: calc(100% - 28px); margin: auto; padding: 23px; border: 1px solid var(--line); border-radius: 4px; background: var(--sheet); color: var(--ink); }
#order::backdrop { background: #251c1888; }
#order .cta { width: 100%; }
.dialog-close { display: block; margin-left: auto; margin-bottom: 6px; min-height: 44px; padding: 0 8px; border: 0; background: transparent; text-decoration: underline; }
.dialog-title { margin: 0; font-size: 1.75rem; line-height: 1; }
.dialog-copy { margin: 14px 0 18px; color: var(--muted); }
.order-summary { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 18px 0; padding-block: 12px; border-block: 1px solid var(--line); }
.order-summary dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 740px) {
  .site-page, .catalog { padding-bottom: 42px; }
  .header-inner { min-height: 52px; }
  .app-hero, .app-workflow { grid-template-columns: minmax(0, 1fr); }
  .app-hero { gap: 4px; padding-bottom: 14px; }
  .app-hero h1 { font-size: clamp(2.1rem, 10.8vw, 4.3rem); }
  .app-hero-copy p { line-height: 1.35; }
  .release-feature { min-height: 156px; }
  .release-copy h2 { font-size: clamp(1.125rem, 4.8vw, 1.75rem); }
  .section-heading { margin-block: 4px; }
  .catalog-heading { align-items: start; flex-direction: column; }
  .product { padding-bottom: 95px; }
  .product-grid { grid-template: 'heading' auto 'gallery' auto 'options' auto 'details' auto / minmax(0, 1fr); gap: 12px; margin-top: 0; }
  .product-heading { padding-top: 0; }
  .product-heading h1 { margin: 4px 0; }
  .slide { height: clamp(220px, 33svh, 350px); }
  .buy {
    position: fixed;
    inset: auto 0 0;
    z-index: 2;
    margin: 0;
    padding: 8px max(var(--gutter), env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  }
  .product + .app-banner { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

@media (max-width: 540px) {
  .lineup { grid-template-columns: minmax(0, 1fr); }
  .device-card {
    display: grid;
    grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }
  .device-image { height: clamp(136px, 40vw, 158px); }
  .card-heading { margin: 2px 0 0; }
  .card-options { margin-top: 6px; }
  .card-options li:last-child .card-option { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .device-image img { transition: none; }
}
