:root {
  --bg-main: #07111f;
  --bg-soft: #0f172a;
  --bg-card: #111c2f;
  --bg-card-strong: #162238;
  --text-main: #e6eefc;
  --text-soft: #9eb0d0;
  --line: rgba(158, 176, 208, 0.18);
  --accent: #758bff;
  --accent-2: #33d6ff;
  --success: #31d08a;
  --danger: #ff6b9f;
  --warning: #ffb347;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans Thai", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top right, rgba(117, 139, 255, 0.18), transparent 28%),
    radial-gradient(circle at left 20%, rgba(51, 214, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #07111f 0%, #091321 40%, #0b1220 100%);
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.page-shell {
  position: relative;
  overflow-x: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(7, 17, 31, 0.72);
  border-bottom: 1px solid rgba(158, 176, 208, 0.08);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(117, 139, 255, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.brand-text {
  display: inline-block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--text-soft);
}

.nav-links a {
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text-main);
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(17, 28, 47, 0.32);
}

.btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  color: #03111b;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}

.btn-secondary {
  color: var(--text-main);
  background: rgba(22, 34, 56, 0.9);
  border-color: rgba(117, 139, 255, 0.22);
}

.btn-danger {
  color: #fff4f8;
  background: rgba(255, 107, 159, 0.16);
  border-color: rgba(255, 107, 159, 0.32);
}

.hero-section,
.projects-hero {
  padding: 84px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 28px;
  align-items: stretch;
}

.eyebrow,
.section-kicker,
.panel-kicker {
  display: inline-flex;
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 179, 71, 0.12);
  color: #ffd28c;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.hero-copy h1,
.projects-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.02;
}

.hero-text {
  margin: 0;
  max-width: 760px;
  color: var(--text-soft);
  font-size: 1.03rem;
  line-height: 1.8;
}

.teacher-box,
.hero-panel-card,
.summary-card,
.roadmap-card,
.project-card,
.submission-item,
.modal-dialog {
  background: linear-gradient(180deg, rgba(17, 28, 47, 0.98), rgba(22, 34, 56, 0.95));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.teacher-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 18px;
  align-items: center;
  margin-top: 28px;
  padding: 22px;
  border-radius: var(--radius-md);
  max-width: 620px;
}

.teacher-info {
  display: grid;
  gap: 6px;
}

.teacher-label {
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.teacher-photo-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  justify-self: end;
  border-radius: 999px;
  border: 1px solid rgba(51, 214, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(17, 28, 47, 0.82), rgba(22, 34, 56, 0.9)),
    linear-gradient(135deg, rgba(117, 139, 255, 0.24), rgba(51, 214, 255, 0.18));
  box-shadow:
    0 0 0 1px rgba(117, 139, 255, 0.16),
    0 0 28px rgba(51, 214, 255, 0.14),
    0 0 42px rgba(117, 139, 255, 0.12);
  overflow: hidden;
}

.teacher-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.teacher-photo-placeholder {
  padding: 16px;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-panel {
  display: grid;
  gap: 18px;
}

.hero-panel-card {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.hero-panel-card.accent {
  background:
    linear-gradient(180deg, rgba(39, 52, 89, 0.96), rgba(22, 34, 56, 0.96)),
    linear-gradient(135deg, rgba(117, 139, 255, 0.22), rgba(51, 214, 255, 0.12));
}

.hero-panel-card h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
}

.hero-panel-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.instructor-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: center;
  padding: 28px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(51, 214, 255, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(17, 28, 47, 0.98), rgba(22, 34, 56, 0.95));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.instructor-copy h2 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.instructor-text {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.85;
}

.instructor-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.instructor-meta div {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(7, 17, 31, 0.52);
  border: 1px solid rgba(117, 139, 255, 0.14);
}

.instructor-meta strong {
  display: block;
  margin-top: 6px;
  font-size: 1.02rem;
}

.instructor-visual {
  display: flex;
  justify-content: center;
}

.instructor-photo {
  width: min(100%, 380px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid rgba(117, 139, 255, 0.24);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.34);
}

.summary-section,
.legend-section,
.roadmap-section,
.submissions-section,
.project-catalog,
.instructor-section {
  padding: 28px 0 34px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.5vw, 2.3rem);
}

.section-heading p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.section-heading.split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.summary-grid,
.roadmap-grid,
.project-grid {
  display: grid;
  gap: 18px;
}

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

.summary-card {
  padding: 22px;
  border-radius: var(--radius-md);
}

.summary-card span {
  display: block;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.summary-card strong {
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
}

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

.phase-pill,
.phase-badge,
.status-badge,
.week-badge,
.project-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
}

.phase-pill {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
}

.phase-explore,
.phase-plan {
  color: #2f1800;
  background: rgba(255, 179, 71, 0.92);
}

.phase-build {
  color: #032114;
  background: rgba(49, 208, 138, 0.92);
}

.phase-test {
  color: #efe5ff;
  background: rgba(136, 92, 255, 0.78);
}

.phase-present {
  color: #fff1f7;
  background: rgba(255, 107, 159, 0.84);
}

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

.roadmap-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-lg);
  min-height: 100%;
}

.roadmap-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.week-badge {
  min-height: 38px;
  padding: 0 14px;
  color: var(--accent-2);
  background: rgba(51, 214, 255, 0.1);
  border: 1px solid rgba(51, 214, 255, 0.16);
}

.phase-badge {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.roadmap-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.roadmap-meta {
  display: grid;
  gap: 10px;
}

.meta-block {
  display: grid;
  gap: 4px;
}

.meta-label {
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-block p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.roadmap-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.status-badge {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.88rem;
}

.status-pending {
  color: #ffeecb;
  background: rgba(255, 179, 71, 0.14);
  border: 1px solid rgba(255, 179, 71, 0.22);
}

.status-submitted {
  color: #ddfff1;
  background: rgba(49, 208, 138, 0.14);
  border: 1px solid rgba(49, 208, 138, 0.22);
}

.submission-list {
  display: grid;
  gap: 14px;
}

.submission-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.submission-notice {
  display: none;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 600;
}

.submission-notice.is-visible {
  display: block;
}

.submission-notice.is-success {
  color: #dffff2;
  background: rgba(49, 208, 138, 0.14);
  border-color: rgba(49, 208, 138, 0.22);
}

.submission-notice.is-info {
  color: #dff7ff;
  background: rgba(51, 214, 255, 0.12);
  border-color: rgba(51, 214, 255, 0.2);
}

.submission-item,
.empty-state {
  padding: 20px;
  border-radius: var(--radius-md);
}

.submission-item {
  display: grid;
  gap: 12px;
}

.submission-item p,
.submission-item strong,
.submission-item span,
.empty-state {
  margin: 0;
}

.submission-item strong {
  font-size: 1.05rem;
}

.submission-item-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.submission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.submission-details {
  color: var(--text-soft);
  line-height: 1.7;
}

.submission-delete-btn {
  min-width: 108px;
}

.btn-ghost-danger {
  color: #ffe3ee;
  background: rgba(255, 107, 159, 0.12);
  border-color: rgba(255, 107, 159, 0.28);
}

.empty-state {
  border: 1px dashed rgba(158, 176, 208, 0.22);
  color: var(--text-soft);
  background: rgba(17, 28, 47, 0.56);
}

.site-footer {
  padding: 34px 0 54px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(158, 176, 208, 0.12);
}

.footer-grid p {
  margin: 8px 0 0;
  color: var(--text-soft);
}

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

.project-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: var(--radius-lg);
}

.project-type {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  color: #ffe8bf;
  background: rgba(255, 179, 71, 0.14);
  border: 1px solid rgba(255, 179, 71, 0.24);
}

.project-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.project-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 10, 20, 0.78);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: min(88vh, 980px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.modal-header {
  padding-right: 48px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 0 0 8px;
}

.modal-header p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.submission-form {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-field,
.radio-group {
  display: grid;
  gap: 8px;
}

.field-span-2 {
  grid-column: span 2;
}

.form-field label,
.radio-group > span {
  font-weight: 600;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(158, 176, 208, 0.18);
  color: var(--text-main);
  background: rgba(7, 17, 31, 0.82);
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.radio-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(158, 176, 208, 0.16);
  background: rgba(7, 17, 31, 0.72);
}

.conditional-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(117, 139, 255, 0.18);
  background: rgba(7, 17, 31, 0.46);
}

.form-feedback {
  min-height: 24px;
  color: #9cffcf;
  font-weight: 600;
}

.form-feedback.is-success {
  color: #aef7ce;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}

.scroll-top-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(117, 139, 255, 0.26);
  border-radius: 999px;
  color: #03111b;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease;
}

.scroll-top-icon {
  display: block;
  font-size: 1.45rem;
  line-height: 1;
}

.scroll-top-label {
  display: block;
  font-size: 0.74rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-top-btn:hover,
.scroll-top-btn:focus-visible {
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.34);
}

.scroll-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 1024px) {
  .summary-grid,
  .roadmap-grid,
  .project-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .instructor-card {
    grid-template-columns: 1fr;
  }

  .teacher-box {
    grid-template-columns: 1fr;
  }

  .teacher-photo-shell {
    justify-self: center;
  }
}

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

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .section-heading.split,
  .roadmap-footer,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .submission-toolbar,
  .submission-item-top {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-grid,
  .roadmap-grid,
  .project-grid,
  .footer-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .instructor-meta {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .hero-section,
  .projects-hero {
    padding-top: 56px;
  }

  .modal-dialog {
    padding: 20px;
    border-radius: 22px;
  }

  .scroll-top-btn {
    right: 16px;
    bottom: 16px;
    width: 58px;
    height: 58px;
  }

  .scroll-top-icon {
    font-size: 1.25rem;
  }

  .scroll-top-label {
    font-size: 0.67rem;
  }
}
