/* ============================================================
   F. BINSABBAR - Diamonds & Craftsmanship  ·  page styles
   Layers on top of fb-ui.css (tokens + components). This file
   owns page layout, the Diamond Size Studio, and the section
   pieces (growth strip, shape gallery, craft steps). The house
   "Promise" card + criterion + tip are lifted from the /traders
   reference so the two pages read as one system.
   ============================================================ */

/* ---------- page shell ---------- */
html, body { overflow-x: hidden; }        /* safety net against any stray wide child */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s-4) max(var(--s-6), env(safe-area-inset-right)) 120px max(var(--s-6), env(safe-area-inset-left));
}
.page p { line-height: 1.65; }
.hero h1 { max-width: 16ch; }

/* Section headings sit closer to their intro copy on this page */
.section > h2 { margin-bottom: var(--s-6); }

/* ============================================================
   THE DIAMOND SIZE STUDIO
   ============================================================ */
.studio {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: var(--s-6);
  align-items: start;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-glass);
  box-shadow: var(--glass-shadow);
  padding: var(--s-6);
}
.studio > * { min-width: 0; }              /* let both columns shrink instead of overflowing */
@media (max-width: 820px) {
  .studio { grid-template-columns: 1fr; gap: var(--s-5); }
}

/* ---- left: the to-scale stage ---- */
.studio__stage-wrap { position: sticky; top: calc(var(--page-nav-h) + var(--s-3)); }
@media (max-width: 820px) { .studio__stage-wrap { position: static; } }

.studio__stage {
  position: relative;
  aspect-ratio: 530 / 830;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border-radius: var(--radius-card);
  background: #f7f1e4;                 /* solid stage colour */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 1px 4px rgba(0,0,0,0.05);
  overflow: hidden;
}
.stage-hand {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  user-select: none; -webkit-user-drag: none;
}
.stage-stone {
  position: absolute;
  transform-origin: 50% 50%;
  pointer-events: none;
  filter: drop-shadow(0 1px 1.5px rgba(0,0,0,0.35));
  transition: width 0.12s ease, height 0.12s ease, left 0.12s ease, top 0.12s ease;
}

.studio__meter { max-width: 340px; margin: var(--s-4) auto 0; }
.studio__meter-track {
  height: 6px; border-radius: 999px;
  background: rgba(0,0,0,0.08); overflow: hidden;
}
.studio__meter-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: var(--text);
  transition: width 0.25s ease, background 0.25s ease;
}
.studio__meter-labels {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  font-size: 10.5px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-faint);
}
.studio__meter-labels span:last-child { color: var(--text-muted); font-weight: 500; }
.studio__scalenote {
  max-width: 340px; margin: var(--s-3) auto 0;
  font-size: 11px; line-height: 1.5; color: var(--text-faint);
  text-align: center;
}

/* ---- right: controls ---- */
.studio__controls { display: grid; gap: var(--s-5); min-width: 0; }
.ctl { display: grid; gap: var(--s-3); min-width: 0; }
.ctl--row {
  grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--s-5); align-items: start;
}
@media (max-width: 520px) { .ctl--row { grid-template-columns: 1fr; } }
.ctl__label {
  font-size: 11px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 500;
}
.ctl__label strong { color: var(--accent); }
.ctl__hint { margin: 6px 0 0; font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }

/* shape chips */
.shape-chips {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s-2);
}
@media (max-width: 520px) { .shape-chips { gap: 6px; } }
.shape-chip {
  min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: var(--s-2) 4px;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.shape-chip:hover { border-color: var(--accent); background: rgba(255,255,255,0.75); }
.shape-chip:active { transform: scale(0.96); }
.shape-chip.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.shape-chip__ico { width: 100%; max-width: 32px; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.shape-chip__ico img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.shape-chip__name {
  font-size: 9.5px; letter-spacing: 0.03em; color: var(--text-muted);
  text-transform: uppercase; text-align: center; line-height: 1.1;
  overflow-wrap: anywhere;
}
.shape-chip.is-on .shape-chip__name { color: var(--text); font-weight: 500; }

/* look segmented control */
.lookseg {
  display: flex; gap: 3px; padding: 3px;
  background: rgba(0,0,0,0.05); border-radius: var(--radius-pill);
}
.lookseg button {
  flex: 1; height: 38px; border: 0; background: transparent; cursor: pointer;
  border-radius: var(--radius-pill);
  font-family: inherit; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.lookseg button:hover { color: var(--text); }
.lookseg button.is-on { background: #fff; color: var(--text); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

/* carat */
.ctl__caratline { display: flex; align-items: baseline; justify-content: space-between; }
.ctl__caratval { font-size: 13px; color: var(--text-muted); }
.ctl__caratval strong {
  font-family: futura-pt, "Tajawal", sans-serif; font-weight: 400;
  font-size: 22px; color: var(--text); letter-spacing: 0.01em;
}
.ctl__presets { display: flex; gap: 6px; }
.ctl__presets button {
  flex: 1; height: 30px; border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.5); border-radius: var(--radius-pill);
  font-family: inherit; font-size: 12px; color: var(--text-muted); cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ctl__presets button:hover { border-color: var(--accent); color: var(--text); }

/* readout */
.readout {
  padding: var(--s-4);
  background: rgba(255,255,255,0.4);
  border-radius: var(--radius-card);
  border: 1px solid rgba(0,0,0,0.06);
}
.readout__row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--s-3); }
.readout__cell { display: grid; gap: 3px; }
.readout__k { font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.readout__v { font-size: 15px; color: var(--text); font-weight: 500; }
.readout__wears {
  margin: var(--s-3) 0 0; padding-top: var(--s-3);
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 12.5px; line-height: 1.55; color: var(--text-muted);
}

/* recommendation */
.rec {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, rgba(247,72,39,0.07), rgba(254,229,165,0.12));
  border: 1px solid rgba(247,72,39,0.16);
}
.rec__eyebrow {
  margin: 0 0 6px; font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
}
.rec__line { margin: 0; font-size: 16px; line-height: 1.45; color: var(--text); font-weight: 300; }
.rec__line strong { font-weight: 500; }
.rec__note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }

/* ============================================================
   SIZE IN PERSPECTIVE - growth strip
   ============================================================ */
.growth {
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: var(--s-3);
  align-items: end;
  margin: var(--s-5) 0 var(--s-4);
}
.growth-cell { text-align: center; }
.growth-art {
  display: flex; align-items: center; justify-content: center;
  height: 92px; margin: 0 auto 6px;
}
.growth-art img { width: 100%; height: 100%; object-fit: contain; display: block; }
.growth-ct {
  display: block; font-family: futura-pt, "Tajawal", sans-serif;
  font-size: 15px; color: var(--text);
}
.growth-mm { display: block; font-size: 10.5px; letter-spacing: 0.06em; color: var(--text-faint); }
@media (max-width: 520px) {
  .growth-cell svg { max-width: 60px; }
  .growth-ct { font-size: 13px; }
}

/* ============================================================
   SHAPE GALLERY
   ============================================================ */
.shapegallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-4);
}
.shapecard {
  display: flex; flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-glass);
  box-shadow: var(--glass-shadow);
  padding: var(--s-5);
}
.shapecard__art {
  display: flex; align-items: center; justify-content: center;
  height: 88px; margin-bottom: var(--s-3);
}
.shapecard__art img { max-width: 82px; max-height: 82px; object-fit: contain; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12)); }
.shapecard h4 { margin: 0 0 2px; font-size: 16px; font-weight: 500; color: var(--text); }
.shapecard__ratio {
  margin: 0 0 var(--s-3); font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-faint);
}
.shapecard__wears { margin: 0 0 var(--s-3); font-size: 13px; line-height: 1.55; color: var(--text-muted); }
.shapecard__suits { margin: 0 0 var(--s-4); font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }
.shapecard__suits strong { color: var(--text); font-weight: 500; }
.shapecard__try {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 var(--s-4);
  background: transparent; color: var(--text);
  border: 1px solid rgba(0,0,0,0.16); border-radius: var(--radius-pill);
  font-family: inherit; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.shapecard__try svg { width: 14px; height: 14px; }
.shapecard__try:hover { background: var(--accent); color: var(--premium-yellow); border-color: var(--accent); }

/* ============================================================
   CRAFT STEPS
   ============================================================ */
.craft-subhead {
  font-weight: 400; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin: var(--s-8) 0 var(--s-5);
}
.craft-steps { align-items: stretch; }
.stepcard {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-glass);
  box-shadow: var(--glass-shadow);
  padding: var(--s-5);
}
.stepcard__n {
  display: block; font-family: futura-pt, "Tajawal", sans-serif; font-weight: 300;
  font-size: 26px; color: var(--accent); line-height: 1; margin-bottom: var(--s-3);
}
.stepcard h4 { margin: 0 0 6px; font-size: 15px; font-weight: 500; color: var(--text); }
.stepcard p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-muted); }

/* ============================================================
   HOUSE "PROMISE" CARD + CRITERION + TIP
   (lifted from the /traders reference so both pages match)
   ============================================================ */
.fb-standard__card {
  position: relative;
  padding: var(--s-7) var(--s-6) var(--s-6);
  border-radius: var(--radius-glass);
  background:
    linear-gradient(135deg, rgba(247,72,39,0.06), rgba(254,229,165,0.10) 60%, rgba(177,155,125,0.08)),
    var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.section > .fb-standard__card + .craft-subhead { margin-top: var(--s-8); }
.fb-standard__eyebrow {
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); font-weight: 500; margin: 0;
}
.fb-standard__statement {
  font-size: clamp(22px, 3vw, 30px); line-height: 1.25; font-weight: 300;
  color: var(--text); margin: var(--s-3) 0 var(--s-4); max-width: 28ch; letter-spacing: -0.005em;
}
.fb-standard__statement strong { font-weight: 500; }
.fb-standard__lede {
  font-size: 14px; color: var(--text-muted); max-width: 65ch; margin: 0 0 var(--s-6); line-height: 1.65;
}
.fb-standard__criteria {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4);
  padding-top: var(--s-5); border-top: 1px solid rgba(0,0,0,0.08);
}
.criterion { display: grid; grid-template-columns: 28px 1fr; column-gap: var(--s-3); align-items: start; }
.criterion__icon {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--accent); color: #fff; flex-shrink: 0;
}
.criterion__icon svg { width: 14px; height: 14px; }
.criterion h4 { margin: 4px 0 4px; font-size: 13.5px; font-weight: 500; letter-spacing: 0.02em; color: var(--text); }
.criterion p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }

.tip {
  margin: var(--s-4) 0 0; padding: var(--s-3) var(--s-4);
  background: rgba(247,72,39,0.06); border-left: 3px solid var(--accent); border-radius: 8px;
  font-size: 13px; line-height: 1.55; color: var(--text);
}
.tip strong { font-weight: 500; }
.tip::before {
  content: "House note"; display: block;
  font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 4px; font-weight: 500;
}

/* ---------- narrow-screen trims ---------- */
@media (max-width: 600px) {
  .page { padding: var(--s-3) var(--s-4) 80px; }
  .fb-standard__statement { font-size: 22px; }
  .fb-standard__card { padding: var(--s-6) var(--s-5) var(--s-5); }
  .studio { padding: var(--s-5); }
}

/* ============================================================
   AR "Try it on your hand" (beta)
   ============================================================ */
.ar-open {
  display: inline-flex; align-items: center; gap: 8px;
  margin: var(--s-4) auto 0;
  height: 40px; padding: 0 var(--s-4);
  background: var(--text); color: var(--canvas-bg);
  border: 0; border-radius: var(--radius-pill);
  font-family: inherit; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; transition: transform 0.15s ease, opacity 0.15s ease;
}
.studio__stage-wrap { text-align: center; }
.ar-open:hover { transform: translateY(-1px); opacity: 0.92; }
.ar-open svg { width: 16px; height: 16px; }
.ar-open__beta {
  font-size: 8.5px; letter-spacing: 0.14em; padding: 2px 6px;
  border-radius: 999px; background: var(--accent); color: var(--premium-yellow);
}

.ar-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: #0b0b0b;
  display: none;
}
.ar-modal.is-on { display: block; }
.ar-stage { position: absolute; inset: 0; overflow: hidden; }
.ar-modal.is-mirrored .ar-stage { transform: scaleX(-1); }
.ar-video, .ar-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.ar-video { background: #0b0b0b; }

.ar-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(var(--s-4), env(safe-area-inset-top)) var(--s-4) var(--s-4);
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0));
}
.ar-title { color: #fff; font-size: 13px; letter-spacing: 0.10em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; }
.ar-title__beta { font-size: 8.5px; letter-spacing: 0.14em; padding: 2px 6px; border-radius: 999px; background: var(--accent); color: var(--premium-yellow); }
.ar-actions { display: flex; gap: var(--s-2); }
.ar-iconbtn {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 0; color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
.ar-iconbtn:hover { background: rgba(255,255,255,0.28); }
.ar-iconbtn svg { width: 20px; height: 20px; }

.ar-footer {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: var(--s-5) var(--s-5) max(var(--s-5), env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(0deg, rgba(0,0,0,0.6), rgba(0,0,0,0));
}
.ar-status { margin: 0 0 6px; color: #fff; font-size: 14px; line-height: 1.5; min-height: 1.4em; }
.ar-readout { margin: 0 0 8px; color: var(--premium-yellow); font-size: 13px; letter-spacing: 0.04em; font-weight: 500; }
.ar-hint { margin: 0 auto; max-width: 34ch; color: rgba(255,255,255,0.7); font-size: 11px; line-height: 1.5; }
