/* Zhetalonians — engineering analysis workstation design system */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #FFFFFF; --surface: #FAFAFA; --surface-2: #F4F5F6;
  --text: #121417; --text-secondary: #5D646C; --text-tertiary: #7A828A;
  --border: #D9DDE2; --border-strong: #B9C0C8;
  --primary: #B44332; --primary-hover: #913628;
  --technical: #087F78; --technical-soft: #EAF6F4;
  --success: #16794A; --warning: #A66A00; --danger: #B42318;
  --grid: #E8EAED;
  --font-tech: "Cascadia Code", "Cascadia Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --font-text: Inter, "Segoe UI", system-ui, sans-serif;
  --max: 1280px; --rail: 360px;
  /* legacy aliases used by older pages */
  --enamel: var(--bg); --enamel-2: var(--surface-2); --panel: var(--surface); --ink: var(--text); --ink-2: var(--text-secondary); --line: var(--border);
  --oxide: var(--primary); --ok: var(--success); --trace: var(--technical); --brass: var(--warning); --display: var(--font-tech); --body: var(--font-text); --mono: var(--font-tech); --radius: 3px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-text); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img, video, canvas { max-width: 100%; display: block; }
a { color: var(--technical); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--technical); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

h1, h2, h3, h4 { font-family: var(--font-tech); font-weight: 600; margin: 0 0 .5em; line-height: 1.2; color: var(--text); text-transform: none; letter-spacing: 0; }
h1 { font-size: 30px; letter-spacing: -0.03em; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .6em; }
p { margin: 0 0 1em; }
.eyebrow { font-family: var(--font-tech); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: .5em; display: block; }
.mono, .tech { font-family: var(--font-tech); }
.muted { color: var(--text-secondary); }
.lede { font-size: 16px; max-width: 70ch; color: var(--text-secondary); }
.hint-block { font-size: 13px; color: var(--text-secondary); }
.hint-block b { color: var(--text); }

.wrap { width: min(var(--max), calc(100% - 3rem)); margin-inline: auto; }
section { padding: 3rem 0; }
.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.rule { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.brand-mark { width: 26px; height: 26px; border: 2px solid var(--text); border-radius: 50%; position: relative; }
.brand-mark::after { content: ''; position: absolute; left: 5px; right: 5px; top: 50%; height: 2px; background: var(--primary); transform: translateY(-50%) rotate(-20deg); }
.brand-name { font-family: var(--font-tech); font-weight: 600; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
.brand-name small { display: block; font-weight: 400; font-size: 10px; letter-spacing: .12em; color: var(--text-tertiary); margin-top: .3em; }
.nav { display: flex; align-items: center; gap: 1.1rem; font-family: var(--font-tech); font-size: 12.5px; }
.nav a { text-decoration: none; color: var(--text-secondary); }
.nav a:hover, .nav a[aria-current] { color: var(--text); }
#nav-auth { display: inline-flex; align-items: center; gap: 1.1rem; }
@media (max-width: 720px) { .nav { gap: .7rem; } .brand-name small { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .55em 1em; border-radius: 3px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); text-decoration: none; font-family: var(--font-tech); font-size: 13px; font-weight: 500; cursor: pointer; line-height: 1.1; }
.btn:hover { background: var(--surface-2); }
.btn.primary, .btn.oxide { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover, .btn.oxide:hover { background: var(--primary-hover); }
.btn.tech { background: var(--technical); border-color: var(--technical); color: #fff; }
.btn.alt { background: transparent; }
.btn.small { padding: .4em .7em; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Panels, cards, tags */
.card, .panel { background: var(--bg); border: 1px solid var(--border); border-radius: 3px; padding: 1.1rem 1.2rem; }
.card h3 { margin-top: 0; }
.tag { font-family: var(--font-tech); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: .2em .5em; border: 1px solid var(--border); border-radius: 2px; background: var(--surface); color: var(--text-secondary); }
.tag.ok { border-color: var(--success); color: var(--success); background: #EEF7F1; }
.tag.warn { border-color: var(--warning); color: var(--warning); background: #FBF4E6; }
.tag.bad { border-color: var(--danger); color: var(--danger); background: #FBEDEB; }
.tag.tech { border-color: var(--technical); color: var(--technical); background: var(--technical-soft); }
.price { font-family: var(--font-tech); font-size: 24px; font-weight: 600; }
.price small { font-size: 11px; color: var(--text-tertiary); letter-spacing: .06em; text-transform: uppercase; margin-left: .4em; }
.features { list-style: none; padding: 0; margin: .8rem 0; font-size: 13px; }
.features li { padding: .35em 0 .35em 1.2em; position: relative; border-top: 1px solid var(--grid); }
.features li::before { content: '—'; position: absolute; left: 0; color: var(--technical); }

/* Plots: white technical panels */
.scope, .plot { background: var(--bg); border: 1px solid var(--border); border-radius: 3px; position: relative; overflow: hidden; }
.scope canvas, .plot canvas { width: 100%; height: auto; }
.scope .readout, .plot .readout { position: absolute; top: 6px; left: 12px; font-family: var(--font-tech); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); z-index: 2; }
.scope .label, .plot .label { position: absolute; bottom: 6px; right: 12px; font-family: var(--font-tech); font-size: 10px; letter-spacing: .08em; color: var(--text-tertiary); text-transform: uppercase; z-index: 2; }

/* Hero */
.hero { padding: 2.5rem 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-size: 30px; }
.bezel { border: 1px solid var(--border); border-radius: 4px; padding: 0; background: var(--surface); }
.bezel .scope { aspect-ratio: 16/9; border: 0; border-radius: 4px 4px 0 0; }
.bezel video { width: 100%; height: 100%; object-fit: cover; }
.bezel-foot { display: flex; justify-content: space-between; align-items: center; padding: .5rem .9rem; font-family: var(--font-tech); font-size: 10.5px; letter-spacing: .1em; color: var(--text-tertiary); text-transform: uppercase; border-top: 1px solid var(--border); }
.bezel-foot .knobs { display: none; }
.ribbon { margin-top: 1.2rem; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); font-family: var(--font-tech); }
.ribbon div { padding: .6rem .8rem; border-right: 1px solid var(--border); }
.ribbon div:last-child { border-right: 0; }
.ribbon b { display: block; font-size: 16px; font-weight: 600; }
.ribbon span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); }

/* Forms */
.form { display: grid; gap: 1rem; max-width: 460px; }
.field { display: grid; gap: .3rem; }
.field label { font-family: var(--font-tech); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.field input, .field select, .field textarea { padding: .5em .65em; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--bg); color: var(--text); width: 100%; font-family: var(--font-tech); font-size: 13px; }
.field input:focus, .field select:focus { border-color: var(--technical); outline: none; }
.field input:disabled { background: var(--surface-2); color: var(--text-tertiary); }
.field .hint { font-size: 12px; color: var(--text-tertiary); }
.field.compact input, .field.compact select { padding: .38em .55em; font-size: 12.5px; }
.field.compact label { font-size: 10.5px; }
.error { color: var(--danger); font-size: 13px; font-family: var(--font-tech); min-height: 1.3em; }
.notice { padding: .7rem .9rem; border: 1px solid var(--border); border-left: 3px solid var(--warning); background: var(--surface); font-size: 13px; }
.notice.bad { border-left-color: var(--danger); }
.notice.good { border-left-color: var(--success); }
.notice.tech { border-left-color: var(--technical); background: var(--technical-soft); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-family: var(--font-tech); }
th, td { text-align: left; padding: .45em .6em; border-bottom: 1px solid var(--grid); vertical-align: middle; }
th { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); font-weight: 500; border-bottom: 1px solid var(--border-strong); }
td.num, th.num { text-align: right; }
td.bad { color: var(--danger); font-weight: 600; }
td.good { color: var(--success); }
table input, table select { font-family: var(--font-tech); font-size: 12px; padding: .2em .4em; border: 1px solid var(--border); border-radius: 2px; width: 100%; background: var(--bg); }
table input[type=checkbox] { width: auto; }

.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: .6em 1em; border-radius: 3px; font-size: 13px; font-family: var(--font-tech); z-index: 100; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; }
.site-foot { border-top: 1px solid var(--border); padding: 1.5rem 0 2.5rem; font-size: 12px; color: var(--text-tertiary); font-family: var(--font-tech); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }

/* Analysis layout */
.bed-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.5rem 0 .8rem; border-bottom: 1px solid var(--border); }
.bed-head h1 { margin: 0; font-size: 22px; }
.bed { display: grid; grid-template-columns: var(--rail) 1fr; gap: 1.5rem; align-items: start; padding: 1.2rem 0 3rem; }
@media (max-width: 960px) { .bed { grid-template-columns: 1fr; } }
.controls { display: grid; gap: 1rem; }
.controls .card { padding: .9rem 1rem; }
.controls h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); margin-bottom: .6em; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .6rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.results { display: grid; gap: 1.2rem; }
.result-ribbon { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--border); }
.result-ribbon div { padding: .6rem .8rem; font-family: var(--font-tech); border-right: 1px solid var(--border); }
.result-ribbon div:last-child { border-right: 0; }
.result-ribbon b { display: block; font-size: 17px; font-weight: 600; }
.result-ribbon b.bad { color: var(--danger); } .result-ribbon b.good { color: var(--success); } .result-ribbon b.warn { color: var(--warning); }
.result-ribbon span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); }
.status-line { display: flex; align-items: center; gap: .8rem; font-family: var(--font-tech); font-size: 13px; padding: .6rem .9rem; border: 1px solid var(--border); background: var(--surface); }
.status-line b { font-weight: 600; letter-spacing: .04em; }
.status-line.ok b { color: var(--success); } .status-line.review b { color: var(--warning); } .status-line.fail b { color: var(--danger); }
.steps { display: flex; flex-wrap: wrap; font-family: var(--font-tech); font-size: 12px; margin: .8rem 0 1rem; border: 1px solid var(--border); }
.steps span { padding: .45em .9em; border-right: 1px solid var(--border); color: var(--text-tertiary); }
.steps span:last-child { border-right: 0; }
.steps span.on { color: var(--text); background: var(--technical-soft); }
.steps span.done { color: var(--technical); }
.filepick { display: flex; gap: .5rem; align-items: center; }
.filepick select { flex: 1; }
.pill-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.pill { font-family: var(--font-tech); font-size: 12px; padding: .3em .65em; border: 1px solid var(--border-strong); border-radius: 2px; background: var(--bg); cursor: pointer; }
.pill.on { background: var(--text); color: #fff; border-color: var(--text); }
details summary { cursor: pointer; font-family: var(--font-tech); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.dropzone { border: 1px dashed var(--border-strong); padding: 1.2rem; text-align: center; border-radius: 3px; background: var(--surface); cursor: pointer; font-size: 13px; }
.dropzone.over { border-color: var(--technical); background: var(--technical-soft); }
.progress { height: 5px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--technical); transition: width .1s linear; }
.kv { font-family: var(--font-tech); font-size: 12.5px; display: grid; grid-template-columns: max-content 1fr; gap: .15rem 1rem; }
.kv span:nth-child(odd) { color: var(--text-tertiary); }
.tracks { display: grid; gap: .6rem; grid-auto-flow: column; grid-auto-columns: 1fr; }
.section-title { font-family: var(--font-tech); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); border-bottom: 1px solid var(--border); padding-bottom: .3rem; margin: 1rem 0 .6rem; }
@media print { .site-head, .controls, .site-foot, .actions, .toast, .steps { display: none !important; } .bed { grid-template-columns: 1fr; } }
