:root {
    --bg: #10140f;
    --bg-2: #171d16;
    --surface: #1e261c;
    --surface-2: #273224;
    --line: #354232;
    --ink: #f4efe4;
    --muted: #a7b09f;
    --brass: #d7a441;
    --brass-2: #f0d7a0;
    --pine: #3f6b4e;
    --mint: #9dcc8a;
    --ember: #c45c3e;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --radius: 22px;
    --gap: 24px;
    --card-pad: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Poppins", sans-serif;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(215, 164, 65, 0.16), transparent 50%),
        radial-gradient(900px 400px at 100% 0%, rgba(63, 107, 78, 0.25), transparent 45%),
        var(--bg);
    color: var(--ink);
    font-weight: 500;
}

a { color: var(--brass-2); text-decoration: none; }
a:hover { color: var(--brass); }
strong, h1, h2, h3, .brand, button, .nav a { font-weight: 700; }

.site-header {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.mark {
    width: 44px; height: 44px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(160deg, var(--brass), #8c5d18);
    color: #1a1408; font-weight: 800; letter-spacing: -0.04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text em { font-style: normal; font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; }
.nav a, .nav button {
    border: 0; background: transparent; color: var(--ink);
    padding: 8px 12px; border-radius: 999px; cursor: pointer; font: inherit;
}
.nav a.active, .nav a:hover, .nav button:hover { background: var(--surface); }
.nav a.tab {
    color: #1a1408;
    background: var(--brass);
    border: 1px solid var(--brass);
}
.nav a.tab:hover, .nav a.tab.active { background: var(--brass-2); color: #1a1408; }
.nav .ghost { color: var(--muted); }
.nav .admin { color: var(--brass-2); background: rgba(215, 164, 65, 0.12); }
#app { max-width: 1180px; margin: 0 auto; padding: 20px 32px 72px; min-height: 70vh; }
.site-footer {
    margin-top: 12px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    background:
        radial-gradient(700px 180px at 0% 0%, rgba(215, 164, 65, 0.12), transparent 60%),
        #0d110d;
}
.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 42px 28px 28px;
    display: grid;
    grid-template-columns: 1.5fr 0.7fr 0.7fr 1fr;
    gap: 32px;
}
.footer-brand p { max-width: 28rem; line-height: 1.55; }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.footer-col h2 {
    margin: 0 0 6px;
    color: var(--brass);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.footer-col a { color: var(--ink); font-weight: 600; }
.footer-col a:hover { color: var(--brass-2); }
.footer-col p { margin: 0; line-height: 1.5; }
.footer-base {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 28px 26px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.hero {
    display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 28px;
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--line); border-radius: 32px; padding: 42px;
    box-shadow: var(--shadow);
}
.eyebrow { color: var(--brass); letter-spacing: 0.2em; text-transform: uppercase; font-size: 12px; font-weight: 700; }
h1 { font-size: clamp(40px, 6vw, 68px); line-height: 0.95; margin: 10px 0 16px; letter-spacing: -0.04em; }
.lede { color: var(--muted); font-size: 18px; max-width: 36rem; }
.hero-card {
    background: #11170f; border: 1px solid var(--line); border-radius: 24px; padding: 22px;
}
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0; }
.pill { background: var(--surface-2); border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }

.grid { display: grid; gap: var(--gap); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: var(--card-pad);
}
.card h2, .card h3 { margin: 0 0 14px; }
.card h3 { font-size: 22px; }
.card p { line-height: 1.6; }
.card > :last-child { margin-bottom: 0; }
.price { color: var(--brass-2); font-weight: 800; font-size: 20px; }
.tag { color: var(--mint); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
    background: var(--surface-2); color: var(--brass-2); border: 1px solid var(--line);
}
.page-head { margin: 8px 0 22px; }
.page-head h1 { margin-bottom: 8px; }
.muted { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
select.status { width: auto; min-width: 180px; padding: 8px 12px; }

.btn, button.btn, input[type=submit] {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brass); color: #1a1408; border: 0; border-radius: 999px;
    padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer;
}
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--ember); color: white; }
.btn.small { padding: 8px 12px; font-size: 13px; }
form { display: grid; gap: 12px; }
label { font-weight: 700; font-size: 13px; }
input, select, textarea {
    width: 100%; background: #12180f; color: var(--ink); border: 1px solid var(--line);
    border-radius: 14px; padding: 12px 14px; font: inherit;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 16px 14px; border-bottom: 1px solid var(--line); }
.table-wrap.card { padding: 8px 12px 12px; }
th { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

.stat { font-size: 36px; font-weight: 800; letter-spacing: -0.04em; }
.flash { background: #3a221c; color: #ffd4c8; padding: 10px 12px; border-radius: 12px; }
.ok { background: #1c3324; color: var(--mint); padding: 10px 12px; border-radius: 12px; }
.mail-frame { width: 100%; min-height: 640px; border: 1px solid #354232; border-radius: 18px; background: #10140f; }
.section-title { margin: 42px 0 16px; font-size: 28px; letter-spacing: -0.03em; }
.news { border-left: 3px solid var(--brass); padding-left: 16px; }
.auth-box { max-width: 460px; margin: 40px auto; }

.intro h1, .dash h1 { font-size: clamp(34px, 5vw, 56px); }
.dash { display: grid; gap: 20px; }
.dash > h1, .dash > .subnav, .dash > .lede, .dash > .eyebrow { margin: 0; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.chart { width: 100%; height: auto; display: block; }
.chart-line { fill: none; stroke: var(--brass); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: rgba(215, 164, 65, 0.16); }
.chart.draw .chart-line { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 1.15s ease forwards; }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; }
.live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--mint); display: inline-block; margin-right: 8px;
    box-shadow: 0 0 0 0 rgba(157, 204, 138, 0.7); animation: pulse 2.2s ease infinite;
}
.product-card { color: inherit; display: flex; flex-direction: column; gap: 8px; min-height: 100%; }
.product-card:hover { border-color: var(--brass); color: inherit; }
a.card.shipment { color: inherit; display: block; }
a.card.shipment:hover { border-color: var(--brass); color: inherit; }
.shipment-line { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); color: inherit; }
.shipment-line:hover { color: var(--brass-2); }
.product-layout { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 28px; align-items: start; }
.buybox { position: sticky; top: 18px; display: grid; gap: 12px; }
.buybox .price { font-size: 32px; }
.qty { display: flex; gap: 8px; align-items: center; }
.qty input { width: 84px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; }
.cart-count {
    display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 6px;
    border-radius: 999px; background: var(--brass); color: #1a1408; font-size: 12px; font-weight: 800;
}
.subnav { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.subnav a {
    padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
    color: var(--ink); background: transparent; font-weight: 700; font-size: 14px;
}
.subnav a.active, .subnav a:hover { background: var(--surface-2); color: var(--brass-2); }
.reply { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: #12180f; border: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
.stack { display: grid; gap: 20px; }
.admin-stats { margin: 0; }
.landing { display: grid; gap: 48px; }
.stage {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: center;
    background: linear-gradient(165deg, #243024 0%, #171d16 55%, #141910 100%);
    border: 1px solid var(--line); border-radius: 32px; padding: 42px;
    box-shadow: var(--shadow);
}
.stage-glow {
    position: absolute; width: 280px; height: 280px; right: 8%; top: -40px; border-radius: 50%;
    background: radial-gradient(circle, rgba(215, 164, 65, 0.45), transparent 68%);
    filter: blur(8px); animation: drift 9s ease-in-out infinite; pointer-events: none;
}
.stage-copy, .stage-machines { position: relative; z-index: 1; }
.stage h1 { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.stage .lede { animation: rise .7s .08s cubic-bezier(.2, .8, .2, 1) both; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; animation: rise .7s .16s cubic-bezier(.2, .8, .2, 1) both; }
.stage-machines { display: grid; gap: 16px; min-height: 280px; }
.machine {
    background: rgba(16, 20, 15, 0.72); border: 1px solid var(--line); border-radius: 20px;
    padding: 16px 18px 16px 18px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
    column-gap: 12px; backdrop-filter: blur(8px);
    animation: floaty 5.5s ease-in-out infinite, rise .8s cubic-bezier(.2, .8, .2, 1) both;
}
.machine strong { font-size: 18px; letter-spacing: -0.03em; }
.machine em { grid-column: 1; color: var(--muted); font-style: normal; font-size: 13px; font-weight: 600; }
.machine-kicker { color: var(--brass-2); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; }
.machine .screen {
    grid-row: 1 / span 2; grid-column: 2; width: 54px; height: 40px; border-radius: 8px; align-self: center;
    background:
        linear-gradient(180deg, rgba(157, 204, 138, 0.2), transparent 40%),
        linear-gradient(90deg, #2a3828, #1a2418);
    border: 1px solid #4d6248; box-shadow: inset 0 0 0 1px rgba(215, 164, 65, 0.25);
    position: relative;
}
.machine .screen::after {
    content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%;
    right: 6px; bottom: 6px; background: var(--mint); animation: pulse 2.2s ease infinite;
}
.machine.m2 { animation-delay: .15s, .4s; margin-left: 28px; }
.machine.m3 { animation-delay: .3s, .7s; margin-left: 10px; }
.band { display: grid; gap: 20px; }
.band h2 { margin: 0; font-size: 32px; letter-spacing: -0.04em; }
.band-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.band-head h2 { margin: 0; }
.work-card, .note, .steps li { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.work-card:nth-child(2), .note:nth-child(2) { animation-delay: .12s; }
.work-card:nth-child(3) { animation-delay: .24s; }
.work-card p, .note p { color: var(--muted); }
.work-card h3, .note h3, .steps h3 { margin-top: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.steps li {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--card-pad);
}
.steps li:nth-child(2) { animation-delay: .12s; }
.steps li:nth-child(3) { animation-delay: .24s; }
.steps span {
    display: block; color: var(--brass); font-weight: 800; letter-spacing: 0.08em; margin-bottom: 10px;
}
.steps p, .note .muted { margin-bottom: 0; }
.note { color: inherit; transition: transform .35s ease, border-color .35s ease; }
.note .more { color: var(--brass-2); font-weight: 700; font-size: 14px; }
.post { max-width: 740px; }
.post-body { font-size: 18px; line-height: 1.7; font-weight: 500; }
.post-body p { margin: 0 0 16px; }
.back { display: inline-block; margin-bottom: 18px; font-weight: 700; }
.work-card { transition: transform .35s ease, border-color .35s ease; }
.note:hover, .work-card:hover, .machine:hover { transform: translateY(-4px); border-color: var(--brass); }
#app.enter { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse {
    70% { box-shadow: 0 0 0 8px rgba(157, 204, 138, 0); }
}
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-28px, 18px) scale(1.08); }
}

.specs { display: grid; gap: 10px; margin: 0 0 18px; }
.specs div { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--brass-2); }
.specs dd { margin: 0; }
.part-list { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.part-list.warn { color: var(--brass-2); }
.summary-block { margin-bottom: 10px; }
.pay-note, .pay-card p { color: var(--muted); }
.pay-card strong { display: block; font-size: 20px; margin: 4px 0; }
.open-order { background: rgba(215, 164, 65, 0.08); }
.order-head { display: flex; justify-content: space-between; gap: 24px; align-items: stretch; margin-bottom: 24px; }
.order-sheet { display: grid; gap: 24px; }
.order-sheet > .back, .order-sheet > .order-head, .order-sheet > .grid { margin: 0; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment p { margin: 6px 0 0; }
.builder-head { margin-bottom: 18px; }
.build-meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.build-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--pine), var(--brass)); transition: width .45s ease; }
.builder-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 28px; align-items: start; }
.slot-rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.slot-tab, .part-card { font: inherit; color: inherit; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; }
.slot-tab { padding: 12px; display: grid; gap: 2px; }
.slot-tab span { color: var(--brass); font-size: 12px; letter-spacing: .08em; }
.slot-tab em { color: var(--muted); font-style: normal; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-tab.open, .part-card.is-on { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
.slot-tab.done { background: var(--surface-2); }
.part-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.part-card { padding: 12px; display: grid; gap: 6px; animation: slotIn .45s cubic-bezier(.2,.8,.2,1) both; }
.part-card img, .part-fallback { width: 100%; height: 120px; object-fit: contain; background: #0d120d; border-radius: 12px; }
.part-fallback { display: grid; place-items: center; font-size: 42px; color: var(--brass-2); }
.part-card b { color: var(--brass-2); }
.tower { position: sticky; top: 18px; display: grid; gap: 12px; }
.tower.complete { animation: pulse 1.2s ease; }
.bay { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 12px; background: #121812; color: var(--muted); }
.bay.filled { color: var(--ink); background: var(--surface-2); animation: slotIn .4s ease both; }
.bay strong { font-size: 13px; text-align: right; }
.tower-price { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.tower-price strong { font-size: 28px; color: var(--brass-2); }
.tower-price strong.pop { animation: pricePop .45s ease; }
@keyframes slotIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pricePop { 40% { transform: scale(1.06); } }

@media (max-width: 900px) {
    #app { padding: 12px 16px 48px; }
    .card { --card-pad: 20px; }
    .landing { gap: 32px; }
    .hero, .stage { padding: 24px; }
    .hero, .charts, .product-layout, .stage, .steps, .footer-inner, .grid.cols-3, .grid.cols-2, .grid.cols-4, .builder-grid, .order-head { grid-template-columns: 1fr; }
    .footer-base { flex-direction: column; }
    .buybox { position: static; }
    .site-header { flex-direction: column; align-items: flex-start; }
    .machine.m2, .machine.m3 { margin-left: 0; }
    .slot-rail, .part-grid, .specs div { grid-template-columns: 1fr; }
    .order-head { flex-direction: column; }
    .tower { position: static; }
}
@media (prefers-reduced-motion: reduce) {
    .part-card, .bay.filled, .tower.complete, .tower-price strong.pop,
    #app.enter, .chart.draw .chart-line, .live-dot, .stage-glow, .stage h1, .stage .lede,
    .hero-actions, .machine, .work-card, .note, .steps li { animation: none; }
}
