:root {
  --bg: #f3f1ec;
  --bg-deep: #ebe7df;
  --ink: #12151a;
  --muted: #5f6772;
  --line: rgba(18, 21, 26, 0.12);
  --panel: rgba(255, 255, 255, 0.78);
  --accent: #ff3b00;
  --accent-2: #0f6e56;
  --ok: #1f8a4c;
  --danger: #b42318;
  --shadow: 0 30px 80px rgba(18, 21, 26, 0.08);
  --font-display: "Sora", sans-serif;
  --font-body: "Public Sans", sans-serif;
  --header-h: 78px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(255, 59, 0, 0.12), transparent 55%),
    radial-gradient(700px 480px at -10% 30%, rgba(15, 110, 86, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-header,
main,
.hero-full,
.strip,
.feature-band,
.cta-band,
.site-footer,
.about-page,
.machines-page,
.login-layout {
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 48px);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: rgba(243, 241, 236, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}
body.scrolled .site-header {
  border-bottom-color: var(--line);
  background: rgba(243, 241, 236, 0.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  width: 12px;
  height: 12px;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 7px 0 0 rgba(255, 59, 0, 0.28);
  animation: mark 2.6s ease-in-out infinite;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 0.92rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
}
.nav a:hover,
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: var(--accent);
}
.nav-cta {
  padding: 10px 16px !important;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink) !important;
  background: rgba(255,255,255,0.55);
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { border-color: rgba(255, 59, 0, 0.45); }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
  border-radius: 14px;
  padding: 14px 22px;
}
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }
.btn-primary.compact { padding: 10px 16px; }
.btn-primary.full { width: 100%; justify-content: space-between; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 20px;
}
.btn-ghost:hover {
  border-color: rgba(255, 59, 0, 0.4);
  background: rgba(255, 59, 0, 0.05);
}
.btn-ghost.light {
  color: #f4f6f8;
  border-color: rgba(255,255,255,0.18);
}
.text-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}
.lede {
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.05rem;
}
.muted { color: var(--muted); }

/* HOME HERO */
.hero-full {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  align-content: center;
  padding: clamp(28px, 6vh, 64px) clamp(18px, 4vw, 48px) 36px;
  position: relative;
  overflow: hidden;
}
.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-orb {
  position: absolute;
  border-radius: 40% 60% 55% 45%;
  filter: blur(8px);
  opacity: 0.55;
}
.hero-orb-a {
  width: min(52vw, 560px);
  height: min(52vw, 560px);
  right: -8%;
  top: 8%;
  background:
    linear-gradient(145deg, rgba(255,59,0,0.35), rgba(255,59,0,0.02) 55%, rgba(15,110,86,0.18));
  animation: float-a 10s ease-in-out infinite;
}
.hero-orb-b {
  width: min(34vw, 360px);
  height: min(34vw, 360px);
  left: 8%;
  bottom: 6%;
  background: linear-gradient(160deg, rgba(15,110,86,0.25), transparent 60%);
  animation: float-b 12s ease-in-out infinite;
}
.hero-scan {
  position: absolute;
  inset: 12% 8% 18% 8%;
  border: 1px solid rgba(18,21,26,0.08);
  border-radius: 28px;
  background:
    linear-gradient(rgba(18,21,26,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18,21,26,0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, black, transparent 90%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 920px;
}
.brand-hero {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.28em;
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0;
  animation: rise 0.7s ease forwards;
}
.hero-full h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 14ch;
  opacity: 0;
  animation: rise 0.8s 0.08s ease forwards;
}
.hero-full .lede {
  max-width: 34rem;
  margin: 22px 0 0;
  opacity: 0;
  animation: rise 0.8s 0.16s ease forwards;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  opacity: 0;
  animation: rise 0.8s 0.24s ease forwards;
}
.hero-foot {
  position: relative;
  z-index: 1;
  margin-top: clamp(48px, 12vh, 120px);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
  opacity: 0;
  animation: rise 0.8s 0.32s ease forwards;
}
.hero-foot .sep {
  width: 28px;
  height: 1px;
  background: var(--line);
}

.strip {
  padding: 0 clamp(18px, 4vw, 48px) 72px;
}
.strip-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}
.strip article h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent);
}
.strip article p {
  margin: 0;
  color: var(--muted);
  max-width: 18rem;
}

.feature-band {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: 24px clamp(18px, 4vw, 48px) 96px;
}
.feature-copy h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.feature-copy .lede,
.feature-copy p {
  max-width: 34rem;
  color: var(--muted);
  line-height: 1.6;
}
.feature-panel { min-height: 320px; }
.fake-window {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(-1.5deg);
  animation: float-a 9s ease-in-out infinite;
}
.fake-bar {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
}
.fake-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(18,21,26,0.15);
}
.fake-bar span:first-child { background: var(--accent); }
.fake-body { padding: 22px; }
.fake-row {
  height: 12px;
  border-radius: 999px;
  background: rgba(18,21,26,0.08);
  margin-bottom: 12px;
}
.fake-row.short { width: 55%; }
.fake-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.fake-grid div {
  aspect-ratio: 1.2;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255,59,0,0.12), rgba(15,110,86,0.08));
  border: 1px solid var(--line);
}

.cta-band {
  margin: 0 clamp(18px, 4vw, 48px) 72px;
  padding: clamp(36px, 6vw, 64px);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(18,21,26,0.96), rgba(18,21,26,0.88)),
    radial-gradient(600px 240px at 100% 0%, rgba(255,59,0,0.35), transparent 55%);
  color: #fff;
  text-align: center;
}
.cta-band.compact { margin-top: 48px; }
.cta-band h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
}
.cta-band p { color: rgba(255,255,255,0.7); margin: 0 0 22px; }
.cta-band .btn-primary { background: var(--accent); }
.cta-band .btn-primary:hover { background: #fff; color: var(--ink); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 28px clamp(18px, 4vw, 48px) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-footer strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  letter-spacing: 0.12em;
}
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* LOGIN PAGE */
.login-layout {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 5vw, 64px);
  padding: clamp(28px, 5vh, 56px) clamp(18px, 4vw, 48px);
  align-items: center;
}
.login-aside h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.login-aside .lede { max-width: 28rem; margin-top: 18px; }
.login-points {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 10px;
}
.login-points li {
  padding-left: 18px;
  position: relative;
  color: var(--muted);
}
.login-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  backdrop-filter: blur(12px);
  animation: rise 0.6s ease both;
}
.login-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
}
.login-card label {
  display: grid;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.login-card input:focus {
  border-color: rgba(255, 59, 0, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 59, 0, 0.1);
}
.form-error { margin: 0; color: var(--danger); font-size: 0.9rem; }
.back-link {
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.back-link:hover { color: var(--ink); }

/* MACHINES */
.machines-page {
  padding: 28px clamp(18px, 4vw, 48px) 72px;
}
.page-intro {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.page-intro h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  letter-spacing: -0.04em;
}
.page-intro .lede { margin: 10px 0 0; max-width: 34rem; }
.page-intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.pill-status {
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.5);
}

.machine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.machine {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
  opacity: 0;
  animation: rise 0.55s ease forwards;
}
.machine:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 59, 0, 0.45);
}
.machine-proto {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}
.machine h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.machine p { margin: 0; color: var(--muted); }
.machine-cta {
  margin-top: 18px;
  display: inline-flex;
  gap: 8px;
  font-weight: 600;
}
.machine:hover .machine-cta { color: var(--accent); }
.empty { color: var(--muted); }

/* ABOUT */
.about-page {
  padding: 36px clamp(18px, 4vw, 48px) 72px;
}
.about-hero {
  max-width: 860px;
  margin-bottom: 48px;
}
.about-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  letter-spacing: -0.04em;
  line-height: 0.98;
}
.about-hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.about-hero .lede { margin-top: 18px; max-width: 36rem; }
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 48px;
}
.about-grid article {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  background: var(--panel);
}
.about-grid h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
}
.about-grid p { margin: 0; color: var(--muted); line-height: 1.55; }
.about-steps h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 18px;
}
.about-steps ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.about-steps li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.about-steps strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.about-steps span { color: var(--muted); }

/* SESSION */
.session-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #0d1114;
  display: grid;
  grid-template-rows: auto 1fr;
  animation: overlay-in 0.35s ease;
}
.session-overlay[hidden] { display: none !important; }
.session-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  background: #151a1e;
  color: #f3f5f7;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.session-bar-left { display: flex; gap: 12px; align-items: center; }
.session-name { margin: 0; font-family: var(--font-display); font-weight: 700; }
.session-sub { margin: 2px 0 0; color: rgba(243,245,247,0.6); font-size: 0.8rem; }
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  animation: live 1.6s infinite;
}
.guac-frame { width: 100%; height: 100%; border: 0; background: #000; }

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes mark {
  0%, 100% { transform: rotate(45deg) scale(1); }
  50% { transform: rotate(45deg) scale(1.08); }
}
@keyframes float-a {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-14px) rotate(0deg); }
}
@keyframes float-b {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(18px); }
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(31,138,76,0.45); }
  70% { box-shadow: 0 0 0 10px rgba(31,138,76,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,138,76,0); }
}
@keyframes overlay-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 14px auto 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 16px;
    background: rgba(255,255,255,0.95);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
  body.nav-open .nav { display: flex; }
  .nav a.is-active::after { display: none; }
  .nav-toggle { display: inline-block; }
  .strip-inner,
  .feature-band,
  .login-layout,
  .about-grid { grid-template-columns: 1fr; }
  .about-steps li { grid-template-columns: 1fr; gap: 6px; }
  .hero-full { min-height: calc(100svh - var(--header-h)); }
}
