/* ==========================================================================
   Credentials: figures (proof band, case key figures) and sector experience
   ========================================================================== */

/* --- Figures (proof band) ------------------------------------------------ */
.figures {
  border-block: 1px solid var(--line);
}

.figures__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.25rem, 1.75rem + 2vw, 3.25rem) var(--col-gap);
}

.figure {
  position: relative;
  padding-top: 1.6rem;
}

.figure::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2.25rem;
  border-top: 1px solid var(--gold-line);
}

.figure__value {
  display: flex;
  align-items: flex-start;
  font-size: calc(clamp(3.25rem, 2.25rem + 3.4vw, 5.5rem) * var(--display-scale));
  line-height: 0.92;
  letter-spacing: -0.015em;
}

.figure__num {
  font-variant-numeric: tabular-nums lining-nums;
}

.figure__mark {
  margin: 0.1em 0 0 0.06em;
  font-size: 0.42em;
  line-height: 1;
  color: var(--gold);
}

.figure__mark--pre {
  margin: 0.1em 0.12em 0 0;
  font-style: italic;
}

.figure__label {
  margin-top: 1.1rem;
  max-width: 19em;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fg-muted);
}

@media (min-width: 40em) {
  .figures__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64em) {
  .figures__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .figures__grid--case { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 64rem; }
}

/* --- Sector experience: tiles with line-art motifs (design G) --------------
   One tile per sector: number, name and a motif that draws itself in.
   site.js arms the entrance (the tiles rise in turn, the motifs draw),
   then lights one tile at a time until the
   visitor points at one. Without script, or with reduced motion, every tile
   simply shows, drawn. Values from the design file. */
.sectors-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(241, 237, 228, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 237, 228, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  pointer-events: none;
}

.sectors {
  position: relative;
}

.sectors__eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-line);
}

.sectors__eyebrow::before {
  content: "";
  width: 2.5rem;
  border-top: 1px solid currentColor;
}

.sectors__tiles {
  display: flex;
  flex-wrap: wrap;
  margin-top: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  border-top: 1px solid #58666a;
  border-left: 1px solid #2c4047;
}

/* Phones first: two tiles a row. */
.sector-tile {
  --pad: 1rem;
  --rise: 0s;
  --draw: 0.35s;
  position: relative;
  flex: 1 1 49%;
  min-width: 0;
  min-height: 12.5rem;
  padding: var(--pad);
  overflow: hidden;
  border-right: 1px solid #2c4047;
  border-bottom: 1px solid #2c4047;
  transition: background-color 0.5s ease, opacity 0.7s ease var(--rise), transform 0.7s ease var(--rise);
}

.sector-tile:nth-child(2) { --rise: 0.07s; --draw: 0.47s; }
.sector-tile:nth-child(3) { --rise: 0.14s; --draw: 0.59s; }
.sector-tile:nth-child(4) { --rise: 0.21s; --draw: 0.71s; }
.sector-tile:nth-child(5) { --rise: 0.28s; --draw: 0.83s; }
.sector-tile:nth-child(6) { --rise: 0.35s; --draw: 0.95s; }
.sector-tile:nth-child(7) { --rise: 0.42s; --draw: 1.07s; }

.sector-tile__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 74% 30%, rgba(230, 174, 35, 0.16), rgba(230, 174, 35, 0) 62%);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.sector-tile__motif {
  position: absolute;
  top: 0.75rem;
  right: 0.5rem;
  width: min(60%, 7.5rem);
  height: auto;
  aspect-ratio: 4 / 3;
  overflow: visible;
  fill: none;
  stroke: var(--gold-line);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.42;
  transform-origin: 60% 40%;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.sector-tile__motif * {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.sector-tile__num {
  position: relative;
  display: block;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.08em;
  color: #b69026;
  transition: color 0.4s ease;
}

.sector-tile__name {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: var(--pad);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.12;
  color: var(--fg);
  text-wrap: balance;
  transition: transform 0.4s ease;
}

.sector-tile__line {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--gold-line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

/* Lit: pointed at, or the ambient turn. The motif draws itself again. */
.sector-tile:is(:hover, .is-lit) { background-color: rgba(230, 174, 35, 0.045); }
.sector-tile:is(:hover, .is-lit) .sector-tile__glow { opacity: 1; }
.sector-tile:is(:hover, .is-lit) .sector-tile__motif { opacity: 1; transform: scale(1.04); }
.sector-tile:is(:hover, .is-lit) .sector-tile__motif * { animation: sector-draw 1.2s ease both; }
.sector-tile:is(:hover, .is-lit) .sector-tile__num { color: var(--gold-line); }
.sector-tile:is(:hover, .is-lit) .sector-tile__name { transform: translateX(4px); }
.sector-tile:is(:hover, .is-lit) .sector-tile__line { transform: none; }

@keyframes sector-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* Entrance, once site.js has armed it: hidden, then risen and drawn in turn. */
.sectors.is-armed .sector-tile { opacity: 0; transform: translateY(18px); }
.sectors.is-armed .sector-tile__motif * { stroke-dashoffset: 1; }
.sectors.is-armed.is-shown .sector-tile { opacity: 1; transform: none; }

.sectors.is-armed.is-shown .sector-tile__motif * {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.6s ease var(--draw);
}

@media (min-width: 40.5em) {
  .sector-tile { --pad: 1.75rem; min-height: 17.5rem; }
  .sector-tile__name { font-size: 1.75rem; }
  .sector-tile__motif { top: 1.25rem; right: 1.25rem; width: min(50%, 13.75rem); }
}

@media (min-width: 68em) {
  .sector-tile { flex-basis: 24%; min-height: 20rem; }
  .sector-tile__name { font-size: clamp(1.5rem, 2.1vw, 1.875rem); }
  .sector-tile__motif { right: 1rem; width: min(66%, 13.375rem); }
}

@media print {
  .sectors.is-armed .sector-tile { opacity: 1 !important; transform: none !important; }
  .sectors.is-armed .sector-tile__motif * { stroke-dashoffset: 0 !important; }
}
