:root {
  --ink: #071a2f;
  --muted: #5f6f82;
  --line: #dce7f0;
  --paper: #f7fbfe;
  --white: #fff;
  --blue: #1199dc;
  --blue-deep: #0878bc;
  --cyan: #55cef6;
  --yellow: #ffd74a;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(7, 43, 72, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 4%, rgba(85, 206, 246, .24), transparent 28rem),
    linear-gradient(180deg, #fff 0%, var(--paper) 55%, #eef7fc 100%);
  font-family: "IBM Plex Sans Thai", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.page-shell { width: min(1280px, calc(100% - 40px)); margin: auto; min-height: 100vh; }
.site-header { height: 96px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(7,26,47,.08); }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand strong { display: block; font: 800 20px/1 "Manrope", sans-serif; letter-spacing: -.03em; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.brand-mark { position: relative; width: 38px; height: 38px; display: inline-block; }
.brand-mark i { position: absolute; display: block; width: 27px; height: 11px; background: var(--blue); transform: rotate(-45deg) skewX(-15deg); border-radius: 2px; }
.brand-mark i:first-child { top: 7px; left: 2px; }
.brand-mark i:last-child { top: 20px; left: 11px; background: var(--cyan); }
.term-badge, .status-pill { border: 1px solid var(--line); background: rgba(255,255,255,.7); border-radius: 999px; padding: 9px 15px; color: #3d5468; font: 700 11px/1 "Manrope", sans-serif; letter-spacing: .08em; }

.hero { min-height: 590px; display: grid; grid-template-columns: 1fr .86fr; align-items: center; gap: clamp(42px, 5vw, 72px); padding: 66px 0 78px; }
.eyebrow { margin: 0 0 18px; color: var(--blue-deep); font: 800 12px/1 "Manrope", sans-serif; letter-spacing: .16em; }
.hero h1, .score-intro h1 { margin: 0; font-family: "IBM Plex Sans Thai", "Manrope", sans-serif; font-size: clamp(44px, 4.7vw, 68px); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; }
.hero h1 { max-width: 720px; }
.hero h1 span { color: var(--blue-deep); }
.hero-lead { max-width: 640px; margin: 27px 0 0; color: var(--muted); font-size: 19px; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 52px; padding: 0 22px; border-radius: 14px; font-weight: 700; text-decoration: none; transition: .22s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: white; background: var(--ink); box-shadow: 0 12px 30px rgba(7,26,47,.18); }
.button-primary:hover { background: #103052; }
.button-secondary { border: 1px solid var(--line); background: rgba(255,255,255,.7); }

.hero-visual { position: relative; min-width: 0; min-height: 410px; display: grid; place-items: center; }
.hero-visual::before { content: ""; position: absolute; width: 390px; height: 390px; border-radius: 50%; background: linear-gradient(145deg, var(--cyan), var(--blue-deep)); opacity: .13; filter: blur(1px); }
.code-window { position: relative; z-index: 1; width: min(500px, calc(100% - 28px)); overflow: hidden; color: #e7f8ff; background: #081d32; border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); box-shadow: 0 28px 60px rgba(7,26,47,.23); }
.window-bar { height: 49px; display: flex; align-items: center; gap: 7px; padding: 0 18px; color: #7f9bb2; border-bottom: 1px solid rgba(255,255,255,.08); font: 600 11px "Manrope", sans-serif; }
.window-bar span { width: 9px; height: 9px; border-radius: 50%; background: #ff6b6b; }
.window-bar span:nth-child(2) { background: var(--yellow); }
.window-bar span:nth-child(3) { background: #4ed69c; }
.window-bar b { margin-left: auto; font-weight: 600; }
pre { margin: 0; padding: 32px 38px 39px; font: 600 18px/1.75 "Manrope", monospace; }
code em, code span { color: #75d5ff; font-style: normal; } code strong { color: var(--yellow); } code small { color: #7794aa; }
.float-note { position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 11px 15px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 12px 35px rgba(7,26,47,.14); font-size: 13px; }
.float-note b { color: var(--blue-deep); font: 800 12px "Manrope", sans-serif; }
.note-one { left: 0; top: 62px; } .note-two { right: 0; top: 154px; } .note-three { left: 34px; bottom: 22px; }

.resource-section { padding: 80px 0 110px; border-top: 1px solid rgba(7,26,47,.08); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 34px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 4vw, 50px); letter-spacing: -.04em; }
.section-heading > p { max-width: 320px; margin: 0; color: var(--muted); text-align: right; }
.resource-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.resource-card { position: relative; min-height: 285px; padding: 31px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.82); text-decoration: none; box-shadow: 0 8px 30px rgba(7,43,72,.05); transition: .25s ease; }
a.resource-card:hover { transform: translateY(-5px); border-color: #9bdcf5; box-shadow: var(--shadow); }
.resource-card.featured { color: #fff; background: linear-gradient(135deg, #08223d, #0b4873); border-color: transparent; }
.card-index { position: absolute; top: 24px; right: 27px; color: #8ba0b3; font: 700 12px "Manrope", sans-serif; }
.featured .card-index { color: #78b9dc; }
.card-icon { display: grid; place-items: center; width: 48px; height: 48px; color: var(--blue-deep); background: #e9f8fe; border-radius: 14px; font: 700 24px "Manrope", sans-serif; }
.featured .card-icon { color: var(--yellow); background: rgba(255,255,255,.1); }
.resource-card h3 { margin: 28px 0 8px; font-size: 24px; letter-spacing: -.025em; }
.resource-card p { max-width: 480px; margin: 0; color: var(--muted); line-height: 1.7; }
.featured p { color: #b8d2e3; }
.card-link { position: absolute; left: 31px; bottom: 29px; color: var(--blue-deep); font-weight: 700; }
.featured .card-link { color: #fff; }
.card-link b { margin-left: 10px; }
.resource-card.muted { background: rgba(239,245,249,.72); box-shadow: none; }
.status-pill { position: absolute; top: 75px; right: 25px; padding: 7px 10px; background: #fff8d9; border-color: #f5e19b; color: #8b6a00; font-size: 9px; }
.live-pill { color: #086b9f; background: #e9f8fe; border-color: #b7e8fa; }

.quiz-main { width: min(900px, 100%); margin: auto; padding: 64px 0 100px; }
.quiz-intro { margin-bottom: 34px; }
.quiz-intro h1 { margin: 0; font: 700 clamp(44px, 6vw, 68px)/1.15 "IBM Plex Sans Thai", sans-serif; letter-spacing: -.035em; }
.quiz-intro > p:last-child { color: var(--muted); font-size: 18px; }
.quiz-form { display: grid; gap: 20px; }
.student-fields, .question-section { padding: 30px; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 35px rgba(7,43,72,.06); }
.form-section-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 25px; }
.form-section-heading > span { display: grid; place-items: center; flex: 0 0 44px; height: 44px; color: var(--blue-deep); background: #e9f8fe; border-radius: 13px; font: 800 12px "Manrope", sans-serif; }
.form-section-heading h2 { margin: 0; font-size: 24px; }
.form-section-heading p { margin: 2px 0 0; color: var(--muted); }
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.student-id-field { grid-column: 1 / -1; }
.quiz-form label { display: grid; gap: 8px; font-weight: 600; }
.quiz-form input, .quiz-form textarea { width: 100%; border: 1px solid #cddce7; border-radius: 13px; outline: none; background: #fbfdff; color: var(--ink); font: 400 16px/1.55 "IBM Plex Sans Thai", sans-serif; transition: border-color .2s, box-shadow .2s; }
.quiz-form input { min-height: 50px; padding: 0 15px; }
.quiz-form textarea { padding: 13px 15px; resize: vertical; }
.quiz-form input:focus, .quiz-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(17,153,220,.12); }
.question-list { display: grid; gap: 14px; }
.question-card { padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: #f9fcfe; }
.question-card strong { font-size: 18px; line-height: 1.55; }
.question-number { color: var(--blue-deep); font: 800 11px "Manrope", sans-serif; letter-spacing: .1em; }
.privacy-note { display: flex; align-items: center; gap: 13px; padding: 16px 19px; color: var(--muted); background: #eef7fc; border: 1px solid #d1e8f4; border-radius: 15px; font-size: 14px; }
.privacy-note span { display: grid; place-items: center; flex: 0 0 27px; height: 27px; color: white; background: var(--blue-deep); border-radius: 50%; font-weight: 700; }
.privacy-note p { margin: 0; }
.submit-button { justify-self: end; min-width: 190px; min-height: 54px; padding: 0 22px; border: 0; border-radius: 14px; color: white; background: var(--ink); font: 700 17px "IBM Plex Sans Thai", sans-serif; cursor: pointer; box-shadow: 0 12px 30px rgba(7,26,47,.18); }
.submit-button:hover:not(:disabled) { background: #103052; transform: translateY(-2px); }
.submit-button:disabled { opacity: .62; cursor: not-allowed; }
.form-message { display: none; padding: 15px 18px; border-radius: 13px; }
.form-message.success { display: block; color: #12643e; background: #e9f8ef; border: 1px solid #bde5cc; }
.form-message.error { display: block; color: #9c2931; background: #fff0f1; border: 1px solid #f1c5c8; }
.trap-field { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 27px 0 35px; color: #718295; border-top: 1px solid rgba(7,26,47,.08); font-size: 13px; }

.back-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; }
.score-main { padding: 65px 0 100px; }
.score-intro { max-width: 850px; margin-bottom: 44px; }
.score-intro h1 { font-size: clamp(45px, 5.3vw, 72px); }
.score-intro > p:last-child { max-width: 700px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.score-board { display: grid; grid-template-columns: .8fr 1.2fr; gap: 22px; }
.score-total { display: flex; flex-direction: column; justify-content: space-between; min-height: 540px; padding: 40px; color: white; background: linear-gradient(145deg, #071a2f, #0d4268); border-radius: var(--radius); box-shadow: var(--shadow); }
.score-total h2 { margin: 0 0 14px; font-size: 34px; line-height: 1.35; }
.score-total p:last-child { color: #accadd; line-height: 1.7; }
.donut { width: 210px; height: 210px; display: grid; place-items: center; align-self: center; border-radius: 50%; background: conic-gradient(var(--yellow) 0 10%, var(--cyan) 10% 40%, var(--blue) 40% 80%, #6ea7ff 80% 100%); }
.donut::before { content: ""; position: absolute; width: 146px; height: 146px; background: #0a2944; border-radius: 50%; }
.donut span { position: relative; z-index: 1; text-align: center; }
.donut b { display: block; font: 800 54px/1 "Manrope", sans-serif; }
.donut small { color: #a9c5d8; }
.score-list { display: grid; gap: 13px; }
.score-item { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 23px; min-height: 127px; padding: 20px 25px; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 20px; }
.score-number { display: grid; place-items: center; width: 62px; height: 62px; color: var(--ink); background: #eaf8fe; border-radius: 17px; font: 800 23px "Manrope", sans-serif; }
.score-item > div:nth-child(2) span { color: var(--blue-deep); font: 800 10px "Manrope", sans-serif; letter-spacing: .12em; }
.score-item h3 { margin: 4px 0 1px; font-size: 21px; }
.score-item p { margin: 0; color: var(--muted); font-size: 14px; }
.score-item > b { color: var(--blue-deep); font: 800 24px "Manrope", sans-serif; }
.assignment .score-number { background: #fff6ce; } .midterm .score-number { background: #ddf7ff; } .final-exam .score-number { color: #fff; background: var(--blue); } .project .score-number { background: #e8edff; }
.score-note { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 18px 22px; color: var(--muted); background: rgba(255,255,255,.65); border: 1px solid var(--line); border-radius: 16px; }
.score-note span { display: grid; place-items: center; flex: 0 0 28px; height: 28px; color: white; background: var(--blue-deep); border-radius: 50%; font: 700 14px serif; }
.score-note p { margin: 0; }

@media (max-width: 900px) {
  .term-badge { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .hero-visual { min-height: 390px; }
  .score-board { grid-template-columns: 1fr; }
  .score-total { min-height: 490px; }
}

@media (max-width: 640px) {
  .page-shell { width: min(100% - 24px, 1280px); }
  .site-header { height: 80px; }
  .brand small { font-size: 10px; }
  .back-link { font-size: 13px; }
  .hero { min-height: auto; gap: 42px; padding: 48px 0 70px; }
  .hero h1 { font-size: 42px; line-height: 1.2; }
  .hero-lead { font-size: 16px; }
  .hero-actions, .button { width: 100%; }
  .hero-visual { min-height: 330px; }
  pre { padding: 26px 22px 31px; font-size: 14px; }
  .float-note { display: none; }
  .resource-section { padding: 64px 0 80px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading > p { text-align: left; }
  .resource-grid { grid-template-columns: 1fr; }
  .resource-card { min-height: 275px; }
  footer { flex-direction: column; }
  .score-main { padding-top: 50px; }
  .score-total { min-height: 470px; padding: 28px; }
  .donut { width: 180px; height: 180px; }
  .donut::before { width: 124px; height: 124px; }
  .score-item { grid-template-columns: 58px 1fr; gap: 15px; padding: 18px; }
  .score-number { width: 54px; height: 54px; }
  .score-item > b { grid-column: 2; font-size: 18px; }
  .quiz-main { padding-top: 48px; }
  .student-fields, .question-section { padding: 21px; }
  .name-grid { grid-template-columns: 1fr; }
  .submit-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
