/* =============================================================
   EDWIS · base — page type, header, footer and section scaffolding
   for every Edwis website page. Load after edwis-tokens.css and
   edwis-controls.css (both generated from src/styles/edwis/).
   Scoped under body.ew so the shared v2 design system (app.css,
   loaded by the pinned v2-headlinks include) cannot bleed in.
   ============================================================= */

.ew {
  background: var(--ew-bg);
  color: var(--ew-ink);
  font-family: var(--ew-font);
  font-size: 16px;
  line-height: 1.6;
}

.ew ::selection { background: var(--ew-primary); color: #fff; }
/* app.css hard-sets heading colour to its theme ink; headings here inherit instead. */
.ew :where(h1, h2, h3, h4) { color: inherit; }
.ew [id] { scroll-margin-top: calc(var(--ew-hdr-h) + 20px); }

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

.ew-skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--ew-ink); color: #fff; font-weight: 600;
  transition: top var(--ew-fast) ease;
}
.ew-skip:focus { top: 12px; }

/* ---------- type ---------- */
.ew-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ew-ink-3);
}
.ew-eyebrow--on-dark { color: #B9C4E4; }

.ew-display {
  font-size: clamp(38px, 4.2vw, 60px);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.035em;
  color: var(--ew-ink);
  text-wrap: balance;
}
.ew-dot { color: var(--ew-primary); }

.ew-h2 {
  font-size: clamp(28px, 2.7vw, 40px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.ew-lede {
  font-size: clamp(16.5px, 1.15vw, 18px);
  line-height: 1.7;
  color: var(--ew-ink-2);
  max-width: 34em;
}

/* =============================================================
   HEADER
   ============================================================= */
.ew-hdr {
  position: sticky; top: 0; z-index: 60;
  background: rgba(246, 248, 253, .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ew-dur) ease, box-shadow var(--ew-dur) ease, background var(--ew-dur) ease;
}
.ew-hdr.scrolled { border-bottom-color: var(--ew-line); box-shadow: 0 8px 24px -18px rgba(11, 21, 51, .35); background: rgba(255, 255, 255, .9); }

.ew-hdr-in {
  display: flex; align-items: center; gap: 28px;
  height: var(--ew-hdr-h);
  max-width: calc(var(--ew-wrap) + var(--ew-pad) * 2);
  margin-inline: auto; padding-inline: var(--ew-pad);
}

.ew-nav { display: flex; align-items: center; gap: 6px; margin-left: 32px; }
.ew-nav-link,
.ew .ew-dd-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 12px;
  border-radius: 8px;
  font-size: 14.5px; font-weight: 500; color: var(--ew-ink-2);
  transition: background var(--ew-fast) ease, color var(--ew-fast) ease;
}
.ew-nav-link:hover,
.ew .ew-dd-trigger:hover,
.ew .ew-dd.open .ew-dd-trigger,
.ew .ew-dd.hovering .ew-dd-trigger { color: var(--ew-ink); background: rgba(11, 21, 51, .05); }

.ew-chev { width: 16px; height: 16px; transition: transform var(--ew-dur) var(--ew-ease); }
.ew-dd.open .ew-chev, .ew-dd.hovering .ew-chev, .ew-dd:focus-within .ew-chev { transform: rotate(180deg); }

.ew-dd { position: relative; }
.ew-dd-panel {
  position: absolute; top: calc(100% + 12px); left: 50%;
  min-width: 380px;
  padding: 10px;
  background: var(--ew-surface);
  border: 1px solid var(--ew-line);
  border-radius: 20px;
  box-shadow: var(--ew-shadow-3);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, -6px);
  transition: opacity 180ms ease, transform 220ms var(--ew-ease);
}
.ew-dd-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.ew-dd-panel--wide { width: 680px; left: -12px; transform: translate(0, -6px); }
.ew-dd.hovering .ew-dd-panel,
.ew-dd.open .ew-dd-panel,
.ew-dd:focus-within .ew-dd-panel { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.ew-dd.hovering .ew-dd-panel--wide,
.ew-dd.open .ew-dd-panel--wide,
.ew-dd:focus-within .ew-dd-panel--wide { transform: none; }

.ew-dd-product { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; }
.ew-dd-list { display: grid; gap: 2px; }
.ew-dd-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 12px; border-radius: 14px;
  transition: background var(--ew-fast) ease;
}
.ew-dd-item:hover { background: var(--ew-tint); }
.ew-dd-ic {
  display: grid; place-items: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 12px;
}
.ew-dd-ic svg { width: 20px; height: 20px; }
.ew-dd-name { display: block; font-size: 15px; font-weight: 700; color: var(--ew-ink); }
.ew-dd-desc { display: block; font-size: 13.5px; color: var(--ew-ink-3); line-height: 1.45; }

.ew-tone-recruit  { background: var(--ew-recruit-soft);  color: var(--ew-recruit-ink); }
.ew-tone-enroll   { background: var(--ew-enroll-soft);   color: var(--ew-enroll-ink); }
.ew-tone-operate  { background: var(--ew-operate-soft);  color: var(--ew-operate-ink); }
.ew-tone-graduate { background: var(--ew-graduate-soft); color: var(--ew-graduate-ink); }

.ew-dd-feature {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px; border-radius: 16px;
  background: linear-gradient(160deg, #F1F5FF 0%, #F4EFFF 100%);
  transition: transform var(--ew-dur) var(--ew-ease);
}
.ew-dd-feature:hover { transform: translateY(-2px); }
.ew-dd-feature img { width: 40px; height: 40px; margin-bottom: 6px; }
.ew-dd-feature-h { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.ew-dd-feature-p { font-size: 13.5px; color: var(--ew-ink-2); line-height: 1.5; }
.ew-dd-feature-cta { margin-top: auto; font-size: 14px; font-weight: 700; color: var(--ew-primary); }

.ew-dd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px; }
.ew-dd-cols--one { grid-template-columns: 1fr; }
.ew-dd-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ew-ink-3); padding: 8px 12px 6px;
}
.ew-dd-link {
  display: block; padding: 10px 12px; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--ew-ink-2);
  transition: background var(--ew-fast) ease, color var(--ew-fast) ease;
}
.ew-dd-link:hover { background: var(--ew-tint); color: var(--ew-ink); }
.ew-dd-all {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 6px 0; padding: 12px; border-top: 1px solid var(--ew-line);
  font-size: 14px; font-weight: 700; color: var(--ew-primary);
}
.ew-dd-all:hover { color: var(--ew-primary-hover); }

.ew-hdr-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.ew-toggle {
  display: none; place-items: center;
  width: 48px; height: 48px; margin-left: auto;
  border-radius: 12px; background: transparent; border: 0; cursor: pointer;
}
.ew-burger, .ew-burger::before, .ew-burger::after {
  display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--ew-ink);
  transition: transform var(--ew-dur) var(--ew-ease), background var(--ew-fast) ease;
}
.ew-burger { position: relative; }
.ew-burger::before, .ew-burger::after { content: ""; position: absolute; left: 0; }
.ew-burger::before { top: -7px; }
.ew-burger::after { top: 7px; }
.ew-hdr.menu-open .ew-burger { background: transparent; }
.ew-hdr.menu-open .ew-burger::before { transform: translateY(7px) rotate(45deg); }
.ew-hdr.menu-open .ew-burger::after { transform: translateY(-7px) rotate(-45deg); }

.ew-mobile {
  position: absolute; top: 100%; left: 0; right: 0;
  display: flex; flex-direction: column;
  padding: 8px var(--ew-pad) calc(24px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--ew-line);
  box-shadow: var(--ew-shadow-3);
  overflow-y: auto; overscroll-behavior: contain;
}
.ew-mobile[hidden] { display: none; }
.ew-mobile a:not(.ew-btn) {
  display: flex; align-items: center; min-height: 48px; padding: 0 4px;
  font-size: 17px; font-weight: 600; border-bottom: 1px solid var(--ew-line);
}
.ew-mobile .ew-dd-label { padding: 18px 4px 4px; }
.ew-mobile-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }

@media (max-width: 980px) {
  .ew-nav, .ew-hdr-actions { display: none; }
  .ew-toggle { display: grid; }
}
@media (min-width: 981px) {
  .ew-mobile { display: none !important; }
}

/* =============================================================
   SECTIONS
   ============================================================= */
.ew-section { position: relative; padding: clamp(88px, 11vw, 160px) 0; }
.ew-section--tint { background: linear-gradient(180deg, var(--ew-tint) 0%, var(--ew-bg) 100%); }

.ew-sec-head { display: flex; flex-direction: column; gap: 16px; max-width: 640px; margin-bottom: clamp(44px, 5vw, 72px); }
.ew-sec-head--center { align-items: center; text-align: center; margin-inline: auto; }
.ew-sec-sub { font-size: 17px; line-height: 1.7; color: var(--ew-ink-3); max-width: 36em; }

.ew .reveal[data-d="1"] { transition-delay: 90ms; }
.ew .reveal[data-d="2"] { transition-delay: 180ms; }

@keyframes ew-fade-up {
  from { opacity: 0; transform: translateY(12px); }
}

.ew-link-arrow {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-size: 15.5px; font-weight: 700; color: var(--ew-primary);
}

/* =============================================================
   FOOTER
   ============================================================= */
.ew-ft { position: relative; overflow: hidden; padding: clamp(56px, 8vw, 104px) 0 32px; background: #081030; color: #C7D0EA; }
.ew-ft::before {
  content: ""; position: absolute; left: -10%; right: -10%; top: -260px; height: 620px; pointer-events: none;
  background:
    radial-gradient(circle at 20% 50%, rgba(20, 97, 234, .38), transparent 45%),
    radial-gradient(circle at 50% 42%, rgba(6, 160, 150, .26), transparent 40%),
    radial-gradient(circle at 80% 50%, rgba(91, 50, 230, .38), transparent 45%);
  filter: blur(24px);
}
.ew-ft :where(a, button):focus-visible { outline-color: #fff; }
.ew-ft-cta {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px;
  padding: clamp(24px, 4vw, 56px);
  margin-bottom: clamp(64px, 8vw, 104px);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .12);
}
.ew-ft-cta-copy { max-width: 640px; }
.ew-ft-cta .ew-h2 { color: #fff; margin: 14px 0 12px; }
.ew-ft-cta-sub { font-size: 16.5px; line-height: 1.7; color: #AEB9D8; }
.ew-ft-cta-acts { display: flex; flex-wrap: wrap; gap: 12px; }
.ew-ft-grid { position: relative; display: grid; grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); gap: 32px; }
.ew-ft-brand p { margin: 16px 0; max-width: 28em; font-size: 15px; }
.ew-ft-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.ew-ft-trust li { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); font-size: 12.5px; font-weight: 600; color: #E2E8F8; }
.ew-ft-col { display: flex; flex-direction: column; }
.ew-ft-h { margin-bottom: 8px; font-size: 14px; font-weight: 800; color: #fff; }
.ew-ft-col a { display: flex; align-items: center; min-height: 36px; font-size: 14.5px; color: #AEB9D8; transition: color var(--ew-fast) ease; }
.ew-ft-col a:hover { color: #fff; }
.ew-ft-bar {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 13.5px; color: #A9B4D3;
}
.ew-ft-legal { display: flex; gap: 20px; }
.ew-ft-legal a:hover { color: #fff; }

@media (max-width: 1099px) {
  .ew-ft-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ew-ft-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .ew-ft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .ew *, .ew *::before, .ew *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}
