/* eTuition header. Mobile first. Prefix: hd- */

html { scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html.hd-lock { overflow: hidden; }

.hd-skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .7rem 1.1rem; border-radius: 999px;
  background: #0E3B22; color: #fff; font-weight: 800; text-decoration: none; transition: top .25s ease;
}
.hd-skip:focus { top: .8rem; }

/* ---------- Announcement bar ---------- */
.hd-bar {
  position: relative; z-index: 61; display: flex; align-items: center; justify-content: center;
  height: 2.1rem; padding: 0 2.6rem; overflow: hidden; background: #06281A; color: #fff;
  font-size: .74rem; font-weight: 700; transition: height .45s cubic-bezier(.2,.8,.2,1), opacity .3s ease;
}
.hd-bar.gone { height: 0; opacity: 0; }
.hd-bar-track { position: relative; flex: 1; height: 100%; max-width: 34rem; }
.hd-msg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .5rem; margin: 0;
  white-space: nowrap; opacity: 0; transform: translateY(100%);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1);
}
.hd-msg.on { opacity: 1; transform: none; }
.hd-msg.out { opacity: 0; transform: translateY(-100%); }
.hd-live { width: .5rem; height: .5rem; border-radius: 50%; background: #3DCB7A; animation: hdPing 1.8s ease-out infinite; }
.hd-bar-x {
  position: absolute; right: .5rem; top: 50%; width: 1.8rem; height: 1.8rem; margin-top: -.9rem; padding: 0;
  border: 0; border-radius: 50%; background: none; color: rgba(255,255,255,.75); font-size: 1.2rem; line-height: 1; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.hd-bar-x:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- Header shell ---------- */
.hd {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid transparent;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease, border-color .3s ease;
}
.hd.scrolled { border-bottom-color: #E3EEE7; box-shadow: 0 12px 30px -22px rgba(6,40,26,.55); }
.hd.hide { transform: translateY(-102%); }
.hd-in { display: flex; align-items: center; gap: 1rem; max-width: 1240px; margin: 0 auto; padding: .5rem 1rem; transition: padding .3s ease; }
.hd.scrolled .hd-in { padding-block: .35rem; }
.hd-logo { display: block; flex: none; line-height: 0; }
.hd-logo img { display: block; height: 1.9rem; width: auto; transition: height .3s ease, transform .35s cubic-bezier(.2,.8,.2,1); }
.hd.scrolled .hd-logo img { height: 1.75rem; }
.hd-logo:hover img { transform: scale(1.05) rotate(-1.5deg); }
.hd-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; transform-origin: left; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, #1FAA59, #F43F54); pointer-events: none;
}

/* ---------- Desktop links ---------- */
.hd-links { display: none; position: relative; align-items: center; gap: .1rem; flex: 1; justify-content: center; }
.hd-pill {
  position: absolute; top: 50%; left: 0; width: 0; height: 2.6rem; margin-top: -1.3rem; border-radius: 999px;
  background: #E9F8EF; opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), width .45s cubic-bezier(.2,.8,.2,1), opacity .25s ease;
}
.hd-link {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .3rem; padding: .65rem .95rem; border: 0; border-radius: 999px;
  background: none; color: #2D4A3A; font: inherit; font-size: .94rem; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: color .25s ease;
}
.hd-link:hover, .hd-link:focus-visible { color: #0E3B22; }
.hd-link.on { color: #127A3E; }
.chev { width: .85rem; height: .85rem; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.hd-dd-wrap.open .chev { transform: rotate(180deg); }

/* Dropdown */
.hd-dd-wrap { position: relative; }
.hd-dd {
  position: absolute; top: calc(100% + .75rem); left: 50%; width: 22rem; padding: .5rem;
  background: #fff; border: 1px solid #E3EEE7; border-radius: 1.2rem; box-shadow: 0 26px 50px -24px rgba(6,40,26,.55);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 10px) scale(.97); transform-origin: top center;
  transition: opacity .25s ease, transform .35s cubic-bezier(.2,.8,.2,1), visibility 0s linear .35s;
}
.hd-dd::before { content: ""; position: absolute; left: 0; right: 0; top: -.9rem; height: .9rem; } /* hover bridge */
.hd-dd::after { content: ""; position: absolute; top: -.4rem; left: 50%; width: .8rem; height: .8rem; margin-left: -.4rem; background: #fff; border-left: 1px solid #E3EEE7; border-top: 1px solid #E3EEE7; transform: rotate(45deg); }
.hd-dd-wrap.open .hd-dd { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0) scale(1); transition-delay: 0s; }
.hd-dd-label { margin: .4rem .7rem .3rem; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #5B6B62; }
.hd-item { position: relative; display: flex; align-items: center; gap: .8rem; padding: .7rem; border-radius: .9rem; color: #0E3B22; text-decoration: none; transition: background .2s ease; }
.hd-item .ic, .hd-m-card .ic {
  flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .8rem; background: #E9F8EF; color: #1FAA59;
  transition: background .25s ease, color .25s ease, transform .3s cubic-bezier(.2,.8,.2,1);
}
.hd-item .ic svg, .hd-m-card .ic svg { width: 1.25rem; height: 1.25rem; }
.hd-item .tx { flex: 1; min-width: 0; }
.hd-item b, .hd-m-card b { display: block; font-size: .95rem; line-height: 1.2; }
.hd-item small, .hd-m-card small { display: block; font-size: .8rem; color: #5B6B62; }
.hd-item > svg { width: 1rem; height: 1rem; color: #1FAA59; opacity: 0; transform: translateX(-6px); transition: opacity .25s ease, transform .3s cubic-bezier(.2,.8,.2,1); }
.hd-item:hover, .hd-item:focus-visible, .hd-item.on { background: #F3FAF6; }
.hd-item:hover .ic, .hd-item:focus-visible .ic { background: #1FAA59; color: #fff; transform: rotate(-6deg) scale(1.06); }
.hd-item:hover > svg, .hd-item:focus-visible > svg { opacity: 1; transform: none; }

/* ---------- Right side ---------- */
.hd-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.hd-text, .hd-acct { display: none; }
.hd-text { position: relative; padding: .5rem .3rem; color: #5B6B62; font-size: .9rem; font-weight: 700; text-decoration: none; transition: color .2s ease; }
.hd-text::after { content: ""; position: absolute; left: .3rem; right: .3rem; bottom: .25rem; height: 2px; border-radius: 2px; background: #1FAA59; transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.hd-text:hover { color: #0E3B22; }
.hd-text:hover::after { transform: scaleX(1); }
.hd-acct {
  align-items: center; gap: .5rem; padding: .55rem 1rem .55rem .75rem; border: 1.5px solid #CFE8D8; border-radius: 999px;
  color: #0E3B22; font-size: .9rem; font-weight: 800; text-decoration: none; white-space: nowrap;
  transition: background .25s ease, border-color .25s ease, transform .25s cubic-bezier(.2,.8,.2,1);
}
.hd-acct svg { width: 1.05rem; height: 1.05rem; color: #1FAA59; }
.hd-acct .av { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #1FAA59; color: #fff; font-size: .8rem; }
.hd-acct:hover { background: #F3FAF6; border-color: #1FAA59; transform: translateY(-1px); }
.hd-acct.on { border-color: #1FAA59; background: #E9F8EF; }

.hd-cta {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .95rem; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #F7596C, #F43F54 55%, #E02C44); color: #fff; font: inherit; font-size: .84rem; font-weight: 800; white-space: nowrap; cursor: pointer;
  box-shadow: 0 10px 22px -10px rgba(244,63,84,.85); transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease;
}
.hd-cta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); transform: translateX(-120%); pointer-events: none; }
.hd-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -12px rgba(244,63,84,.9); }
.hd-cta:hover::after { transform: translateX(120%); transition: transform .8s ease; }
.hd-cta:active { transform: scale(.96); }
.hd-cta svg { width: .95rem; height: .95rem; transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.hd-cta:hover svg { transform: translateX(3px); }
.hd-cta .full { display: none; }
@media (min-width: 480px) { .hd-cta .full { display: inline; } .hd-cta .short { display: none; } }

/* Burger */
.hd-burger {
  display: grid; place-content: center; gap: .26rem; width: 2.5rem; height: 2.5rem; padding: 0; border: 0; border-radius: 50%;
  background: #E9F8EF; cursor: pointer; transition: background .25s ease, transform .2s ease;
}
.hd-burger:active { transform: scale(.92); }
.hd-burger span { display: block; width: 1.1rem; height: 2px; border-radius: 2px; background: #0E3B22; transition: transform .4s cubic-bezier(.2,.8,.2,1), opacity .2s ease, width .3s ease; }
.hd-burger span:nth-child(2) { width: .78rem; margin-left: auto; }
.hd-burger.open { background: #fff; }
.hd-burger.open span:nth-child(1) { transform: translateY(.38rem) rotate(45deg); }
.hd-burger.open span:nth-child(2) { opacity: 0; }
.hd-burger.open span:nth-child(3) { transform: translateY(-.38rem) rotate(-45deg); }

.hd-link:focus-visible, .hd-item:focus-visible, .hd-acct:focus-visible, .hd-cta:focus-visible, .hd-burger:focus-visible,
.hd-text:focus-visible, .hd-logo:focus-visible, .hd-bar-x:focus-visible, .hd-m-link:focus-visible, .hd-m-card:focus-visible,
.hd-m-acct a:focus-visible, .hd-m-cta:focus-visible { outline: 3px solid #FFC93C; outline-offset: 2px; }

/* ---------- Mobile menu: circular reveal from the burger ---------- */
.hd-menu {
  position: fixed; inset: 0; z-index: 55; overflow-y: auto; visibility: hidden; color: #fff;
  padding: calc(var(--hd-b, 4rem) + .9rem) 1.1rem 2rem;
  background: radial-gradient(circle at 88% 6%, #1B9150 0, transparent 46%), linear-gradient(170deg, #0E5A31, #06281A 72%);
  clip-path: circle(0px at var(--cx, calc(100% - 2rem)) var(--cy, 2rem));
  transition: clip-path .75s cubic-bezier(.7,0,.2,1), visibility 0s linear .75s;
}
.hd-menu.open { visibility: visible; clip-path: circle(170vmax at var(--cx, calc(100% - 2rem)) var(--cy, 2rem)); transition-delay: 0s; }
.hd-menu-in { max-width: 34rem; margin: 0 auto; }
.hd-m-item { opacity: 0; transform: translateY(22px); transition: opacity .3s ease, transform .3s ease; }
.hd-menu.open .hd-m-item { opacity: 1; transform: none; transition: opacity .55s ease, transform .65s cubic-bezier(.2,.8,.2,1); transition-delay: calc(.3s + var(--i, 0) * .06s); }
.hd-m-label { margin: 0 0 .55rem; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #7BE0A6; }
.hd-m-free { display: grid; gap: .5rem; margin-bottom: 1.2rem; }
.hd-m-card { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; border-radius: 1rem; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.hd-m-card .ic { width: 2.2rem; height: 2.2rem; background: rgba(255,255,255,.16); color: #fff; }
.hd-m-card .ic svg { width: 1.1rem; height: 1.1rem; }
.hd-m-card b { font-size: .9rem; }
.hd-m-card small { font-size: .74rem; color: rgba(255,255,255,.75); }
.hd-m-card:active, .hd-m-card.on { background: rgba(255,255,255,.18); }
.hd-m-acct { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.1rem; }
.hd-m-acct a { padding: .5rem .85rem; border: 1.5px solid rgba(255,255,255,.35); border-radius: 999px; color: #fff; font-size: .82rem; font-weight: 700; text-decoration: none; }
.hd-m-acct a:first-child { background: #fff; border-color: #fff; color: #0E3B22; }
.hd-m-cta {
  display: flex; align-items: center; justify-content: center; gap: .55rem; width: 100%; padding: .9rem 1.1rem; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, #F7596C, #F43F54 55%, #E02C44); color: #fff; font: inherit; font-size: .95rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 16px 30px -14px rgba(244,63,84,.9);
}
.hd-m-cta svg { width: 1rem; height: 1rem; }
.hd-m-foot { margin: .9rem 0 0; text-align: center; font-size: .75rem; color: rgba(255,255,255,.7); }

/* ---------- Desktop ---------- */
@media (min-width: 1100px) {
  .hd-in { padding: .6rem 1.5rem; gap: 1.4rem; }
  .hd.scrolled .hd-in { padding-block: .4rem; }
  .hd-logo img { height: 2.6rem; }
  .hd.scrolled .hd-logo img { height: 2.2rem; }
  .hd-links { display: flex; }
  .hd-text { display: inline-block; }
  .hd-acct { display: inline-flex; }
  .hd-cta { padding: .7rem 1.1rem; font-size: .92rem; gap: .5rem; }
  .hd-cta svg { width: 1rem; height: 1rem; }
  .hd-right { gap: .55rem; }
  .hd-burger { display: none; }
  .hd-menu { display: none; }
}

@keyframes hdPing { 0% { box-shadow: 0 0 0 0 rgba(61,203,122,.7); } 100% { box-shadow: 0 0 0 .5rem rgba(61,203,122,0); } }

@media (prefers-reduced-motion: reduce) {
  .hd, .hd-in, .hd-logo img, .hd-pill, .hd-dd, .hd-burger span, .hd-menu, .hd-m-item, .hd-cta, .hd-acct, .hd-item, .hd-bar, .hd-msg { transition: none !important; }
  .hd-live { animation: none; }
  .hd-menu.open .hd-m-item { transition: none; }
}

.hd.hide { transform: none !important; }