/* Dev Crow Egg · Feed (Round 3). One design per screen, each on its own saturated colour field.
   Every block reads two tokens: --field (the colour) and --on (the text colour on it, contrast checked).
   Type: Bricolage Grotesque (display), DM Sans (text), Readex Pro (Arabic). Logical properties throughout. */

:root {
  --ink: #17121c; --paper: #ffffff; --muted: #575062; --line: rgba(23, 18, 28, .16); --hot: #ff5b3a;
  --field: #17121c; --on: #ffffff;
  --f-d: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --f-b: "DM Sans", system-ui, sans-serif;
  --r-l: 32px; --r-m: 22px; --r-s: 14px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --top-h: calc(112px + var(--sat));
  --col: min(440px, calc((100vh - 32px) * .52));
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* the shared room viewer */
  --rv-bg: #17121c; --rv-surface: #241d2b; --rv-text: #ffffff; --rv-muted: #cfc8d8; --rv-line: rgba(255, 255, 255, .18);
  --rv-accent: #c4f236; --rv-accent-text: #17121c; --rv-radius: 22px; --rv-font: var(--f-b); --rv-font-display: var(--f-d);
  color-scheme: light;
}
:root[lang="ar"] { --f-d: "Readex Pro", "DM Sans", sans-serif; --f-b: "Readex Pro", "DM Sans", sans-serif; }
:root.snap { scroll-snap-type: y mandatory; }
:root.snap.rm { scroll-snap-type: none; }
:root:not(.rm) { scroll-behavior: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font: 400 16px/1.5 var(--f-b); color: var(--on); background: var(--field);
  -webkit-font-smoothing: antialiased; transition: background-color .45s var(--ease);
}
.rm body, .rm * { transition-duration: 0s !important; animation: none !important; }
h1, h2, h3, p, ol, ul, dl, dd, figure, fieldset { margin: 0; }
ol, ul { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.ico { width: 22px; height: 22px; flex: none; }
[dir="rtl"] .ico--dir { transform: scaleX(-1); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--on); outline-offset: 3px; }
.skip { position: fixed; z-index: 100; inset-inline-start: 12px; top: -80px; padding: 12px 18px; border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 700; text-decoration: none; }
.skip:focus { top: calc(10px + var(--sat)); outline-color: var(--ink); }
[lang="ar"] * { letter-spacing: normal !important; }

/* ---------- pills, buttons, chips ---------- */
.pill {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--on); color: var(--field); font: 700 15px/1 var(--f-b); text-decoration: none; white-space: nowrap;
}
.pill--ico { padding: 0 11px; }
.pill:disabled { opacity: .35; cursor: default; }
.pill__txt { display: none; }
.badge {
  position: absolute; top: -4px; inset-inline-end: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--hot); color: var(--ink); font: 700 12px/22px var(--f-b); text-align: center; box-shadow: 0 0 0 2px var(--field);
}
.badge.is-zero { display: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px;
  border-radius: 999px; border: 2px solid var(--on); font: 700 17px/1.1 var(--f-d); text-decoration: none; text-align: center;
  transition: transform .15s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn--add { background: var(--on); color: var(--field); }
.btn--ghost { background: transparent; color: var(--on); }
.btn--wide { width: 100%; }
.btn.is-done { transform: scale(1.03); }
.chip {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--on);
  background: transparent; color: var(--on); font: 600 15px/1 var(--f-b); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--on); color: var(--field); }
.link { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.kick { display: inline-flex; align-self: flex-start; padding: 6px 12px; border-radius: 999px; border: 2px solid var(--on); font: 700 14px/1 var(--f-b); }

/* ---------- the logo: an egg with a play mark ---------- */
.mark { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; color: var(--on); text-decoration: none; }
.mark__egg { width: 30px; height: 30px; fill: var(--on); }
.mark__play { fill: var(--field); }
.mark__t { font: 800 17px/1 "Bricolage Grotesque", var(--f-d); letter-spacing: -.03em; white-space: nowrap; }
.foot__mark { font-family: "Bricolage Grotesque", var(--f-d) !important; }

/* ---------- home: the top bar + chips (phone), rails (desktop) ---------- */
.rail-l { position: fixed; z-index: 20; top: 0; inset-inline: 0; padding: var(--sat) 12px 0; pointer-events: none; }
.rail-l > * { pointer-events: auto; }
.top { display: flex; align-items: center; gap: 6px; height: 58px; }
.top__sp { flex: 1; }
@media (max-width: 379px) { .top .mark__t { display: none; } }
.rail-nav, .rail-keys, .rail-r { display: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 8px; margin-inline: -12px; padding-inline: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { background: var(--field); }
.chips .chip[aria-pressed="true"] { background: var(--on); }

/* ---------- a screen ---------- */
.scr { min-height: 100svh; scroll-snap-align: start; position: relative; outline: none; }
.scr--p, .scr--intro { height: 100svh; }
.scr__card {
  position: relative; min-height: 100svh; height: 100%; display: flex; flex-direction: column; gap: 12px;
  padding: var(--top-h) 16px calc(16px + var(--sab)); background: var(--field); color: var(--on); overflow: hidden;
}
.scr:focus-visible .scr__card { box-shadow: inset 0 0 0 4px var(--on); }
.scr__h { font: 800 clamp(30px, 8.6vw, 44px)/1 var(--f-d); letter-spacing: -.035em; text-wrap: balance; }
.scr__p { font-size: 17px; line-height: 1.45; max-width: 34ch; }

/* the stage: a still of the model, with the one live canvas laid over it on the screen in view */
.scr__stage, .stagebox { position: relative; flex: 1 1 auto; min-height: 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.scr__stage::before, .stagebox::before {
  content: ""; position: absolute; inset-inline: 22%; bottom: 7%; height: 9%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(23, 18, 28, .38), rgba(23, 18, 28, 0)); pointer-events: none;
}
.scr__still, .stagebox > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .3s; pointer-events: none; }
.scr__still.is-on, .stagebox > img.is-on { opacity: 1; }
.scr__stage:has(canvas.live.is-on) .scr__still, .stagebox:has(canvas.live.is-on) > img { opacity: 0; transition: none; }
canvas.live { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: grab; }
canvas.live.is-on { opacity: 1; }
canvas.live:active { cursor: grabbing; }
.no3d::after { content: attr(data-no3d); position: absolute; inset: auto 0 40%; text-align: center; font-weight: 600; }

/* product screens */
.scr__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.scr__info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; border: 2px solid var(--on); font: 700 13px/1.1 var(--f-b); }
.tag .ico { width: 14px; height: 14px; fill: currentColor; }
.tag--studio, .tag--off { background: var(--on); color: var(--field); }
.scr__name { font: 800 clamp(27px, 7.6vw, 38px)/1 var(--f-d); letter-spacing: -.035em; text-wrap: balance; }
.scr__name a { display: inline-block; padding-block: 9px; margin-block: -9px; text-decoration: none; }
.scr__name a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.scr__by { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 15px; font-weight: 500; }
.mat { display: inline-block; padding: 1px 7px; border: 2px solid currentColor; border-radius: 7px; font: 700 12.5px/1.4 var(--f-b); letter-spacing: .02em; }
.pr { display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pr__now { font: 800 18px/1.1 var(--f-d); }
.pr__was { font-size: 15px; font-weight: 500; }
.pr--feed .pr__now { font-size: 26px; letter-spacing: -.02em; }
.dots { display: flex; align-items: center; margin-inline-start: -8px; }
.dot { position: relative; display: grid; place-items: center; width: 44px; height: 44px; }
.dot input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.dot span { width: 28px; height: 28px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--on); transition: box-shadow .15s; }
.dot input:checked + span { box-shadow: 0 0 0 3px var(--field), 0 0 0 6px var(--on); }
.dot input:focus-visible + span { outline: 3px solid var(--on); outline-offset: 7px; }
.dots__name { margin-inline-start: 8px; font-size: 14px; font-weight: 600; }
.scr__buy { display: flex; gap: 8px; }
.scr__buy .btn--add { flex: 1; }
.scr__side { display: flex; flex-direction: column; gap: 10px; padding-bottom: 66px; }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 3px; width: 56px; padding: 0; border: 0; background: none;
  color: var(--on); font: 600 13px/1.2 var(--f-b); text-decoration: none;
}
.act .ico { box-sizing: content-box; width: 22px; height: 22px; padding: 11px; border-radius: 50%; border: 2px solid var(--on); }
.act[aria-pressed="true"] .ico { background: var(--on); color: var(--field); fill: var(--field); }
.act[aria-pressed="true"] .ico path { fill: var(--field); stroke: var(--field); }

/* intro */
.scr--intro .scr__card { gap: 14px; }
.intro__t { font: 800 clamp(44px, 13vw, 76px)/.92 var(--f-d); letter-spacing: -.045em; max-width: 9ch; }
:root[lang="ar"] .intro__t { font-size: clamp(36px, 10vw, 60px); line-height: 1.15; max-width: 11ch; }
.scr__stage--intro { margin-block: -8px; }
.intro__sub { font-size: 17px; max-width: 32ch; }
.intro__cta { display: flex; gap: 8px; }
.intro__cta .btn { flex: 1; }
.intro__cue { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600; }
.intro__cue .ico { animation: cue 1.4s var(--ease) 3; }
.cue--mouse { display: none; }
@media (hover: hover) and (pointer: fine) { .cue--mouse { display: inline; } .cue--touch { display: none; } }
@keyframes cue { 50% { transform: translateY(5px); } }

/* how it's made: a sideways carousel of the 4 steps */
.scr--how .scr__card, .scr--sell .scr__card, .scr--trust .scr__card, .scr--end .scr__card { justify-content: center; gap: 14px; }
.car {
  display: grid; grid-auto-flow: column; grid-auto-columns: 84%; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; margin-inline: -16px; padding: 4px 16px 8px; scroll-padding-inline: 16px; scrollbar-width: none;
}
.car::-webkit-scrollbar { display: none; }
.car__i {
  scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; min-height: min(46svh, 380px);
  padding: 20px; border-radius: var(--r-m); background: var(--field); color: var(--on);
}
.car__n { font: 800 110px/.8 var(--f-d); letter-spacing: -.06em; margin-bottom: auto; }
.car__i .ico { width: 34px; height: 34px; }
.car__i h3 { font: 800 24px/1.05 var(--f-d); letter-spacing: -.02em; }
.car__nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.car__at { font-weight: 700; min-width: 9ch; text-align: center; }

/* your design here: the mini calculator */
.mini { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-m); background: var(--ink); color: #fff; --on: #ffffff; --field: #17121c; }
.mini__t { font: 800 20px/1.1 var(--f-d); }
.mini__l { display: block; padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.mini__row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.seg { display: flex; gap: 6px; }
.seg--wrap { flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--on); font-weight: 600; font-size: 15px; }
.seg input:checked + span { background: #c4f236; border-color: #c4f236; color: var(--ink); }
.seg input:focus-visible + span { outline: 3px solid var(--on); outline-offset: 3px; }
.mini__p { flex: 1; min-width: 130px; }
.pin { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--on); }
.pin:focus-within { outline: 3px solid #c4f236; outline-offset: 2px; }
.pin__c { font-weight: 700; }
.pin input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; outline: none; font: 700 18px/1 var(--f-b); }
.mini__out { display: flex; flex-direction: column; gap: 2px; }
.mini__out b { font: 800 34px/1.05 var(--f-d); color: #c4f236; letter-spacing: -.02em; }
.mini__out small { font-size: 14px; color: #ddd6e5; }

/* trust */
.trust { display: grid; gap: 20px; }
.trust li { display: flex; gap: 14px; align-items: flex-start; }
.trust .ico { width: 34px; height: 34px; }
.trust b { display: block; font: 800 21px/1.15 var(--f-d); letter-spacing: -.015em; margin-bottom: 3px; }

/* end + footer */
.scr--end .btn { align-self: flex-start; }
.foot { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; padding-top: 20px; border-top: 2px solid color-mix(in srgb, var(--on) 25%, transparent); }
.foot__mark { font: 800 34px/1 var(--f-d); letter-spacing: -.04em; }
.foot__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.foot__cols nav { display: flex; flex-direction: column; align-items: flex-start; }
.foot__cols h3 { font: 800 17px/1 var(--f-d); margin-bottom: 4px; }
.foot__cols a, .foot__cols .link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; font-size: 16px; text-decoration: none; text-align: start; }
.foot__cols a:hover, .foot__cols .link:hover { text-decoration: underline; }
.foot__copy { font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* ---------- desktop: a phone-width feed between two rails ---------- */
@media (min-width: 1024px) {
  :root { --top-h: 0px; }
  body.pg-home { background: color-mix(in srgb, var(--field) 30%, var(--ink)); }
  .feed { width: var(--col); margin-inline: auto; }
  .scr { height: 100vh; min-height: 100vh; padding: 16px 0; }
  .scr__card { min-height: 0; border-radius: var(--r-l); padding: 24px 20px 20px; }
  .scr:not(.scr--p):not(.scr--intro) { height: auto; }
  .scr:not(.scr--p):not(.scr--intro) .scr__card { min-height: calc(100vh - 32px); }
  .rail { --on: #ffffff; --field: #17121c; position: fixed; top: 0; bottom: 0; width: calc((100vw - var(--col)) / 2); padding: 28px 32px; color: #fff; overflow-y: auto; }
  .rail-l { inset-inline-start: 0; inset-inline-end: auto; display: flex; flex-direction: column; gap: 22px; pointer-events: auto; }
  .rail-l .top { flex-direction: column; align-items: flex-start; height: auto; gap: 10px; }
  .rail-l .top__sp, .pill--sell { display: none; }
  .rail-nav { display: flex; flex-direction: column; margin-bottom: 6px; }
  .rail-nav a { font: 800 26px/1.15 var(--f-d); letter-spacing: -.025em; text-decoration: none; padding: 3px 0; }
  .rail-nav a:hover { text-decoration: underline; }
  .rail-l .pill__txt { display: inline; }
  .rail-l .pill--ico { padding: 0 18px 0 14px; }
  .mark__t { font-size: 24px; }
  .mark__egg { width: 36px; height: 36px; }
  .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; max-width: 330px; }
  .chips .chip { background: transparent; }
  .chips .chip[aria-pressed="true"] { background: #fff; }
  .rail-keys { display: block; margin-top: auto; font-size: 14px; color: #ddd6e5; max-width: 30ch; }
  .rail-r { display: flex; flex-direction: column; justify-content: center; gap: 18px; inset-inline-end: 0; }
  .rcard { max-width: 340px; padding: 22px; border-radius: var(--r-m); background: rgba(255, 255, 255, .08); }
  .rcard h2 { font: 800 24px/1.05 var(--f-d); letter-spacing: -.025em; margin-bottom: 12px; }
  .rsteps { counter-reset: s; display: grid; gap: 10px; }
  .rsteps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; column-gap: 8px; font-size: 14px; color: #ddd6e5; }
  .rsteps li::before { content: counter(s); grid-row: span 2; font: 800 24px/1 var(--f-d); color: #fff; }
  .rsteps b { color: #fff; font-size: 15px; }
  .rcard--sell { background: #c4f236; color: var(--ink); --on: #17121c; --field: #c4f236; }
  .rcard--sell p { margin-bottom: 14px; }
  .rnav { display: flex; align-items: center; gap: 12px; }
  .rnav__n { font-weight: 700; min-width: 11ch; text-align: center; }
  .car { grid-auto-columns: 88%; }
  .intro__t { font-size: clamp(40px, 6.4vh, 60px); }
}
@media (min-width: 1024px) and (max-height: 760px) {
  .scr__name { font-size: 30px; }
  .dots .dot { width: 40px; height: 44px; }
}

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 60; inset-inline: 12px; bottom: calc(16px + var(--sab) + var(--toast-lift, 0px)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; width: min(420px, 100%); padding: 10px 12px; border-radius: 20px;
  background: var(--ink); color: #fff; box-shadow: 0 12px 30px rgba(23, 18, 28, .35); pointer-events: auto;
  transform: translateY(16px); opacity: 0; transition: transform .25s var(--ease), opacity .25s;
}
.toast.is-on { transform: none; opacity: 1; }
.toast__art { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--field); overflow: hidden; position: relative; }
.toast__art img { width: 100%; height: 100%; object-fit: contain; }
.toast__txt { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.toast__txt b { font-size: 15px; }
.toast__undo { margin-inline-start: auto; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 2px solid #fff; background: none; color: #fff; font-weight: 700; }

/* ---------- search dialog ---------- */
.dlg { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink); --on: #17121c; --field: #ffffff; }
.dlg::backdrop { background: rgba(23, 18, 28, .6); }
.dlg__h { position: sticky; top: 0; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--sat)) 12px 10px; background: var(--paper); border-bottom: 2px solid var(--line); }
.dlg__ico { display: grid; place-items: center; width: 32px; }
.dlg__h input { flex: 1; min-width: 0; min-height: 48px; border: 0; background: none; font-size: 18px; outline: none; }
.dlg__h:focus-within { box-shadow: inset 0 -3px 0 var(--ink); }
.iconbtn { display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--ink); color: #fff; }
.dlg__b { padding: 12px 12px calc(24px + var(--sab)); }
.sres__n { font-weight: 700; margin: 4px 4px 10px; }
.sres { display: grid; gap: 8px; }
.srow { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 18px; text-decoration: none; }
.srow:hover { background: #f1eff4; }
.srow__art { position: relative; flex: none; width: 64px; height: 64px; border-radius: 14px; background: var(--field); }
.srow__art img { width: 100%; height: 100%; object-fit: contain; opacity: 0; }
.srow__art img.is-on { opacity: 1; }
.srow__t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.srow__n { font: 700 17px/1.2 var(--f-d); }
.srow__by { font-size: 14px; color: var(--muted); }
@media (min-width: 700px) {
  .dlg { width: min(620px, calc(100% - 48px)); height: auto; max-height: min(720px, calc(100% - 64px)); margin: 32px auto auto; border-radius: var(--r-m); }
  .dlg__h { padding-top: 10px; }
}
