/* Platform styles: shared by the portal and every tool (header, footer, accounts, projects, docs, legal,
   landing-page basics). Tool-specific pages add their own file: leed.css, pes.css, spm.css, dft.css. */
:root {
  --bg: #0d1016; --bg2: #12161d; --panel: #161b23; --panel2: #1b212b; --line: #262e3a; --line2: #303a48;
  --text: #dfe5ee; --muted: #8b96a8; --faint: #5d6778; --accent: #7aa2ff; --accent2: #5b84f0;
  --accent-bg: rgba(122,162,255,.12); --ok: #5fd39a; --warn: #f2b84b; --err: #ff6b6b; --radius: 10px;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); }
body { min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 28px 0 10px; }
h3 { font-size: 15px; margin: 0 0 10px; }
code { font: 13px var(--mono); background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line2);
  border-radius: 7px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-bg); border-color: var(--accent); }
input[type=checkbox] { width: auto; }
input[type=file] { padding: 6px; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .danger { color: var(--err); }
.inline { display: inline; }

.btn, button[type=submit], .auth-card button:not(.link) {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--accent2);
  background: var(--accent2); color: #fff; font-weight: 600; text-decoration: none !important; cursor: pointer; white-space: nowrap; }
.btn:hover, button[type=submit]:hover { background: var(--accent); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line2); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { background: #b4373f; border-color: #b4373f; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: normal; }
button.link.danger { color: var(--err); }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--line2); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: rgba(95,211,154,.4); }

/* header / footer */
.site-head { display: flex; align-items: center; gap: 20px; padding: 0 24px; height: 60px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand span { white-space: nowrap; }
@media (max-width: 480px) { .site-head { gap: 12px; padding: 0 16px; } .site-nav { gap: 12px; } .site-nav .nav-docs { display: none; } }
.brand .mark { width: 28px; height: 28px; fill: var(--accent); color: var(--accent); }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 14px; }
.site-nav a { color: var(--muted); } .site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.btn { color: #fff; }
.site-nav button.link { color: var(--muted); font-size: 14px; } .site-nav button.link:hover { color: var(--text); }
.site-foot { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; padding: 18px 24px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; margin-top: 40px; }
.site-foot nav { display: flex; gap: 18px; } .site-foot a { color: var(--muted); }

/* page frames */
main.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 24px 0; flex: 1; }
main.page.narrow { max-width: 620px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.messages { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.msg { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); }
.msg.success { border-color: rgba(95,211,154,.45); } .msg.error { border-color: rgba(255,107,107,.5); }
.msg.warning { border-color: rgba(242,184,75,.5); }
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; width: 100%; color: var(--muted); font-size: 14px; }
.stack label input { width: 100%; }
ul.plain { list-style: none; padding: 0; margin: 0; } ul.plain li { padding: 5px 0; }
.back { margin: 0 0 12px; font-size: 14px; }

/* auth pages (allauth's default elements) */
.auth-card h1 { font-size: 22px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card form p { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.auth-card label { color: var(--muted); font-size: 14px; }
.auth-card input:not([type=checkbox]) { width: 100%; }
.auth-card form p:has(input[type=checkbox]) { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 8px; }
.auth-card .helptext, .auth-card small { color: var(--faint); font-size: 13px; }
.auth-card ul.errorlist, .errorlist { color: var(--err); margin: 2px 0; padding-left: 18px; font-size: 14px; }
.auth-card table { border-collapse: collapse; width: 100%; } .auth-card td, .auth-card th { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; }
.auth-card img { background: #fff; padding: 8px; border-radius: 8px; max-width: 220px; }

/* landing pages (portal and tools): phosphor accent, display face, transparent sticky header */
:root { --phosphor: #5cff9d; --phosphor-rgb: 92, 255, 157;
  --display: "Inter Display", "Inter", "Segoe UI Variable Display", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
/* header on the landing page: transparent over the hero, sticky and frosted once scrolled; one accent colour */
.is-landing .site-head { position: sticky; top: 0; z-index: 20; background: transparent; border-bottom-color: transparent;
  transition: background .3s, border-color .3s; }
.is-landing .site-head.scrolled { background: rgba(13, 16, 22, .8); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom-color: rgba(255, 255, 255, .06); }
.is-landing .brand .mark { fill: var(--phosphor); color: var(--phosphor); filter: drop-shadow(0 0 4px rgba(var(--phosphor-rgb), .45)); }
.is-landing .site-nav a.btn { background: transparent; color: var(--text); border-color: rgba(var(--phosphor-rgb), .35); }
.is-landing .site-nav a.btn:hover { border-color: var(--phosphor); box-shadow: 0 0 14px rgba(var(--phosphor-rgb), .3); }
.is-landing .site-foot { margin-top: 0; }
main.page.landing { max-width: none; padding: 0; }

/* platform: per-site accent (LazyLEED + portal: green phosphor; PrettyPES: amber; SuperSPM: cyan; DirectDFT: magenta) */
.site-pes { --phosphor: #ffb45c; --phosphor-rgb: 255, 180, 92; }
.site-spm { --phosphor: #4fe3f0; --phosphor-rgb: 79, 227, 240; }
.site-dft { --phosphor: #ff5ce1; --phosphor-rgb: 255, 92, 225; }
.landing .kicker { display: block; font: 500 12px var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: rgba(var(--phosphor-rgb), .85); margin-bottom: 12px; }
.landing .lead { color: #c3ccd8; }

/* portal */
.portal-hero, .pes-hero, .tool-hero { position: relative; max-width: 1080px; margin: 0 auto; padding: 88px 24px 40px; text-align: center; }
.portal-hero::before { content: ""; position: absolute; inset: -60px 0 -120px; z-index: -1; pointer-events: none; opacity: .55;
  background-image: radial-gradient(circle, rgba(var(--phosphor-rgb), .5) 1.1px, transparent 2px); background-size: 30px 26px;
  -webkit-mask-image: radial-gradient(ellipse 50% 60% at 50% 40%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 50% 60% at 50% 40%, #000, transparent 75%); }
.portal-hero h1, .pes-hero h1, .tool-hero h1 { font-family: var(--display); font-size: clamp(36px, 5vw, 72px); font-weight: 600; letter-spacing: -.035em;
  line-height: 1.04; margin: 0 auto 18px; max-width: 16ch; text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 25%, #c9f5da); -webkit-background-clip: text; background-clip: text; color: transparent; }
.portal-hero .lead, .pes-hero .lead, .tool-hero .lead { font-size: clamp(16px, 1.3vw, 19px); max-width: 46ch; margin: 0 auto; line-height: 1.55; text-wrap: balance; }
.tools { max-width: 1080px; margin: 0 auto; padding: 24px 24px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.tool-card { --c: var(--phosphor-rgb); position: relative; display: flex; flex-direction: column; padding: 30px 30px 28px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(22, 27, 35, .92), rgba(14, 18, 24, .92)); border: 1px solid var(--line);
  transition: border-color .35s, box-shadow .35s, transform .35s; }
.tool-card.tool-pes { --c: 255, 180, 92; }
.tool-card.tool-spm { --c: 79, 227, 240; }
.tool-card.tool-dft { --c: 255, 92, 225; }
.tool-card:hover { border-color: rgba(var(--c), .45); box-shadow: 0 0 40px -14px rgba(var(--c), .5); transform: translateY(-2px); }
.tool-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.tool-ico { width: 112px; height: 112px; overflow: visible; }
.tool-ico .screen { fill: #070b09; stroke: #2a323d; stroke-width: 2.5; }
.tool-pes .tool-ico .screen { fill: #0b0a08; }
.tool-ico .spot { fill: rgb(var(--c)); }
.tool-ico .spot.sub { fill: #dfffea; filter: drop-shadow(0 0 2px rgba(var(--c), .9)) drop-shadow(0 0 5px rgba(var(--c), .6)); }
.tool-ico .spot.ads { filter: drop-shadow(0 0 2.5px rgba(var(--c), .8)); }
.tool-ico .bg { fill: none; stroke: rgba(var(--c), .35); stroke-width: 1.2; stroke-dasharray: 3 3; }
.tool-ico .comp { fill: rgba(var(--c), .12); stroke: rgba(var(--c), .55); stroke-width: 1; }
.tool-ico .raw { fill: none; stroke: #fff1dd; stroke-width: 1.6; filter: drop-shadow(0 0 3px rgba(var(--c), .8)); }
.tool-spm .tool-ico .screen, .tool-dft .tool-ico .screen { fill: #08090c; }
.tool-ico .atom { fill: rgb(var(--c)); }
.tool-ico .atom.ads { fill: #eaffff; filter: drop-shadow(0 0 2.5px rgba(var(--c), .9)); }
.tool-ico .axis { stroke: rgba(var(--c), .3); stroke-width: 1; stroke-dasharray: 3 3; }
.tool-ico .band { fill: none; stroke: rgba(var(--c), .75); stroke-width: 1.6; }
.tool-ico .band.b1, .tool-ico .band.b2 { stroke: #ffe6fa; filter: drop-shadow(0 0 2.5px rgba(var(--c), .9)); }
.tool-card .status { font: 500 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; padding: 4px 10px; border-radius: 20px;
  color: rgb(var(--c)); border: 1px solid rgba(var(--c), .4); }
.tool-card h2 { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -.03em; margin: 0; }
.tool-card .tool-title { margin: 2px 0 12px; font: 13px var(--mono); color: rgba(var(--c), .85); letter-spacing: .02em; }
.tool-card .tool-tagline { color: #c3ccd8; margin: 0 0 18px; font-size: 15.5px; line-height: 1.55; }
.tool-card ul { list-style: none; padding: 0; margin: 0 0 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; flex: 1; align-content: start; }
.tool-card li { position: relative; padding-left: 18px; font-size: 14px; color: var(--muted); }
.tool-card li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%;
  background: rgb(var(--c)); box-shadow: 0 0 6px rgba(var(--c), .8); }
.tool-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 22px; border-radius: 11px;
  font-weight: 600; font-size: 15.5px; color: var(--text); text-decoration: none !important; border: 1px solid rgba(var(--c), .55);
  background: rgba(var(--c), .07); box-shadow: 0 0 12px rgba(var(--c), .12); transition: box-shadow .3s, border-color .3s; }
.tool-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s; }
.tool-btn:hover { border-color: rgb(var(--c)); box-shadow: 0 0 16px rgba(var(--c), .5), inset 0 0 12px rgba(var(--c), .15); }
.tool-btn:hover svg { transform: translateX(3px); }
.tool-btn.ghost { border-color: var(--line2); background: transparent; box-shadow: none; color: var(--muted); }
.tool-btn.ghost:hover { border-color: rgba(var(--c), .55); color: var(--text); box-shadow: 0 0 14px rgba(var(--c), .25); }
.portal-facts { max-width: 1080px; margin: 0 auto; padding: 72px 24px 96px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.portal-facts > div { border-left: 1px solid rgba(var(--phosphor-rgb), .35); padding: 2px 0 2px 20px; }
.portal-facts .no { display: block; font: 11px var(--mono); letter-spacing: .14em; color: rgba(var(--phosphor-rgb), .8); margin-bottom: 8px; }
.portal-facts h3 { font-family: var(--display); font-size: 18px; margin: 0 0 6px; letter-spacing: -.01em; }
.portal-facts p { color: var(--muted); margin: 0; font-size: 14.5px; line-height: 1.55; }

@media (max-width: 860px) {
  .tools, .portal-facts { grid-template-columns: 1fr; }
  .tool-card { padding: 24px 22px 22px; }
  .tool-card ul { grid-template-columns: 1fr; }
  .portal-hero { padding-top: 48px; }
}

.cta .kicker { display: block; font: 500 12px var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: rgba(var(--phosphor-rgb), .85); margin-bottom: 12px; }
.cta h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.035em; line-height: 1.08; margin: 0; }
.cta { position: relative; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 88px 16px 96px; text-align: center; }
.cta::before { content: ""; position: absolute; inset: 40px 0 60px; pointer-events: none; opacity: .5;
  background-image: radial-gradient(circle, rgba(var(--phosphor-rgb), .55) 1.2px, transparent 2.2px);
  background-size: 34px 29.4px; -webkit-mask-image: radial-gradient(ellipse 34% 60% at 50% 45%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 34% 60% at 50% 45%, #000, transparent 75%); }
.cta > * { position: relative; }
.cta h2 { font-size: clamp(30px, 3.6vw, 56px); text-wrap: balance; }
.cta-box { display: inline-flex; align-items: center; gap: 12px; padding: 16px 32px; border-radius: 12px;
  border: 1px solid rgba(var(--phosphor-rgb), .55); background: rgba(13, 20, 17, .9); color: var(--text);
  box-shadow: 0 0 12px rgba(var(--phosphor-rgb), .15), inset 0 0 0 100px rgba(var(--phosphor-rgb), .06);
  font-size: 17px; font-weight: 600; letter-spacing: 0; text-decoration: none !important;
  transition: box-shadow .35s, border-color .35s, color .35s, transform .35s; }
.cta-box svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s; }
.cta-box:hover, .cta-box:focus-visible { color: #eafff2; border-color: var(--phosphor);
  box-shadow: 0 0 14px rgba(var(--phosphor-rgb), .55), 0 0 32px rgba(var(--phosphor-rgb), .28), inset 0 0 0 100px rgba(var(--phosphor-rgb), .12),
    inset 0 0 16px rgba(var(--phosphor-rgb), .25);
  text-shadow: 0 0 8px rgba(var(--phosphor-rgb), .3); transform: translateY(-1px); outline: none; }
.cta-box:hover svg { transform: translateX(4px); }
.cta-note { color: var(--faint); font-size: 13px; margin: 0; }
.cta-note a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.cta-note a:hover { color: var(--text); }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.feature .no { display: block; font: 11px var(--mono); letter-spacing: .12em; color: var(--faint); margin-bottom: 6px; transition: color .6s; }
.feature h3 { margin: 0 0 6px; font-size: 15px; }
.feature p { color: var(--muted); margin: 0; font-size: 13.5px; line-height: 1.5; }
@media (max-width: 760px) { .cta { padding: 64px 16px 80px; } }

/* documentation / legal */
.doc-layout.with-toc { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
.toc { position: sticky; top: 20px; align-self: start; font-size: 14px; }
.toc h4 { margin: 0 0 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.toc ul { list-style: none; padding: 0; margin: 0; } .toc li { padding: 3px 0; } .toc a { color: var(--muted); }
.prose { max-width: 780px; }
.prose table { border-collapse: collapse; margin: 12px 0; } .prose td, .prose th { border: 1px solid var(--line2); padding: 5px 10px; }
.prose pre { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 12px 0; padding: 4px 16px; border-left: 3px solid var(--warn); color: var(--muted); }
@media (max-width: 860px) { .doc-layout.with-toc { grid-template-columns: 1fr; } .toc { position: static; } }

/* dashboard */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.quota { display: flex; flex-direction: column; gap: 5px; min-width: 220px; font-size: 13px; color: var(--muted); }
.quota.wide { margin: 14px 0 18px; }
.quota .bar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; }
.quota .bar div { height: 100%; background: var(--accent); border-radius: 4px; min-width: 2px; }
.new-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
.new-card { margin: 0 0 16px; padding: 16px 18px; } .new-card h3 { margin-bottom: 10px; }
.new-card .fields { display: flex; gap: 8px; } .new-card .fields input:not([type=file]) { flex: 1; }
.new-card .fields input[type=file] { flex: 1; }
.hint { color: var(--faint); font-size: 13px; margin: 8px 0 0; }
@media (max-width: 860px) { .new-row { grid-template-columns: 1fr; } .new-card .fields { flex-wrap: wrap; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.project { padding: 0; overflow: visible; position: relative; margin: 0; }
.project .thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #080a0e;
  border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; position: relative; }
.project .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project .thumb .empty { color: var(--faint); font-size: 13px; }
.project .tag { position: absolute; left: 8px; top: 8px; font-size: 11px; padding: 1px 7px; border-radius: 8px; background: rgba(13,16,22,.8); color: var(--muted); border: 1px solid var(--line2); }
.project .tag.open { left: auto; right: 8px; color: var(--ok); border-color: rgba(95,211,154,.45); }
.project .meta { padding: 12px 14px 14px; }
.project .name { display: block; font-weight: 600; color: var(--text); margin-right: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project .sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.project .sub.faint { color: var(--faint); }
.more { position: absolute; right: 8px; bottom: 34px; }
.more summary { list-style: none; cursor: pointer; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); font-size: 18px; }
.more summary::-webkit-details-marker { display: none; }
.more summary:hover, .more[open] summary { background: var(--panel2); color: var(--text); }
.more .pop { position: absolute; right: 0; top: 32px; z-index: 5; width: 260px; display: flex; flex-direction: column; gap: 10px; padding: 12px;
  background: #1a2029; border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.45); font-size: 14px; }
.more .pop form { display: flex; gap: 6px; } .more .pop input { flex: 1; padding: 4px 8px; }
.empty-state { text-align: center; padding: 40px; } .empty-state p { color: var(--muted); max-width: 520px; margin: 0 auto; }
.auth-card .helptext ul { margin: 2px 0 0; padding-left: 18px; color: var(--faint); font-size: 13px; }

/* placeholder pages of tools in development (SuperSPM, DirectDFT): planned features */
.tool-planned { max-width: 1080px; margin: 0 auto; padding: 72px 24px 0; }
.tool-planned h2 { font-family: var(--display); font-size: clamp(28px, 3.2vw, 44px); font-weight: 600; letter-spacing: -.035em; margin: 0 0 32px; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.tool-grid .feature { background: none; border: 0; border-left: 1px solid rgba(var(--phosphor-rgb), .4); border-radius: 0; padding: 2px 0 2px 20px; }
.tool-grid .feature .no { color: rgba(var(--phosphor-rgb), .85); }
.tool-grid .feature p { font-size: 14.5px; line-height: 1.55; }
.tool-note { color: var(--faint); font-size: 13px; margin: 24px 0 0; }
@media (max-width: 860px) {
  .tool-grid { grid-template-columns: 1fr; }
  .tool-hero { padding-top: 48px; }
}
