/* Octi Flow shared design system */

:root {
  --deep: #073080;
  --blue: #015cc6;
  --pale: #eaf6fb;
  --ink: #19212b;
  --soft: #657080;
  --line: #b9dce8;
  --white: #fff;

  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 48px;
  --s6: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 8px;
}

.container {
  max-width: 1060px;
  margin-inline: auto;
  padding-inline: 24px;
}

/* Header */

nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(90deg, var(--deep), var(--blue));
  box-shadow: 0 10px 24px -8px rgba(7, 48, 128, 0.62);
}

.nav-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  height: 46px;
}

.brand-logo {
  display: block;
  width: 108px;
  height: 40px;
  max-width: 100%;
  object-fit: contain;
  vertical-align: middle;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  color: #fff !important;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  opacity: 1;
}

.back-arrow {
  display: block;
  flex: none;
  width: 14px;
  height: 14px;
}

.back-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-back:hover {
  transform: translateX(-2px);
}

/* Hero */

.hero {
  overflow: visible;
  padding: clamp(72px, 11vw, 128px) 0 72px;
  background: linear-gradient(180deg, var(--pale), #fff 78%);
  text-align: center;
}

.hero h1 {
  max-width: 760px;
  margin-inline: auto;
  padding-bottom: 0.08em;
  background: linear-gradient(90deg, var(--deep) 0%, var(--blue) 52%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-size: clamp(2.35rem, 6vw, 4.4rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.hero p {
  max-width: 580px;
  margin: var(--s3) auto 0;
  color: var(--soft);
  font-size: 1.08rem;
  text-wrap: balance;
}

/* Main layout */

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: var(--s6);
  padding-block: var(--s6);
}

/* Table of contents */

.toc {
  position: sticky;
  top: 92px;
  height: max-content;
}

.toc-disclosure {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.toc-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 var(--s2);
  cursor: pointer;
  list-style: none;
  color: var(--deep);
  font-size: 0.84rem;
  font-weight: 700;
}

.toc-disclosure summary::-webkit-details-marker {
  display: none;
}

.toc-disclosure summary::after {
  content: "+";
  color: var(--blue);
  font-size: 1.15rem;
  font-weight: 400;
}

.toc-disclosure[open] summary {
  border-bottom: 1px solid var(--line);
}

.toc-disclosure[open] summary::after {
  content: "−";
}

/* Desktop: one item per full-width row */
.toc-menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  gap: 0;
}

.toc-menu a {
  display: grid;
  place-items: center start;
  width: 100%;
  min-height: 38px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.78rem;
  line-height: 1.25;
}

.toc-menu a:last-child {
  border-bottom: 0;
}

/* Policy text */

.policy {
  min-width: 0;
}

.policy section {
  padding-block: var(--s4);
  border-bottom: 1px solid #e7eef2;
}

.policy section:first-child {
  padding-top: 0;
}

.policy h2 {
  color: var(--deep);
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.policy p {
  margin-top: 12px;
  color: #475b6b;
}

.policy ul {
  margin: 12px 0 0;
  padding-left: 20px;
  color: #475b6b;
}

.policy li + li {
  margin-top: 8px;
}

.document-status {
  display: inline-flex;
  margin-top: var(--s4);
  padding: 6px 10px;
  border-radius: 100px;
  background: #edf8fc;
  color: var(--deep);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Contact */

.contact-card {
  display: flex;
  justify-content: center;
  padding: var(--s4);
  border-radius: 24px;
  background: linear-gradient(135deg, var(--deep), var(--blue));
  box-shadow: 0 22px 40px -17px rgba(7, 48, 128, 0.58);
  color: #fff;
  text-align: center;
}

.contact-card p {
  margin-inline: auto;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
}

.contact-card p a {
  color: inherit;
  text-decoration: none;
}

.contact-card p a:hover {
  opacity: 0.9;
}

/* Footer */

footer {
  border-top: 1px solid #e7eef2;
  background: #f8fbfc;
}

.apple-footer {
  padding-block: var(--s4);
}

.apple-footer-legal {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
  color: var(--soft);
  font-size: 0.78rem;
}

.apple-footer-links {
  display: flex;
  gap: var(--s2);
}

.apple-footer-links a:hover {
  color: var(--deep);
}

/* Reveal animation */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Mobile */

@media (max-width: 820px) {
  .container {
    padding-inline: 16px;
  }

  .nav-inner {
    height: 62px;
  }

  .brand-logo {
    width: 96px;
    height: 36px;
  }

  .hero {
    padding: var(--s5) 0;
  }

  .hero p {
    font-size: 1rem;
  }

  .layout {
    display: block;
    padding-block: var(--s4);
  }

  .toc {
    position: static;
    margin-bottom: var(--s4);
  }

  /* Exactly 13 identical 38px rows */
  .toc-menu {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: repeat(13, 38px) !important;
    grid-auto-rows: 38px !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
  }

  .toc-menu > a {
    display: grid !important;
    place-items: center start !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 38px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    color: var(--soft);
    font-size: 0.8rem;
    line-height: 1.2 !important;
  }

  .toc-menu > a:not(:last-child) {
    border-bottom: 1px solid var(--line) !important;
  }

  .policy section {
    padding-block: var(--s3);
  }

  .contact-card {
    padding: var(--s3);
  }

  .apple-footer-legal {
    display: block;
  }

  .apple-footer-links {
    flex-wrap: wrap;
    margin-top: var(--s2);
  }
}

/* Browser fallback */

@supports not (background-clip: text) {
  .hero h1 {
    background: none;
    color: var(--deep);
    -webkit-text-fill-color: var(--deep);
  }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
/* Final status and contact layout */

.policy > .document-status {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin: var(--s4) 0 var(--s4) auto;
  padding: 9px 14px;
  border: 1px solid #dce7ed;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 16px -12px rgba(7, 48, 128, 0.45);
  color: var(--soft);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.policy > .document-status::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--blue);
}

.policy > #contact {
  padding: 0 0 var(--s3);
  border-bottom: 0;
}

.policy > #contact h2 {
  margin: 0 0 16px;
}

.policy > #contact .contact-card {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  text-align: center;
}

.policy > #contact .contact-card p {
  width: 100%;
  margin: 0;
  text-align: center;
}

/* Contact page */

.contact-page {
  max-width: 760px;
  padding-top: var(--s3);
  padding-bottom: var(--s6);
}

.contact-directory {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
}

.contact-directory-item {
  padding: var(--s4);
}

.contact-directory-item + .contact-directory-item {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.contact-directory-item h2 {
  margin: 0;
}

.contact-directory-item p {
  margin: 8px 0 12px;
}

.contact-directory-item a {
  display: inline-block;
}

@media (max-width: 820px) {
  .contact-page {
    padding-top: var(--s2);
    padding-bottom: var(--s4);
  }

  .contact-directory-item {
    padding: var(--s3);
  }
}
