/* Buttons, the header, and the home page: hero, chip, sources strip, sections. */

/* Buttons */

/* The main button is tinted glass: ember behind a glossy face, light pooling along its lower edge. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 26px;
  border: 0;
  border-radius: var(--r-pill);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.3), rgb(255 255 255 / 0) 46%),
    radial-gradient(120% 90% at 50% 120%, color-mix(in srgb, var(--accent-fill) 60%, #ffd2a8), transparent 60%),
    var(--accent-fill);
  color: var(--on-accent);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.55),
    inset 0 0 0 1px rgb(255 255 255 / 0.14),
    inset 0 -2px 6px rgb(255 220 190 / 0.3),
    0 14px 28px -12px var(--accent-fill);
}

.button:hover {
  filter: brightness(1.08) saturate(1.1);
}

.button.glass {
  background: var(--glass);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 -14px 24px -18px var(--glass-depth),
    var(--glass-shadow);
}

/* Inside another glass surface, a glass button can only blur that surface's own fill (its parent is its
   backdrop root), so it gets a frosted fill instead. */
.tile .button.glass,
.glass .button.glass {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--glass-strong);
}

.button.glass:hover {
  background: var(--glass-strong);
  filter: none;
}

/* English pages (under /en/) run left to right; --flow turns the marquee around. */
:root[dir="ltr"] {
  --flow: -1;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-block: 12px;
}

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  width: min(100% - 24px, 1200px);
  min-height: 60px;
  margin-inline: auto;
  padding-block: 6px;
  padding-inline: 16px 6px;
  border-radius: var(--r-pill);
  /* On the bar itself, not on the header around it: an element with a view-transition-name cuts the glass
     inside it off from the page behind, so the bar would not blur anything. */
  view-transition-name: site-header;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: var(--text-lg);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
}

.nav-list {
  display: flex;
  gap: 2px;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

.nav-list a:hover {
  background: var(--hover);
  color: var(--ink);
}

.nav-list a[aria-current="page"] {
  background: var(--tint);
  color: var(--accent);
}

/* The language switch: a small outlined pill, set apart from the page links. It names the other language
   in that language (EN, עב), the way people look for it. */
.nav-list .lang-switch {
  margin-inline-start: 4px;
  padding-inline: 12px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav-list .lang-switch:hover {
  border-color: var(--accent);
}

/* A translated policy says which version applies. */
.translation-note {
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-chip);
  background: var(--tint);
  font-size: var(--text-sm);
}

@media (max-width: 440px) {
  .header-bar {
    padding-inline-start: 12px;
  }

  .brand {
    font-size: var(--text-md);
  }

  .nav-list a {
    padding-inline: 7px;
    font-size: var(--text-sm);
  }

  .nav-list .lang-switch {
    margin-inline-start: 0;
    padding-inline: 10px;
  }
}

/* Home: hero with the chip */

.hero {
  display: grid;
  gap: 40px;
  align-items: center;
  padding-block: 28px 48px;
}

.hero h1 {
  font-size: clamp(2.6rem, 1.5rem + 4.6vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.lede {
  max-width: 34em;
  margin-top: 20px;
  color: var(--ink-2);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
}

/* One clear action: the button. The second way in is a quieter text link. */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 32px;
}

.hero-actions .button {
  min-height: 52px;
  padding-inline: 32px;
  font-size: var(--text-base);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 4px;
  color: var(--accent);
  font-weight: 600;
}

.hero-facts {
  max-width: 36em;
  margin-top: 24px;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 64px;
    padding-block: 56px 88px;
  }
}

.chip {
  position: relative;
  padding: 16px;
}

/* The pins around the package, as in the logo. */
.chip::before,
.chip::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.chip::before {
  inset: 3px 72px;
  background:
    linear-gradient(90deg, transparent 7px, var(--pin) 7px 11px, transparent 11px) 0 0 / 18px 10px space no-repeat,
    linear-gradient(90deg, transparent 7px, var(--pin) 7px 11px, transparent 11px) 0 100% / 18px 10px space no-repeat;
}

.chip::after {
  inset: 72px 3px;
  background:
    linear-gradient(transparent 7px, var(--pin) 7px 11px, transparent 11px) 0 0 / 10px 18px no-repeat space,
    linear-gradient(transparent 7px, var(--pin) 7px 11px, transparent 11px) 100% 0 / 10px 18px no-repeat space;
}

/* The package is glass too, so the warm light behind the page shows through around the die. */
.chip-body {
  position: relative;
  padding: 10px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-tile);
  background: var(--package);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 -18px 30px -20px var(--glass-depth),
    0 40px 70px -40px rgb(110 40 5 / 0.45);
}

/* The die: each core is a product, colored by its score. */
.heatmap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 22px;
  background: var(--die);
  list-style: none;
}

.heatmap li:first-child {
  grid-column: span 2;
}

@media (min-width: 560px) {
  .heatmap {
    grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
  }

  .heatmap li:first-child {
    grid-column: auto;
    grid-row: span 2;
  }
}

.heatmap a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  min-height: 118px;
  padding: 14px 16px;
  border: 1px solid transparent; /* stays visible in forced-colors mode */
  border-radius: 14px;
  background: var(--gloss), var(--heat);
  color: var(--on-heat);
  text-decoration: none;
  --core-rest: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 0 0 0 transparent;
  box-shadow: var(--core-rest);
}

.heatmap a {
  --core-rest: inset 0 1px 0 rgb(255 255 255 / 0.18), 0 0 30px -10px var(--heat);
}


.heat-score {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.heatmap li:first-child .heat-score {
  font-size: 3.4rem;
}

.heat-name {
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
  /* Model names like "9850X3D" are one long word; at phone width they break instead of spilling out. */
  overflow-wrap: anywhere;
  hyphens: auto;
}

@media (max-width: 440px) {
  .heatmap a {
    padding-inline: 10px;
  }

  .heat-name {
    font-size: var(--text-xs);
  }
}

.heat-cat {
  display: block;
  font-size: var(--text-xs);
  font-weight: 400;
}

/* The glass lid over the die. Its glare follows the pointer (main.js sets --gx and --gy). */
.chip-lid {
  position: absolute;
  inset: 10px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(320px circle at var(--gx, 50%) var(--gy, -30%), var(--lid-glare), transparent 60%),
    linear-gradient(150deg, var(--lid-sheen), transparent 30%, transparent 75%, var(--lid-sheen));
  box-shadow: inset 0 1px 0 var(--lid-edge), inset 0 0 0 1px var(--lid-edge);
  pointer-events: none;
}

.chip-lid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgb(255 255 255 / 0.35) 50%, transparent 60%) 150% 0 / 250% 100% no-repeat;
  opacity: 0;
}

.chip-figure figcaption {
  max-width: 60ch;
  margin-top: 16px;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

/* Home: the sources strip */

.sources-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding-block: 8px;
}

.strip-label {
  flex: 0 1 auto;
  color: var(--ink-2);
  font-weight: 600;
}

.marquee {
  flex: 1 1 320px;
  min-width: 0;
}

.marquee-track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 0;
  list-style: none;
}

/* Small glass chips. No blur of their own: behind them is only soft light, which blur would not change,
   and a dozen moving blurred chips would cost every frame. */
.marquee-track li {
  padding: 8px 16px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--chip-glass), transparent), var(--chip-glass);
  box-shadow: inset 0 1px 0 var(--glass-rim), 0 6px 16px -10px rgb(120 45 5 / 0.35);
  font-weight: 600;
  white-space: nowrap;
}

.marquee.is-running {
  display: flex;
  overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee.is-running .marquee-track {
  flex: none;
  flex-wrap: nowrap;
  padding-inline-end: 10px;
}

.marquee-toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
}

.marquee-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.marquee-toggle[aria-pressed="true"] .icon-pause,
.marquee-toggle[aria-pressed="false"] .icon-play {
  display: none;
}

/* Sections */

.section {
  padding-block: 56px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 20px;
}

.section-title {
  font-size: clamp(1.9rem, 1.35rem + 1.9vw, 2.75rem);
  letter-spacing: -0.015em;
}

.section-lede {
  max-width: 44em;
  margin-top: 12px;
  color: var(--ink-2);
}
