/* مِسبار — Luxury Navy & Gold Unit Converter */
:root{
  --ease: cubic-bezier(.32,.72,0,1);
  --r-xl: 34px;
  --r-lg: 26px;
  --r-md: 16px;
  --r-sm: 12px;

  --bg: #060b14;
  --bg-soft: #0a1423;
  --surface: rgba(255,255,255,.042);
  --surface-2: rgba(255,255,255,.07);
  --surface-3: rgba(255,255,255,.11);
  --border: rgba(255,255,255,.09);
  --border-2: rgba(255,255,255,.16);
  --fg: #f5f2ea;
  --muted: #93a2b5;
  --faint: #63758c;

  --gold: #c9a227;
  --gold-2: #e8c96a;
  --gold-3: #f3e2ad;
  --gold-text: #e8c96a;
  --gold-soft: rgba(201,162,39,.14);
  --gold-line: rgba(201,162,39,.34);

  --sea: #1e3a8a;
  --sea-2: #3b82f6;
  --danger: #e5484d;

  --shadow-soft: 0 30px 60px -30px rgba(0,0,0,.75);
  --shadow-lift: 0 24px 48px -20px rgba(0,0,0,.6);
  --bezel-outer: rgba(255,255,255,.06);

  --font-display: "Reem Kufi", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

html[data-theme="light"]{
  --bg: #faf8f3;
  --bg-soft: #f2eee4;
  --surface: #ffffff;
  --surface-2: rgba(15,23,42,.035);
  --surface-3: rgba(15,23,42,.07);
  --border: rgba(15,23,42,.10);
  --border-2: rgba(15,23,42,.18);
  --fg: #101a2c;
  --muted: #5b6678;
  --faint: #8b93a1;

  --gold: #a16207;
  --gold-2: #b8860b;
  --gold-3: #d8a92e;
  --gold-text: #8a6210;
  --gold-soft: rgba(161,98,7,.10);
  --gold-line: rgba(161,98,7,.28);

  --bezel-outer: rgba(15,23,42,.05);
  --shadow-soft: 0 30px 60px -34px rgba(15,23,42,.28);
  --shadow-lift: 0 20px 40px -24px rgba(15,23,42,.24);
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background .6s var(--ease), color .6s var(--ease);
}
h1,h2,h3{ font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
p{ margin: 0; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; color: inherit; }
i[data-lucide]{ display: inline-flex; width: 1em; height: 1em; }
.num{ font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- ambient background ---------- */
.ambient{ position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob{ position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.blob-a{
  width: 46vw; height: 46vw; top: -14vw; inset-inline-end: -8vw;
  background: radial-gradient(circle at 30% 30%, rgba(201,162,39,.30), transparent 68%);
  animation: drift 26s var(--ease) infinite alternate;
}
.blob-b{
  width: 52vw; height: 52vw; bottom: -22vw; inset-inline-start: -14vw;
  background: radial-gradient(circle at 60% 40%, rgba(30,58,138,.55), transparent 70%);
  animation: drift 34s var(--ease) infinite alternate-reverse;
}
.grid-veil{
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
}
html[data-theme="light"] .grid-veil{ background-image: linear-gradient(rgba(15,23,42,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(15,23,42,.05) 1px, transparent 1px); }
@keyframes drift{ from{ transform: translate3d(0,0,0) scale(1); } to{ transform: translate3d(4vw,3vw,0) scale(1.14); } }

/* ---------- shell ---------- */
.container{ width: min(1180px, 100% - 40px); margin-inline: auto; }
.section{ position: relative; z-index: 1; padding: 88px 0; }
.stack{ display: flex; flex-direction: column; }
.eyebrow{
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; color: var(--gold-text);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow .dot{ width: 6px; height: 6px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 12px var(--gold-2); }
.section-sub{ color: var(--muted); margin-top: 14px; max-width: 62ch; }
.badge{
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  padding: 6px 12px; border-radius: 999px; color: var(--gold-text);
  background: var(--gold-soft); border: 1px solid var(--gold-line);
}

/* ---------- topnav ---------- */
.topnav{
  position: sticky; top: 16px; z-index: 60;
  width: min(1180px, 100% - 32px); margin: 18px auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 10px 12px 10px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-soft) 72%, transparent);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}
.brand{ display: inline-flex; align-items: center; gap: 12px; }
.brand-mark{
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  font-size: 20px; color: #0a0d14;
  background: linear-gradient(145deg, var(--gold-3), var(--gold-2) 42%, var(--gold));
  box-shadow: 0 8px 22px -8px rgba(201,162,39,.75), inset 0 1px 0 rgba(255,255,255,.6);
}
.brand-mark.small{ width: 34px; height: 34px; border-radius: 11px; font-size: 16px; }
.brand-text{ display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong{ font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.brand-text small{ font-family: var(--font-mono); font-size: 9px; letter-spacing: .26em; color: var(--faint); }
.nav-links{ display: flex; gap: 4px; }
.nav-links a{
  padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--muted);
  transition: color .25s var(--ease), background .25s var(--ease);
}
.nav-links a:hover{ color: var(--fg); background: var(--surface-2); }

.icon-btn{
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 18px;
  cursor: pointer; transition: transform .35s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
}
.icon-btn:hover{ background: var(--surface-3); border-color: var(--border-2); transform: translateY(-2px); }

/* ---------- buttons ---------- */
.btn{
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px;
  padding: 13px 22px; font-size: 15px; font-weight: 500; font-family: var(--font-body);
  transition: transform .45s var(--ease), background .3s var(--ease), border-color .3s var(--ease), box-shadow .45s var(--ease);
}
.btn i{ font-size: 18px; }
.btn-primary{
  background: linear-gradient(120deg, var(--gold-3), var(--gold-2) 45%, var(--gold));
  color: #0a0d14; font-weight: 600;
  box-shadow: 0 16px 34px -16px rgba(201,162,39,.85), inset 0 1px 0 rgba(255,255,255,.55);
  padding-inline-end: 8px;
}
.btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 22px 42px -16px rgba(201,162,39,.95); }
.btn-primary:active{ transform: scale(.98); }
.btn-trail{
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(10,13,20,.14); font-size: 18px; margin-inline-start: 6px;
  transition: transform .45s var(--ease);
}
.btn-primary:hover .btn-trail{ transform: translate(-2px,-2px) scale(1.06); }
.btn-ghost{ background: transparent; border-color: var(--border-2); color: var(--fg); }
.btn-ghost:hover{ background: var(--surface-2); transform: translateY(-2px); }
.btn-soft{
  background: var(--surface-2); border-color: var(--border); color: var(--fg);
  padding: 10px 16px; font-size: 13.5px;
}
.btn-soft:hover{ background: var(--surface-3); border-color: var(--border-2); transform: translateY(-2px); }
.btn-soft.done{ color: var(--gold-text); border-color: var(--gold-line); background: var(--gold-soft); }

/* ---------- hero ---------- */
.hero{ padding-top: 84px; padding-bottom: 64px; }
.hero-center{ text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.hero h1{
  font-size: clamp(2.5rem, 6.2vw, 5rem);
  font-weight: 600; letter-spacing: -.02em; max-width: 16ch; line-height: 1.06;
}
.hero h1 em{
  font-style: normal;
  background: linear-gradient(100deg, var(--gold-3), var(--gold-2) 40%, var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .lead{ max-width: 58ch; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.18rem); }
.hero-cta{ display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 6px; }
.hero-meta{
  display: flex; flex-wrap: wrap; gap: 12px 30px; justify-content: center; margin-top: 26px;
  font-size: 13px; color: var(--faint);
}
.hero-meta span{ display: inline-flex; align-items: center; gap: 8px; }
.hero-meta i{ font-size: 16px; color: var(--gold-text); }

.reveal{ opacity: 0; transform: translateY(16px); filter: blur(6px); }
.reveal.in{ opacity: 1; transform: none; filter: none; transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease); }

/* ---------- converter: double bezel ---------- */
.conv-shell{
  padding: 10px; border-radius: calc(var(--r-xl) + 10px);
  background: linear-gradient(150deg, rgba(201,162,39,.22), rgba(255,255,255,.04) 40%, transparent 75%);
  border: 1px solid var(--bezel-outer);
  box-shadow: var(--shadow-soft);
}
.conv-core{
  border-radius: var(--r-xl); padding: 30px;
  background: color-mix(in srgb, var(--bg-soft) 88%, var(--surface));
  border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.conv-core::before{
  content:""; position: absolute; inset-inline: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
}
.conv-head{ display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.conv-title{ font-size: clamp(1.6rem, 3vw, 2.2rem); }
.conv-precision{ display: flex; flex-direction: column; gap: 7px; }
.conv-precision label{ font-size: 12px; color: var(--faint); font-family: var(--font-mono); letter-spacing: .08em; }
.prec-select{
  appearance: none; cursor: pointer; padding: 10px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--fg);
  font-family: var(--font-body); font-size: 14px;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.prec-select:hover{ border-color: var(--gold-line); }

/* categories */
.conv-cats{ display: flex; gap: 9px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 22px; scrollbar-width: thin; }
.conv-cats::-webkit-scrollbar{ height: 5px; }
.conv-cats::-webkit-scrollbar-thumb{ background: var(--surface-3); border-radius: 9px; }
.cat-chip{
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 16px; border-radius: 999px; font-size: 13.5px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  transition: all .3s var(--ease);
}
.cat-chip i{ font-size: 16px; }
.cat-chip:hover{ color: var(--fg); border-color: var(--border-2); transform: translateY(-2px); }
.cat-chip[aria-selected="true"]{
  color: #0a0d14; font-weight: 600; border-color: transparent;
  background: linear-gradient(120deg, var(--gold-3), var(--gold-2) 50%, var(--gold));
  box-shadow: 0 12px 26px -14px rgba(201,162,39,.9);
}

/* body */
.conv-body{
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: end;
  padding: 22px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--border);
}
.conv-field{ display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.field-label{ font-size: 12px; font-family: var(--font-mono); letter-spacing: .14em; color: var(--faint); text-transform: uppercase; }
.value-input{
  width: 100%; border: none; background: transparent; outline: none;
  font-size: clamp(1.5rem, 3.4vw, 2.3rem); font-weight: 500; color: var(--fg);
  padding: 8px 0; border-bottom: 1.5px solid var(--border);
  transition: border-color .35s var(--ease);
  direction: ltr; text-align: left;
}
.value-input:focus{ border-color: var(--gold-2); }
.value-input.result{ color: var(--gold-text); font-weight: 600; overflow-wrap: anywhere; }
.swap-btn{
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-size: 21px; cursor: pointer; margin-bottom: 6px;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--gold-text);
  transition: transform .55s var(--ease), background .3s var(--ease), border-color .3s var(--ease);
}
.swap-btn:hover{ background: var(--gold-soft); border-color: var(--gold-line); transform: rotate(180deg); }

/* ---------- custom unit select ---------- */
.uselect{ position: relative; }
.uselect-btn{
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; padding: 12px 15px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--fg);
  transition: border-color .3s var(--ease), background .3s var(--ease), transform .4s var(--ease);
}
.uselect-btn:hover{ border-color: var(--gold-line); background: var(--surface-3); }
.uselect[data-open="true"] .uselect-btn{ border-color: var(--gold-2); background: var(--surface-3); }
.uselect-label{ display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.uselect-sym{ font-size: 15px; font-weight: 600; color: var(--gold-text); flex: 0 0 auto; }
.uselect-name{ font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uselect-btn > i{ font-size: 16px; color: var(--faint); flex: 0 0 auto; transition: transform .4s var(--ease); }
.uselect[data-open="true"] .uselect-btn > i{ transform: rotate(180deg); }

.uselect-pop{
  position: absolute; z-index: 40; top: calc(100% + 8px); inset-inline: 0;
  border-radius: var(--r-md); padding: 8px;
  background: color-mix(in srgb, var(--bg-soft) 96%, #000);
  border: 1px solid var(--border-2); box-shadow: 0 32px 64px -24px rgba(0,0,0,.85);
  opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none;
  transition: opacity .3s var(--ease), transform .35s var(--ease);
}
.uselect[data-open="true"] .uselect-pop{ opacity: 1; transform: none; pointer-events: auto; }
.uselect-search{ padding: 2px 2px 8px; }
.uselect-search input{
  width: 100%; padding: 10px 13px; border-radius: 10px; font-family: var(--font-body); font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--fg); outline: none;
}
.uselect-search input:focus{ border-color: var(--gold-2); }
.uselect-list{ max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.uselect-list::-webkit-scrollbar{ width: 6px; }
.uselect-list::-webkit-scrollbar-thumb{ background: var(--surface-3); border-radius: 9px; }
.opt{
  display: flex; align-items: center; gap: 10px; text-align: start; cursor: pointer;
  padding: 9px 12px; border-radius: 10px; font-size: 14px; background: transparent; border: none; width: 100%;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.opt:hover,.opt.hi{ background: var(--surface-2); }
.opt[aria-selected="true"]{ background: var(--gold-soft); color: var(--gold-text); font-weight: 600; }
.opt-sym{ font-family: var(--font-mono); font-size: 12px; color: var(--gold-text); min-width: 42px; }
.opt-name{ flex: 1; color: var(--muted); }
.opt[aria-selected="true"] .opt-name{ color: inherit; }
.opt-empty{ padding: 14px; text-align: center; color: var(--faint); font-size: 13px; }

/* ---------- actions ---------- */
.conv-actions{
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border);
}
.formula{ font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.formula b{ color: var(--gold-text); font-weight: 600; }
.conv-buttons{ display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- all units grid ---------- */
.conv-all{ margin-top: 26px; }
.conv-all-head{ display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.conv-all-head h3{ font-size: 1.05rem; font-weight: 500; }
.unit-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }
.unit-cell{
  padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
  transition: transform .4s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.unit-cell:hover{ transform: translateY(-3px); border-color: var(--gold-line); background: var(--surface-2); }
.unit-cell.is-active{ border-color: var(--gold-line); background: var(--gold-soft); }
.uc-top{ display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.uc-name{ font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-sym{ font-family: var(--font-mono); font-size: 11px; color: var(--faint); flex: 0 0 auto; }
.uc-val{ font-size: 1.15rem; font-weight: 600; color: var(--fg); direction: ltr; text-align: left; overflow-wrap: anywhere; }
.unit-cell.is-active .uc-val{ color: var(--gold-text); }

/* ---------- quick conversions ---------- */
.quick-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 14px; }
.quick-card{
  text-align: start; cursor: pointer; padding: 20px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); color: inherit;
  display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden;
  transition: transform .45s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.quick-card::after{
  content:""; position: absolute; inset-inline-end: -30px; top: -30px; width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-soft), transparent 70%); opacity: 0; transition: opacity .4s var(--ease);
}
.quick-card:hover{ transform: translateY(-4px); border-color: var(--gold-line); background: var(--surface-2); }
.quick-card:hover::after{ opacity: 1; }
.qc-icon{ width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; color: var(--gold-text); background: var(--gold-soft); border: 1px solid var(--gold-line); }
.qc-pair{ display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.qc-pair i{ font-size: 15px; color: var(--faint); }
.qc-eq{ font-family: var(--font-mono); font-size: 1.05rem; color: var(--fg); }
.qc-eq b{ color: var(--gold-text); }

/* ---------- reference table ---------- */
.ref-head{ max-width: 60ch; margin-bottom: 34px; }
.ref-head h2{ font-size: clamp(1.6rem, 3.4vw, 2.5rem); margin-top: 14px; }
.table-wrap{ border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.ref-table{ width: 100%; border-collapse: collapse; font-size: 14px; }
.ref-table thead th{
  text-align: start; padding: 16px 18px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text);
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.ref-table td{ padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--muted); }
.ref-table tbody tr:last-child td{ border-bottom: none; }
.ref-table tbody tr{ transition: background .25s var(--ease); }
.ref-table tbody tr:hover{ background: var(--surface-2); }
.ref-table td:first-child{ color: var(--fg); font-weight: 500; }
.num-col{ text-align: start; font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; }
.ref-table thead .num-col{ text-align: start; }
.ref-table .row-group td{ background: var(--gold-soft); color: var(--gold-text); font-weight: 600; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }

/* ---------- footer ---------- */
.pagefoot{ position: relative; z-index: 1; margin-top: 24px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--bg-soft) 60%, transparent); }
.foot-row{ display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; padding: 32px 0; }
.foot-brand{ display: flex; align-items: center; gap: 14px; }
.foot-brand div{ display: flex; flex-direction: column; }
.foot-brand strong{ font-family: var(--font-display); font-size: 17px; }
.foot-brand span{ font-size: 12.5px; color: var(--faint); }
.foot-meta{ font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); letter-spacing: .04em; }

/* ---------- toast ---------- */
.toast{
  position: fixed; z-index: 90; inset-block-end: 26px; inset-inline-start: 50%;
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 999px; font-size: 14px;
  background: color-mix(in srgb, var(--bg-soft) 94%, #000); color: var(--fg);
  border: 1px solid var(--gold-line); box-shadow: var(--shadow-lift);
  display: inline-flex; align-items: center; gap: 10px;
  transition: opacity .35s var(--ease), transform .45s var(--ease);
}
.toast.show{ opacity: 1; transform: translate(-50%, 0); }
.toast i{ color: var(--gold-text); font-size: 17px; }

/* ---------- responsive ---------- */
@media (max-width: 1024px){
  .conv-body{ grid-template-columns: 1fr; align-items: stretch; }
  .swap-btn{ justify-self: center; margin: 2px 0; transform: rotate(90deg); }
  .swap-btn:hover{ transform: rotate(270deg); }
}
@media (max-width: 860px){
  .nav-links{ display: none; }
  .section{ padding: 64px 0; }
  .conv-core{ padding: 20px; }
  .uselect-pop{ inset-inline: 0; }
}
@media (max-width: 560px){
  .container{ width: min(1180px, 100% - 26px); }
  .topnav{ top: 10px; padding: 8px 10px; }
  .brand-text small{ display: none; }
  .hero{ padding-top: 56px; }
  .hero h1{ font-size: 2.3rem; }
  .value-input{ font-size: 1.6rem; }
  .unit-grid{ grid-template-columns: 1fr 1fr; }
  .quick-grid{ grid-template-columns: 1fr; }
  .conv-actions{ flex-direction: column; align-items: stretch; }
  .conv-buttons{ justify-content: stretch; }
  .conv-buttons .btn{ flex: 1; justify-content: center; }
  .ref-table thead th, .ref-table td{ padding: 11px 12px; font-size: 12.5px; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal{ opacity: 1; transform: none; filter: none; }
}
:focus-visible{ outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 6px; }

/* ---------- Lucide icons (createIcons replaces <i> with <svg>) ---------- */
svg.lucide{ width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: middle; }
.brand-mark svg.lucide{ width: 20px; height: 20px; }
.brand-mark.small svg.lucide{ width: 16px; height: 16px; }
.icon-btn svg.lucide{ width: 18px; height: 18px; }
.btn svg.lucide{ width: 18px; height: 18px; }
.btn-soft svg.lucide{ width: 15px; height: 15px; }
.btn-trail svg.lucide{ width: 18px; height: 18px; }
.hero-meta svg.lucide{ width: 16px; height: 16px; color: var(--gold-text); }
.cat-chip svg.lucide{ width: 16px; height: 16px; }
.qc-icon svg.lucide{ width: 19px; height: 19px; }
.toast svg.lucide{ width: 17px; height: 17px; color: var(--gold-text); }
.uselect-btn > svg.lucide{ width: 16px; height: 16px; color: var(--faint); transition: transform .4s var(--ease); }
.uselect[data-open="true"] .uselect-btn > svg.lucide{ transform: rotate(180deg); }
.qc-pair svg.lucide{ width: 15px; height: 15px; color: var(--faint); }

/* button-element resets for grid cards */
.unit-cell{ text-align: start; cursor: pointer; width: 100%; font-family: var(--font-body); }
.uc-val{ display: block; }
.quick-card{ font-family: var(--font-body); }

.eyebrow-tight{ margin-bottom:10px; }
.stack-48{ gap:48px; }
.stack-head{ max-width:44ch; }

/* ---------- entrance animations (load-time, no observer needed) ---------- */
@keyframes riseIn{ from{ opacity: 0; transform: translateY(18px); } to{ opacity: 1; transform: none; } }
@keyframes fadeIn{ from{ opacity: 0; } to{ opacity: 1; } }
.conv-shell{ animation: riseIn .9s var(--ease) both; }
.hero .eyebrow{ animation: fadeIn .7s var(--ease) both; }
.hero h1{ animation: riseIn .95s var(--ease) .06s both; }
.hero .lead{ animation: riseIn .95s var(--ease) .14s both; }
.hero .hero-cta{ animation: riseIn .95s var(--ease) .22s both; }
.hero .hero-meta{ animation: fadeIn .9s var(--ease) .34s both; }
