:root{
  --bg:#0b1020;
  --bg-soft:#111830;
  --panel:#121933;
  --panel-2:#182142;
  --text:#eef2ff;
  --muted:#bcc6ea;
  --line:rgba(255,255,255,.12);
  --line-strong:rgba(255,255,255,.18);
  --accent:#7dd3fc;
  --accent-2:#c4b5fd;
  --good:#86efac;
  --warn:#fde68a;
  --danger:#fca5a5;
  --shadow:0 18px 50px rgba(0,0,0,.32);
  --radius:22px;
  --radius-sm:16px;
  --max:1160px;
  --nav-h:72px;
}

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

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:Arial,Helvetica,sans-serif;
  line-height:1.7;
  color:var(--text);
  background:
    radial-gradient(circle at top right, rgba(125,211,252,.14), transparent 28%),
    radial-gradient(circle at top left, rgba(196,181,253,.10), transparent 24%),
    linear-gradient(180deg,#09101c,#0b1020);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

img{
  max-width:100%;
  height:auto;
  display:block;
}

a{
  color:var(--accent);
  text-decoration:none;
}

a:hover{
  text-decoration:underline;
}

strong{
  color:#fff;
}

code,
pre{
  font-family:Consolas,Monaco,"Courier New",monospace;
}

/* ---------- LAYOUT ---------- */
.wrap{
  max-width:var(--max);
  margin:0 auto;
  padding:0 20px;
}

main{
  min-height:50vh;
}

.section{
  padding:14px 0;
}

.section h2{
  margin:0 0 12px;
  font-size:clamp(1.55rem,3vw,2.35rem);
  line-height:1.1;
}

.section p{
  margin:0 0 12px;
  color:var(--muted);
}

/* ---------- TOP NAV ---------- */
.topbar{
  position:sticky;
  top:0;
  z-index:40;
  backdrop-filter:blur(12px);
  background:rgba(11,16,32,.78);
  border-bottom:1px solid var(--line);
}

.nav{
  min-height:var(--nav-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 0;
}

.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  color:#fff;
  letter-spacing:.02em;
  white-space:nowrap;
}

.brand-mark{
  width:38px;
  height:38px;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, rgba(56,189,248,.28), rgba(139,92,246,.22));
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  font-weight:900;
  color:#fff;
}

.links{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  align-items:center;
  font-size:.96rem;
}

.links a{
  color:var(--text);
  opacity:.92;
}

.links a:hover{
  opacity:1;
  text-decoration:none;
}

.nav-toggle{
  display:none;
  appearance:none;
  border:1px solid var(--line);
  background:var(--panel);
  color:#fff;
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  font:inherit;
}

/* ---------- HERO ---------- */
.hero{
  padding:68px 0 30px;
}

.eyebrow{
  display:inline-block;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(125,211,252,.28);
  background:rgba(125,211,252,.10);
  color:#e5f8ff;
  font-size:.92rem;
  margin-bottom:16px;
}

.hero h1{
  margin:0 0 14px;
  font-size:clamp(2.2rem,4.9vw,4.8rem);
  line-height:1.03;
  letter-spacing:-.03em;
}

.lead{
  max-width:920px;
  color:var(--muted);
  font-size:1.08rem;
  margin:0;
}

.cta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:24px;
}

/* ---------- BUTTONS ---------- */
.btn{
  display:inline-block;
  padding:14px 18px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--panel);
  color:#fff;
  font-weight:700;
  box-shadow:var(--shadow);
  transition:transform .18s ease, border-color .18s ease, background .18s ease;
}

.btn:hover{
  text-decoration:none;
  transform:translateY(-1px);
  border-color:var(--line-strong);
}

.btn.primary{
  background:linear-gradient(135deg,#38bdf8,#8b5cf6);
  border:none;
}

.btn.ghost{
  background:transparent;
}

.btn.small{
  padding:10px 12px;
  border-radius:12px;
  font-size:.92rem;
}

/* ---------- GRIDS ---------- */
.grid{
  display:grid;
  gap:18px;
}

.grid-2{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.grid-3{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.grid-4{
  grid-template-columns:repeat(4,minmax(0,1fr));
}

/* ---------- CARDS ---------- */
.card{
  background:linear-gradient(180deg,var(--panel),var(--panel-2));
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:22px;
  box-shadow:var(--shadow);
}

.card h3{
  margin:0 0 10px;
  font-size:1.16rem;
}

.card p{
  margin:0;
  color:var(--muted);
}

.card + .card{
  margin-top:0;
}

/* ---------- STEP / NUMBER ---------- */
.num{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:50%;
  background:rgba(134,239,172,.12);
  border:1px solid rgba(134,239,172,.22);
  color:var(--good);
  font-weight:800;
  margin-bottom:10px;
}

/* ---------- LESSON SYSTEM ---------- */
.lesson{
  margin-top:16px;
  display:grid;
  gap:16px;
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.lesson-card{
  position:relative;
  border:1px solid var(--line);
  border-radius:20px;
  padding:18px;
  background:rgba(255,255,255,.03);
  transition:transform .18s ease, border-color .18s ease, background .18s ease;
}

.lesson-card:hover{
  transform:translateY(-1px);
  border-color:var(--line-strong);
  background:rgba(255,255,255,.05);
}

.lesson-card .jp{
  font-size:1.32rem;
  font-weight:800;
  color:#fff;
  line-height:1.25;
  margin-bottom:2px;
}

.lesson-card .kana{
  color:#d8ddff;
  line-height:1.45;
}

.lesson-card .romaji{
  color:#9bdcff;
  font-style:italic;
  line-height:1.45;
}

.lesson-card .english{
  color:#fff;
  font-weight:700;
  margin-top:8px;
}

.lesson-card .meta{
  color:var(--muted);
  font-size:.96rem;
  margin-top:8px;
}

.lesson-card .meta strong{
  color:#fff;
}

.lesson-card .badge{
  position:absolute;
  top:14px;
  right:14px;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--muted);
  font-size:.78rem;
  line-height:1;
}

/* ---------- QUICK REVIEW TABLES ---------- */
table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
  overflow:hidden;
}

th,
td{
  padding:12px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
}

th{
  color:#fff;
  font-size:.95rem;
}

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

tr:last-child td{
  border-bottom:none;
}

/* ---------- LISTS ---------- */
ul,
ol{
  padding-left:1.2rem;
  margin:10px 0 0;
}

li{
  margin:0 0 8px;
  color:var(--muted);
}

/* ---------- UTILITIES ---------- */
.muted{color:var(--muted)}
.center{text-align:center}
.mt-0{margin-top:0}
.mt-1{margin-top:8px}
.mt-2{margin-top:16px}
.mt-3{margin-top:24px}
.mb-0{margin-bottom:0}
.hidden{display:none !important}

.callout{
  border:1px solid rgba(125,211,252,.22);
  background:rgba(125,211,252,.08);
  border-radius:18px;
  padding:16px 18px;
  color:#e5f8ff;
}

.note{
  border-left:4px solid var(--accent);
  padding-left:14px;
  color:var(--muted);
}

.warning{
  border:1px solid rgba(253,230,138,.24);
  background:rgba(253,230,138,.08);
  border-radius:18px;
  padding:16px 18px;
}

/* ---------- FOOTER ---------- */
footer{
  margin-top:40px;
  padding:28px 0 56px;
  border-top:1px solid var(--line);
  color:var(--muted);
}

.footergrid{
  display:grid;
  gap:16px;
  grid-template-columns:2fr 1fr 1fr;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width:980px){
  .grid-4,
  .grid-3,
  .grid-2,
  .lesson,
  .footergrid{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width:760px){
  .nav{
    align-items:flex-start;
    flex-wrap:wrap;
  }

  .nav-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }

  .links{
    display:none;
    width:100%;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
    padding:8px 0 4px;
  }

  .links.open{
    display:flex;
  }

  .hero{
    padding-top:52px;
  }
}

@media (max-width:680px){
  .grid-4,
  .grid-3,
  .grid-2,
  .lesson,
  .footergrid{
    grid-template-columns:1fr;
  }

  .wrap{
    padding:0 16px;
  }

  .card,
  .lesson-card{
    padding:18px;
  }

  .hero h1{
    font-size:clamp(2rem,11vw,3rem);
  }

  .lead{
    font-size:1rem;
  }
}
