/* Final Apple Watch Ultra 3-inspired visual system */
:root {
  --ultra-black: #050507;
  --ultra-ink: #1d1d1f;
  --ultra-muted: #86868b;
  --ultra-blue: #2997ff;
  --ultra-green: #6ee7b7;
  --ultra-orange: #ff9f0a;
}

body {
  background: #f5f5f7;
  color: var(--ultra-ink);
}

body::before {
  background:
    radial-gradient(circle at 50% 0%, rgba(41, 151, 255, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(5, 5, 7, 0.95) 0 28%, rgba(245, 245, 247, 0) 48%);
  opacity: 1;
}

.topbar {
  margin: 0;
  padding: 10px 28px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: rgba(5, 5, 7, 0.72);
  color: #f5f5f7;
  box-shadow: none;
}

.brand-block h1 {
  color: #ffffff;
  font-size: 22px;
}

.eyebrow {
  color: #a1a1a6;
}

.nav {
  border: 0;
  background: transparent;
}

.nav a {
  color: #d2d2d7;
  font-size: 12px;
}

.nav a:hover {
  background: transparent;
  color: #ffffff;
}

.github-action {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.github-action p {
  color: #a1a1a6;
}

.github-button,
.stat-pill,
.like-button {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  box-shadow: none;
}

.github-action svg {
  fill: #f5f5f7;
}

.site-stats {
  gap: 8px;
}

.stat-pill,
.like-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-weight: 800;
}

.stat-pill span,
.like-button span:not(.heart-mark) {
  color: #ffffff;
}

.stat-pill strong,
.like-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.like-button {
  background: rgba(255, 245, 250, 0.96);
  color: #b21f5b;
}

.like-button span:not(.heart-mark) {
  color: #b21f5b;
}

.like-button strong {
  background: rgba(178, 31, 91, 0.14);
  color: #7f153f;
}

main {
  padding: 0;
}

main > section:not(.apple-product-hero) {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.apple-product-hero {
  min-height: 100vh;
  padding: clamp(70px, 8vw, 116px) clamp(20px, 5vw, 72px) clamp(44px, 6vw, 80px);
  background:
    radial-gradient(circle at 50% 34%, rgba(41, 151, 255, 0.34), transparent 26%),
    radial-gradient(circle at 48% 76%, rgba(110, 231, 183, 0.18), transparent 32%),
    linear-gradient(180deg, #020204 0%, #07080c 62%, #11131a 100%);
}

.apple-device-frame,
.apple-glass-specs {
  display: none !important;
}

.apple-hero-copy h2 {
  color: #ffffff;
  font-size: clamp(54px, 8.4vw, 122px);
  line-height: 0.92;
}

.apple-hero-copy p:not(.section-kicker) {
  color: #a1a1a6;
}

.apple-visual-stage {
  display: grid;
  place-items: center;
  min-height: min(48vh, 500px);
  perspective: 1100px;
}

.apple-edge-orbit {
  width: min(940px, 94vw);
  aspect-ratio: 900 / 560;
}

.apple-edge-orbit svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 48px 110px rgba(0, 0, 0, 0.55));
}

.orbit-rings ellipse {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
}

.orbit-edges path {
  fill: none;
  stroke: url("#appleEdgeGradient");
  stroke-linecap: round;
  stroke-width: 4.8;
}

.orbit-nodes circle {
  fill: url("#appleNodeGlow");
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2.5;
}

.apple-ultra-highlights,
.apple-tech-strip,
.workspace,
.problem-framing-section,
.results-section,
.figures-section,
.playground-section,
.edge-dynamics-section,
.paper-code-section {
  padding-left: max(24px, calc((100vw - 1360px) / 2));
  padding-right: max(24px, calc((100vw - 1360px) / 2));
}

.apple-ultra-highlights {
  padding-top: clamp(74px, 9vw, 132px);
  padding-bottom: clamp(74px, 9vw, 132px);
  background: #11131a;
  color: #f5f5f7;
}

.apple-ultra-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.apple-ultra-heading .section-kicker,
.ultra-card span {
  color: var(--ultra-orange);
}

.apple-ultra-heading h2 {
  color: #ffffff;
  font-size: clamp(42px, 6.2vw, 86px);
  line-height: 0.96;
}

.apple-ultra-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ultra-card {
  min-height: 285px;
  padding: clamp(22px, 2.5vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 76% 14%, rgba(41, 151, 255, 0.18), transparent 32%),
    #1d1f27;
  color: #f5f5f7;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.ultra-card-large,
.ultra-card-wide {
  grid-column: span 2;
}

.ultra-card h3,
.ultra-card strong {
  color: #ffffff;
}

.ultra-card p {
  color: #a1a1a6;
}

.apple-tech-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: clamp(70px, 8vw, 118px);
  padding-bottom: clamp(70px, 8vw, 118px);
  background: #f5f5f7;
}

.apple-tech-strip article,
.story-block,
.problem-grid article,
.problem-flow div,
.method-summary article,
.innovation-grid div {
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.055);
}

.workspace {
  grid-template-columns: minmax(300px, 0.42fr) minmax(680px, 1.58fr);
  gap: 28px;
  align-items: start;
  padding-top: clamp(76px, 8vw, 128px);
  padding-bottom: clamp(76px, 8vw, 128px);
  background: #ffffff;
}

.story-block {
  background: #f5f5f7;
}

.viewer-shell {
  position: sticky;
  top: 108px;
  min-height: 0;
  height: calc(100vh - 132px);
  max-height: 820px;
  border: 0;
  border-radius: 8px;
  background:
    radial-gradient(circle at 58% 18%, rgba(41, 151, 255, 0.26), transparent 32%),
    linear-gradient(180deg, #07080c, #11131a);
  color: #f5f5f7;
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.24);
}

.viewer-shell .viewer-layout {
  height: calc(100% - 76px);
  min-height: 0;
}

.viewer-shell .viewer-panel,
.viewer-shell .viewer {
  min-height: 0;
  height: 100%;
}

.viewer-shell .metrics-panel {
  min-height: 0;
}

.viewer-toolbar,
.viewer-panel,
.metrics-panel {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
}

.metrics-panel h2,
.metrics dd {
  color: #ffffff;
}

.metrics-panel,
.legend p,
.viewer-status {
  color: #a1a1a6;
}

.problem-framing-section,
.playground-section {
  padding-top: clamp(82px, 10vw, 150px);
  padding-bottom: clamp(82px, 10vw, 150px);
  background: #f5f5f7;
}

.figures-section,
.paper-code-section {
  padding-top: clamp(82px, 10vw, 150px);
  padding-bottom: clamp(82px, 10vw, 150px);
  background: #ffffff;
}

.results-section {
  padding-top: clamp(82px, 10vw, 150px);
  padding-bottom: clamp(82px, 10vw, 150px);
  background: #08090d;
  color: #f5f5f7;
}

.results-section .section-heading h2,
.results-section .result-group-heading h3,
.results-section .result-table-heading h4,
.results-section .result-analysis strong {
  color: #ffffff;
}

.results-section .section-heading p:last-child,
.results-section .result-table-heading p,
.results-section .result-analysis p {
  color: #c7c7cc;
}

.results-section .result-table-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #161820;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.results-section .table-scroll {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #0f1016;
}

.results-section .result-table {
  color: #f5f5f7;
}

.results-section .result-table thead th {
  background: #242734;
  color: #ffffff;
}

.results-section .result-table th,
.results-section .result-table td,
.results-section .result-table tbody th,
.results-section .result-table tbody td {
  border-bottom-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
  background: transparent;
}

.results-section .result-table tbody tr:nth-child(even) th,
.results-section .result-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.035);
}

.results-section .best-row th,
.results-section .best-row td {
  background: rgba(110, 231, 183, 0.095) !important;
}

.results-section .is-best {
  color: #6ee7b7 !important;
  font-weight: 900;
}

.results-section .is-second {
  color: #9cc7ff !important;
  font-weight: 800;
}

.edge-dynamics-section {
  padding-top: clamp(82px, 10vw, 150px);
  padding-bottom: clamp(82px, 10vw, 150px);
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 159, 10, 0.12), transparent 30%),
    #11131a;
  color: #f5f5f7;
}

.edge-dynamics-section .section-heading h2,
.edge-dynamics-section h3 {
  color: #ffffff;
}

.edge-dynamics-section .section-heading p:last-child,
.edge-dynamics-section p {
  color: #c7c7cc;
}

.edge-animation-figure,
.edge-animation-toolbar,
.edge-gif-panel {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.figure-card {
  min-height: 620px;
  border-radius: 8px;
  background: #f5f5f7;
}

.code-link-panel {
  border: 0;
  border-radius: 8px;
  background:
    radial-gradient(circle at 80% 0%, rgba(41, 151, 255, 0.18), transparent 34%),
    #11131a;
  color: #f5f5f7;
  box-shadow: 0 28px 86px rgba(0, 0, 0, 0.22);
}

@media (max-width: 1100px) {
  .apple-ultra-grid,
  .apple-tech-strip,
  .workspace {
    grid-template-columns: 1fr;
  }

  .ultra-card,
  .ultra-card-large,
  .ultra-card-wide {
    grid-column: auto;
  }

  .viewer-shell {
    position: static;
    height: auto;
    max-height: none;
    min-height: auto;
  }

  .viewer-shell .viewer-layout,
  .viewer-shell .viewer-panel,
  .viewer-shell .viewer {
    height: auto;
    min-height: 560px;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .apple-product-hero {
    padding: 54px 16px 34px;
  }

  .apple-hero-copy h2 {
    font-size: 46px;
  }

  .apple-edge-orbit {
    width: min(680px, 112vw);
  }

  .apple-ultra-highlights,
  .apple-tech-strip,
  .workspace,
  .problem-framing-section,
  .results-section,
  .figures-section,
  .playground-section,
  .edge-dynamics-section,
  .paper-code-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .apple-ultra-heading {
    display: block;
  }

  .figure-card {
    min-height: auto;
  }

  .stat-pill,
  .like-button {
    min-height: 36px;
  }

  .viewer-shell .viewer-layout,
  .viewer-shell .viewer-panel,
  .viewer-shell .viewer {
    min-height: 430px;
  }
}
