:root {
  color-scheme: dark;
  --bg: #071019;
  --surface: #0d1823;
  --surface-raised: #111f2d;
  --line: #2a3948;
  --line-bright: #475b6d;
  --text: #f7f3ea;
  --muted: #aeb9c4;
  --gold: #d3b16d;
  --blue: #4a92ff;
  --blue-deep: #1b5fbf;
  font-family: "Geist", "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, transparent 0 49.94%, rgb(255 255 255 / 2.8%) 50%, transparent 50.06%),
    radial-gradient(circle at 86% 8%, rgb(46 121 226 / 16%), transparent 29rem),
    radial-gradient(circle at 8% 40%, rgb(211 177 109 / 7%), transparent 25rem),
    var(--bg);
  font-size: 16px;
  line-height: 1.5;
}

button, a { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 8px;
  left: 8px;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 8px;
  background: #fff;
  color: #06101a;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.app-shell { width: min(100% - 48px, 1540px); margin: 0 auto; }
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; min-height: 44px; gap: 13px; color: inherit; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: "Inter Tight", sans-serif;
  font-size: 21px;
  font-weight: 800;
}
.brand > span:last-child { display: grid; line-height: 1.1; }
.brand strong { font-size: 18px; letter-spacing: -.025em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }

.access-state { display: inline-flex; align-items: center; min-height: 44px; gap: 10px; color: var(--muted); font: 650 12px/1 ui-monospace, monospace; letter-spacing: .09em; text-transform: uppercase; }
.access-state span { width: 7px; height: 7px; border-radius: 50%; background: #69d99b; box-shadow: 0 0 0 5px rgb(105 217 155 / 10%); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(420px, .75fr);
  min-height: 540px;
  align-items: center;
  padding: 68px 0 92px;
}
.hero-copy { max-width: 880px; }
.eyebrow { margin: 0 0 15px; color: var(--gold); font: 700 12px/1.3 ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { margin: 0; font-family: "Inter Tight", "Geist", sans-serif; font-size: clamp(58px, 7.2vw, 118px); line-height: .83; letter-spacing: -.075em; }
.hero h1 em { color: var(--blue); font-style: normal; }
.hero-copy > p:last-child { max-width: 620px; margin: 34px 0 0; color: #c0cad4; font-size: clamp(18px, 2vw, 24px); }

.hero-ledger { align-self: end; margin: 0 0 16px; border-top: 1px solid var(--line-bright); }
.hero-ledger div { display: grid; grid-template-columns: 1fr auto; align-items: end; min-height: 92px; border-bottom: 1px solid var(--line); }
.hero-ledger dt { padding-bottom: 18px; color: var(--muted); font: 700 11px/1 ui-monospace, monospace; letter-spacing: .13em; text-transform: uppercase; }
.hero-ledger dd { margin: 0; padding-bottom: 10px; color: var(--text); font-family: "Inter Tight", sans-serif; font-size: 48px; font-weight: 700; letter-spacing: -.06em; }
.hero-rule { position: absolute; right: 0; bottom: 38px; left: 0; height: 1px; background: var(--line); }
.hero-rule span { display: block; width: 31%; height: 3px; margin-top: -1px; background: linear-gradient(90deg, var(--blue), var(--gold)); }

.catalog { padding: 40px 0 110px; }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.catalog-heading h2 { margin: 0; font-family: "Inter Tight", sans-serif; font-size: clamp(35px, 4vw, 58px); letter-spacing: -.045em; }
.catalog-heading [role="status"] { margin: 0 0 8px; color: var(--muted); font: 600 13px/1.2 ui-monospace, monospace; }

.filter-row { display: flex; gap: 8px; margin: 34px 0; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.filter-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 46px;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(8 18 27 / 72%);
  cursor: pointer;
}
.filter-button span { display: grid; min-width: 23px; height: 23px; place-items: center; border-radius: 50%; background: #1b2a38; color: var(--muted); font-size: 11px; }
.filter-button:hover { border-color: var(--line-bright); }
.filter-button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-deep); }
.filter-button[aria-pressed="true"] span { background: rgb(4 20 42 / 45%); color: #fff; }

.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.asset-card { position: relative; display: grid; grid-template-rows: auto 1fr auto; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(155deg, rgb(17 31 45 / 95%), rgb(8 17 26 / 98%)); box-shadow: 0 22px 70px rgb(0 0 0 / 15%); }
.asset-card::before { position: absolute; z-index: 2; top: 0; left: 0; width: 44%; height: 2px; background: var(--blue); content: ""; transition: width .25s ease; }
.asset-card:hover::before, .asset-card:focus-within::before { width: 100%; background: linear-gradient(90deg, var(--blue), var(--gold)); }

.card-preview { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background: #09131d; }
.card-preview img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.86) contrast(.98); transition: transform .45s cubic-bezier(.2,.8,.2,1), filter .3s ease; }
.asset-card:hover .card-preview img { transform: scale(1.025); filter: saturate(1) contrast(1); }
.card-preview blockquote { display: grid; height: 100%; margin: 0; padding: 28px; place-items: center; color: #e7dece; background: radial-gradient(circle at 70% 10%, rgb(211 177 109 / 15%), transparent 45%), #101b27; font-family: "Inter Tight", sans-serif; font-size: clamp(18px, 2vw, 27px); font-weight: 620; line-height: 1.2; letter-spacing: -.025em; }
.card-index { position: absolute; top: 13px; right: 13px; display: grid; min-width: 38px; height: 30px; place-items: center; border: 1px solid rgb(255 255 255 / 25%); border-radius: 999px; background: rgb(2 8 13 / 72%); color: #fff; font: 700 11px/1 ui-monospace, monospace; backdrop-filter: blur(10px); }

.card-body { padding: 23px 23px 18px; }
.card-meta { margin: 0 0 8px; color: var(--gold); font: 700 10px/1.2 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.card-body h3 { margin: 0; font-family: "Inter Tight", sans-serif; font-size: 25px; line-height: 1.05; letter-spacing: -.035em; }
.card-body > code { display: block; margin-top: 18px; overflow: hidden; color: #8fa0b1; font: 11px/1.4 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px 14px; }

.button, .icon-button, .command-copy {
  display: inline-flex;
  min-width: 44px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.button { padding: 0 14px; border: 1px solid transparent; font-size: 13px; font-weight: 700; }
.button-primary { background: var(--blue-deep); border-color: #4a8ef1; }
.button-primary:hover { background: #246bc9; }
.button-secondary { border-color: var(--line-bright); background: #121f2b; }
.button-quiet { border-color: transparent; background: transparent; color: #aebdca; }
.button-quiet:hover { background: #142230; color: #fff; }
.button[data-copy-state="copied"] { border-color: #5fc28c; color: #96e8b8; }

button:focus-visible, a:focus-visible { outline: 3px solid #f1cb80; outline-offset: 3px; }
.empty-state { min-height: 180px; padding: 50px; border: 1px dashed var(--line); text-align: center; color: var(--muted); }

footer { display: flex; justify-content: space-between; min-height: 100px; align-items: center; border-top: 1px solid var(--line); color: var(--muted); font: 600 11px/1.2 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }

.preview-dialog { width: min(96vw, 1760px); height: min(94vh, 1080px); max-width: none; max-height: none; padding: 0; overflow: hidden; border: 1px solid var(--line-bright); border-radius: 18px; background: #08121c; color: var(--text); box-shadow: 0 40px 120px #000b; }
.preview-dialog::backdrop { background: rgb(1 5 9 / 82%); backdrop-filter: blur(9px); }
.dialog-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
.dialog-header { display: flex; min-height: 84px; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px 16px 28px; border-bottom: 1px solid var(--line); }
.dialog-header .eyebrow { margin-bottom: 7px; }
.dialog-header h2 { margin: 0; font-family: "Inter Tight", sans-serif; font-size: 28px; letter-spacing: -.035em; }
.icon-button { width: 50px; border: 1px solid var(--line); background: #101d29; font-size: 29px; }
.dialog-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 410px); min-height: 0; }
.preview-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; border-right: 1px solid var(--line); background: #050b11; }
.preview-toolbar { display: flex; min-height: 58px; align-items: center; justify-content: space-between; padding: 7px 16px 7px 22px; border-bottom: 1px solid var(--line); color: var(--muted); font: 650 11px/1 ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
.preview-toolbar > div { display: flex; gap: 5px; }
.preview-toolbar button { min-width: 70px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: transparent; cursor: pointer; font-size: 11px; }
.preview-toolbar button[aria-pressed="true"] { border-color: var(--blue); background: #12325a; color: #fff; }
.preview-host { display: grid; min-width: 0; min-height: 0; place-items: center; overflow: auto; padding: 20px; }
.preview-host iframe { width: 100%; height: 100%; min-height: 500px; border: 1px solid var(--line-bright); border-radius: 10px; background: #fff; }
.preview-host[data-viewport="mobile"] iframe { width: min(390px, 100%); height: 780px; max-height: 100%; }
.edit-panel { min-height: 0; overflow-y: auto; padding: 32px 28px 60px; }
.meta-label { margin: 0 0 8px; color: var(--gold); font: 700 10px/1.2 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.source-path { display: block; overflow-wrap: anywhere; color: #c2ced9; font: 12px/1.6 ui-monospace, monospace; }
.edit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 36px; }
.edit-panel h3 { margin: 0 0 18px; font-family: "Inter Tight", sans-serif; font-size: 29px; letter-spacing: -.035em; }
.edit-steps { display: grid; gap: 13px; margin: 0 0 28px; padding-left: 23px; color: #c0cad3; }
.commands { display: grid; gap: 8px; }
.commands > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 9px 9px 9px 13px; border: 1px solid var(--line); border-radius: 8px; background: #06101a; }
.commands code { overflow-wrap: anywhere; padding-top: 7px; color: #9fc2ee; font: 11px/1.45 ui-monospace, monospace; }
.command-copy { padding: 0 10px; border: 1px solid var(--line); background: #142331; font-size: 11px; }
.toast { position: fixed; z-index: 3000; right: 20px; bottom: 20px; max-width: calc(100vw - 40px); min-height: 0; padding: 0; border-radius: 8px; color: #062313; background: #80dca5; font-size: 13px; font-weight: 700; opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
.toast:not(:empty) { min-height: 44px; padding: 12px 16px; opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; padding-top: 80px; }
  .hero-ledger { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 70px; }
  .hero-ledger div { display: flex; min-height: 100px; flex-direction: column; align-items: flex-start; justify-content: end; }
  .hero-ledger dd { order: -1; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 760px) {
  .app-shell { width: min(100% - 28px, 1540px); }
  .admin-header { min-height: 78px; }
  .access-state { font-size: 0; }
  .access-state span { margin-right: 2px; }
  .hero { min-height: 520px; padding: 72px 0 78px; }
  .hero h1 { font-size: clamp(52px, 17vw, 78px); }
  .hero-copy > p:last-child { font-size: 18px; }
  .hero-ledger { margin-top: 56px; }
  .hero-ledger div { min-height: 82px; }
  .hero-ledger dd { font-size: 36px; }
  .catalog { padding-top: 25px; }
  .catalog-heading { display: block; }
  .catalog-heading [role="status"] { margin-top: 16px; }
  .filter-row { margin-inline: -14px; padding-inline: 14px; }
  .asset-grid { grid-template-columns: 1fr; }
  .card-preview blockquote { font-size: 23px; }
  footer { display: grid; align-content: center; gap: 8px; }
  .preview-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .dialog-header { min-height: 76px; padding-left: 18px; }
  .dialog-header h2 { font-size: 22px; }
  .dialog-layout { display: block; overflow-y: auto; }
  .preview-panel { min-height: 540px; border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-toolbar { padding-left: 14px; }
  .preview-host { min-height: 470px; padding: 10px; }
  .preview-host iframe { min-height: 440px; }
  .edit-panel { overflow: visible; padding: 28px 18px 70px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
