/* HYPERFARM design system. Palette from the logo: deep night teal, cyan -> mint -> yellow. No backdrop-filter, animations always on (manual toggle in the nav). */
:root {
  --deep: #03211c; --bg: #041a17; --panel: #0a2723; --panel2: #0e322d; --panel3: #143d37; --line: #1f4b44; --line2: #2b6258;
  --ink: #f3fffd; --muted: #8db3ac; --cyan: #29e0ff; --mint: #7dffb4; --teal: #50d2c1; --yellow: #ffd23a; --gold: #ffb020; --short: #ed7088; --long: #1fa67d;
  --ui: 'Parkinsans', system-ui, sans-serif; --display: 'Zalando Sans Expanded', 'Parkinsans', system-ui, sans-serif; --num: 'Google Sans Code', ui-monospace, monospace;
  --r: 14px; --nav-h: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; background: var(--deep); }
body { margin: 0; background: var(--deep); color: var(--ink); font: 400 16px/1.5 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, canvas, svg, video { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.02em; line-height: 1.08; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.mint { color: var(--mint); } .cyan { color: var(--cyan); } .yellow { color: var(--yellow); } .muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* dot-matrix background (also the fallback when WebGL is missing) */
.dots { background-image: radial-gradient(circle, rgba(80, 210, 193, .22) 1.2px, transparent 1.6px); background-size: 22px 22px; }
#scene3d { position: fixed; inset: 0; z-index: 0; background: radial-gradient(ellipse at 70% 30%, #0b4a3f 0%, #03211c 60%) , var(--deep); }
#scene3d canvas { display: block; width: 100%; height: 100%; }
#scene3d::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(3, 33, 28, .78) 0%, rgba(3, 33, 28, .15) 55%, rgba(3, 33, 28, 0) 100%); }
main, header.nav, footer { position: relative; z-index: 2; }

/* nav: a floating pill like the reference, own content */
header.nav { position: fixed; top: 10px; left: 0; right: 0; z-index: 50; pointer-events: none; }
.nav-in { pointer-events: auto; width: min(1180px, 100% - 20px); margin-inline: auto; min-height: var(--nav-h); display: flex; align-items: center; gap: 18px; padding: 8px 12px 8px 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(5, 32, 28, .94); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 19px/1 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.brand img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }
.brand b { color: var(--mint); font-weight: 800; }
.nav-links { display: flex; gap: 4px; margin-left: 6px; }
.nav-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 12px; border-radius: 10px; color: #b9d8d2; font-size: 15px; font-weight: 500; white-space: nowrap; transition: background .2s, color .2s; }
.nav-links a:hover, .nav-links a.on { background: var(--panel3); color: var(--ink); }
.nav-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font: 500 13.5px/1 var(--num); white-space: nowrap; color: #cfe9e3; }
.chip b { color: var(--mint); font-weight: 600; }
.chip.btn-like { cursor: pointer; } .chip.btn-like:hover { border-color: var(--teal); }
.burger { display: none; }

/* buttons: label always centered inside the frame, 44px+ high */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border: 1px solid var(--line2); border-radius: 14px; background: var(--panel2); color: var(--ink); font: 600 16px/1 var(--ui); cursor: pointer; white-space: nowrap; transition: transform .15s, border-color .2s, background .2s; }
.btn:hover { border-color: var(--teal); background: var(--panel3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #03211c; }
.btn.primary:hover { background: var(--mint); border-color: var(--mint); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14.5px; border-radius: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* hero */
.hero { min-height: 100vh; display: flex; align-items: center; padding: calc(var(--nav-h) + 56px) 0 80px; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px 0 8px; border: 1px solid var(--line2); border-radius: 999px; background: rgba(5, 32, 28, .85); font-weight: 600; font-size: 14px; }
.pill img { width: 22px; height: 22px; border-radius: 7px; }
.hero h1 { font-size: clamp(40px, 6.6vw, 76px); font-weight: 800; margin: 22px 0 20px; max-width: 8.4em; }
.hero h1 em { font-style: normal; color: var(--mint); }
.hero p.lead { max-width: 33em; font-size: 18px; color: #c4dcd7; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 18px; }
.ca { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5, 32, 28, .85); font: 500 14px/1 var(--num); max-width: 100%; }
.ca span.k { color: var(--muted); }
.ca code { color: var(--mint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticker { display: flex; align-items: center; gap: 14px; margin: 18px 0 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(5, 32, 28, .85); max-width: 640px; overflow: hidden; }
.ticker .tag { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 0 10px; border-radius: 8px; background: var(--mint); color: #03211c; font: 700 12px/1 var(--num); letter-spacing: .04em; }
.ticker .track { display: flex; gap: 28px; white-space: nowrap; animation: slide 38s linear infinite; font-size: 14.5px; color: #cfe9e3; }
.ticker .track b { color: var(--ink); } .ticker .track i { font-style: normal; color: var(--muted); }
@keyframes slide { to { transform: translateX(-50%); } }
.stats { display: flex; flex-wrap: wrap; gap: 28px 40px; margin-top: 22px; }
.stats div b { display: block; font: 700 26px/1.1 var(--num); } .stats div span { color: var(--muted); font-size: 14px; }
.scroll-hint { margin-top: 40px; color: var(--muted); font: 500 12.5px/1 var(--num); letter-spacing: .12em; }

/* scroll scenes: numbered cards over the 3D film */
.scene-step { min-height: 100vh; display: flex; align-items: flex-end; padding: 0 0 12vh; }
.scene-step.right { justify-content: flex-end; }
.card-step { width: min(460px, 100%); padding: 22px 24px; border: 1px solid var(--line2); border-radius: 18px; background: rgba(5, 30, 26, .92); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.card-step .no { font: 600 13px/1 var(--num); color: var(--teal); letter-spacing: .06em; }
.card-step h2 { font-size: clamp(26px, 3.4vw, 38px); margin: 10px 0 10px; font-weight: 800; }
.card-step h2 em { font-style: normal; color: var(--yellow); }
.card-step p { color: #c4dcd7; font-size: 16px; }
.formula { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; font: 500 14px/1.2 var(--num); }
.formula span { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 10px; border-radius: 8px; background: var(--panel3); border: 1px solid var(--line2); }
.formula i { color: var(--teal); font-style: normal; }
.split-bar { display: flex; height: 12px; border-radius: 8px; overflow: hidden; margin-top: 14px; background: var(--panel3); }
.split-bar span { display: block; height: 100%; }

/* flat sections (solid background above the scene) */
.flat { position: relative; background: var(--deep); padding: 84px 0; border-top: 1px solid var(--line); }
.flat.alt { background: var(--bg); }
.sec-head { max-width: 760px; margin-bottom: 30px; }
.sec-head .k { font: 600 13px/1 var(--num); color: var(--teal); letter-spacing: .08em; text-transform: uppercase; }
.sec-head h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; margin: 10px 0 12px; }
.sec-head p { color: #b7d3cd; font-size: 17px; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); padding: 22px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; } .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); } .kpi span { display: block; color: var(--muted); font-size: 13.5px; } .kpi b { display: block; margin-top: 6px; font: 700 24px/1.1 var(--num); }
.note { color: var(--muted); font-size: 13.5px; margin-top: 12px; } .demo-flag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 6px; background: rgba(255, 210, 58, .15); border: 1px solid rgba(255, 210, 58, .5); color: var(--yellow); font: 600 11.5px/1 var(--num); letter-spacing: .05em; }

/* forms */
label.f { display: block; margin-bottom: 14px; } label.f > span { display: block; margin-bottom: 6px; color: #b7d3cd; font-size: 14px; }
.in { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 12px; background: var(--deep); outline: none; } .in:focus { border-color: var(--mint); }
textarea.in { min-height: 90px; padding: 12px 14px; resize: vertical; }
.drop { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; min-height: 120px; border: 1.5px dashed var(--line2); border-radius: 14px; background: var(--deep); color: var(--muted); cursor: pointer; text-align: center; padding: 12px; } .drop:hover { border-color: var(--mint); } .drop img { max-height: 100px; border-radius: 10px; }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; } .steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14.5px; } .steps li::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--line2); } .steps li.wait { color: var(--ink); } .steps li.wait::before { background: var(--yellow); } .steps li.done { color: #bfe9dd; } .steps li.done::before { background: var(--mint); } .steps li.bad { color: var(--short); } .steps li.bad::before { background: var(--short); }
.preview-farm { display: grid; place-items: center; min-height: 240px; border: 1px solid var(--line); border-radius: 16px; background: var(--deep); overflow: hidden; }

/* tables / lists */
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; } .tbl th { text-align: left; padding: 10px 12px; color: var(--muted); font: 500 12.5px/1 var(--num); letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); } .tbl td { padding: 12px; border-bottom: 1px solid rgba(31, 75, 68, .6); vertical-align: middle; } .tbl tr:last-child td { border-bottom: 0; } .tbl .r { text-align: right; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.farm-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); transition: border-color .2s, transform .2s; } .farm-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.av { width: 46px; height: 46px; border-radius: 12px; background: var(--panel3) center/cover; display: grid; place-items: center; font: 700 14px/1 var(--num); color: var(--mint); }
.farm-card h3 { font: 700 17px/1.2 var(--ui); } .farm-card .sub { color: var(--muted); font-size: 13.5px; } .farm-card .big { text-align: right; font: 700 18px/1.1 var(--num); } .farm-card .big small { display: block; margin-top: 4px; color: var(--muted); font: 500 12.5px/1 var(--ui); }
.stage-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 0 8px; border-radius: 6px; background: var(--panel3); border: 1px solid var(--line2); font: 600 11.5px/1 var(--num); color: var(--mint); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; } .tab { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: #b9d8d2; font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap; } .tab.on { background: var(--teal); border-color: var(--teal); color: #03211c; }
.empty { display: grid; place-items: center; gap: 10px; padding: 34px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: 16px; } .empty img { width: 64px; height: 64px; border-radius: 16px; opacity: .9; }
.skel { background: linear-gradient(90deg, var(--panel) 25%, var(--panel2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: sk 1.3s linear infinite; border-radius: 12px; min-height: 64px; } @keyframes sk { to { background-position: -200% 0; } }
.flow { display: grid; gap: 0; } .flow .row { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid rgba(31, 75, 68, .5); } .flow .row:last-child { border-bottom: 0; } .flow .dot { width: 12px; height: 12px; margin: 6px 0 0 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px rgba(125, 255, 180, .6); } .flow .row b { display: block; font: 600 16px/1.3 var(--ui); } .flow .row small { color: var(--muted); } .flow .row a { color: var(--cyan); font: 500 13px/1 var(--num); }

/* modal + toast */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(1, 12, 10, .8); } .modal.on { display: flex; } .modal .box { width: min(520px, 100%); max-height: 92vh; overflow: auto; padding: 24px; border: 1px solid var(--line2); border-radius: 20px; background: var(--panel); } .modal h3 { font-size: 24px; margin-bottom: 10px; } .modal .row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 99; display: grid; gap: 8px; } .toast { padding: 12px 16px; border: 1px solid var(--line2); border-radius: 12px; background: var(--panel2); font-size: 14.5px; max-width: 340px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: pop .25s ease-out; } .toast.bad { border-color: var(--short); } .toast.ok { border-color: var(--mint); } @keyframes pop { from { transform: translateY(10px); opacity: 0; } }
.bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 99; background: linear-gradient(90deg, var(--cyan), var(--mint), var(--yellow)); }

footer { background: var(--bg); border-top: 1px solid var(--line); padding: 40px 0 60px; } footer .cols { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; align-items: center; } footer p { color: var(--muted); font-size: 14px; max-width: 520px; }
.apiblock { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #021512; font: 400 13px/1.55 var(--num); color: #bfe9dd; overflow: auto; max-height: 320px; }
.ep { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid rgba(31, 75, 68, .5); } .ep b { font: 600 12px/1 var(--num); color: #03211c; background: var(--mint); padding: 5px 7px; border-radius: 6px; } .ep code { font: 500 14px/1 var(--num); color: var(--ink); } .ep span { color: var(--muted); font-size: 14px; }
.calc input[type=range] { width: 100%; accent-color: var(--mint); } .calc .out { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.motion-toggle { cursor: pointer; }

@media (max-width: 980px) {
  .nav-links { display: none; } .burger { display: inline-flex; } .nav-links.open { display: flex; position: absolute; top: calc(100% + 8px); left: 0; right: 0; flex-direction: column; padding: 10px; border: 1px solid var(--line2); border-radius: 16px; background: var(--panel); pointer-events: auto; }
  .grid2, .grid3 { grid-template-columns: 1fr; } .grid4 { grid-template-columns: 1fr 1fr; } .calc .out { grid-template-columns: 1fr; }
  #scene3d::after { background: linear-gradient(180deg, rgba(3, 33, 28, .55), rgba(3, 33, 28, .8)); }
  .hide-m { display: none !important; }
}
@media (max-width: 560px) {
  .nav-in { gap: 8px; padding: 8px; } .brand span.w { display: none; } .hero { padding-top: calc(var(--nav-h) + 30px); } .scene-step { padding-bottom: 8vh; } .flat { padding: 56px 0; } .grid4 { grid-template-columns: 1fr; }
  .farm-card { grid-template-columns: auto 1fr; } .farm-card .big { grid-column: 1 / -1; text-align: left; }
}

/* reveal on scroll (only while animations are on) */
html[data-motion="on"] .rv { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
html[data-motion="on"] .rv.rv-in { opacity: 1; transform: none; }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation: none !important; transition: none !important; }
.btn, .farm-card { will-change: transform; }

@media (max-width: 1140px) {
  .nav-links { display: none; } .burger { display: inline-flex; }
  .nav-links.open { display: flex; position: absolute; top: calc(100% + 8px); left: 0; right: 0; flex-direction: column; padding: 10px; border: 1px solid var(--line2); border-radius: 16px; background: var(--panel); pointer-events: auto; }
  .nav-r .chip.hide-m { display: none; }
}

.farm-card.slot { border-style: dashed; background: transparent; } .farm-card.slot .av { font-size: 22px; color: var(--teal); } .farm-card.slot:hover { background: var(--panel); }

/* readability over the bright scene + nav spacing */
.nav-links { margin-left: 24px; }
#scene3d::after { background: linear-gradient(90deg, rgba(3, 33, 28, .9) 0%, rgba(3, 33, 28, .66) 38%, rgba(3, 33, 28, .12) 72%, rgba(3, 33, 28, 0) 100%); }
.hero p.lead, .hero .stats span, .scroll-hint, .hero .ca { text-shadow: 0 1px 12px rgba(2, 20, 17, .95), 0 0 2px rgba(2, 20, 17, .9); }
.hero p.lead { color: #dff3ee; }

.map-note { margin-top: 22px; padding: 16px 18px; border: 1px solid var(--line2); border-radius: 14px; background: var(--panel); color: #c4dcd7; font-size: 15.5px; } .map-note b { color: var(--mint); }

/* nav fits its frame: wider pill, tighter links, nothing may stick out; burger from 1180px */
.nav-in { width: min(1240px, 100% - 20px); gap: 12px; }
.nav-links { margin-left: 14px; gap: 0; min-width: 0; } .nav-links a { padding: 0 10px; font-size: 14.5px; }
.nav-r { flex: none; gap: 6px; } .nav-r .chip { padding: 0 10px; font-size: 13px; }
@media (max-width: 1180px) { .nav-links { display: none; } .burger { display: inline-flex; } .nav-r .chip.hide-m { display: none; } }
@media (max-width: 1320px) and (min-width: 1181px) { #hypeChip { display: none; } }
@media (max-width: 980px) { #scene3d::after { background: linear-gradient(180deg, rgba(3, 33, 28, .82) 0%, rgba(3, 33, 28, .72) 55%, rgba(3, 33, 28, .5) 100%); } .hero p.lead { color: #eafaf6; } }

/* phone: tables keep only the columns that matter, so nothing is cut at the right edge */
@media (max-width: 560px) {
  #valTbl th:nth-child(3), #valTbl td:nth-child(3), #ledgerTbl th:nth-child(3), #ledgerTbl td:nth-child(3), #ledgerTbl th:nth-child(4), #ledgerTbl td:nth-child(4) { display: none; }
  .tbl th, .tbl td { padding: 10px 8px; } .tbl { font-size: 14px; }
  .map-note { font-size: 14.5px; }
}

.ca[hidden] { display: none; }
