/* =========================================================
   NARI — internal.css (WORLD B ONLY)
   Behaviour:
   - Header + footer FLOAT over content (always visible)
   - Scrollable content starts BELOW header
   - Scrollable content ends ABOVE footer
   - ONLY the middle region scrolls (no body scroll)
   - Do not change header/footer button layout/positions
   ========================================================= */

html, body { height: 100%; }

body.nari-page{
  margin: 0;
  padding: 0;
  background: #f6f7f9;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: rgba(15,23,42,.88);
  overflow: hidden;

  display: block;
  align-items: initial;
  justify-content: initial;
  min-height: 100%;

  --header-h: 96px;
  --footer-h: 74px;
  --page-gutter: 12px;
}

/* If device supports safe areas, the bars effectively get taller */
@supports (padding: max(0px)){
  body.nari-page{
    --header-h: calc(96px + env(safe-area-inset-top, 0px));
    --footer-h: calc(74px + env(safe-area-inset-bottom, 0px));
  }
}

/* Stage: fixed viewport container */
body.nari-page .stage{
  width: 100%;
  max-width: 100%;
  margin: 0;
  position: relative;
  background: #f6f7f9;
  overflow: hidden;

  height: 100vh;
  height: 100svh;
  height: 100dvh;
}

/* Optional desktop frame */
@media (min-width: 1000px){
  body.nari-page .stage{
    max-width: 460px;
    margin: 0 auto;
  }
}

/* ---------------------------------------------------------
   FLOATING HEADER / FOOTER (overlay)
   --------------------------------------------------------- */
body.nari-page .top-row{
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;

  background: rgba(246,247,249,.96);
  border-bottom: 1px solid rgba(15,23,42,.08);
}

body.nari-page .footer-row{
  position: absolute !important;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;

  background: rgba(246,247,249,.96);
  border-top: 1px solid rgba(15,23,42,.08);
}

/* Fix: footer copyright must be readable on light background */
body.nari-page .footer-copy{
  color: rgba(15,23,42,.58);
}

/* ---------------------------------------------------------
   Shared scroll window
   --------------------------------------------------------- */
body.nari-page .page-scroll{
  position: absolute;
  top: var(--header-h);
  bottom: var(--footer-h);
  left: var(--page-gutter);
  right: var(--page-gutter);

  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;

  padding: 0 0 12px;
  min-height: 0;
  box-sizing: border-box;
}

/* ---------------------------------------------------------
   IMPORTANT FIX:
   Direct-card pages like handoff.html must also sit inside
   the protected content window with equal left/right gutters.
   --------------------------------------------------------- */
body.nari-page .stage > .card{
  position: absolute;
  top: var(--header-h);
  bottom: var(--footer-h);
  left: var(--page-gutter);
  right: var(--page-gutter);

  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;

  margin: 0;
  width: auto;
  max-width: none;
}

/* Content block */
body.nari-page .card{
  box-sizing: border-box;

  margin: 0;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 22px;
  box-shadow: 0 18px 46px rgba(0,0,0,.08);

  background: rgba(255,255,255,.92);
  padding: 18px 18px 20px;

  overflow: hidden;
}

/* Optional premium rounding only on true desktop frames */
@media (min-width: 1000px){
  body.nari-page .card{
    border-radius: 24px;
  }
}

/* Prevent media from forcing horizontal scroll */
body.nari-page .card img,
body.nari-page .card video,
body.nari-page .card svg{
  max-width: 100%;
  height: auto;
  display: block;
}

/* Typography */
body.nari-page .h1{
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.20;
  font-weight: 650;
  color: rgba(15,23,42,.94);
  letter-spacing: 0.01em;
}

body.nari-page .p{
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.62;
  color: rgba(15,23,42,.78);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------------------------------------------------------
   SECTION HEADINGS
   --------------------------------------------------------- */
body.nari-page{
  --nari-section-heading-size: 19px;
  --nari-section-heading-line: 1.20;
  --nari-section-heading-weight: 650;
  --nari-section-heading-color: rgba(15,23,42,.94);
}

body.nari-page .card h2,
body.nari-page .card h3{
  margin: 18px 0 10px;
  font-size: var(--nari-section-heading-size);
  line-height: var(--nari-section-heading-line);
  font-weight: var(--nari-section-heading-weight);
  color: var(--nari-section-heading-color);
  letter-spacing: 0.01em;
}

body.nari-page .card h2:first-of-type{
  margin-top: 12px;
}

/* Lists */
body.nari-page .card ul{
  margin: 10px 0 12px 18px;
  padding: 0;
  color: rgba(15,23,42,.78);
}

body.nari-page .card li{
  margin: 0 0 8px;
  line-height: 1.55;
}

/* Fine print */
body.nari-page .fine{
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(15,23,42,.58);
}

/* Buttons / rows used on internal pages */
body.nari-page .btn-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

body.nari-page .btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  max-width: 100%;
  text-align: center;

  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.88);
  color: rgba(15,23,42,.88);

  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;

  padding: 14px 18px;
  min-height: 56px;

  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);

  box-sizing: border-box;

  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.nari-page .btn:active{
  transform: scale(.99);
}

body.nari-page .btn-hero{
  background: rgba(244,212,79,.92);
  border-color: rgba(244,212,79,.92);
  color: rgba(15,23,42,.92);
}

body.nari-page .btn-ghost{
  background: rgba(255,255,255,.85);
  color: rgba(15,23,42,.90);
  border-color: rgba(15,23,42,.16);
}

/* Narrow mobile: stack the paired buttons earlier so they feel calmer */
@media (max-width: 430px){
  body.nari-page .btn-row{
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.nari-page .btn{
    min-height: 54px;
  }
}

/* ---------------------------------------------------------
   Legal footer line
   --------------------------------------------------------- */
body.nari-page .footer-copy{
  white-space: normal;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: calc(100% - 170px);
  line-height: 1.15;
}

body.nari-page .footer-legal{
  opacity: .78;
  display: block;
  font-size: 0.60rem;
  line-height: 1.05;
  margin-top: 2px;
}