@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a25;
  --border: #2a2a3a;
  --accent: #f5c842;
  --accent2: #e8a020;
  --text: #eeeef5;
  --text-muted: #8888aa;
  --js-color: #f0db4f;
  --success: #4ade80;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0,0,0,0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── NAV ─── */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 48px;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo span { color: var(--accent); }

.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

/* ─── HERO ─── */
.hero {
  padding: 100px 48px 80px;
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: center;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(245,200,66,0.12);
  border: 1px solid rgba(245,200,66,0.3);
  color: var(--accent);
  padding: 6px 14px; border-radius: 100px;
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-badge::before {
  content: ''; width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 900; line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal; color: var(--accent);
  position: relative;
}

.hero p {
  color: var(--text-muted); font-size: 1.05rem;
  max-width: 460px; margin-bottom: 36px;
}

.hero-stats {
  display: flex; gap: 36px; margin-bottom: 40px;
}

.stat strong {
  display: block; font-family: 'Playfair Display', serif;
  font-size: 2rem; font-weight: 700; color: var(--accent);
  line-height: 1;
}

.stat span { font-size: 0.82rem; color: var(--text-muted); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: all 0.25s ease;
  border: none;
}

.btn-primary {
  background: var(--accent); color: #0a0a0f;
  box-shadow: 0 0 30px rgba(245,200,66,0.25);
}

.btn-primary:hover {
  background: var(--accent2);
  box-shadow: 0 0 40px rgba(245,200,66,0.4);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.hero-visual {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px; width: 320px;
  box-shadow: var(--shadow);
  position: relative;
}

.hero-card-icon {
  width: 52px; height: 52px;
  background: rgba(240,219,79,0.15);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 16px;
}

.hero-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.hero-card p { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 16px; }

.progress-bar {
  height: 6px; background: var(--border); border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  animation: fillBar 2s ease forwards;
}

@keyframes fillBar { from { width: 0; } to { width: 72%; } }

.floating-badge {
  position: absolute;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.8rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}

.floating-badge.top-right { top: -16px; right: -40px; }
.floating-badge.bottom-left { bottom: -16px; left: -40px; }
.floating-badge .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.green { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot.yellow { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* ─── SECTION HEADER ─── */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}

.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900; letter-spacing: -1px;
}

.section-header p {
  color: var(--text-muted); margin-top: 12px;
  font-size: 1rem; max-width: 500px; margin-inline: auto;
}

/* ─── COURSES GRID ─── */
.courses-section {
  padding: 80px 48px;
  max-width: 1200px; margin: 0 auto;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: flex; flex-direction: column;
}

.course-card:hover {
  transform: translateY(-6px);
  border-color: rgba(245,200,66,0.3);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}

.course-card.featured {
  border-color: rgba(245,200,66,0.4);
  background: linear-gradient(145deg, #111118, #16161f);
}

.course-card.featured::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at top left, rgba(245,200,66,0.06), transparent 60%);
  pointer-events: none;
}

.card-thumb {
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
  position: relative; overflow: hidden;
}

.card-thumb.js-thumb {
  background: linear-gradient(135deg, #1a1600, #2a2200);
}
.card-thumb.py-thumb { background: linear-gradient(135deg, #001a14, #002a20); }
.card-thumb.react-thumb { background: linear-gradient(135deg, #001226, #00204d); }
.card-thumb.css-thumb { background: linear-gradient(135deg, #1a0026, #2a0040); }
.card-thumb.node-thumb { background: linear-gradient(135deg, #061a00, #0a2800); }
.card-thumb.ts-thumb { background: linear-gradient(135deg, #00102a, #001840); }

.featured-ribbon {
  position: absolute; top: 16px; right: 16px;
  background: var(--accent); color: #0a0a0f;
  font-size: 0.7rem; font-weight: 700;
  padding: 4px 10px; border-radius: 100px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }

.card-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}

.card-tag {
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 10px; border-radius: 100px;
  text-transform: uppercase; letter-spacing: 0.3px;
}

.tag-js { background: rgba(240,219,79,0.15); color: var(--js-color); }
.tag-py { background: rgba(59,186,91,0.15); color: #3bba5b; }
.tag-react { background: rgba(97,218,251,0.15); color: #61dafb; }
.tag-css { background: rgba(180,100,255,0.15); color: #b464ff; }
.tag-node { background: rgba(104,183,56,0.15); color: #68b738; }
.tag-ts { background: rgba(49,120,198,0.15); color: #3178c6; }

.card-level {
  font-size: 0.75rem; color: var(--text-muted);
}

.card-body h3 {
  font-size: 1.05rem; font-weight: 600;
  margin-bottom: 8px; line-height: 1.3;
}

.card-body p {
  font-size: 0.85rem; color: var(--text-muted);
  margin-bottom: 18px; flex: 1;
}

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.card-hours {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--text-muted);
}

.card-arrow {
  width: 32px; height: 32px;
  background: var(--surface2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  transition: all 0.25s;
}

.course-card:hover .card-arrow {
  background: var(--accent); color: #0a0a0f;
  transform: rotate(45deg);
}

/* ─── COURSE PAGE ─── */
.course-page {
  max-width: 1000px; margin: 0 auto;
  padding: 48px 48px 80px;
}

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-muted);
  margin-bottom: 36px;
}

.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-muted); }

.course-header { margin-bottom: 40px; }

.course-header .badge-row {
  display: flex; gap: 10px; margin-bottom: 16px;
  flex-wrap: wrap;
}

.course-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900; letter-spacing: -1px;
  margin-bottom: 14px;
}

.course-header p {
  color: var(--text-muted); font-size: 1rem;
  max-width: 600px;
}

.video-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px;
  position: relative; overflow: hidden;
  cursor: pointer;
}

.video-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0a0a1a, #1a1600);
}

.video-play {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
}

.play-btn {
  width: 72px; height: 72px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  transition: all 0.3s;
  box-shadow: 0 0 40px rgba(245,200,66,0.3);
  cursor: pointer;
}

.play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 60px rgba(245,200,66,0.5);
}

.video-label {
  position: relative; z-index: 2;
  color: var(--text-muted); font-size: 0.85rem;
}

.video-title-overlay {
  position: absolute; bottom: 20px; left: 24px;
  z-index: 2; font-size: 0.85rem; color: var(--text-muted);
}

.course-info-bar {
  display: flex; gap: 24px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 28px;
  margin-bottom: 32px;
}

.info-item {
  display: flex; align-items: center; gap: 10px;
}

.info-icon {
  width: 36px; height: 36px;
  background: var(--surface2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

.info-item strong { font-size: 0.9rem; display: block; }
.info-item span { font-size: 0.78rem; color: var(--text-muted); }

.curriculum {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
}

.curriculum h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; margin-bottom: 20px;
}

.module {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  display: flex; align-items: center; justify-content: space-between;
}

.module:last-child { border-bottom: none; }

.module-left { display: flex; align-items: center; gap: 12px; }

.module-num {
  width: 28px; height: 28px;
  background: var(--surface2); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
}

.module-title { font-size: 0.9rem; font-weight: 500; }
.module-dur { font-size: 0.8rem; color: var(--text-muted); }

.complete-section {
  text-align: center; padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.complete-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; margin-bottom: 10px;
}

.complete-section p {
  color: var(--text-muted); font-size: 0.9rem;
  margin-bottom: 24px;
}

.btn-complete {
  background: var(--accent); color: #0a0a0f;
  font-size: 1rem; padding: 16px 40px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 40px rgba(245,200,66,0.3);
}

.btn-complete:hover {
  background: var(--accent2);
  box-shadow: 0 0 60px rgba(245,200,66,0.5);
  transform: translateY(-2px);
}

/* ─── CERTIFICATE PAGE ─── */
.cert-page {
  max-width: 900px; margin: 0 auto;
  padding: 60px 48px 80px;
  text-align: center;
}

.cert-page h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900; margin-bottom: 12px;
  letter-spacing: -1px;
}

.cert-page > p {
  color: var(--text-muted); margin-bottom: 48px;
}

.name-input-group {
  display: flex; gap: 12px; max-width: 480px;
  margin: 0 auto 48px;
}

.name-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem; color: var(--text);
  outline: none; transition: border-color 0.2s;
}

.name-input:focus { border-color: var(--accent); }
.name-input::placeholder { color: var(--text-muted); }

/* ─── CERTIFICATE DISPLAY ─── */
#certificate-display {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
#certificate-display.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Input error shake */
.name-input.input-error {
  border-color: #ef4444 !important;
  animation: inputShake 0.4s ease;
}
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

.certificate {
  /* ── Landscape A4 proportions: 297 × 210mm → ~1.414 ratio ── */
  background: #fefdf5;
  border: 3px solid #c9a227;
  border-radius: 10px;
  width: 100%;
  max-width: 1020px;          /* landscape width */
  /* Fixed height via aspect-ratio keeps it strictly landscape */
  aspect-ratio: 1.414 / 1;
  margin: 0 auto 28px;
  padding: 36px 52px 28px;   /* tight, balanced insets */
  position: relative;
  text-align: center;
  box-shadow: 0 24px 72px rgba(0,0,0,0.55);
  color: #1a1400;
  /* Flex column so we can push the bottom bar to the bottom */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden;           /* nothing bleeds outside */
}

/* ── Corner ornaments ── */
.cert-corner {
  position: absolute;
  width: 52px; height: 52px;
  opacity: 0.45;
}
.cert-corner.tl { top: 12px; left: 12px; }
.cert-corner.tr { top: 12px; right: 12px; transform: scaleX(-1); }
.cert-corner.bl { bottom: 12px; left: 12px; transform: scaleY(-1); }
.cert-corner.br { bottom: 12px; right: 12px; transform: scale(-1,-1); }

/* ── Top area: logo + divider + subtitle ── */
.cert-logo {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem; font-weight: 900;
  color: #9a7700; letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cert-line {
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #c9a227, transparent);
  margin: 6px 0 10px;
}

.cert-subtitle {
  font-size: 0.65rem; letter-spacing: 3.5px;
  text-transform: uppercase; color: #7a6000;
}

/* ── Body: "This certifies that" → name → course ── */
.cert-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 4px 0;
}

.cert-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 700;
  color: #5a4000;
  margin-bottom: 2px;
}

.cert-presented {
  font-size: 0.72rem; color: #7a6000;
  margin-bottom: 4px;
}

.cert-name {
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem; font-weight: 900; font-style: italic;
  color: #7a3800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 4px 0 8px;
}

.cert-desc {
  font-size: 0.72rem; color: #5a5000;
  max-width: 500px;
  margin-bottom: 6px;
}

.cert-course {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 700;
  color: #1a1400;
}

/* ── Unified bottom bar: QR | Seal+Sig | Date+ID ── */
.cert-bottom {
  display: grid;
  grid-template-columns: 72px 1fr 140px;  /* fixed left, flexible center, fixed right */
  align-items: center;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(201,162,39,0.6);
  margin-top: 8px;
}

/* Left column: QR */
.cert-qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

#cert-qr img,
#cert-qr canvas {
  display: block;
  width: 60px !important;
  height: 60px !important;
  border: 1.5px solid rgba(201,162,39,0.4);
  border-radius: 4px;
  padding: 2px;
  background: #fefdf5;
}

.cert-qr-label {
  font-size: 0.52rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #9a7700;
  white-space: nowrap;
}

/* Center column: seal + signature */
.cert-center-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.cert-seal {
  width: 48px; height: 48px;
  background: #c9a227;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 0 3px rgba(201,162,39,0.25);
  margin-bottom: 3px;
}

.cert-sig {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-style: italic;
  color: #3a2000;
  line-height: 1.1;
}

.cert-sig-label {
  font-size: 0.6rem; color: #7a6000;
  letter-spacing: 1px; text-transform: uppercase;
}

/* Right column: date + cert ID */
.cert-right-block {
  text-align: right;
}

.cert-date {
  font-size: 0.82rem; font-weight: 600;
  color: #3a2000;
  margin-bottom: 1px;
}

.cert-date-label {
  font-size: 0.58rem; color: #7a6000;
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 6px;
}

.cert-id {
  font-family: 'Courier New', monospace;
  font-size: 0.68rem; font-weight: 700;
  color: #5a3a00;
  background: rgba(201,162,39,0.1);
  border: 1px solid rgba(201,162,39,0.3);
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-bottom: 1px;
}

.cert-id-label {
  font-size: 0.58rem; color: #7a6000;
  letter-spacing: 1px; text-transform: uppercase;
  display: block;
}

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 48px;
  text-align: center;
  color: var(--text-muted); font-size: 0.82rem;
}

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

/* ─── COMING SOON MODAL ─── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px; text-align: center;
  max-width: 380px; width: 90%;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-icon { font-size: 3rem; margin-bottom: 16px; }

.modal h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; margin-bottom: 10px;
}

.modal p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }


/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  nav { padding: 14px 20px; }
  .nav-links { display: none; }

  .hero { grid-template-columns: 1fr; padding: 48px 20px 40px; gap: 40px; }
  .hero-visual { order: -1; }
  .hero-card { width: 280px; }
  .floating-badge { display: none; }

  .courses-section { padding: 48px 20px; }
  .courses-grid { grid-template-columns: 1fr; }

  .course-page { padding: 32px 20px 60px; }
  .cert-page { padding: 40px 20px 60px; }
  .certificate {
    aspect-ratio: auto;          /* let it grow naturally on small screens */
    padding: 24px 20px 20px;
  }
  .cert-name { font-size: 1.8rem; }
  .cert-bottom { grid-template-columns: 56px 1fr 110px; gap: 10px; }
  #cert-qr img, #cert-qr canvas { width: 48px !important; height: 48px !important; }
  .name-input-group { flex-direction: column; }

  .course-info-bar { gap: 16px; }
}