:root {
  --font: 'IBM Plex Sans Thai', 'Sukhumvit Set', 'Leelawadee UI', system-ui, sans-serif;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --ink: #1d1f22;
  --muted: #5f636a;
  --line: #e4e2dc;
  --accent: #cf3f1a;
  --accent-ink: #ffffff;
  --stage: #121417;
  --stage-panel: #1b1e22;
  --stage-line: #2c3137;
  --hand: #f5a524;
  --laser: #ff2d2d;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #111316;
    --surface: #191c20;
    --ink: #ecebe8;
    --muted: #a2a7ae;
    --line: #2c3137;
    --accent: #e0532c;
    --accent-ink: #ffffff;
    --stage: #0b0c0e;
    --stage-panel: #16191c;
    --stage-line: #262a30;
  }
}

:root[data-theme='dark'] {
  --bg: #111316;
  --surface: #191c20;
  --ink: #ecebe8;
  --muted: #a2a7ae;
  --line: #2c3137;
  --accent: #e0532c;
  --stage: #0b0c0e;
  --stage-panel: #16191c;
  --stage-line: #262a30;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

main,
.site-header,
.site-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 15px;
}

.site-header nav a {
  text-decoration: none;
  color: var(--muted);
}

.site-header nav a:hover {
  color: var(--ink);
}

.site-header .nav-cta {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
}

.site-header .nav-cta:hover {
  color: var(--bg);
  opacity: 0.88;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
  padding: 56px 0 88px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(38px, 5.4vw, 60px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

h1 .accent {
  color: var(--accent);
  white-space: nowrap;
}

.lede {
  margin: 20px 0 32px;
  max-width: 34em;
  font-size: 18px;
  color: var(--muted);
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dl {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
  padding: 12px 20px 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  line-height: 1.3;
  transition: transform 0.15s, box-shadow 0.15s;
}

.dl:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.dl svg {
  width: 26px;
  height: 26px;
  flex: none;
  fill: currentColor;
}

.dl b {
  display: block;
  font-weight: 600;
  font-size: 16px;
}

.dl small {
  color: var(--muted);
  font-size: 13px;
}

.dl.primary {
  order: -1;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.dl.primary small {
  color: rgba(255, 255, 255, 0.85);
}

.dl[aria-disabled='true'] {
  pointer-events: none;
  opacity: 0.55;
}

.meta {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- hero visual: a teacher window with a laser on one student's screen ---------- */

.hero-visual {
  position: relative;
  padding-bottom: 72px;
}

.window {
  border-radius: 16px;
  background: var(--stage);
  border: 1px solid var(--stage-line);
  box-shadow: 0 30px 60px -20px rgba(20, 10, 5, 0.35);
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  background: var(--stage-panel);
  border-bottom: 1px solid var(--stage-line);
  color: #9aa0a6;
  font-size: 12px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3f46;
}

.window-code {
  margin-left: 14px;
}

.window-code b {
  color: #ecebe8;
  letter-spacing: 0.08em;
}

.window-count {
  margin-left: auto;
}

.window-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
}

.tile {
  position: relative;
  aspect-ratio: 16 / 11;
  padding: 10px 10px 22px;
  border-radius: 8px;
  background: #2f5f93;
  border: 1px solid var(--stage-line);
  overflow: hidden;
}

.tile::before {
  content: '';
  position: absolute;
  inset: 12% 10% 30%;
  border-radius: 3px;
  background: #f4f4f6;
}

.tile i {
  position: relative;
  display: block;
  height: 4px;
  margin: 18% 0 0 14%;
  width: 46%;
  border-radius: 2px;
  background: #c9ccd2;
}

.tile i + i {
  margin-top: 6%;
  width: 34%;
}

.tile em {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 8px;
  background: var(--stage-panel);
  color: #ecebe8;
  font-style: normal;
  font-size: 11px;
}

.tile.hand {
  border-color: var(--hand);
  box-shadow: 0 0 0 1px var(--hand);
}

.tile s {
  position: absolute;
  right: 6px;
  bottom: 3px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hand);
  color: #241600;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.focus {
  position: absolute;
  right: -12px;
  bottom: 0;
  width: 62%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  background: #2f5f93;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 48px -12px rgba(20, 10, 5, 0.45);
  overflow: hidden;
}

.focus-doc {
  position: absolute;
  inset: 10% 8% 10%;
  padding: 0 7% 0;
  border-radius: 6px;
  background: #fff;
  color: #1d1f22;
}

.focus-title {
  margin: 0 -11% 10px;
  padding: 6px 11%;
  background: #e9e9ee;
  font-size: 12px;
  font-weight: 600;
}

.focus-doc i {
  display: block;
  height: 5px;
  margin: 10px 0;
  width: 55%;
  border-radius: 3px;
  background: #d3d6dc;
}

.focus-doc i:nth-child(3) {
  width: 40%;
}

.focus-btn {
  position: absolute;
  right: 8%;
  bottom: 12%;
  padding: 4px 14px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.laser {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.laser path {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: laser 4.2s ease-in-out infinite;
}

.laser-glow {
  stroke: var(--laser);
  stroke-width: 10;
  filter: url(#glow);
  opacity: 0.8;
}

.laser-core {
  stroke: #fff;
  stroke-width: 2.5;
}

.laser-tip {
  fill: #fff;
  stroke: var(--laser);
  stroke-width: 4;
  opacity: 0;
  animation: tip 4.2s ease-in-out infinite;
}

@keyframes laser {
  0% {
    stroke-dashoffset: 400;
    opacity: 1;
  }
  35% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  65% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  85%,
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}

@keyframes tip {
  0%,
  30% {
    opacity: 0;
  }
  35%,
  65% {
    opacity: 1;
  }
  85%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .laser path {
    animation: none;
    stroke-dashoffset: 0;
  }
  .laser-tip {
    animation: none;
    opacity: 1;
  }
}

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

h2 {
  margin: 0 0 32px;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

h3 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.4;
}

.how,
.install {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps p,
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.step-n {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 72px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
  overflow: hidden;
}

.feature {
  padding: 28px;
  background: var(--surface);
}

.install-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.install-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.install-card ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 16px;
}

.install-card li + li {
  margin-top: 8px;
}

.install-card b {
  color: var(--ink);
  font-weight: 600;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 24px;
  }
  .focus {
    right: 0;
  }
  .steps,
  .features,
  .install-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  main,
  .site-header,
  .site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .site-header nav a:not(.nav-cta) {
    display: none;
  }
  .dl {
    min-width: 0;
    width: 100%;
  }
  .window-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .window-grid .tile:nth-child(n + 5) {
    display: none;
  }
}
