*, *::before, *::after { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 24.7px;
  letter-spacing: .5px;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; letter-spacing: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 6px; }
svg { display: block; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: 'OffBit', monospace; font-weight: 700; letter-spacing: 0; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 12px 20px;
  transform: translateY(-160%);
  background: white;
  color: var(--blue);
}
.skip-link:focus { transform: none; }

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  padding: 20px 48px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--blue);
  font-family: 'OffBit', monospace;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.7px;
}
.brand-mark { display: block; width: 44px; height: 44px; object-fit: contain; flex: none; }
.account-nav { display: flex; align-items: center; gap: 12px; }
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 24px;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.button:hover { background: #d8dbe1; }
.button-primary { background: var(--blue); color: white; }
.button-primary:hover { background: #003fa9; transform: translateY(-2px); }

.home-main { flex: 1; width: 100%; padding: 0 32px 52px; }
.hero { position: relative; max-width: 1120px; margin: 0 auto; padding: 54px 0 40px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; justify-content: center; gap: 11px; font-size: 14px; line-height: 22px; }
.tiny-cross { width: 13px; height: 13px; color: var(--blue); }
.hero h1 { position: relative; margin: 15px 0 20px; color: var(--blue); font-size: clamp(78px, 10vw, 120px); line-height: .95; z-index: 1; }
.hero .eyebrow { position: relative; z-index: 1; }
.hero-description { position: relative; z-index: 1; }
.hero-description { max-width: 540px; margin: 0 auto; color: var(--ink); text-wrap: balance; }

.pixel-cluster {
  position: absolute;
  width: 98px;
  height: 112px;
  color: var(--blue);
  pointer-events: none;
  z-index: 0;
}
.pixel-cluster-left { left: -150px; top: 132px; transform: rotate(-90deg); }
.pixel-cluster-right { right: -150px; top: 152px; transform: rotate(90deg); }
.pixel-cluster i {
  position: absolute;
  width: 14px;
  height: 14px;
  background: currentColor;
  animation: pixel-appear 3.4s steps(1, end) both;
  animation-delay: calc(var(--i) * 120ms);
}
.pixel-cluster i:nth-child(1) { left: 14px; top: 14px; --i: 0; opacity: .22; }
.pixel-cluster i:nth-child(2) { left: 42px; top: 28px; --i: 3; opacity: .45; }
.pixel-cluster i:nth-child(3) { left: 28px; top: 42px; --i: 1; }
.pixel-cluster i:nth-child(4) { left: 42px; top: 42px; --i: 4; }
.pixel-cluster i:nth-child(5) { left: 56px; top: 42px; --i: 0; }
.pixel-cluster i:nth-child(6) { left: 42px; top: 56px; --i: 2; }
.pixel-cluster i:nth-child(7) { left: 70px; top: 70px; --i: 5; opacity: .32; }
.pixel-cluster i:nth-child(8) { left: 14px; top: 84px; --i: 2; opacity: .2; }

.tools-section { width: min(100%, 1180px); margin: 0 auto; }
.section-heading { display: flex; align-items: center; gap: 12px; margin: 0 0 19px; }
.section-heading h2 { font-size: 24px; line-height: 1.2; }
.tool-count { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #bfc3cb; border-radius: 4px; font-size: 13px; line-height: 1; }
.tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px;
  overflow: hidden;
  border: 1px solid #fff;
  border-radius: 10px;
  background: #f9f9fb;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  animation: card-enter .65s ease backwards;
}
.tool-card-live:hover { transform: translateY(-5px); border-color: var(--blue); box-shadow: 0 12px 30px #17171708; }
.tool-card:nth-child(2) { animation-delay: 80ms; }
.tool-card:nth-child(3) { animation-delay: 160ms; }
.tool-card:nth-child(4) { animation-delay: 240ms; }
.tool-card:nth-child(5) { animation-delay: 320ms; }
.tool-card-soon { animation-delay: 100ms; }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tool-icon { width: 32px; height: 32px; color: var(--blue); }
.tool-badge { padding: 4px 10px; border: 1px solid #cfdcf3; border-radius: 4px; color: var(--blue); font-size: 12px; line-height: 18px; letter-spacing: .3px; }
.tool-badge-soon { border-color: #d5d7dc; color: var(--muted); }
.tool-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 132px;
  margin: 21px 0 24px;
  overflow: hidden;
  border: 1px solid #e3e7f0;
  border-radius: 4px;
  background-color: #edf1fa;
  background-image: linear-gradient(#024bc808 1px, transparent 1px), linear-gradient(90deg, #024bc808 1px, transparent 1px);
  background-size: 16px 16px;
}
.classroom-diagram { width: 214px; height: 112px; }
.classroom-diagram .desk { transition: transform .35s ease; }
.tool-card-live:hover .desk-first { transform: translate(4px, 3px); }
.tool-card-live:hover .desk-last { transform: translate(-4px, -3px); }
.preview-pixel { position: absolute; right: 22px; top: 20px; width: 8px; height: 8px; background: #024bc842; box-shadow: -8px 8px 0 #024bc81c, 0 16px 0 #024bc83b, 8px 8px 0 #024bc83b; transition: opacity .2s steps(2); }
.tool-card-live:hover .preview-pixel { animation: pixel-hover .8s steps(1, end); }
.timetable-preview { background-color: #eff0f3; background-image: linear-gradient(#17171705 1px, transparent 1px), linear-gradient(90deg, #17171705 1px, transparent 1px); border-color: #e3e4e8; }
.timetable-diagram { width: 213px; height: 112px; }
.sequence-diagram { width: 214px; height: 112px; }
.sequence-step { transition: transform .35s ease; }
.tool-card-live:hover .sequence-step { transform: translateY(3px); }
.classes-preview { background-color: #eef3fc; }
.classes-preview-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 170px;
  gap: 8px;
  padding: 13px 15px;
  border: 1px solid #cbd7ec;
  border-radius: 4px;
  background: #fff;
  box-shadow: 7px 7px 0 #b7cef5;
  transition: transform .25s ease, box-shadow .25s ease;
}
.tool-card-live:hover .classes-preview-sheet { transform: translate(-3px, -3px); box-shadow: 10px 10px 0 #b7cef5; }
.classes-preview-title { width: 70px; height: 5px; margin-bottom: 2px; background: #024bc8; }
.classes-preview-row { display: flex; align-items: center; gap: 8px; }
.classes-preview-row i { width: 13px; height: 13px; border: 2px solid #80a8e8; border-radius: 50%; }
.classes-preview-row b { width: 92px; height: 5px; background: #c8d7ef; }
.classes-preview-row:nth-child(3) b { width: 72px; }
.classes-preview-row:nth-child(4) b { width: 84px; }
.classes-preview-add { position: absolute; right: 10px; top: 9px; color: var(--blue); font: 700 20px/1 'OffBit', monospace; }
.wheel-preview { background-color: #f4f1e9; background-image: linear-gradient(#17171705 1px, transparent 1px), linear-gradient(90deg, #17171705 1px, transparent 1px); }
.wheel-preview-diagram { width: 214px; height: 112px; }
.preview-wheel { transform-origin: 56px 55px; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.tool-card-live:hover .preview-wheel { transform: rotate(90deg); }
.tool-card h2 { margin-bottom: 10px; font-size: 34px; line-height: 1.05; }
.tool-description { min-height: 74.1px; margin-bottom: 24px; font-size: 16px; line-height: 24.7px; letter-spacing: .5px; }
.card-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 19px; border-top: 1px solid #dedfe4; color: var(--blue); font-size: 14px; line-height: 22px; }
.card-arrow { flex: none; width: 18px; height: 18px; transition: transform .2s ease; }
.tool-card-live:hover .card-arrow { transform: translateX(4px); }
.card-action-soon { color: var(--muted); }
.tool-note { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 26px 0 0; color: var(--muted); font-size: 13px; line-height: 22px; text-align: center; }
.tool-note svg { flex: none; width: 15px; height: 15px; }

.site-footer { background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 22px; }
.footer-brand { display: flex; align-items: center; gap: 9px; }
.footer-brand svg { width: 14px; height: 14px; color: var(--blue); }
.site-footer a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }

.account-dialog { width: min(480px, calc(100% - 32px)); max-height: calc(100svh - 48px); padding: 40px; border: 1px solid white; border-radius: 10px; background: #f9f9fb; color: var(--ink); overflow: auto; }
.account-dialog::backdrop { background: #101d3b66; backdrop-filter: blur(5px); }
.account-dialog[open] { animation: card-enter .2s ease both; }
.dialog-close { position: absolute; right: 12px; top: 12px; display: grid; place-items: center; width: 36px; height: 36px; padding: 8px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); }
.dialog-close:hover { background: var(--background); }
.dialog-symbol { width: 38px; height: 38px; margin: 8px 0 25px; color: var(--blue); }
.account-dialog h2 { margin-bottom: 18px; color: var(--blue); font-size: 40px; line-height: 1; }
.account-dialog p { margin: 0 0 16px; }
.account-dialog .button-primary { width: 100%; margin-top: 12px; }
body:has(.account-dialog[open]) { overflow: hidden; }

@keyframes card-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pixel-appear {
  0%, 12%, 28%, 62% { visibility: hidden; }
  18%, 45%, 78%, 100% { visibility: visible; }
}
@keyframes pixel-hover { 0%, 40%, 80% { opacity: 0; } 20%, 60%, 100% { opacity: 1; } }

@media (min-width: 1600px) {
  .hero { padding-top: 96px; padding-bottom: 66px; }
}
@media (max-width: 1050px) {
  .tools-section { max-width: 936px; }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .site-header { padding: 20px 24px; }
  .wordmark { font-size: 29px; gap: 8px; }
  .brand-mark { width: 36px; height: 36px; }
  .account-nav { gap: 3px; }
  .account-nav .button { padding: 9px 13px; font-size: 14px; }
  .hero { padding-top: 64px; padding-bottom: 46px; }
  .pixel-cluster-left { left: -150px; top: 132px; transform: scale(.6) rotate(-90deg); }
  .pixel-cluster-right { right: -150px; top: 152px; transform: scale(.6) rotate(90deg); }
  .tool-card { padding: 23px; }
  .tools-grid { gap: 18px; }
  .tool-card h2 { font-size: 29px; }
  .tool-description { min-height: 98.8px; }
  .site-footer { padding-inline: 24px; }
}
@media (max-width: 600px) {
  .site-header { gap: 8px; padding: 18px 20px; min-height: 80px; flex-wrap: wrap; }
  .wordmark { font-size: 26px; }
  .brand-mark { width: 30px; height: 30px; }
  .account-nav { gap: 3px; }
  .account-nav .button { min-height: 40px; padding: 7px 9px; font-size: 12px; letter-spacing: .15px; }
  .home-main { padding: 0 20px 48px; }
  .hero { padding-top: 48px; padding-bottom: 40px; }
  .hero h1 { margin: 18px 0 18px; font-size: clamp(64px, 15vw, 90px); }
  .eyebrow { font-size: 12px; }
  .hero-description { max-width: 330px; }
  .pixel-cluster { display: none; }
  .tools-grid { grid-template-columns: 1fr; gap: 20px; }
  .section-heading { margin-bottom: 16px; }
  .section-heading h2 { font-size: 23px; }
  .tool-card { padding: 25px; }
  .tool-card h2 { font-size: 34px; }
  .tool-description { min-height: 0; }
  .tool-preview { height: 148px; }
  .tool-note { align-items: flex-start; font-size: 12px; gap: 8px; }
  .tool-note svg { margin-top: 3px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 8px; padding: 20px; font-size: 12px; }
  .account-dialog { padding: 32px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.card-action { min-height: 64px; }
