:root {
  color-scheme: dark;
  --ink: #f8f6ff;
  --muted: #aaa4ba;
  --faint: #70697f;
  --paper: #090611;
  --panel: rgba(15, 10, 25, .94);
  --panel-2: rgba(26, 18, 42, .94);
  --line: rgba(190, 164, 255, .20);
  --ember: #9b6cff;
  --ember-pale: #c5adff;
  --mint: #79f2cf;
  --danger: #ff6b6b;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(4, 3, 10, .18) 0, rgba(7, 4, 14, .58) 34rem, #090611 64rem),
    linear-gradient(90deg, rgba(4, 3, 10, .15), rgba(4, 3, 10, .35)),
    url("/luraph-background.png") center top / cover fixed no-repeat,
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .035; z-index: 20; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E"); }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid var(--line); background: rgba(7, 4, 14, .54); backdrop-filter: blur(14px); }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.7); background: linear-gradient(145deg, #6846a6, #33205d); color: #fff; box-shadow: 0 0 28px rgba(141, 91, 255, .35); font: 900 20px/1 Georgia, serif; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .03em; }
.brand small { color: var(--muted); font: 600 10px/1.35 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.local-pill { display: flex; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: #afb4b7; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.local-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
main { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.hero { min-height: 610px; display: flex; align-items: flex-end; padding: 90px 0 58px; }
.hero-copy { width: min(610px, 100%); padding: 30px 34px; border: 1px solid rgba(190,164,255,.16); border-radius: var(--radius-lg); background: linear-gradient(110deg, rgba(8,5,16,.90), rgba(8,5,16,.52) 76%, rgba(8,5,16,.18)); box-shadow: 0 24px 70px rgba(0,0,0,.3); backdrop-filter: blur(7px); }
.eyebrow { margin: 0 0 19px; color: var(--ember-pale); font: 700 11px var(--mono); letter-spacing: .18em; }
h1 { margin: 0; font: 800 clamp(50px, 7.2vw, 88px)/.92 var(--sans); letter-spacing: -.055em; text-shadow: 0 5px 28px rgba(0,0,0,.8); }
h1 em { color: var(--ember); font-weight: 400; }
.lede { max-width: 650px; margin: 30px 0 0; color: #a7abad; font-size: 18px; line-height: 1.65; }
.workspace-card, .run-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(140deg, rgba(155,108,255,.07), transparent 42%), var(--panel); padding: 30px; box-shadow: 0 30px 90px rgba(0,0,0,.48); backdrop-filter: blur(18px); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 20px; }
.section-heading > div:first-child { display: flex; gap: 13px; align-items: center; }
.section-heading h2 { margin: 0; font: 750 25px var(--sans); letter-spacing: -.025em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.step { color: var(--ember-pale); font: 700 10px var(--mono); border: 1px solid rgba(155,108,255,.42); border-radius: 7px; padding: 5px 7px; }
.input-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; background: rgba(7,4,14,.72); padding: 3px; }
.input-switch-button { border: 0; border-radius: 999px; background: transparent; color: var(--muted); padding: 8px 13px; cursor: pointer; font: 700 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.input-switch-button.active { background: var(--panel-2); color: var(--ink); box-shadow: 0 3px 12px rgba(0,0,0,.22); }
.dropzone { min-height: 168px; display: flex; align-items: center; gap: 20px; padding: 28px 32px; border: 1px dashed rgba(190,164,255,.36); border-radius: var(--radius-md); background: rgba(7,4,14,.72); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.dropzone:hover, .dropzone:focus, .dropzone.dragging { border-color: var(--ember); background: rgba(30,18,53,.86); outline: none; }
.dropzone.dragging { transform: translateY(-2px); }
.dropzone.selected { border-style: solid; border-color: #385447; }
.drop-icon { flex: 0 0 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); }
.drop-icon svg, .primary-button svg, .search svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.drop-copy { flex: 1; min-width: 0; }
.drop-copy strong, .drop-copy span { display: block; }
.drop-copy strong { font: 700 18px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-copy span { color: var(--muted); margin-top: 8px; font-size: 13px; }
.paste-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(7,4,14,.82); }
.paste-toolbar, .paste-footer { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 14px; color: var(--faint); font: 700 9px var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.paste-toolbar { border-bottom: 1px solid var(--line); }
.paste-footer { border-top: 1px solid var(--line); }
.paste-panel textarea { display: block; width: 100%; min-height: 310px; resize: vertical; padding: 18px; border: 0; outline: 0; background: transparent; color: #d8d9d4; font: 12px/1.65 var(--mono); tab-size: 2; }
.paste-panel textarea::placeholder { color: #484e52; }
.paste-footer input { width: min(280px, 70%); border: 0; outline: 0; background: transparent; color: #afb4b7; font: 11px var(--mono); text-transform: none; }
.paste-footer .text-button { font-size: 10px; }
.ghost-button, .text-button { border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--ink); padding: 11px 16px; cursor: pointer; text-decoration: none; }
.ghost-button:hover { border-color: #596168; }
.controls-grid { display: grid; grid-template-columns: repeat(3, 1fr) 1.25fr; gap: 12px; margin-top: 18px; }
.field, .check-field { min-height: 70px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-2); }
.field { display: block; padding: 10px 13px 7px; }
.field > span { display: block; color: var(--faint); font: 700 9px var(--mono); text-transform: uppercase; letter-spacing: .13em; }
.field select { width: 100%; color: var(--ink); color-scheme: dark; background: transparent; border: 0; outline: 0; padding: 8px 20px 4px 0; }
.field select option { color: var(--ink); background-color: #1a122a; }
.check-field { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; }
.check-field input { position: absolute; opacity: 0; }
.check-ui { width: 19px; height: 19px; border: 1px solid #6e667d; border-radius: 6px; display: grid; place-items: center; }
.check-field input:checked + .check-ui { background: var(--ember); border-color: var(--ember); }
.check-field input:checked + .check-ui::after { content: "✓"; color: #111; font-size: 13px; font-weight: 900; }
.check-field strong, .check-field small { display: block; }
.check-field strong { font-size: 13px; }
.check-field small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.action-row { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.action-row p { margin: 0; color: var(--muted); font: 12px var(--mono); }
.primary-button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #a97cff, #7748d1); color: #fff; padding: 0 21px; font-weight: 800; cursor: pointer; text-decoration: none; box-shadow: 0 10px 32px rgba(111,64,209,.28); }
.primary-button svg { width: 18px; }
.primary-button:hover { background: linear-gradient(135deg, #bc98ff, #8658df); }
.primary-button:disabled { opacity: .35; cursor: not-allowed; }
.primary-button.small { min-height: 39px; font-size: 12px; }
.hidden { display: none !important; }
.run-card { margin-top: 18px; padding-bottom: 24px; }
.run-summary { display: grid; grid-template-columns: auto 1fr auto; gap: 17px; align-items: center; }
.status-orb { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(155,108,255,.42); border-radius: 12px; color: var(--ember); font-size: 26px; }
.status-orb.running { animation: pulse 1.5s infinite; }
.status-orb.success { border-color: #365e4b; color: var(--mint); }
.status-orb.failure { border-color: #6a3434; color: var(--danger); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(155,108,255,.09); } }
.run-summary .eyebrow { margin: 0 0 4px; }
.run-summary h2 { margin: 0; font: 750 21px var(--sans); letter-spacing: -.02em; }
.run-summary p:last-child { margin: 5px 0 0; color: var(--muted); font: 11px var(--mono); }
.text-button { color: var(--muted); border: 0; padding: 8px; }
.progress-track { height: 2px; background: #272c30; margin-top: 23px; overflow: hidden; }
.progress-track span { display: block; width: 4%; height: 100%; background: var(--ember); transition: width .7s ease; }
.progress-track span.indeterminate { width: 35%; animation: travel 1.6s infinite ease-in-out; }
.progress-track span.complete { width: 100%; }
.progress-track span.error { width: 100%; background: var(--danger); }
.expiry-notice { display: flex; gap: 12px; align-items: baseline; margin-top: 14px; padding: 14px 18px; border: 1px solid rgba(190,164,255,.28); border-radius: var(--radius-md); background: rgba(10,7,17,.92); color: var(--muted); font-size: 12px; line-height: 1.55; }
.expiry-notice strong { flex: 0 0 auto; color: var(--ember); font: 700 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
@keyframes travel { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.result-section { margin-top: 62px; }
.result-heading { margin-bottom: 18px; }
.result-actions { display: flex; gap: 8px; align-items: center; }
.search { height: 39px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(12,8,20,.7); }
.search svg { width: 15px; color: var(--muted); }
.search input { width: 150px; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 12px; }
.code-tabs { height: 54px; display: flex; align-items: end; overflow: hidden; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius-md) var(--radius-md) 0 0; background: var(--panel); }
.code-tab { align-self: stretch; padding: 0 22px; background: transparent; color: var(--muted); border: 0; border-right: 1px solid var(--line); cursor: pointer; }
.code-tab.active { color: var(--ink); box-shadow: inset 0 -2px var(--ember); background: #13171a; }
.code-tab span { margin-left: 8px; color: var(--faint); font: 9px var(--mono); }
.wrap-toggle { margin: auto 18px auto auto; color: var(--muted); font: 11px var(--mono); cursor: pointer; }
.partial-notice { display: flex; gap: 12px; align-items: baseline; padding: 13px 17px; border: 1px solid #65492c; border-bottom: 0; background: #18130d; color: #c6a87d; font-size: 12px; }
.partial-notice strong { flex: 0 0 auto; color: #f1bd75; font: 700 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.code-shell { display: grid; grid-template-columns: auto 1fr; height: min(620px, 68vh); overflow: auto; border: 1px solid var(--line); background: #0b0e10; }
.line-numbers, #codeViewer { margin: 0; padding: 20px 0; font: 12px/1.65 var(--mono); tab-size: 2; }
.line-numbers { position: sticky; left: 0; z-index: 2; min-width: 58px; text-align: right; padding-right: 15px; color: #444a4e; background: #0e1113; border-right: 1px solid #202529; user-select: none; }
#codeViewer { padding-left: 19px; min-width: max-content; color: #d8d9d4; white-space: pre; outline: 0; }
#codeViewer.wrap { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-footer { display: flex; justify-content: space-between; padding: 10px 14px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-md) var(--radius-md); color: var(--faint); font: 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 80px 0; background: transparent; border: 0; }
.notes-grid article { border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(10, 7, 17, .90); padding: 25px; }
.notes-grid span { color: var(--ember); font: 700 9px var(--mono); letter-spacing: .16em; }
.notes-grid h3 { margin: 14px 0 9px; font: 700 18px var(--sans); letter-spacing: -.02em; }
.notes-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
footer { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 25px 0 35px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--faint); font: 9px var(--mono); letter-spacing: .13em; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; transform: translateY(100px); opacity: 0; padding: 13px 17px; background: var(--ink); color: #111; font: 700 12px var(--mono); transition: .25s; }
.toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 800px) {
  body { background-position: 38% top; background-attachment: scroll; }
  main { width: min(100% - 28px, 1180px); }
  .topbar { padding: 0 14px; }
  .hero { min-height: 520px; padding: 58px 0 34px; }
  .hero-copy { padding: 24px; }
  .workspace-card, .run-card { padding: 20px; }
  .controls-grid { grid-template-columns: 1fr 1fr; }
  .dropzone { padding: 22px; }
  .dropzone .ghost-button { display: none; }
  .result-heading { align-items: flex-start; flex-direction: column; }
  .result-actions { width: 100%; flex-wrap: wrap; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .notes-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .local-pill { display: none; }
  .section-heading { align-items: flex-start; }
  .controls-grid { grid-template-columns: 1fr; }
  .dropzone { text-align: center; flex-direction: column; }
  .drop-copy strong { white-space: normal; }
  .action-row { gap: 18px; align-items: stretch; flex-direction: column; }
  .run-summary { grid-template-columns: auto 1fr; }
  .run-summary .text-button { grid-column: 1 / -1; justify-self: start; }
  .code-tab { padding: 0 12px; }
  .wrap-toggle { display: none; }
}
