/* What's in your phone (/minerals/whats-in-your-phone): the full-screen stage, the phone picker, the step bar, labels on
   the orbs and countries, the element card, and the flat element grid used where WebGL is missing. Page from
   builder/minerals/build_phone.py, script from builder/www/src/phone/ (bundled to /assets/phone.js?v=ef7a8501). Tokens from minerals.css. */
.ph-main { padding: 0; }
.ph-stage { --dock: 120px; position: relative; height: 100vh; height: 100svh; min-height: 640px; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 80% at 50% 35%, #0a1a1c 0%, #05080a 60%, #030507 100%); }
.ph-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
.ph-stage > :not(canvas) { z-index: 3; }

/* heading */
.ph-head { position: absolute; left: 32px; top: 86px; max-width: 460px; pointer-events: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.ph-head a, .ph-head .crumbs { pointer-events: auto; }
.ph-head .crumbs { font-size: 12.5px; color: var(--faint); margin-bottom: 10px; }
.ph-head .crumbs a { color: var(--muted); text-decoration: none; }
.ph-head .crumbs span { margin: 0 4px; }
.ph-head .kick { margin-bottom: 10px; }
.ph-head h1 { font-size: clamp(30px, 3.6vw, 50px); line-height: 1.02; letter-spacing: -.035em; text-shadow: 0 2px 30px rgba(0, 0, 0, .6);
  background: linear-gradient(95deg, #fff 0%, #eef3f1 40%, var(--lime) 75%, var(--teal) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-head .lede { font-size: 15px; color: #c9d4d0; margin-top: 12px; line-height: 1.55; text-shadow: 0 1px 12px rgba(0, 0, 0, .8); }
.picked .ph-head .lede { display: none; }
.picked .ph-head h1 { font-size: clamp(24px, 2.4vw, 34px); }
.has-panel .ph-head { opacity: 0; transform: translateY(-8px); }


/* caption */
.ph-cap { position: absolute; left: 32px; bottom: calc(var(--dock) + 16px); max-width: 520px; font-size: 14px; line-height: 1.5; color: #c9d4d0;
  padding: 10px 14px; border-radius: 14px; background: rgba(6, 11, 13, .64); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.ph-cap b { color: var(--text); font-weight: 600; }
.ph-cap a { color: var(--lime); }
.ph-cap:empty { display: none; }
.has-panel .ph-cap { opacity: 0; pointer-events: none; }
@media (min-width: 1500px) { .has-panel .ph-cap { opacity: 1; pointer-events: auto; } }

/* the phone picker: a row of glass cards along the bottom */
.ph-picker { position: absolute; left: 50%; bottom: 16px; translate: -50% 0; display: flex; gap: 6px; padding: 6px; border-radius: 20px; max-width: calc(100% - 24px);
  overflow-x: auto; scrollbar-width: none; background: rgba(6, 11, 13, .74); border: 1px solid var(--line2);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9); }
.ph-picker::-webkit-scrollbar { display: none; }
.ph-pick { flex: none; display: grid; grid-template-columns: 18px auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 14px 8px 10px;
  border-radius: 14px; color: var(--muted); text-decoration: none; transition: background .25s, color .25s, box-shadow .25s; }
.ph-pick i { grid-row: 1 / 3; width: 16px; height: 30px; border-radius: 4px; border: 1.5px solid var(--t); background: linear-gradient(160deg, color-mix(in srgb, var(--t) 40%, transparent), transparent); box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--t) 50%, transparent); }
.ph-pick b { font-family: var(--head); font-size: 14.5px; font-weight: 600; color: var(--text); letter-spacing: -.01em; white-space: nowrap; }
.ph-pick small { font: 10.5px var(--mono); color: var(--faint); white-space: nowrap; }
.picked .ph-pick { padding: 7px 11px 7px 9px; column-gap: 8px; }
.picked .ph-pick small .y { display: none; }
.ph-pick:hover { background: rgba(255, 255, 255, .05); }
.ph-pick[aria-current="true"] { background: var(--lime); box-shadow: 0 0 28px -4px rgba(220, 255, 60, .55); }
.ph-pick[aria-current="true"] b { color: #0b1200; }
.ph-pick[aria-current="true"] small { color: rgba(11, 18, 0, .7); }
.ph-pick[aria-current="true"] i { border-color: #0b1200; background: rgba(11, 18, 0, .15); box-shadow: none; }
.ph-stage:not(.picked) .ph-picker { bottom: 50%; translate: -50% 50%; flex-wrap: wrap; justify-content: center; max-width: min(820px, calc(100% - 24px)); padding: 10px; }
.ph-stage:not(.picked) .ph-pick { padding: 12px 18px 12px 12px; }
.ph-stage:not(.picked) .ph-picker::before { content: "Pick a phone"; flex-basis: 100%; text-align: center; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lime); padding: 4px 0 6px; }
.ph-stage:not(.picked) .ph-cap { display: none; }

/* the steps */
.ph-steps { position: absolute; left: 50%; top: 84px; translate: -50% 0; display: flex; gap: 4px; padding: 4px; border-radius: 14px;
  background: rgba(6, 11, 13, .7); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.ph-steps[hidden] { display: none; }
.ph-steps button { font: inherit; font-size: 13px; padding: 6px 13px; border-radius: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ph-steps button:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.ph-steps button[aria-pressed="true"] { color: var(--text); background: color-mix(in srgb, var(--teal) 28%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 55%, transparent); }
.ph-steps button[data-step="rock"][aria-pressed="true"] { background: rgba(224, 138, 74, .28); box-shadow: inset 0 0 0 1px rgba(224, 138, 74, .6); }
.has-panel .ph-steps { left: calc((100% - 420px) / 2); }

/* tools */
.ph-tools { position: absolute; right: 24px; top: 84px; display: flex; gap: 6px; }
.ph-ic { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line2); background: rgba(6, 11, 13, .7); color: var(--muted); cursor: pointer;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.ph-ic:hover { color: var(--text); }
.ph-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.has-panel .ph-tools { right: 432px; }
.ph-toast { position: absolute; left: 50%; top: 92px; translate: -50% 0; z-index: 9; font-size: 13.5px; padding: 9px 16px; border-radius: 999px; background: var(--lime); color: #0b1200;
  font-weight: 600; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* labels over the 3D */
.ph-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ph-lbl { position: absolute; left: 0; top: 0; translate: -50% -100%; white-space: nowrap; font: 500 11px var(--mono); color: #dfe8e5; padding: 3px 7px; border-radius: 7px;
  background: rgba(4, 8, 10, .74); border: 1px solid color-mix(in srgb, var(--c, #5fe0c8) 55%, transparent); will-change: transform; transition: opacity .3s, background .2s; }
.ph-lbl b { font-family: var(--head); font-size: 12.5px; color: var(--c, var(--lime)); margin-right: 5px; }
.ph-lbl.el { pointer-events: auto; cursor: pointer; }
.ph-lbl.el:hover, .ph-lbl.el.on { background: color-mix(in srgb, var(--c) 30%, rgba(4, 8, 10, .9)); }
.ph-lbl.country { translate: -50% -130%; font-size: 10.5px; border-color: rgba(255, 255, 255, .16); text-align: center; }
.ph-lbl.country b { display: block; color: var(--text); margin: 0; font-size: 12px; }
.ph-lbl.country.big b { color: var(--lime); font-size: 13.5px; }
.ph-lbl.country.rec { border-color: rgba(95, 224, 200, .6); }
.ph-lbl.country.rec b { color: var(--teal); }
.ph-lbl.layer { translate: 0 -50%; font-size: 10.5px; }
.ph-lbl.layer b { display: block; margin: 0 0 1px; }

/* the element card */
.ph-panel { --c: var(--teal); position: absolute; right: 14px; top: 76px; bottom: 14px; width: 404px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  border-radius: 22px; padding: 0 0 18px; background: rgba(6, 11, 13, .84); border: 1px solid color-mix(in srgb, var(--c) 32%, var(--line));
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); z-index: 6;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .06); animation: pc-in .5s var(--ease); }
.ph-panel[hidden] { display: none; }
@keyframes pc-in { from { opacity: 0; transform: translateX(24px) scale(.98); } }
.pc-head { position: sticky; top: 0; z-index: 2; display: flex; gap: 14px; align-items: center; padding: 16px 18px 12px; background: linear-gradient(180deg, rgba(6, 11, 13, .97) 70%, rgba(6, 11, 13, 0)); }
.pc-tile { flex: none; width: 76px; height: 76px; border-radius: 14px; display: grid; place-content: center; text-align: center; color: #fff;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 75%, #fff 5%), color-mix(in srgb, var(--c) 25%, #05080a));
  box-shadow: 0 0 34px -6px color-mix(in srgb, var(--c) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35); }
.pc-tile b { font: 700 30px/1 var(--head); letter-spacing: -.03em; text-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.pc-tile span { font: 10px var(--mono); opacity: .9; margin-top: 4px; }
.pc-ttl { min-width: 0; padding-right: 30px; }
.pc-kick { font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 0; }
.pc-ttl h2 { font-size: 28px; line-height: 1.05; margin: 2px 0 3px; }
.pc-sub { font-size: 13px; color: var(--muted); margin: 0; }
.pc-sub b { color: var(--c); font-weight: 600; }
.pc-x { position: absolute; right: 12px; top: 10px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line2); background: rgba(255, 255, 255, .04); color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.pc-x:hover { color: var(--text); }
.pc-sec { padding: 10px 18px 6px; }
.pc-sec h3 { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 6px 0 10px; }
.pc-cap, .pc-note { font-size: 12px; color: var(--faint); line-height: 1.55; margin: 8px 0 0; }
.pc-note { font-size: 13px; color: #b8c4c0; }
.pc-src { font: 10.5px var(--mono); color: var(--teal); text-decoration: none; border-bottom: 1px dotted currentColor; margin-left: 2px; }
.pc-split { position: relative; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.pc-split i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: linear-gradient(90deg, rgba(95, 224, 200, .55), rgba(95, 224, 200, .25)); }
.pc-split span { position: relative; display: block; padding: 6px 10px; font-size: 12.5px; color: var(--text); }
.pc-claims { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: #c9d4d0; line-height: 1.45; }
.pc-claims li { padding-left: 14px; position: relative; }
.pc-claims li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }
.pc-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.pc-bars li { display: grid; grid-template-columns: 112px 1fr 48px; align-items: center; gap: 10px; font-size: 13px; color: #c9d4d0; }
.pc-bars span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-bars i { height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .05); position: relative; overflow: hidden; }
.pc-bars i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 5px; background: var(--c); box-shadow: 0 0 14px -2px var(--c); animation: pc-grow .9s var(--ease); }
@keyframes pc-grow { from { width: 0; } }
.pc-bars b { font: 500 12px var(--mono); color: var(--text); text-align: right; }
.pc-mines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-mines li { padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); min-width: 0; }
.pc-mines b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-mines small { display: block; font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-models, .pc-go { display: grid; gap: 8px; }
.pc-models a, .pc-go a { display: block; padding: 10px 12px; border-radius: 12px; text-decoration: none; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.pc-models a:hover, .pc-go a:hover { border-color: var(--c, var(--lime)); background: rgba(255, 255, 255, .05); }
.pc-models b, .pc-go b { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
.pc-models span, .pc-go span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pc-models small { display: inline-block; margin-top: 6px; font: 10.5px var(--mono); color: var(--faint); letter-spacing: .03em; }
.pc-models a.open { border-color: rgba(220, 255, 60, .35); background: linear-gradient(135deg, rgba(220, 255, 60, .08), rgba(255, 255, 255, .02)); }
.pc-models a.open small { color: #0b1200; background: var(--lime); padding: 2px 7px; border-radius: 999px; }

/* loader and the link down */
.ph-load { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; font: 12px var(--mono); color: var(--muted); letter-spacing: .08em;
  text-transform: uppercase; pointer-events: none; transition: opacity 1s var(--ease); background: #05080a; z-index: 8 !important; }
.ph-load i { width: 30px; height: 52px; border-radius: 8px; border: 1.5px solid var(--lime); box-shadow: 0 0 30px -4px rgba(220, 255, 60, .6); animation: ph-spin 1.6s var(--ease) infinite; }
@keyframes ph-spin { 50% { transform: rotateY(180deg) scale(.85); } 100% { transform: rotateY(360deg); } }
.ph-load.gone { opacity: 0; }
.ph-down { position: absolute; right: 24px; bottom: 26px; font: 12px var(--mono); color: var(--faint); text-decoration: none; letter-spacing: .04em; }
.ph-down:hover { color: var(--text); }
.picked .ph-down, .has-panel .ph-down { display: none; }

/* the flat view: an element grid where the 3D would be */
.ph-ring { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ph-ring button:focus-visible { position: fixed; left: 50%; top: 140px; translate: -50% 0; z-index: 9; clip: auto; }
.flat .ph-ring { position: absolute; left: 50%; top: 52%; translate: -50% -50%; height: auto; overflow: visible; clip: auto; width: min(720px, calc(100% - 24px)); display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; pointer-events: auto; }
.flat .ph-ring button { font: inherit; display: grid; gap: 2px; padding: 10px; border-radius: 12px; cursor: pointer; text-align: left; color: var(--text);
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 28%, transparent), rgba(255, 255, 255, .02)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.flat .ph-ring button b { font: 700 22px var(--head); color: var(--c); }
.flat .ph-ring button span { font-size: 12.5px; }
.flat .ph-ring button small { font: 11px var(--mono); color: var(--muted); }
.flat .ph-ring button.on { box-shadow: 0 0 0 2px var(--c); }
.flat canvas, .flat .ph-labels { display: none; }
.flat .ph-steps button[data-step="apart"], .flat .ph-steps button[data-step="elements"] { display: none; }

/* the words below the stage */
.ph-copy { padding-top: 64px; }
.ph-copy > h2:first-child { margin-top: 0; }
.ph-list { padding-left: 18px; display: grid; gap: 8px; }
.ph-src { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }

/* small screens */
@media (max-width: 900px) {
  .ph-stage { --dock: 84px; height: 88vh; height: 88svh; min-height: 600px; }
  .ph-head { left: 16px; right: 16px; top: 72px; max-width: none; }
  .ph-head .crumbs, .ph-head .kick { display: none; }
  .ph-head h1 { font-size: 26px; }
  .ph-head .lede { font-size: 13px; margin-top: 6px; }
  .ph-tools { top: 72px; right: 12px; }
  .ph-ic { width: 34px; height: 34px; }
  #ph-full { display: none; }
  .ph-cap { left: 12px; right: 56px; bottom: auto; top: 116px; max-width: none; font-size: 12.5px; padding: 8px 12px; }
  .ph-picker { bottom: 10px; justify-content: flex-start; }
  .ph-pick { padding: 6px 10px 6px 8px; }
  .ph-pick small { display: none; }
  .ph-pick i { height: 22px; width: 12px; }
  .ph-stage:not(.picked) .ph-picker { bottom: 14px; translate: -50% 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px; }
  .ph-stage:not(.picked) .ph-picker::before { grid-column: 1 / -1; }
  .ph-stage:not(.picked) .ph-pick { padding: 8px 10px 8px 8px; }
  .picked .ph-head { display: none; }
  .picked .ph-cap { top: 66px; }
  .ph-stage:not(.picked) .ph-pick small { display: block; }
  .ph-steps { top: auto; bottom: calc(var(--dock) - 14px); width: calc(100% - 16px); justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  .ph-steps button { padding: 6px 8px; font-size: 12px; }
  .has-panel .ph-steps { left: 50%; }
  .ph-down { display: none; }
  .ph-panel { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; height: 60%; border-radius: 22px 22px 18px 18px; animation-name: pc-up; }
  @keyframes pc-up { from { opacity: 0; transform: translateY(40px); } }
  .has-panel .ph-tools, .has-panel .ph-picker, .has-panel .ph-steps { opacity: 0; pointer-events: none; }
  .flat .ph-ring { top: 56%; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .ph-panel, .pc-bars i::after, .ph-load i { animation: none; }
}
