/*
  VARIANT A — "Materia legible"
  Same identity as c-materia-clear: warm dark ground, family tints, grain texture, display
  serif. What changes is strictly geometry and wayfinding, learned from the real TWE page:
  aligned sensory rows (comparable strips), a jump nav, and a label-over-value information
  block. Hue still identifies a FAMILY, never a score.
*/

:root {
  --ground: #0B0A09;
  --raise: #141210;
  --raise-2: #1B1815;
  --ink: #F3EFEA;
  --ink-2: #BFB8AF;
  --ink-3: #8A8279;
  --edge: #ffffff14;
  --gold: #C8A24A;
  --green: #6FAE84;

  --ember: #D3623C;
  --sans: 'Inter', system-ui, sans-serif;
  --display: 'Instrument Serif', 'Times New Roman', serif;
}

.sheet { --accent: color-mix(in srgb, var(--family) 42%, var(--ember)); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(120% 60% at 50% -10%, #24150F 0%, transparent 60%),
    var(--ground);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.sheet { max-width: 780px; margin: 0 auto; padding: 0 0 110px; }

.topbar { padding: 14px 18px 0; }
.back {
  background: none; border: 0; color: var(--ink-2); cursor: pointer;
  font: 400 15px/1 var(--sans); padding: 8px 0;
}

/* ---------- opening ---------- */

.opening { padding: 6px 18px 26px; text-align: center; }

.opening-stage {
  height: 210px;
  background: url('../../ui-exploration-v2/assets/fondo-carrusel.png') center/contain no-repeat;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.opening-bottle {
  width: 60px; height: 146px;
  border-radius: 24px 24px 8px 8px;
  background: linear-gradient(180deg, #ffffff16, #ffffff06 42%, #ffffff12);
  border: 1px solid #ffffff20;
  box-shadow: 0 0 60px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}

.tagline {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 10.5vw, 54px);
  line-height: 1.05;
}
.sub {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 21px;
  color: var(--ink-2);
}
/* TWE puts "70cl / 46%" right under the name: identity data belongs with the name. */
.idline { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); letter-spacing: .05em; }
.price {
  margin: 12px 0 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.price b { color: var(--ink); font-weight: 500; }

/* ---------- statement ---------- */

.statement {
  padding: 28px 22px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 16%, transparent),
    color-mix(in srgb, var(--accent) 4%, transparent));
  border-top: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.statement p {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.32;
  max-width: 40ch;
}
.statement p:last-child { margin-bottom: 0; }

/* ---------- jump nav ---------- */
/* The sheet's table of contents, one line, learned from TWE's anchor bar. */

.jump {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 14px 18px 6px;
  scrollbar-width: none;
}
.jump::-webkit-scrollbar { display: none; }
.jump a {
  flex: none;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--raise);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
}
.jump a:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

/* ---------- bands ---------- */

.body { display: flex; flex-direction: column; }
.band { padding: 30px 18px; }

.head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1;
  scroll-margin-top: 70px;
}
.head-ic { color: var(--accent); display: inline-flex; }

.hint { margin: -10px 0 16px; font-size: 13px; color: var(--ink-3); }
.para { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 62ch; }

/* ---------- character shelf (unchanged from clear: it already reads) ---------- */

.shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tile {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  padding: 14px 16px 16px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  background:
    linear-gradient(150deg,
      color-mix(in srgb, var(--tint) 30%, transparent),
      color-mix(in srgb, var(--tint) 8%, transparent) 70%),
    var(--raise);
  border: 1px solid color-mix(in srgb, var(--tint) 34%, transparent);
}
.tile-lead { grid-column: 1 / -1; min-height: 150px; }

.tile-top { display: flex; align-items: center; gap: 9px; }
.tile-mark { color: color-mix(in srgb, var(--tint) 62%, white); line-height: 0; flex: none; }
.tile-family {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--tint) 34%, var(--ink-2));
}

.tile-body { position: relative; display: flex; flex-direction: column; }
.tile-body b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.05;
}
.tile-lead .tile-body b { font-size: 42px; }

.shelf-pairs .tile { min-height: 96px; }

/* ---------- sensory rows ---------- */
/*
  The TWE lesson: four values in one aligned band are comparable without thought. Rows share
  a left edge and a strip width, so extent comparison is pre-attentive. The grain still
  densifies with the level (Materia's voice) and the word stays the reading.
*/

.scale-key {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  max-width: 420px;
}
.key-word {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex: none;
}
.key-word-hi { color: color-mix(in srgb, var(--accent) 55%, var(--ink-2)); }
.key-ramp {
  flex: 1;
  display: flex;
  height: 14px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--edge);
}
.key-cell {
  flex: 1;
  background-image:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 80%, white) var(--dot, 0px), transparent calc(var(--dot, 0px) + .6px)),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 55%, white) calc(var(--dot, 0px) * .7), transparent calc(var(--dot, 0px) * .7 + .6px));
  background-size: var(--cell, 20px) var(--cell, 20px), var(--cell, 20px) var(--cell, 20px);
  background-position: 0 0, calc(var(--cell, 20px) / 2) calc(var(--cell, 20px) / 2);
}
.k-1 { --dot: 1.1px; --cell: 11px; }
.k-2 { --dot: 1.4px; --cell: 9px; }
.k-3 { --dot: 1.7px; --cell: 7px; }
.k-4 { --dot: 2px; --cell: 5.5px; }
.k-5 { --dot: 2.3px; --cell: 4.5px; }

.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) 1fr 88px;
  align-items: center;
  gap: 12px;
  background: var(--raise);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 12px 14px;
}

.row-name { font-size: 15px; line-height: 1.25; }

.row-strip {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: #ffffff05;
  border: 1px solid #ffffff0d;
  overflow: hidden;
}
.row-grain {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 100%);
  background-image:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 80%, white) var(--dot, 0px), transparent calc(var(--dot, 0px) + .6px)),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 55%, white) calc(var(--dot, 0px) * .7), transparent calc(var(--dot, 0px) * .7 + .6px));
  background-size: var(--cell, 20px) var(--cell, 20px), var(--cell, 20px) var(--cell, 20px);
  background-position: 0 0, calc(var(--cell, 20px) / 2) calc(var(--cell, 20px) / 2);
}

.lv-0 { --dot: 0px; --cell: 22px; }
.lv-1 { --dot: 1.2px; --cell: 15px; }
.lv-2 { --dot: 1.5px; --cell: 12px; }
.lv-3 { --dot: 1.8px; --cell: 9px; }
.lv-4 { --dot: 2.2px; --cell: 7px; }
.lv-5 { --dot: 2.6px; --cell: 5.5px; }

/* A measured absence: the strip stays, empty and dashed. Not a hole, a zero. */
.lv-0 .row-strip { border-style: dashed; background: none; }
.lv-0 .row-grain { display: none; }
.lv-0 .row-name, .lv-0 .row-word { color: var(--ink-3); }

.row-word {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  line-height: 1.3;
}
.lv-5 .row-word { color: color-mix(in srgb, var(--accent) 60%, white); font-weight: 600; }

/* ---------- tasting stages ---------- */
/* No spine, no nodes: each stage is a small-caps label and its text, separated by rhythm. */

.stages { display: grid; gap: 22px; }
.stage h4 {
  margin: 0 0 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 70%, var(--ink-2));
}
.stage p { margin: 0; font-size: 17px; line-height: 1.55; max-width: 60ch; }

/* ---------- production slabs ---------- */

.slabs { display: grid; gap: 8px; }
.slab {
  background: var(--raise);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 14px 16px;
}
.slab-key {
  margin: 0 0 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.slab-val { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); }

/* ---------- product information ---------- */
/* TWE's fact pattern: quiet label above, bold value below. One glance per cell. */

.specs {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.spec {
  background: var(--raise);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.spec-key {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.spec-val { font-size: 16px; font-weight: 500; }

.stamps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stamp {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--raise);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 13px 15px;
}
.stamp-ic { color: var(--ink-3); flex: none; }
.s-true .stamp-ic { color: var(--green); }
.s-false .stamp-ic { color: #D3623C; }
.stamp-body { display: flex; flex-direction: column; min-width: 0; }
.stamp-body b { font-size: 16px; font-weight: 500; }
.stamp-body > span { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* ---------- awards ---------- */

.medals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.medals li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(120deg, #C8A24A1F, transparent 60%), var(--raise);
  border: 1px solid #C8A24A38;
  border-radius: 12px;
  padding: 14px 15px;
}
.m-ic { color: var(--gold); flex: none; }
.m-body { display: flex; flex-direction: column; min-width: 0; }
.m-body b { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.1; }
.m-body > span { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

.ext { margin-top: 14px; }
.ext-title {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ext-row { margin: 0 0 10px; display: flex; align-items: baseline; gap: 12px; }
.ext-row b { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1; }
.ext-row b i { font-style: normal; font-size: 16px; color: var(--ink-3); }
.ext-row span { font-size: 14px; color: var(--ink-2); }

/* ---------- larger screens ---------- */

@media (min-width: 640px) {
  .shelf { grid-template-columns: repeat(3, 1fr); }
  .tile-lead { grid-column: span 3; }
  .slabs { grid-template-columns: 1fr 1fr; }
  .stamps { grid-template-columns: 1fr 1fr; }
  .specs { grid-template-columns: repeat(3, 1fr); }
  .row { grid-template-columns: 170px 1fr 130px; }
}

@media (min-width: 1024px) {
  .sheet {
    max-width: 1280px;
    display: grid;
    grid-template-columns: 460px 1fr;
    grid-template-areas:
      "top   top"
      "open  statement"
      "open  jump"
      "open  body";
    column-gap: 56px;
    padding: 0 40px 120px;
  }
  .topbar { grid-area: top; }
  .opening {
    grid-area: open;
    position: sticky;
    top: 20px;
    align-self: start;
    text-align: left;
    padding-left: 0;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
  }
  .opening-stage { margin: 22px 0 0; height: 42vh; }
  .opening-bottle { width: 94px; height: 232px; }
  .price { justify-content: flex-start; }
  .statement {
    grid-area: statement;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
    margin-top: 22px;
  }
  .jump { grid-area: jump; padding-inline: 0; }
  .body { grid-area: body; }
  .band { padding-inline: 0; }
  .shelf { grid-template-columns: repeat(4, 1fr); }
  .tile-lead { grid-column: span 4; }
  .shelf-pairs { grid-template-columns: repeat(3, 1fr); }
  .shelf-pairs .tile { grid-column: span 1; }
}

@media (forced-colors: active) {
  .row-grain, .scale-key { display: none; }
  .tile, .row, .slab, .stamp, .spec { border: 1px solid CanvasText; }
}
