/* DeviceCore landing page — Neo Brutalism
   thick black rules, flat primary accents, hard offset edges, monospace. */

:root {
  --bg: #ece8da;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #6b6b60;
  --line: #111111;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #f5c518;
  --purple: #7c3aed;
  --track: #d8d3c2;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --shadow: 5px 5px 0 rgba(17, 17, 17, 0.22);
  --maxw: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

h1, h2, h3, h4 { margin: 0; line-height: 1.1; letter-spacing: -0.01em; }
p { margin: 0; }

code { font-family: var(--mono); }

.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; flex: none; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--yellow); color: var(--ink); padding: 10px 16px; border: 3px solid var(--ink); font-weight: 700;
}
.skip:focus { left: 12px; top: 12px; }

.muted { color: var(--muted); }

/* top bar ------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px clamp(14px, 4vw, 28px);
  background: var(--ink); color: #fff;
  border-bottom: 4px solid var(--ink);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.mark {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  background: var(--yellow); color: var(--ink);
  border: 3px solid #fff; font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 17px; letter-spacing: 0.02em; }
.brand-text em { font-style: normal; color: #9a9a90; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

.nav { display: flex; gap: 22px; }
.nav a { color: #d7d7cc; text-decoration: none; font-size: 13px; font-weight: 700; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.active { color: #fff; border-bottom-color: var(--yellow); }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.pill-live {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border: 2px solid #fff; font-size: 11px; font-weight: 700; color: #fff;
}
.pill-live i { width: 8px; height: 8px; background: var(--green); border: 2px solid #fff; animation: blink 2.4s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.nav-toggle { display: none; flex-direction: column; gap: 4px; padding: 9px; background: transparent; border: 2px solid #fff; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: #fff; }

.lang { display: inline-flex; border: 2px solid #fff; }
.lang a {
  padding: 4px 9px; color: #d7d7cc; text-decoration: none;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.35;
}
.lang a + a { border-left: 2px solid #fff; }
.lang a:hover { color: #fff; }
.lang a.is-active { background: var(--yellow); color: var(--ink); }

/* buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; background: #fff; color: var(--ink);
  border: 3px solid var(--ink); font-family: var(--mono); font-size: 13px; font-weight: 700;
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow);
  transition: transform 0.06s ease, box-shadow 0.06s ease, background 0.12s ease;
}
.btn:hover { background: var(--yellow); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 rgba(17, 17, 17, 0.22); }
.btn .ico { font-size: 15px; }
.btn.small { padding: 6px 12px; font-size: 12px; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35); }
.btn.primary { background: var(--yellow); }
.btn.primary:hover { background: #ffd83a; }
.btn.ghost { background: var(--ink); color: #fff; }
.btn.ghost:hover { background: var(--blue); color: #fff; }
.btn.ghost:active { box-shadow: 1px 1px 0 rgba(0,0,0,0.4); }

/* hero ---------------------------------------------------------------- */

.hero {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(24px, 4vw, 56px);
  align-items: center;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(40px, 7vw, 84px) clamp(14px, 4vw, 28px);
  position: relative;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(17,17,17,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,17,0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(120% 80% at 30% 20%, #000 30%, transparent 78%);
}

.badge {
  display: inline-block; padding: 5px 12px; margin-bottom: 20px;
  background: var(--yellow); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: 3px 3px 0 rgba(17,17,17,0.22);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.hero h1 { font-size: clamp(34px, 5.6vw, 62px); font-weight: 700; letter-spacing: -0.02em; }
.hero h1 .hl { background: var(--yellow); box-shadow: 0 0 0 3px var(--ink); padding: 0 6px; display: inline-block; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.lead { margin-top: 22px; max-width: 60ch; font-size: clamp(14px, 1.5vw, 16px); color: #3a3a34; }
.lead a { color: var(--blue); font-weight: 700; }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.stat-row { display: flex; flex-wrap: wrap; gap: 0; list-style: none; margin: 34px 0 0; padding: 0; border: 3px solid var(--ink); background: var(--panel); box-shadow: var(--shadow); }
.stat-row li { flex: 1 1 0; min-width: 100px; padding: 12px 14px; border-right: 3px solid var(--ink); }
.stat-row li:last-child { border-right: 0; }
.stat-row b { display: block; font-size: 24px; letter-spacing: -0.02em; }
.stat-row span { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* hero terminal */
.hero-demo { position: relative; }
.window { border: 3px solid var(--ink); background: #12130f; box-shadow: 8px 8px 0 rgba(17,17,17,0.28); }
.window-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #1c1d18; border-bottom: 3px solid var(--ink); }
.window-bar em { margin-left: 8px; color: #9a9a90; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.dot { width: 11px; height: 11px; border: 2px solid #000; }
.dot.red { background: #ff5d5d; } .dot.yellow { background: var(--yellow); } .dot.green { background: #56d364; }
.dot.on { background: var(--green); }

.terminal {
  margin: 0; padding: 18px 16px; min-height: 240px;
  color: #e6e4d8; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.terminal .p { color: var(--yellow); }
.terminal .ok { color: #56d364; }
.terminal .dim { color: #7a7a6e; }
.terminal .cur { background: var(--yellow); color: #12130f; }

.float-tag {
  position: absolute; padding: 5px 10px; background: var(--panel); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: 3px 3px 0 rgba(17,17,17,0.22);
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.float-tag.t1 { top: -14px; right: 22px; background: var(--blue); color: #fff; transform: rotate(3deg); }
.float-tag.t2 { bottom: 26px; left: -16px; background: var(--green); color: #fff; transform: rotate(-3deg); }
.float-tag.t3 { bottom: -14px; right: 40px; background: var(--yellow); transform: rotate(2deg); }

/* sections ------------------------------------------------------------ */

.section { padding: clamp(48px, 7vw, 90px) clamp(14px, 4vw, 28px); }
.section.alt { background: #e3dfcd; border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink); }
.section > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }

.section-head { margin-bottom: 34px; }
.kicker { display: inline-block; margin-bottom: 12px; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.section-head h2 { font-size: clamp(26px, 3.6vw, 40px); }
.section-lead { margin-top: 14px; max-width: 68ch; color: #3a3a34; }

/* features ------------------------------------------------------------ */

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { padding: 20px; background: var(--panel); border: 3px solid var(--ink); box-shadow: var(--shadow); border-top: 8px solid var(--accent, var(--ink)); }
.ficon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; background: var(--accent, var(--ink)); color: #fff; border: 3px solid var(--ink); }
.ficon .ico { font-size: 22px; }
.feature h3 { font-size: 16px; margin-bottom: 8px; }
.feature p { font-size: 13px; color: #3a3a34; }

/* filter chips -------------------------------------------------------- */

.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 14px; background: var(--panel); color: var(--ink);
  border: 3px solid var(--ink); font-family: var(--mono); font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.chip:hover { background: #fff; }
.chip:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.chip.is-active { background: var(--ink); color: #fff; }
.chip-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--yellow); color: var(--ink); border: 2px solid var(--ink);
  font-size: 10px; font-weight: 700; line-height: 1;
}
.chip.is-active .chip-count { background: var(--yellow); color: var(--ink); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* tool grid ----------------------------------------------------------- */

.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool {
  display: flex; flex-direction: column;
  padding: 18px; background: var(--panel); border: 3px solid var(--ink);
  box-shadow: var(--shadow); border-top: 8px solid var(--accent, var(--ink));
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tool:hover { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 rgba(17,17,17,0.28); }
.tool.hide { display: none; }
.tool-head { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 12px; margin-bottom: 12px; }
.tool-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 42px; height: 42px; background: var(--accent, var(--ink)); color: #fff; border: 3px solid var(--ink); }
.tool-icon .ico { font-size: 21px; }
.tool-head h3 { font-size: 17px; }
.tool-id { font-size: 10px; color: var(--muted); font-weight: 700; }
.tool p { font-size: 13px; color: #3a3a34; flex: 1; }
.caps { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.caps li { padding: 3px 8px; background: var(--bg); border: 2px solid var(--ink); font-size: 10px; font-weight: 700; letter-spacing: 0.02em; }

/* graphics ------------------------------------------------------------ */

.graphics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gcard { background: var(--panel); border: 3px solid var(--ink); box-shadow: var(--shadow); }
.gdemo { height: 150px; padding: 14px; background: #12130f; border-bottom: 3px solid var(--ink); }
.gdemo svg { width: 100%; height: 100%; display: block; }
.gcard h3 { padding: 14px 16px 0; font-size: 14px; }
.gcard h3 code { background: var(--yellow); border: 2px solid var(--ink); padding: 1px 6px; }
.gcard p { padding: 8px 16px 18px; font-size: 13px; color: #3a3a34; }
.gline { fill: none; stroke: var(--blue); stroke-width: 3; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 2.4s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.g3d polygon { stroke: var(--ink); stroke-width: 1; }
@media (prefers-reduced-motion: reduce) { .gline { animation: none; stroke-dashoffset: 0; } }

/* dashboard ----------------------------------------------------------- */

.dash { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 52px); align-items: center; }
.dash-copy h2 { font-size: clamp(26px, 3.6vw, 40px); margin-bottom: 16px; }
.dash-copy > .kicker { margin-bottom: 12px; }
.dash-copy p { color: #3a3a34; margin-bottom: 18px; }

.codeblock { display: flex; align-items: stretch; gap: 0; background: #12130f; border: 3px solid var(--ink); box-shadow: var(--shadow); }
.codeblock code { flex: 1; padding: 12px 14px; color: #e6e4d8; font-size: 12.5px; overflow-x: auto; white-space: pre; }
.copy-ic {
  display: grid; place-items: center; width: 48px; background: #1c1d18; color: #e6e4d8;
  border: 0; border-left: 3px solid var(--ink); cursor: pointer;
}
.copy-ic .ico { font-size: 17px; }
.copy-ic:hover { background: var(--yellow); color: var(--ink); }

.dash-shot { display: flex; flex-direction: column; gap: 14px; }
.mini-panel { border: 3px solid var(--ink); background: var(--panel); box-shadow: var(--shadow); }
.mini-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 3px solid var(--ink); font-size: 12px; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.mini-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 2px solid var(--ink); background: #eef7ee; font-size: 12px; font-weight: 700; }
.mini-card .run { font-style: normal; font-size: 10px; padding: 2px 7px; border: 2px solid var(--ink); background: var(--green); color: #fff; }
.mini-term { padding: 12px 14px; background: #12130f; color: #e6e4d8; border: 3px solid var(--ink); box-shadow: var(--shadow); font-size: 12.5px; }
.mini-term .p { color: var(--yellow); }
.mini-term .cursor { color: var(--yellow); animation: blink 1s steps(1) infinite; }

/* steps --------------------------------------------------------------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; padding: 20px; background: var(--panel); border: 3px solid var(--ink); box-shadow: var(--shadow); }
.step-n { display: grid; place-items: center; width: 44px; height: 44px; background: var(--ink); color: var(--yellow); border: 3px solid var(--ink); font-size: 20px; font-weight: 700; }
.steps h3 { font-size: 17px; margin-bottom: 8px; }
.steps p { color: #3a3a34; margin-bottom: 14px; }
.steps .codeblock { margin-bottom: 10px; }
.steps .muted { font-size: 12px; }

.start-note { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 16px 18px; background: var(--yellow); border: 3px solid var(--ink); box-shadow: var(--shadow); }
.start-note .ico { font-size: 24px; }
.start-note code { background: var(--panel); border: 2px solid var(--ink); padding: 1px 6px; }

/* footer -------------------------------------------------------------- */

.footer { background: var(--ink); color: #d7d7cc; }
.footer-main { max-width: var(--maxw); margin: 0 auto; padding: 48px clamp(14px, 4vw, 28px) 30px; display: grid; grid-template-columns: 1.2fr 2fr; gap: 34px; }
.foot-brand { display: flex; gap: 14px; align-items: flex-start; }
.foot-brand strong { color: #fff; font-size: 17px; display: block; margin-bottom: 6px; }
.foot-brand p { font-size: 13px; color: #9a9a90; max-width: 34ch; }
.foot-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.foot-nav h4 { color: #fff; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 12px; }
.foot-nav a { display: block; color: #b9b9ae; text-decoration: none; font-size: 13px; font-weight: 700; padding: 3px 0; }
.foot-nav a:hover { color: var(--yellow); }
.footer-bar { border-top: 2px solid #33332c; max-width: var(--maxw); margin: 0 auto; padding: 16px clamp(14px, 4vw, 28px); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 11px; color: #8a8a80; }

/* toast --------------------------------------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  padding: 11px 18px; background: var(--green); color: #fff; border: 3px solid var(--ink);
  box-shadow: var(--shadow); font-size: 12px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; z-index: 80;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* reveal -------------------------------------------------------------- */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* responsive ---------------------------------------------------------- */

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-demo { max-width: 560px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .tool-grid, .graphics { grid-template-columns: repeat(2, 1fr); }
  .dash { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--ink); border-bottom: 4px solid var(--ink);
    padding: 6px 14px 14px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; border-bottom: 1px solid #33332c; }
  .nav a:last-child { border-bottom: 0; }
  .nav-toggle { display: flex; }
  .pill-live { display: none; }
  .tool-grid, .graphics, .features { grid-template-columns: 1fr; }
  .stat-row li { flex: 1 1 45%; }
  .float-tag { display: none; }
  .footer-bar { flex-direction: column; }
  .steps li { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .brand-text em { display: none; }
  .cta-row .btn { flex: 1 1 100%; justify-content: center; }
}
