/* ===== Tokens ===== */
:root {
    --green: #30af5b;
    --green-strong: #1b7a3c;
    --green-deep: #10391f;
    --ink: #292c27;
    --muted: #5a6156;
    --bg: #ffffff;
    --tint: #f1f5f0;
    --surface: #ffffff;
    --line: #dce3d9;
    --sun: #f2b705;
    --water: #3b93c9;
    --font-head: "Geist", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --radius: 12px;
    color-scheme: light;
}
html.dark {
    --ink: #edf1ea;
    --muted: #a8b2a3;
    --bg: #171a16;
    --tint: #1e231d;
    --surface: #252b23;
    --line: #363e33;
    --green-strong: #5fd084;
    color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { font: 400 1rem/1.65 var(--font-body); color: var(--ink); background: var(--bg); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; letter-spacing: -0.025em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
a { color: inherit; }
ul { list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 50; background: var(--surface); padding: 8px 14px; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 1.5px solid transparent; border-radius: 8px; font: 600 0.93rem var(--font-body); text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.btn--primary { background: #1b7a3c; color: #fff; }
.btn--primary:hover { background: #14602f; }
.btn--ghost, .btn--outline { border-color: var(--line); background: transparent; color: var(--ink); }
.btn--ghost:hover, .btn--outline:hover { border-color: var(--green); }
.btn--outline[aria-pressed="true"] { background: #1b7a3c; border-color: #1b7a3c; color: #fff; }
.btn--signup { background: var(--sun); color: #151515; white-space: nowrap; }
.btn--signup:hover { background: #ffca28; }
.header .btn--signup:focus-visible { outline-color: var(--ink); }
.btn--light { background: #fff; color: #10391f; }
.btn--light:hover { background: #d9f2e1; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-btn .fill { fill: currentColor; }

/* ===== Header ===== */
.header { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.header__row { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; line-height: 1.2; }
.brand__mark { width: 90px; height: 90px; flex: none; }
.brand__mark rect { fill: var(--green); }
.brand__mark path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.brand strong { display: block; font: 700 1.25rem var(--font-head); }
.brand small { display: block; font-size: 0.72rem; color: var(--muted); }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { font-size: 0.93rem; font-weight: 500; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.is-active { border-color: var(--green); }
.header__actions { display: flex; gap: 10px; }
.header__quote { white-space: nowrap; }
.menu-btn { display: none; }
.nav .nav__quote { display: none; }

/* ===== Hero ===== */
.hero { padding-block: clamp(48px, 7vw, 96px); background: var(--tint); }
.hero__grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero__copy p { max-width: 48ch; margin-top: 22px; font-size: 1.12rem; color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Live ladder demo (always dark, like an HMI screen) */
.demo { background: #1d211b; color: #edf1ea; border-radius: 20px; padding: clamp(16px, 2.5vw, 28px); box-shadow: 0 30px 60px -30px rgba(16, 57, 31, .55); }
html.dark .demo { border: 1px solid #454d40; }
.demo figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-bottom: 14px; }
.demo figcaption strong { font-family: var(--font-head); }
.demo figcaption span { font-size: 0.88rem; color: #a8b2a3; }
.demo svg { display: block; width: 100%; height: auto; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ladder { border-bottom: 1px solid #394035; padding-bottom: 8px; }
.ladder path { stroke: #657060; stroke-width: 3; transition: stroke .3s; }
.ladder text { fill: #c5cdc1; font: 500 15px var(--font-body); text-anchor: middle; }
.ladder .rail { stroke: #a8b2a3; stroke-width: 4; }
.ladder .wire.on, .ladder g.on path { stroke: #4fe083; }
.plant { position: relative; margin-top: 14px; }
.plant path, .plant circle { stroke: #a8b2a3; stroke-width: 2.5; }
.plant .sun { opacity: .22; transition: opacity .3s; }
.plant .sun * { stroke: var(--sun); }
.demo.has-sun .sun { opacity: 1; }
.plant .pipe { stroke: #4a5346; stroke-width: 9; }
.plant .flow { stroke: var(--water); stroke-width: 4; stroke-dasharray: 8 12; opacity: 0; }
.plant .pump circle { fill: #1d211b; }
.demo.is-running .flow { opacity: 1; animation: flow .8s linear infinite; }
.demo.is-running .pump circle { stroke: #4fe083; }
.demo.is-running .rotor { transform-origin: 260px 142px; animation: spin 1s linear infinite; }
.plant .water { fill: var(--water); stroke: none; }
.plant__level { position: absolute; right: 2%; top: 0; font-size: 0.85rem; color: #a8b2a3; }
.demo__controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.switch { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px; border: 1px solid #454d40; border-radius: 10px; background: transparent; color: inherit; font: 500 0.92rem var(--font-body); cursor: pointer; }
.switch::after { content: "Off"; padding: 2px 10px; border-radius: 20px; background: #394035; font-size: 0.78rem; }
.switch[aria-pressed="true"] { border-color: #4fe083; }
.switch[aria-pressed="true"]::after { content: "On"; background: #4fe083; color: #10391f; }
@keyframes flow { to { stroke-dashoffset: -20; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Sections ===== */
.section { padding-block: clamp(64px, 8vw, 104px); }
.section--tint { background: var(--tint); }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 40px; margin-bottom: 40px; }
.section__head p { max-width: 46ch; color: var(--muted); }

/* Solutions explorer */
.explorer { display: grid; grid-template-columns: minmax(240px, 1fr) 1.8fr; gap: 24px; }
.explorer__tabs { display: flex; flex-direction: column; }
.explorer__tabs button { text-align: left; min-height: 62px; flex: 1; padding: 0 18px; border: 0; border-left: 4px solid var(--line); background: transparent; color: var(--muted); font: 600 1.08rem var(--font-head); cursor: pointer; }
.explorer__tabs button:hover { color: var(--ink); }
.explorer__tabs button[aria-selected="true"] { border-color: var(--green); background: var(--tint); color: var(--ink); }
.explorer__panels { display: grid; gap: 16px; }
.explorer__panel { background: #10391f; color: #fff; border-radius: 20px; padding: clamp(24px, 4vw, 52px); }
.explorer__panel h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.explorer__panel > p { max-width: 52ch; margin-top: 12px; color: #cfe3d5; }
.ticks { margin-block: 26px 30px; }
.ticks li { padding: 11px 0 11px 30px; border-top: 1px solid #ffffff26; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 3px; top: 17px; width: 7px; height: 12px; border: solid #4fe083; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

/* Digital products */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { min-height: 40px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 40px; background: var(--surface); color: var(--ink); font: 500 0.9rem var(--font-body); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr)); gap: 16px; }
.file { display: grid; grid-template-columns: auto 1fr; gap: 14px 20px; align-content: space-between; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.file__icon { display: flex; align-items: end; justify-content: center; width: 68px; height: 82px; padding-bottom: 10px; color: #fff; background: #1b7a3c; font: 600 0.9rem var(--font-head); border-radius: 6px; clip-path: polygon(0 0, 70% 0, 100% 24%, 100% 100%, 0 100%); }
.file__icon--eplan { background: #2d5f86; }
.file__icon--cad { background: #9a4a2f; }
.file__body p { margin-block: 6px; color: var(--muted); font-size: 0.93rem; }
.file__tool { font-size: 0.82rem; font-weight: 600; color: var(--green-strong); }
.file__buy { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 600; font-size: 0.93rem; }

/* Agricultural products */
.agri { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.agri__item { display: flex; flex-direction: column; align-items: flex-start; padding: 32px 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.agri__item svg { width: 64px; height: 64px; margin-bottom: 22px; fill: none; stroke: var(--green-strong); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.agri__item p { margin-block: 8px 22px; color: var(--muted); }
.agri__item .btn { margin-top: auto; }

/* Posts */
.posts { display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px; }
.posts__list { display: grid; gap: 24px; }
.post { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.post--lead { border-top: 6px solid var(--green); padding: clamp(28px, 4vw, 48px); }
.post--lead h3 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); }
.post__topic { display: block; margin-bottom: 8px; font-size: 0.85rem; font-weight: 600; color: var(--green-strong); }
.post > p { margin-top: 10px; color: var(--muted); }
.post details { margin-top: 18px; }
.post summary { cursor: pointer; font-weight: 600; text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 4px; }
.post details p { margin-top: 12px; max-width: 65ch; }

/* ===== Contact and footer ===== */
.contact { padding-block: clamp(64px, 8vw, 104px); background: #10391f; color: #fff; }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); }
.contact__grid > div > p { max-width: 44ch; margin-top: 16px; color: #cfe3d5; }
.contact__details { margin-top: 32px; font-weight: 600; }
.contact__details li { padding: 12px 0; border-top: 1px solid #ffffff26; overflow-wrap: anywhere; }
.form { display: grid; gap: 16px; padding: clamp(20px, 3vw, 34px); background: var(--surface); color: var(--ink); border-radius: 20px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.form input, .form textarea { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: 400 1rem var(--font-body); resize: vertical; }
.basket { padding: 14px; background: var(--tint); border-radius: 8px; font-size: 0.92rem; }
.basket li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 6px; }
.basket button { border: 0; background: none; color: var(--green-strong); font: 600 0.85rem var(--font-body); text-decoration: underline; cursor: pointer; padding: 6px; }
.form__note { font-size: 0.88rem; color: var(--muted); }
.form__note:empty { display: none; }
.basket-pill { position: fixed; right: 20px; bottom: 20px; z-index: 15; padding: 13px 20px; border-radius: 40px; background: var(--sun); color: #292c27; font-weight: 600; text-decoration: none; box-shadow: 0 10px 24px -8px #0006; }


/* ===== Responsive ===== */
@media (max-width: 1180px) {
    .menu-btn { display: grid; }
    .header__actions { margin-left: auto; }
    .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 20px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
    .nav.is-open { display: flex; }
    .nav a { padding: 12px 0; }
}
@media (max-width: 1020px) {
    .hero__grid, .explorer, .posts, .contact__grid { grid-template-columns: minmax(0, 1fr); }
    .agri { grid-template-columns: repeat(2, 1fr); }
    .explorer__tabs { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .explorer__tabs button { flex: 0 0 auto; min-height: 44px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 0.95rem; padding: 0 14px; }
}
@media (max-width: 640px) {
    .header__quote { display: none; }
    .nav .nav__quote { display: block; }
    .brand small { font-size: 0.66rem; }
    .header__row { gap: 12px; }
    .header__actions { gap: 8px; }
    .btn--signup { padding: 0 14px; }
    .agri { grid-template-columns: 1fr; }
    .file { grid-template-columns: 1fr; }
    .demo__controls { grid-template-columns: 1fr; }
    .ladder text { font-size: 20px; }
}
@media (max-width: 460px) {
    .brand small { display: none; }
}
@media (max-width: 359px) {
    .brand__mark { display: none; }
    .header__actions { gap: 6px; }
    .icon-btn { width: 40px; }
    .btn--signup { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
