/* ==========================================================================
   German Language Course — IIT Kanpur
   Mobile-first. Breakpoints: 640px (tablet), 1024px (desktop).
   ========================================================================== */

:root {
  --bg: #FFFFFF;
  --bg-alt: #F7F5F0;
  --ink: #14213D;
  --muted: #5B6475;
  --accent: #C8961E;
  --accent-dark: #A67A12;
  --line: #E4E1D8;

  --radius: 12px;
  --max: 1140px;
  --gutter: 20px;
  --header-h: 68px;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem); }

.icon {
  width: 1.25em; height: 1.25em;
  flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-lg { width: 28px; height: 28px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}


.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px;
  font: 600 1.0625rem/1.2 var(--font-body);
  text-decoration: none; text-align: center;
  border-radius: 10px; border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row--center { justify-content: center; margin-top: 40px; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s;
}
.site-header.is-scrolled { box-shadow: 0 4px 18px rgba(20,33,61,.1); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h);
  gap: 16px;
}
.brand { display: flex; align-items: center; min-height: 44px; flex: 0 1 auto; min-width: 0; }
.brand img { height: 40px; width: auto; max-width: 220px; object-fit: contain; }
@media (min-width: 1024px) { .brand img { height: 48px; max-width: none; } }

.header-actions { display: flex; align-items: center; gap: 8px; }
.header-enroll { display: none; min-height: 44px; padding: 8px 20px; }
.menu-toggle {
  width: 48px; height: 48px;
  display: inline-grid; place-items: center;
  background: transparent; border: 0; color: var(--ink); cursor: pointer; border-radius: 10px;
}
.menu-toggle .icon { width: 26px; height: 26px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Mobile nav panel */
.site-nav {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(20,33,61,.1);
  padding: 8px var(--gutter) 20px;
}
.site-nav.is-open { display: block; }
.site-nav a:not(.btn) {
  display: flex; align-items: center; min-height: 48px;
  text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line);
}
.site-nav a.is-active { color: var(--accent-dark); font-weight: 600; }
.site-nav .nav-enroll { margin-top: 16px; width: 100%; }

/* No-JS: keep navigation reachable */
.no-js .menu-toggle { display: none; }
.no-js .site-nav { display: block; position: static; box-shadow: none; padding-block: 0; }
.no-js .header-inner { flex-wrap: wrap; }

@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .header-enroll { display: inline-flex; }
  .nav-enroll { display: none; }
}

@media (min-width: 1024px) {
  .menu-toggle { display: none; }
  .site-nav, .no-js .site-nav {
    display: block; position: static; background: none; border: 0; box-shadow: none; padding: 0;
    margin-left: auto;
  }
  .site-nav ul { display: flex; gap: 4px; }
  .site-nav a:not(.btn) {
    border: 0; padding: 0 12px; border-radius: 8px; font-size: .97rem; color: var(--ink);
    position: relative;
  }
  .site-nav a:not(.btn):hover { background: var(--bg-alt); }
  .site-nav a.is-active { color: var(--ink); }
  .site-nav a.is-active::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; background: var(--accent);
  }
}

/* ---- Sections ---- */
main section[id], #top { scroll-margin-top: calc(var(--header-h) + 8px); }
.section { padding-block: clamp(56px, 8vw, 96px); }
.section--alt { background: var(--bg-alt); }
.section-head { margin-bottom: clamp(28px, 4vw, 48px); max-width: 720px; }
.section-head h2 { margin-top: 4px; }
.section-intro { margin-top: 12px; color: var(--muted); font-size: 1.125rem; }
.eyebrow {
  font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}

/* Reveal animation (class added by JS only) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---- Hero ---- */
.hero { padding-block: clamp(40px, 7vw, 88px); background: var(--bg); }
.hero-grid { display: grid; gap: 40px; align-items: center; }
.hero-copy .eyebrow { margin-bottom: 14px; }
.lead { margin-top: 20px; font-size: 1.1875rem; color: var(--muted); max-width: 40em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 28px; }
.chips li {
  padding: 6px 14px; font-size: .9375rem; font-weight: 500;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-alt);
}
.hero-card {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px); display: grid; gap: 16px;
}
.hero-card-kicker { font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; }
.hero-course {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: grid; gap: 12px;
}
.hero-course--gold { border-color: var(--accent); border-width: 2px; }
.hero-course-title { font-size: 1.35rem; }
.hero-course-meta { color: var(--muted); font-size: .95rem; }
.hero-course ul { display: grid; gap: 6px; font-size: .97rem; }
.hero-course li { display: flex; gap: 10px; align-items: center; }
.hero-course .icon { color: var(--accent-dark); }

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1.2fr .8fr; gap: 64px; }
}

/* ---- Cards & grids ---- */
.grid { display: grid; gap: 20px; }
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(20,33,61,.1); }

.grid-highlights .card { display: grid; gap: 8px; align-content: start; }
.grid-highlights .icon-lg { color: var(--accent-dark); margin-bottom: 6px; }
.grid-highlights p { color: var(--muted); }

@media (min-width: 640px) {
  .grid-highlights { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-highlights { grid-template-columns: repeat(6, 1fr); }
  .grid-highlights .card { grid-column: span 2; }
  .grid-highlights .card:nth-child(n+7) { grid-column: span 3; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Instructors ---- */
.profile {
  display: flex; flex-direction: column; gap: 20px;
  padding: 24px;
}
.profile img {
  width: 200px; height: 250px; max-width: 100%; margin-inline: auto; flex: none;
  object-fit: cover; object-position: center top; image-rendering: auto;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-alt);
}
.profile-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; flex: 1; }
.profile-body h3, .profile-body .role { text-align: center; }
.profile-body p:not(.role) { text-align: left; }
.role { font-weight: 600; color: var(--muted); font-size: .97rem; margin-top: -6px; }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.tags li {
  width: fit-content;
  padding: 4px 12px; font-size: .875rem; font-weight: 500;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px;
}
/* Cards stack below 1024px; side by side (equal height) above */
@media (max-width: 1023px) {
  #instructors .grid-2 { grid-template-columns: 1fr; }
}
@media (min-width: 1024px) {
  #instructors .grid-2 { align-items: stretch; }
}
@media (max-width: 639px) {
  .profile img { width: 160px; height: 200px; }
}

/* ---- Tabs & curriculum ---- */
.tab-list {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 24px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  width: 100%;
}
.tab {
  flex: 1; min-height: 48px; padding: 8px 12px;
  font: 600 .97rem/1.25 var(--font-body); color: var(--ink);
  background: transparent; border: 0; border-radius: 9px; cursor: pointer;
  transition: background-color .2s;
}
.tab:hover { background: var(--bg-alt); }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; }
@media (min-width: 640px) {
  .tab-list { width: auto; display: inline-flex; }
  .tab { flex: none; padding-inline: 24px; }
}
.js .tab-panel[hidden] { display: none; }
.no-js .tab-list { display: none; }
.no-js .tab-panel[hidden] { display: block; }
.no-js .tab-panel { margin-bottom: 40px; }

.summary { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-bottom: 24px; }
.summary div { display: flex; flex-direction: column; }
.summary dt { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.summary dd { font-weight: 600; }
.panel-note {
  margin-bottom: 20px; padding: 12px 16px; font-weight: 500;
  background: var(--bg); border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0;
}
.plain-list { list-style: decimal; padding-left: 24px; display: grid; gap: 10px; }

.topics { display: grid; gap: 10px; }
.topic {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .25s, box-shadow .25s;
}
.topic:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,33,61,.08); }
.topic-title { font: inherit; }
.topic-btn {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 52px; padding: 12px 16px;
  font: 600 1rem/1.3 var(--font-body); color: var(--ink);
  background: none; border: 0; border-radius: var(--radius); cursor: pointer;
}
.topic-num { font-size: .8125rem; font-weight: 600; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.topic-name { flex: 1; }
.topic-flag {
  font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--ink);
}
.topic-chev { transition: transform .25s; color: var(--muted); }
.topic.is-open .topic-chev { transform: rotate(180deg); }
.topic-desc { padding: 0 16px 16px 44px; color: var(--muted); font-size: .97rem; }
.topic-desc em { color: var(--ink); }
.topic--feature { border: 2px solid var(--accent); background: #FDF8EC; }

/* Mobile: accordion */
@media (max-width: 639px) {
  .topic:not(.is-open) .topic-desc { display: none; }
}
/* Tablet+: static cards */
@media (min-width: 640px) {
  .topics { grid-template-columns: repeat(2, 1fr); gap: 16px; align-items: start; }
  .topic-btn { cursor: default; pointer-events: none; padding-bottom: 6px; }
  .topic-chev { display: none; }
  .topic-desc { padding-left: 46px; }
}

/* ---- Fees ---- */
.price { display: flex; flex-direction: column; gap: 14px; padding: clamp(24px, 3vw, 32px); }
.price--featured { border: 2px solid var(--accent); position: relative; }
.badge {
  align-self: flex-start; padding: 4px 12px; border-radius: 999px;
  font-size: .8125rem; font-weight: 600; background: var(--accent); color: var(--ink);
}
.price-meta { color: var(--muted); }
.fee-table { width: 100%; border-collapse: collapse; margin-block: 4px; }
.fee-table th, .fee-table td { padding: 14px 0; border-top: 1px solid var(--line); text-align: left; }
.fee-table tr:last-child th, .fee-table tr:last-child td { border-bottom: 1px solid var(--line); }
.fee-table th { font-weight: 500; }
.fee-table td { text-align: right; font-family: var(--font-head); font-weight: 600; font-size: 1.6rem; }
.price-code { color: var(--muted); }
.price-code strong { color: var(--ink); }
.price .btn { margin-top: auto; }
.info-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px;
  margin-top: 32px; padding: 18px 24px;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
}
.info-strip span { display: inline-flex; align-items: center; gap: 10px; }
.info-strip .icon { color: var(--accent-dark); }

/* ---- Payment ---- */
.stepper { display: grid; gap: 0; counter-reset: step; }
.step {
  counter-increment: step; position: relative;
  padding: 0 0 28px 64px;
}
.step::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 44px; height: 44px; display: grid; place-items: center;
  font: 600 1.15rem var(--font-head);
  background: var(--ink); color: #fff; border-radius: 50%;
}
.step::after { /* connector (vertical) */
  content: ""; position: absolute; left: 21px; top: 50px; bottom: 6px; width: 2px; background: var(--line);
}
.step:last-child { padding-bottom: 0; }
.step:last-child::after { display: none; }
.step h3 { font-size: 1.15rem; margin-bottom: 4px; padding-top: 6px; }
.step p { color: var(--muted); }
.step p strong { color: var(--ink); }
.link-ext {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 44px;
  font-weight: 600; color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 2px;
}
.link-ext:hover { text-decoration-color: var(--ink); }
.btn .icon { width: 1.1em; height: 1.1em; }

@media (min-width: 1024px) {
  .stepper { grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .step { padding: 60px 0 0 0; }
  .step::after { left: 52px; right: -24px; top: 21px; bottom: auto; width: auto; height: 2px; }
  .step:last-child::after { display: none; }
}

.codes { display: grid; gap: 16px; margin-top: 48px; }
.code-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px;
}
.code-label { font-size: .8125rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.code-value { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.code-prefix { color: var(--muted); }
.code-value strong { font: 600 clamp(2rem, 1.6rem + 2vw, 2.75rem)/1.1 var(--font-head); letter-spacing: .04em; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 8px 16px;
  font: 600 .97rem var(--font-body); color: var(--ink);
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.copy-btn:hover { border-color: var(--accent); background: #FDF8EC; }
@media (min-width: 640px) {
  .codes { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 399px) {
  .code-chip { flex-direction: column; align-items: flex-start; }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(20,33,61,.3);
  transition: opacity .25s, transform .25s;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ---- Who can join ---- */
.join { background: var(--bg-alt); text-align: center; padding-block: clamp(56px, 7vw, 88px); }
.join-inner { max-width: 720px; display: grid; gap: 14px; }
.join p { color: var(--muted); font-size: 1.125rem; }
.join p strong { color: var(--ink); }

/* ---- CTA ---- */
.cta { background: var(--ink); color: #fff; text-align: center; padding-block: clamp(56px, 8vw, 96px); }
.cta-inner { display: grid; justify-items: center; gap: 28px; }
.cta h2 { max-width: 20em; }
.cta-contact { color: #D5DAE5; }
.cta-contact a { color: #fff; font-weight: 600; text-decoration-color: var(--accent); text-underline-offset: 4px; overflow-wrap: anywhere; }
.cta :focus-visible { outline-color: #FFD266; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); padding-block: 28px; font-size: .9375rem; color: var(--muted); }
.footer-inner { display: grid; gap: 16px; }
.footer-brand { display: grid; gap: 10px; justify-items: start; }
.footer-brand img { height: 36px; width: auto; max-width: 100%; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-footer a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 500; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
@media (min-width: 1024px) {
  .footer-inner { grid-template-columns: auto 1fr; align-items: center; }
  .site-footer ul { justify-content: flex-end; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
  .card:hover, .topic:hover { transform: none; }
}

/* ---- Floating back-to-top button ---- */
.fab-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--ink); color: var(--accent); border-radius: 50%;
  box-shadow: 0 6px 18px rgba(20,33,61,.3);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s;
}
.fab-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.fab-top .icon { width: 22px; height: 22px; stroke-width: 2.5; }
.fab-top:focus-visible { outline-color: var(--accent); outline-offset: 3px; }
.no-js .fab-top { display: none; }
.site-header:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { .fab-top { transition: none; } }

/* ---- Course coordinator (reuses .card.profile) ---- */
.coordinator { max-width: 540px; margin: 32px auto 0; }
@media (min-width: 1024px) { .coordinator { margin-top: 32px; } }

/* ---- GST, certificate lines ---- */
.fee-table .gst { font: 500 1rem var(--font-body); color: var(--ink); white-space: nowrap; }
.fee-table .price-total { display: block; margin-top: 2px; font: 400 .875rem var(--font-body); color: var(--muted); }
.price-feature { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.price-feature .icon { color: var(--accent-dark); }
.fee-note { margin-top: 20px; text-align: center; font-size: .9375rem; color: var(--muted); }
.fee-note + .info-strip { margin-top: 20px; }
.step-note { margin-top: 8px; }
