/* Direction: modern tech showroom — deep slate canvas, electric cyan accent,
   confident display sans. Calm, stable, flagship-store feel. */
/* Completed by the platform from the short form: both modes, every
   palette token, each text-on-ground pair at its floor. To restyle, write the
   short form again (the decisions in one :root) and it is completed again. */

:root {
  --canvas: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eaeef3;
  --border: #dde3ea;
  --border-strong: #abb0b9;
  --ink: #10151d;
  --muted: #58626f;
  --accent: #0a5cff;
  --accent-hover: #094ed9;
  --accent-ink: #ffffff;
  --accent-text: #0a4fd8;
  --accent-strong: #0a4fd8;
  --accent-soft: #e2ecff;
  --accent-border: #8bb1fc;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #d9e8e2;
  --success-strong: #137638;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #ece2dc;
  --warning-strong: #a64c08;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #eddcde;
  --danger-strong: #b91c1c;
  --chart-1: #0a5cff;
  --chart-2: #cd3ee1;
  --chart-3: #a70f26;
  --chart-4: #a87d1b;
  --chart-5: #066a04;
  --chart-6: #1e9aa2;

  --font-display: "Sora", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --display-weight: 800;
  --display-tracking: -0.03em;
  --radius-card: 20px;
  --radius-btn: 12px;
  --shadow-card: 0 12px 32px -12px rgba(16, 21, 29, 0.16);
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: "Inter", system-ui, sans-serif;
  --eyebrow-tracking: 0.08em;
  --x-on-photo: #ffffff;
}

html[data-theme="dark"] {
  --canvas: #010610;
  --surface: #1a1f28;
  --surface-2: #0e121c;
  --border: #252931;
  --border-strong: #4d5158;
  --ink: #f4f6f9;
  --muted: #93969c;
  --accent: #0a5cff;
  --accent-hover: #2f74ff;
  --accent-ink: #ffffff;
  --accent-text: #4180ff;
  --accent-strong: #4180ff;
  --accent-soft: #031945;
  --accent-border: #052d7c;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #05211a;
  --success-strong: #499c68;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #28170e;
  --warning-strong: #c06e2f;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #290b13;
  --danger-strong: #cd5c5c;
  --chart-1: #0a5cff;
  --chart-2: #cd3ee1;
  --chart-3: #ea1b39;
  --chart-4: #a87d1b;
  --chart-5: #179b13;
  --chart-6: #1e9aa2;
}

/*
 * app.css — the smartphone showcase's own layout: a fixed device rail and a
 * scroll-stable feature stage. Nothing here reorders on interaction; only
 * an active/inactive class toggles, so the layout never jumps.
 */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-btn);
  z-index: 50;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.site-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 0.75rem;
}

/* ---- Hero ---- */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  max-width: 56rem;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 640ms var(--ease-out, ease), transform 640ms var(--ease-out, ease);
}
.hero-section.is-inview { opacity: 1; transform: none; }
html.reduced-motion .hero-section { opacity: 1; transform: none; transition: none; }

.hero-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.05;
  color: var(--ink);
}
.hero-sub {
  margin-top: 1.25rem;
  max-width: 42rem;
  font-size: 1.0625rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ---- Showcase layout: STABLE two-column grid, never reflows on select ---- */
.showcase {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  padding-top: 1.5rem;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 640ms var(--ease-out, ease), transform 640ms var(--ease-out, ease);
}
.showcase.is-inview { opacity: 1; transform: none; }
html.reduced-motion .showcase { opacity: 1; transform: none; transition: none; }

@media (max-width: 1023px) {
  .showcase { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Device rail: fixed order, fixed height rows, never reorders ---- */
.device-rail {
  position: sticky;
  top: 5.5rem;
  align-self: start;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
}
@media (max-width: 1023px) {
  .device-rail { position: static; }
}

.device-rail-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  margin: 0 0 0.9rem;
}

.device-rail-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.phone-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}
.phone-card:hover { border-color: var(--accent-border, var(--accent)); }
.phone-card:active { transform: translateY(1px); }
.phone-card:focus-visible { outline: none; box-shadow: var(--ring); }

.phone-card-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.phone-card-thumb {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  display: block;
}
.phone-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.phone-card-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  flex: 1 1 auto;
}
.phone-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}
.phone-card-tagline {
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-card-price {
  font-size: 0.75rem;
  color: var(--accent-text);
  font-weight: 600;
  margin-top: 0.15rem;
}
.phone-card-arrow {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 150ms ease;
}
.phone-card-active .phone-card-arrow { color: var(--accent-text); transform: translateX(2px); }

/* ---- Device stage: fixed min-height so switching devices never shifts
       surrounding page content; only the active panel is visible ---- */
.device-stage {
  position: relative;
  min-height: 60rem;
}

.phone-panel {
  display: none;
}
.phone-panel-active {
  display: block;
  animation: panel-settle 420ms var(--ease-out, ease) both;
}
html.reduced-motion .phone-panel-active { animation: none; }

@keyframes panel-settle {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.phone-panel-head {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 560ms var(--ease-out, ease), transform 560ms var(--ease-out, ease);
}
.phone-panel-head.is-inview { opacity: 1; transform: none; }
html.reduced-motion .phone-panel-head { opacity: 1; transform: none; transition: none; }

.phone-panel-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: clamp(1.8rem, 3vw, 2.75rem);
  color: var(--ink);
  margin: 0;
}
.phone-panel-tagline {
  margin-top: 0.6rem;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 38rem;
}
.phone-panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.phone-panel-hero {
  margin-top: 1.5rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--ease-out, ease), transform 600ms var(--ease-out, ease);
}
.phone-panel-hero.is-inview { opacity: 1; transform: none; }
html.reduced-motion .phone-panel-hero { opacity: 1; transform: none; transition: none; }

/* ---- Feature list: fixed row structure, image left / copy right on desktop,
       stacked on mobile — never alternates sides, so it stays predictable ---- */
.feature-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.feature-row {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 1.75rem;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 560ms var(--ease-out, ease), transform 560ms var(--ease-out, ease);
}
.feature-row.is-inview { opacity: 1; transform: none; }
html.reduced-motion .feature-row { opacity: 1; transform: none; transition: none; }

@media (max-width: 767px) {
  .feature-row {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }
  .feature-row-media { order: 1; }
  .feature-row-copy { order: 2; }
}

.feature-row-number {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.35rem;
}

.feature-row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  margin-bottom: 0.6rem;
}

.feature-row-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0 0 0.4rem;
}

.feature-row-detail {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  max-width: 34rem;
}

/* ---- Closing band ---- */
.closing-band {
  margin-top: 4.5rem;
  padding: 3.5rem 2rem;
  text-align: center;
  border-radius: var(--radius-card);
  background: var(--ink);
  color: var(--canvas);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 640ms var(--ease-out, ease), transform 640ms var(--ease-out, ease);
}
.closing-band.is-inview { opacity: 1; transform: none; }
html.reduced-motion .closing-band { opacity: 1; transform: none; transition: none; }

.closing-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  color: var(--canvas);
  margin: 0;
}
.closing-sub {
  margin: 1rem auto 0;
  max-width: 36rem;
  color: color-mix(in srgb, var(--canvas) 75%, transparent);
  font-size: 1rem;
}

/* An outline button placed on the fixed-dark .closing-band: transparent
   fill, light border and label, so it never renders as a white-on-white
   (or white-on-dark) fill regardless of the active colour mode. */
.btn-on-dark {
  background-color: transparent;
  border-color: color-mix(in srgb, var(--x-on-photo) 55%, transparent);
  color: var(--x-on-photo);
}
.btn-on-dark:hover {
  background-color: color-mix(in srgb, var(--x-on-photo) 15%, transparent);
  border-color: var(--x-on-photo);
  color: var(--x-on-photo);
}
.btn-on-dark:focus-visible {
  outline: 2px solid var(--x-on-photo);
  outline-offset: 2px;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* Smooth native scrolling with a comfortable offset for the sticky bar */
html { scroll-behavior: smooth; }
html.reduced-motion { scroll-behavior: auto; }
#device-list { scroll-margin-top: 5.5rem; }

/* ---- Compare page: fixed picker on top, two-column result below that
       never reflows — only the two columns' content swaps via htmx ---- */
.compare-picker {
  position: sticky;
  top: 4.5rem;
  z-index: 20;
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--ease-out, ease), transform 600ms var(--ease-out, ease);
}
.compare-picker.is-inview { opacity: 1; transform: none; }
html.reduced-motion .compare-picker { opacity: 1; transform: none; transition: none; }

@media (max-width: 767px) {
  .compare-picker { position: static; }
}

.compare-picker-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 1rem;
  align-items: end;
}
@media (max-width: 639px) {
  .compare-picker-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

.compare-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  align-self: center;
  margin-bottom: 0.1rem;
}
@media (max-width: 639px) {
  .compare-vs { margin: 0 auto; }
}

.compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1.75rem;
  min-height: 40rem;
  align-items: start;
}
@media (max-width: 767px) {
  .compare-grid { grid-template-columns: minmax(0, 1fr); }
}

.compare-col {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  animation: panel-settle 360ms var(--ease-out, ease) both;
}
html.reduced-motion .compare-col { animation: none; }

.compare-col-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20rem;
}

.compare-col-head {
  text-align: center;
}
.compare-col-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
  margin: 1rem 0 0.35rem;
}
.compare-col-tagline {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}
.compare-col-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.compare-feature-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.compare-feature-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}
.compare-feature-item:first-child {
  border-top: none;
  padding-top: 0;
}
.compare-feature-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.compare-feature-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.compare-feature-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}
.compare-feature-detail {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.55;
}
