/* Final layout safeguards */
.hero {
  display: block;
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  border-radius: 22px;
  background: #e8ddd0;
}

.hero picture {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-copy {
  position: absolute;
  left: clamp(18px, 3vw, 40px);
  bottom: clamp(28px, 4vh, 44px);
  width: min(calc(100% - 2 * clamp(18px, 3vw, 40px)), 900px);
  margin: 0;
  padding: 0;
}

.hero-copy h1 {
  max-width: 900px;
  margin-bottom: 14px;
  font-size: clamp(44px, 4.3vw, 64px);
  line-height: 1.03;
}

.hero-copy .lead {
  max-width: 590px;
}

.hero-actions {
  margin-top: 20px;
}

.map-card:focus-visible,
.button:focus-visible,
.lesson-links a:focus-visible,
.module-nav a:focus-visible,
.complete-button:focus-visible,
.choices button:focus-visible {
  outline: 3px solid #5476b8;
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .hero-copy h1 {
    max-width: 720px;
    font-size: clamp(42px, 5.4vw, 54px);
  }
}

@media (max-width: 650px) {
  .hero {
    display: block;
    position: relative;
    min-height: 100svh;
    padding: 0;
  }

  .hero picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .hero picture img {
    position: absolute;
    height: 100%;
    object-position: center top;
  }

  .hero-copy {
    position: absolute;
    left: clamp(18px, 3vw, 40px);
    right: clamp(18px, 3vw, 40px);
    bottom: 24px;
    width: auto;
    margin: 0;
    padding: 0;
  }

  .hero-copy h1 {
    max-width: 350px;
    font-size: clamp(36px, 10vw, 42px);
    line-height: 1.04;
  }

  .hero-copy .lead {
    max-width: 350px;
    font-size: 16px;
  }

  .hero-actions {
    margin-top: 16px;
  }
}

@media (max-width: 380px), (max-height: 720px) {
  .hero-copy h1 {
    font-size: 36px;
  }

  .hero-copy .lead {
    font-size: 15px;
    line-height: 1.5;
  }

  .hero-actions {
    margin-top: 12px;
  }
}
.site-header .desktop-nav,
.site-header .header-action {
  display: none;
}

.site-header .menu-button {
  display: inline-flex;
  margin-left: auto;
}

/* Quiet, image-first navigation */
.site-header {
  grid-template-columns: 1fr 1fr;
  background: transparent;
  border-bottom: 0;
  color: #171512;
  transition: background-color .28s ease, box-shadow .28s ease;
}

.site-header.scrolled,
.home .site-header.scrolled {
  background: rgba(246, 244, 240, .78);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  backdrop-filter: saturate(160%) blur(22px);
  border-bottom: 1px solid rgba(29, 27, 23, .08);
  box-shadow: 0 6px 24px rgba(29, 27, 23, .035);
}

.site-header .brand,
.site-header .menu-button {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.site-header .menu-button {
  align-items: center;
  gap: 10px;
  padding: 10px 0 10px 12px;
  cursor: pointer;
}

.site-header .menu-button::after {
  content: "";
  width: 18px;
  height: 9px;
  background: linear-gradient(currentColor, currentColor) left top / 18px 1.5px no-repeat,
              linear-gradient(currentColor, currentColor) right bottom / 13px 1.5px no-repeat;
  transition: transform .25s ease;
}

.site-header .menu-button[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.mobile-menu {
  padding: 18px clamp(18px, 3vw, 40px) 28px;
  background: rgba(246, 244, 240, .92);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  backdrop-filter: saturate(160%) blur(24px);
}

/* Module heroes: copy lives inside the image's negative space */
.module-hero.has-image {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(78svh, 820px);
  padding: 110px clamp(18px, 3vw, 40px) clamp(48px, 7vh, 74px);
  overflow: hidden;
  border-radius: 22px;
  isolation: isolate;
  background: #eadbc9;
}

.module-hero-image {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.module-hero.has-image .container {
  display: block;
  width: min(100%, 1180px);
  max-width: none;
  margin: 0 auto;
}

.module-hero.has-image .container > div {
  width: min(48%, 600px);
}

.module-hero.has-image.image-right .container > div {
  margin-left: auto;
}

.module-hero.has-image h1 {
  margin-bottom: 16px;
  font-size: clamp(46px, 5vw, 72px);
}

.module-hero.has-image .lead {
  color: #4f4942;
}

.module-hero.has-image .module-meta span {
  border-color: rgba(29, 27, 23, .22);
  background: rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@media (max-width: 760px) {
  .hero,
  .module-hero.has-image {
    border-radius: 16px;
  }

  .module-hero.has-image {
    min-height: 100svh;
    align-items: flex-end;
    padding: 88px 18px 38px;
  }

  .module-hero.has-image .module-hero-image {
    object-position: 62% center;
  }

  .module-hero.has-image.image-right .module-hero-image {
    object-position: 35% center;
  }

  .module-hero.has-image.image-center .module-hero-image {
    object-position: 52% center;
  }

  .module-hero.has-image .container > div,
  .module-hero.has-image.image-right .container > div {
    width: 100%;
    margin: 0;
  }

  .module-hero.has-image h1 {
    font-size: clamp(40px, 12vw, 56px);
  }

  .module-hero.has-image .lead {
    max-width: 34rem;
    font-size: 16px;
    line-height: 1.5;
  }

  .module-hero.has-image .module-meta {
    margin-top: 18px;
  }
}

/* CGT Apple-style visual system */
body {
  background: #f6f4f0;
  color: #111;
}
.site-header {
  height: 54px;
  background: rgba(246, 244, 240, .78);
  border-bottom: 1px solid rgba(17, 17, 17, .08);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.site-header a { font-weight: 400; }
.site-header .brand { font-weight: 600; }
.hero,
.module-hero.has-image {
  border-radius: 14px;
}
.hero h1 {
  max-width: 760px;
  font-size: clamp(52px, 6.6vw, 86px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.055em;
}
.module-hero.has-image h1 {
  max-width: 650px;
  font-size: clamp(44px, 5vw, 68px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.045em;
}
.module-hero.has-image .lead {
  max-width: 560px;
  font-size: 17px;
  line-height: 1.65;
}
.map-section,
.lesson-block { padding-block: 48px !important; }
.lesson-index { padding-block: 24px !important; }
.lesson-block h2 {
  max-width: 760px;
  margin-bottom: 16px !important;
  font-size: clamp(32px, 4vw, 50px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.04em;
}
.lesson-block .lead {
  max-width: 560px;
  color: #767676;
  font-size: 17px;
  line-height: 1.65;
}
.compact-card,
.simple-table article,
.lesson-links a {
  border-color: #e4e0d8;
  border-radius: 14px;
  box-shadow: none;
}
.compact-card h3,
.simple-table h3 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.025em;
}
.compact-card p,
.simple-table p {
  color: #575757;
  font-size: 15px;
  line-height: 1.65;
}
.map-card h3 { font-weight: 600; }
.module-nav { border-top: 1px solid #e4e0d8; }
.complete-button,
.header-action { border-radius: 100px; }

@media (max-width: 760px) {
  .hero h1 { font-size: clamp(46px, 14vw, 64px); }
  .module-hero.has-image h1 { font-size: clamp(38px, 11vw, 52px); }
  .map-section,
  .lesson-block { padding-block: 36px !important; }
  .lesson-block h2 { font-size: clamp(30px, 9vw, 42px); }
}

/* CGT identity and compact homepage overrides */
.hero-gms-logo { display: none !important; }
.gms-brand img { filter: invert(1); }
.cgt-home-hero { min-height: min(760px, 90vh) !important; }

@media (max-width: 760px) {
  .module-hero.has-image {
    display: flex !important;
    flex-direction: column !important;
    min-height: auto !important;
    padding: 0 !important;
  }
  .module-hero.has-image::before { display: none !important; }
  .module-hero-media {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9;
  }
  .module-hero-image {
    position: relative !important;
    z-index: 0 !important;
    inset: auto !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }
  .module-hero.has-image .container {
    position: relative !important;
    width: 100% !important;
    padding: 26px 20px 30px !important;
    background: #f5ead9;
  }
  .module-hero.has-image h1,
  .module-hero.has-image .lead { color: #111 !important; }
}

/* Desktop hero safe zones — copy supports the scene instead of covering it */
@media (min-width: 761px) {
  body[data-module="persiapan"] .module-hero.has-image .container,
  body[data-module="langkah"] .module-hero.has-image .container,
  body[data-module="takaran"] .module-hero.has-image .container,
  body[data-module="menabur"] .module-hero.has-image .container {
    position: absolute;
    inset: 0;
    width: min(calc(100% - 80px), 1180px);
    height: 100%;
    pointer-events: none;
  }

  body[data-module="persiapan"] .module-hero.has-image .container > div,
  body[data-module="langkah"] .module-hero.has-image .container > div,
  body[data-module="takaran"] .module-hero.has-image .container > div,
  body[data-module="menabur"] .module-hero.has-image .container > div {
    position: absolute;
    width: min(43%, 500px);
    pointer-events: auto;
  }

  body[data-module="persiapan"] .module-hero.has-image .container > div {
    top: 18%;
    left: 0;
  }

  body[data-module="langkah"] .module-hero.has-image .container > div {
    top: 19%;
    left: 0;
  }

  body[data-module="takaran"] .module-hero.has-image .container > div {
    top: 15%;
    left: 16%;
    width: min(38%, 440px);
  }

  body[data-module="menabur"] .module-hero.has-image .container > div {
    top: 10%;
    right: 0;
    left: auto;
    margin-left: 0;
  }

  body[data-module="persiapan"] .module-hero.has-image h1,
  body[data-module="langkah"] .module-hero.has-image h1,
  body[data-module="takaran"] .module-hero.has-image h1,
  body[data-module="menabur"] .module-hero.has-image h1 {
    font-size: clamp(52px, 4.7vw, 68px);
  }
}

/* Apple-calibrated visual scale — published editor values still take priority */
body {
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -.011em;
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -.03em;
}

.hero-copy h1,
.module-hero.has-image h1 {
  max-width: 980px;
  margin-bottom: 16px;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1.02;
}

.lesson-block h2,
.checkpoint h2,
.closing h2 {
  margin-bottom: 16px;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.06;
}

.lead {
  max-width: 560px;
  font-size: clamp(17px, 1.55vw, 21px);
  font-weight: 300;
  line-height: 1.55;
}

.lesson-block p,
.checkpoint p,
.card p,
.phase p,
.steps p {
  max-width: 560px;
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.68;
}

.lesson-block,
.checkpoint,
.closing {
  padding-top: clamp(48px, 6vw, 64px);
  padding-bottom: clamp(48px, 6vw, 64px);
}

.lesson-visual img,
.visual-card img,
.phase img,
.steps li.has-visual > img {
  border-radius: 14px;
}

.lesson-visual img {
  max-height: min(620px, 70vh);
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero-copy h1,
  .module-hero.has-image h1 { font-size: clamp(40px, 12vw, 56px); }
  .lesson-block h2,
  .checkpoint h2,
  .closing h2 { font-size: clamp(32px, 9vw, 44px); }
  .lead { font-size: 17px; }
}

/* Revision: truly invisible navigation until the page moves */
.site-header:not(.scrolled) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.site-header .menu-button {
  overflow: hidden;
  width: 30px;
  padding: 10px 0;
  gap: 0;
  font-size: 0;
  line-height: 0;
}

.site-header .menu-button::after {
  flex: 0 0 20px;
  width: 20px;
  height: 10px;
  margin-left: auto;
  background-size: 20px 1.5px, 14px 1.5px;
}

/* Supporting training visuals */
.lesson-visual,
.visual-grid {
  margin-top: clamp(28px, 4vw, 48px);
}

.split > .lesson-visual,
.split > .visual-grid {
  grid-column: 1 / -1;
}

.lesson-visual img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 620px;
  object-fit: cover;
  border-radius: 18px;
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* Visible course progress */
.training-progress {
  display: grid;
  grid-template-columns: auto minmax(140px, 260px);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.training-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.training-progress-track {
  overflow: hidden;
  height: 5px;
  border-radius: 99px;
  background: #ded9d0;
}

.training-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--night);
  transition: width .35s ease;
}

.map-card.done {
  border-color: rgba(77, 105, 72, .42);
  box-shadow: inset 0 0 0 1px rgba(77, 105, 72, .10);
}

.map-card .status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: #52684d;
  font-size: 12px;
  font-weight: 700;
}

.checkpoint {
  padding: clamp(64px, 8vw, 96px) var(--pad);
  background: #eeebe5;
}

.checkpoint .container {
  max-width: 800px;
}

.checkpoint .scenario {
  margin-top: 24px;
}

@media (min-width: 761px) {
  body[data-module="pembuka"] .module-hero-image,
  body[data-module="posisi"] .module-hero-image,
  body[data-module="langkah"] .module-hero-image,
  body[data-module="takaran"] .module-hero-image {
    object-position: 64% center;
  }

  body[data-module="menabur"] .module-hero-image {
    object-position: 38% center;
  }

  body[data-module="persiapan"] .module-hero-image {
    object-position: 54% center;
  }
}

@media (max-width: 760px) {
  .training-progress {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.visual-card {
  margin: 0;
}

.visual-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
}

.visual-card figcaption {
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.phase img {
  width: calc(100% + 40px);
  max-width: none;
  height: 150px;
  margin: -24px -20px 20px;
  object-fit: cover;
  border-radius: 14px 14px 0 0;
}

.phase h3 {
  margin-top: 22px;
}

.steps li.has-visual {
  grid-template-columns: 92px 42px minmax(0, 1fr) 180px;
}

.steps li.has-visual > img {
  width: 82px;
  height: 82px;
  border-radius: 12px;
  object-fit: cover;
}

@media (max-width: 760px) {
  .visual-grid {
    grid-template-columns: 1fr;
  }

  .visual-card {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 14px;
    align-items: center;
  }

  .visual-card img {
    width: 108px;
    height: 108px;
  }

  .visual-card figcaption {
    padding: 0;
  }

  .steps li.has-visual {
    grid-template-columns: 72px 34px 1fr;
  }

  .steps li.has-visual > img {
    width: 66px;
    height: 66px;
  }

.steps li.has-visual small {
    grid-column: 3;
  }
}

/* Final responsive calibration */
.lesson-block,
.checkpoint,
.closing {
  padding-top: clamp(48px, 6vw, 64px);
  padding-bottom: clamp(48px, 6vw, 64px);
}

.hero-copy h1,
.module-hero.has-image h1 {
  margin-bottom: 16px;
  font-size: clamp(40px, 7vw, 88px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.03em;
}

.lesson-block h2,
.checkpoint h2,
.closing h2 {
  margin-bottom: 16px;
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -.03em;
}

.lesson-block p,
.checkpoint p,
.card p,
.phase p,
.steps p {
  max-width: 560px;
  font-size: clamp(15px, 1.2vw, 17px);
  font-weight: 300;
  line-height: 1.68;
}

.lesson-visual img {
  max-height: min(620px, 70vh);
  border-radius: 14px;
}

@media (max-width: 760px) {
  .hero-copy h1,
  .module-hero.has-image h1 { font-size: clamp(40px, 12vw, 56px); }
  .lesson-block h2,
  .checkpoint h2,
  .closing h2 { font-size: clamp(32px, 9vw, 44px); }
}

/* Published-layout reset calibration — responsive source of truth */
.site-header .brand,
.site-header .menu-button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  margin: 0;
  transform: none;
}

.site-header .brand {
  justify-self: start;
  font-size: 14px;
  line-height: 1;
}

.site-header .menu-button {
  justify-self: end;
  min-width: 30px;
}

.module-hero.has-image {
  min-height: 100svh;
  padding-top: clamp(88px, 10vh, 112px);
  padding-bottom: clamp(48px, 7vh, 64px);
}

.module-hero.has-image .container > div {
  width: min(46%, 590px);
}

.module-hero.has-image h1 {
  max-width: 720px;
  text-wrap: balance;
}

.module-hero.has-image .lead,
.lesson-block .lead,
.checkpoint h2 {
  text-wrap: pretty;
}

.lesson-index {
  padding-top: 48px;
  padding-bottom: 48px;
}

.lesson-index .container {
  grid-template-columns: minmax(150px, 200px) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

.lesson-index .eyebrow {
  margin: 8px 0 0;
}

.lesson-links {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.lesson-links a {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 20px;
}

.lesson-links small {
  line-height: 1.45;
}

body[data-module="pembuka"] { --hero-x-desktop: 70%; --hero-x-mobile: 72%; }
body[data-module="persiapan"] { --hero-x-desktop: 50%; --hero-x-mobile: 50%; }
body[data-module="posisi"] { --hero-x-desktop: 72%; --hero-x-mobile: 76%; }
body[data-module="langkah"] { --hero-x-desktop: 72%; --hero-x-mobile: 78%; }
body[data-module="takaran"] { --hero-x-desktop: 52%; --hero-x-mobile: 54%; }
body[data-module="menabur"] { --hero-x-desktop: 34%; --hero-x-mobile: 38%; }

body[data-module] .module-hero-image {
  object-position: var(--hero-x-desktop, 50%) center;
}

@media (min-width: 761px) {
  .module-hero.has-image h1 {
    font-size: clamp(52px, 4.7vw, 68px);
  }

  .module-hero.has-image .lead {
    font-size: clamp(17px, 1.35vw, 19px);
    line-height: 1.58;
  }
}

.module-hero-media {
  display: contents;
}

@media (max-width: 760px) {
  .site-header .brand,
  .site-header .menu-button {
    min-height: 52px;
  }

  .module-hero.has-image {
    min-height: 100svh;
    padding: 84px 18px 36px;
  }

  body[data-module] .module-hero-image,
  body[data-module] .module-hero.has-image.image-right .module-hero-image,
  body[data-module] .module-hero.has-image.image-center .module-hero-image {
    object-position: var(--hero-x-mobile, 50%) center;
  }

  .module-hero.has-image .container > div,
  .module-hero.has-image.image-right .container > div {
    width: min(100%, 560px);
  }

  .module-hero.has-image h1 {
    max-width: 12ch;
    font-size: clamp(40px, 11vw, 54px);
  }

  .lesson-index {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .lesson-index .container {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .lesson-index .eyebrow {
    margin: 0;
  }

  .lesson-links {
    grid-template-columns: 1fr;
  }

  .lesson-links a {
    min-height: 0;
  }
}

/* Visible hero frame — keep last so responsive base rules cannot override it. */
.hero,
.module-hero.has-image {
  width: calc(100% - 24px);
  min-height: calc(100svh - 24px);
  margin: 12px auto;
  border-radius: 24px;
}

@media (max-width: 760px) {
  .hero,
  .module-hero.has-image {
    width: calc(100% - 12px);
    min-height: calc(100svh - 12px);
    margin: 6px auto;
    border-radius: 18px;
  }
}
