:root {
  --ink: #17221d;
  --ink-2: #35423b;
  --paper: #f4f1e8;
  --card: #fbfaf5;
  --line: #d4d7cc;
  --acid: #c7f34f;
  --acid-dark: #789a18;
  --mint: #dbeee1;
  --coral: #ef725f;
  --quiet: #778078;
  --shadow: 0 24px 70px rgba(23, 34, 29, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 8%, rgba(199, 243, 79, .28), transparent 24rem),
    radial-gradient(circle at 8% 32%, rgba(205, 230, 217, .58), transparent 27rem),
    var(--paper);
  font-family: Aptos, "Segoe UI Variable", sans-serif;
  min-height: 100vh;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.hidden { display: none !important; }
.grain { position: fixed; inset: 0; pointer-events: none; opacity: .18; z-index: -1; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E"); }

.topbar { height: 76px; padding: 0 clamp(22px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(23, 34, 29, .14); backdrop-filter: blur(16px); background: rgba(244, 241, 232, .72); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-family: Bahnschrift, sans-serif; font-weight: 700; letter-spacing: -.03em; font-size: 19px; }
.brand em { font-family: "Bodoni 72", Georgia, serif; font-weight: 400; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; color: var(--acid); background: var(--ink); font-family: Georgia, serif; font-style: italic; }
.top-actions { display: flex; align-items: center; gap: 22px; }
.text-link { color: var(--ink-2); font-size: 13px; text-underline-offset: 4px; }
.presence { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: rgba(251, 250, 245, .74); border-radius: 999px; padding: 9px 14px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.presence-dot, .live-dot { width: 9px; height: 9px; border-radius: 50%; background: #a8aea9; box-shadow: 0 0 0 4px rgba(168, 174, 169, .14); }
.presence.online .presence-dot, .live-dot.online { background: #74b51f; box-shadow: 0 0 0 4px rgba(116, 181, 31, .16), 0 0 18px rgba(116, 181, 31, .6); }
.presence.checking .presence-dot { background: #e6b43c; animation: pulse 1.2s infinite; }
.presence.offline .presence-dot { background: var(--coral); }

main { width: min(1160px, calc(100% - 40px)); margin: 0 auto 90px; }
.hero { padding: clamp(58px, 9vw, 116px) 2px 56px; max-width: 980px; position: relative; }
.kicker, .eyebrow { font: 700 11px/1 Bahnschrift, sans-serif; letter-spacing: .2em; color: var(--acid-dark); margin: 0 0 19px; }
.hero h1 { font: 700 clamp(48px, 8vw, 94px)/.91 Bahnschrift, sans-serif; letter-spacing: -.07em; margin: 0; max-width: 900px; }
.hero h1 i { font-family: "Bodoni 72", Georgia, serif; font-weight: 400; color: var(--ink-2); }
.hero-copy { max-width: 620px; margin: 30px 0 0 auto; font-size: 19px; line-height: 1.55; color: var(--ink-2); }

.journey { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 18px 18px 0 0; overflow: hidden; background: rgba(251, 250, 245, .7); }
.journey-step { min-height: 74px; padding: 15px 20px; display: flex; align-items: center; gap: 13px; border: 0; border-right: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; transition: .25s ease; }
.journey-step:last-child { border-right: 0; }
.journey-step b { font: 700 11px Bahnschrift, sans-serif; color: var(--quiet); }
.journey-step span { font-weight: 650; }
.journey-step.active { background: var(--ink); color: white; }
.journey-step.active b { color: var(--acid); }
.journey-step.done:not(.active) { background: rgba(199, 243, 79, .18); }
.journey-step:disabled { opacity: .42; cursor: not-allowed; }

.workspace { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 24px 24px; overflow: hidden; box-shadow: var(--shadow); background: rgba(251, 250, 245, .84); }
.stage { min-height: 370px; padding: clamp(30px, 5vw, 64px); display: grid; grid-template-columns: minmax(280px, .9fr) minmax(340px, 1.1fr); gap: clamp(35px, 7vw, 90px); align-items: center; border-bottom: 1px solid var(--line); opacity: 1; transition: opacity .3s ease; }
.stage:last-child { border-bottom: 0; }
.stage.locked { display: none; }
.stage-copy { align-self: start; display: flex; gap: 22px; }
.step-number { font: italic 24px/1 Georgia, serif; color: var(--acid-dark); }
.stage h2 { font: 700 clamp(34px, 4vw, 54px)/.98 Bahnschrift, sans-serif; letter-spacing: -.05em; margin: 0 0 18px; }
.stage-copy p:last-child { font-size: 17px; line-height: 1.55; color: var(--ink-2); margin: 0; max-width: 430px; }
.action-well { min-height: 250px; border-radius: 24px; background: var(--ink); color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; overflow: hidden; position: relative; }
.action-well::before { content: ""; position: absolute; width: 220px; height: 220px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.radar { width: 92px; height: 92px; display: grid; place-items: center; position: relative; margin-bottom: 24px; }
.radar i { position: absolute; inset: 0; border: 1px solid rgba(199, 243, 79, .42); border-radius: 50%; animation: radar 2.4s infinite; }
.radar i:nth-child(2) { animation-delay: 1.2s; }
.radar span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--acid); color: var(--ink); font: italic 22px Georgia, serif; z-index: 2; }

.button { border: 0; min-height: 54px; border-radius: 999px; padding: 0 23px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: space-between; gap: 25px; transition: transform .18s, box-shadow .18s, opacity .18s; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button.primary { background: var(--acid); color: var(--ink); box-shadow: 0 10px 30px rgba(199, 243, 79, .2); }
.button.ink { background: var(--ink); color: white; }
.button.wide { width: 100%; }
.button:disabled { cursor: not-allowed; opacity: .42; }
.microcopy { font-size: 12px; color: rgba(255,255,255,.58); margin: 15px 0 0; text-align: center; }

.device-card { margin: 26px; padding: 18px 22px; border-radius: 20px; background: var(--mint); display: grid; grid-template-columns: auto 1fr auto auto; gap: 18px; align-items: center; animation: reveal .45s ease both; }
.device-orb { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--card); font-size: 28px; }
.device-name { display: grid; gap: 4px; min-width: 0; }
.device-name small, .device-card dt { font: 700 9px Bahnschrift, sans-serif; letter-spacing: .16em; color: var(--quiet); }
.device-name strong { font-size: 19px; overflow: hidden; text-overflow: ellipsis; }
.device-name span { color: var(--ink-2); font-size: 13px; }
.device-card dl { display: flex; gap: 28px; margin: 0; }
.device-card dl div { display: grid; gap: 5px; }
.device-card dd { margin: 0; font: 700 13px Bahnschrift, sans-serif; }
.good { color: #527f19; }
.icon-button { border: 0; background: var(--card); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 18px; }
.compatibility-notice { margin: -12px 26px 26px; padding: 14px 18px; border: 1px solid #d6ad3a; border-radius: 14px; background: #fff4ce; color: #5c4610; display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.compatibility-notice strong { white-space: nowrap; }

.wifi-picker { display: grid; gap: 12px; }
.wifi-choice { width: 100%; border: 1px solid var(--line); border-radius: 17px; padding: 17px; background: var(--card); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; text-align: left; cursor: pointer; transition: .2s; }
.wifi-choice:hover:not(:disabled), .wifi-choice.selected { border-color: var(--ink); transform: translateX(4px); }
.wifi-choice:disabled { opacity: .42; cursor: not-allowed; }
.wifi-icon { width: 45px; height: 45px; display: grid; place-items: center; background: var(--mint); border-radius: 13px; font-size: 23px; }
.wifi-choice span:nth-child(2) { display: grid; gap: 2px; }
.wifi-choice small { font: 700 9px Bahnschrift, sans-serif; letter-spacing: .14em; color: var(--acid-dark); }
.wifi-choice strong { font-size: 16px; }
.wifi-choice em { font-size: 12px; color: var(--quiet); font-style: normal; }
.wifi-form { border: 1px solid var(--line); border-radius: 18px; background: var(--card); padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; animation: reveal .3s ease both; }
.wifi-form label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; }
.wifi-form label span { color: var(--quiet); font-weight: 400; float: right; }
.wifi-form input { width: 100%; height: 50px; border: 1px solid var(--line); background: white; border-radius: 11px; padding: 0 14px; outline: none; }
.wifi-form input:focus { border-color: var(--acid-dark); box-shadow: 0 0 0 3px rgba(199, 243, 79, .25); }
.wifi-form .button, .validation { grid-column: 1 / -1; }
.validation { color: #b43b2d; min-height: 0; font-size: 12px; }

.configure-panel { border-radius: 22px; border: 1px solid var(--line); padding: 20px; background: var(--card); }
.network-ticket { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; border-bottom: 1px dashed var(--line); padding: 0 3px 17px; margin-bottom: 17px; }
.network-ticket span { font: 700 9px Bahnschrift, sans-serif; letter-spacing: .16em; color: var(--quiet); }
.network-ticket strong { overflow: hidden; text-overflow: ellipsis; }
.network-ticket button { border: 0; background: none; text-decoration: underline; cursor: pointer; }
.recovery-steps { list-style: none; padding: 20px 4px 0; margin: 0; display: grid; gap: 13px; }
.recovery-steps li { display: flex; align-items: center; gap: 13px; color: var(--quiet); }
.recovery-steps li i { width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; position: relative; flex: 0 0 auto; }
.recovery-steps li span { display: grid; }
.recovery-steps li b { font-size: 13px; color: var(--ink-2); }
.recovery-steps li small { font-size: 11px; }
.recovery-steps li.active i { border: 6px solid var(--acid); animation: pulse 1.2s infinite; }
.recovery-steps li.done i { background: var(--acid); border-color: var(--acid); }
.recovery-steps li.done i::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink); font: 700 12px sans-serif; }
.recovery-steps li.failed i { background: var(--coral); border-color: var(--coral); }
.configure-message { min-height: 20px; margin-top: 16px; font-size: 13px; color: var(--ink-2); }

.control-stage { align-items: start; }
.control-console { border-radius: 25px; background: var(--ink); color: white; padding: clamp(22px, 4vw, 36px); box-shadow: 0 25px 55px rgba(23,34,29,.22); }
.console-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 26px; border-bottom: 1px solid rgba(255,255,255,.12); }
.console-head > div:first-child { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.console-head .live-dot { grid-row: span 2; align-self: center; }
.console-head strong { font-size: 16px; }
.console-head small { color: rgba(255,255,255,.55); }
.transport { display: flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.08); }
.transport button { border: 0; background: transparent; color: rgba(255,255,255,.6); border-radius: 999px; padding: 8px 11px; font-size: 11px; cursor: pointer; }
.transport button.active { background: white; color: var(--ink); }
.power-row { display: flex; justify-content: space-between; align-items: center; padding: 25px 0; }
.power-row > div:first-child { display: grid; gap: 5px; }
.power-row small, .mist-section > small { font: 700 9px Bahnschrift, sans-serif; letter-spacing: .18em; color: var(--acid); }
.power-row strong { font: 700 27px Bahnschrift, sans-serif; }
.power-buttons { display: flex; gap: 6px; }
.control-button { border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: white; border-radius: 999px; min-width: 66px; padding: 10px 13px; cursor: pointer; }
.control-button.selected { background: var(--acid); color: var(--ink); border-color: var(--acid); }
.mist-section { padding-top: 21px; border-top: 1px solid rgba(255,255,255,.12); }
.mist-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 12px; }
.mist-button { border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.055); color: white; border-radius: 17px; padding: 17px 12px; min-height: 105px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; cursor: pointer; transition: .2s; }
.mist-button:hover:not(:disabled) { border-color: rgba(199,243,79,.65); transform: translateY(-2px); }
.mist-button.selected { background: var(--acid); color: var(--ink); border-color: var(--acid); }
.mist-button span { display: grid; }
.mist-button b { font-size: 14px; }
.mist-button em { font-size: 10px; opacity: .55; font-style: normal; }
.mist { height: 25px; position: relative; display: block; }
.mist::before, .mist::after { content: ""; position: absolute; width: 2px; height: 20px; border-radius: 99px; background: currentColor; transform: rotate(17deg); opacity: .75; }
.mist::after { left: 8px; height: 14px; top: 5px; }
.mist.two::after { box-shadow: 8px -4px 0 currentColor; }
.mist.three::after { box-shadow: 8px -4px 0 currentColor, 16px 1px 0 currentColor; }
.command-status { margin-top: 16px; min-height: 38px; border-radius: 12px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.62); padding: 11px 13px; font-size: 12px; }
.control-console button:disabled { opacity: .35; cursor: not-allowed; }

.diagnostics { margin: 24px 0; border: 1px solid var(--line); border-radius: 18px; background: rgba(251,250,245,.7); overflow: hidden; }
.diagnostics summary { padding: 18px 22px; cursor: pointer; display: flex; justify-content: space-between; }
.diagnostics summary span { font-weight: 800; }
.diagnostics summary small { color: var(--quiet); }
.diagnostic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.diagnostic-grid div { padding: 16px; background: var(--card); display: grid; gap: 5px; }
.diagnostic-grid small { color: var(--quiet); }
.diagnostic-grid strong { font-size: 12px; overflow-wrap: anywhere; }
.diagnostics table { width: 100%; border-collapse: collapse; font-size: 11px; }
.diagnostics th, .diagnostics td { padding: 10px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.diagnostics th { color: var(--quiet); font-weight: 700; }

@keyframes radar { from { transform: scale(.48); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 820px) {
  .hero-copy { margin-left: 0; }
  .journey-step { padding: 13px 10px; justify-content: center; }
  .journey-step span { display: none; }
  .stage { grid-template-columns: 1fr; gap: 28px; }
  .device-card { grid-template-columns: auto 1fr auto; }
  .device-card dl { grid-column: 1 / -1; justify-content: space-between; }
  .wifi-form { grid-template-columns: 1fr; }
  .diagnostic-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  main { width: min(100% - 20px, 1160px); }
  .topbar { padding: 0 15px; }
  .text-link { display: none; }
  .presence { padding: 8px 10px; }
  .hero h1 { font-size: 48px; }
  .stage { padding: 27px 20px; }
  .stage-copy { gap: 10px; }
  .device-card { margin: 14px; padding: 15px; }
  .device-card dl { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .console-head { align-items: flex-start; flex-direction: column; }
  .transport { width: 100%; }
  .transport button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
