/* ==========================================================================
   Lilo and Stitch | Official
   Font: IBM Plex Sans (local, /public/fonts)
   ========================================================================== */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallback so the swap does not shift layout */
@font-face {
  font-family: "IBM Plex Sans Fallback";
  src: local("Arial"), local("Helvetica");
  size-adjust: 102%;
}

/* Keep the hidden attribute authoritative (author display rules such as .post-card would otherwise override it) */
[hidden] {
  display: none !important;
}

/* ---------- Design tokens ---------- */
:root {
  --ink: #0d2328;
  --ink-soft: #35515a;
  --bg: #f4f9f9;
  --surface: #ffffff;
  --surface-alt: #e9f4f4;
  --line: #cfe0e2;

  --ocean-900: #06343a;
  --ocean-700: #0b5c63;
  --ocean-600: #0e6b66;
  --ocean-100: #d6eeee;
  --coral-600: #b5461f;
  --coral-500: #e0673b;
  --coral-100: #fde7dc;
  --sand-100: #fff6e8;
  --sand-300: #f6d9a8;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(13, 35, 40, 0.06);
  --shadow: 0 4px 14px rgba(13, 35, 40, 0.08), 0 18px 40px rgba(13, 35, 40, 0.08);
  --shadow-lift: 0 10px 24px rgba(13, 35, 40, 0.12), 0 24px 56px rgba(13, 35, 40, 0.1);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --gutter: clamp(1rem, 3vw, 2rem);
  --max: 1180px;
  --font: "IBM Plex Sans", "IBM Plex Sans Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(224, 103, 59, 0.08), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(14, 107, 102, 0.1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-feature-settings: "kern", "liga";
  overflow-wrap: anywhere;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img,
iframe,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}
.zoomable-image {
  cursor: zoom-in;
}
.zoomable-image:focus-visible {
  outline-offset: -4px;
}
.image-lightbox {
  position: fixed;
  inset: 0;
  width: min(94vw, 1200px);
  max-width: none;
  max-height: 92vh;
  padding: 56px 16px 16px;
  border: 0;
  border-radius: var(--radius);
  background: #071b28;
  overflow: auto;
}
.image-lightbox::backdrop {
  background: rgba(2, 12, 20, 0.86);
  backdrop-filter: blur(4px);
}
.image-lightbox img {
  width: auto;
  max-width: 100%;
  max-height: calc(92vh - 72px);
  margin: 0 auto;
  object-fit: contain;
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--ocean-900);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.6rem); }
h2 {
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem);
  position: relative;
  padding-bottom: 0.4em;
}
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--coral-500), var(--sand-300));
}
h3 { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem); }

p {
  margin: 0 0 1em;
}
ul,
ol {
  padding-left: 1.25rem;
}
li {
  margin-bottom: 0.4em;
}
strong {
  font-weight: 600;
  color: var(--ocean-900);
}
u {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--coral-500);
}

a {
  color: var(--ocean-700);
  text-underline-offset: 0.2em;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--coral-600);
}
:focus-visible {
  outline: 3px solid var(--coral-500);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Layout helpers ---------- */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}
.main {
  flex: 1 0 auto;
  padding-block: 0 var(--space-16);
}
/* Constrain every content block to the page container; only the hero breaks out to full width */
.main > *:not(.hero-full) {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}
.block {
  margin-block: var(--space-16) 0;
}
.home #overview {
  position: relative;
  z-index: 3;
  margin-top: -2rem;
  padding: var(--space-8);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.block > h2 {
  margin-bottom: var(--space-6);
}
section {
  scroll-margin-top: 88px;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -4rem;
  background: var(--ink);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 50;
}
.skip-link:focus {
  top: var(--space-3);
}

/* ---------- Header and navigation (always visible) ---------- */
.site-header {
  position: relative;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 64px;
  flex-wrap: nowrap;
  padding-block: var(--space-2);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ocean-900);
  text-decoration: none;
  min-height: 44px;
}
.brand:hover {
  color: var(--coral-600);
}
.nav {
  width: auto;
  flex: 0 0 auto;
}
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(0px, 0.5vw, 8px);
  justify-content: flex-end;
}
.nav li {
  margin: 0;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 0;
  padding: 0 clamp(8px, 1vw, 16px);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav a:hover {
  background: var(--ocean-100);
  color: var(--ocean-900);
}
.nav a[aria-current="page"] {
  background: var(--ocean-600);
  color: #ffffff;
}

@media (max-width: 520px) {
  .header-inner {
    width: calc(100% - 16px);
  }
  .brand {
    font-size: 14px;
  }
  .nav a {
    min-height: 44px;
    min-width: 44px;
    padding-inline: 4px;
    font-size: 12px;
  }
}

/* ---------- Hero (full width) ---------- */
.hero-full {
  position: relative;
  width: 100%;
  margin-left: 0;
  margin-top: 0;
  padding-block: clamp(3rem, 7vw, 6rem) clamp(5rem, 9vw, 8rem);
  color: #ffffff;
  background:
    radial-gradient(ellipse at 92% 12%, rgba(91, 172, 255, 0.36), transparent 35%),
    linear-gradient(112deg, #1765cb 0%, #124b9f 52%, #082b68 100%);
  overflow: hidden;
  isolation: isolate;
}
.hero-full::before {
  /* decorative wave band; pure CSS, no external URL */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 68px;
  background: var(--bg);
  clip-path: ellipse(62% 100% at 50% 100%);
  z-index: 1;
  pointer-events: none;
}
.hero-inner {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
  display: grid;
  gap: var(--space-8);
  align-items: center;
  grid-template-columns: 1fr;
  position: relative;
  z-index: 1;
}
.hero-full h1,
.hero-full h2,
.hero-full strong {
  color: #ffffff;
}
.hero-full p,
.hero-full li {
  color: #ffffff;
}
.hero-full a {
  color: #ffffff;
  font-weight: 600;
  text-decoration-color: var(--sand-300);
}
.hero-full a:hover {
  color: var(--sand-300);
}
.hero-full .btn-cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--space-6);
  border-radius: 999px;
  background: #ffffff;
  color: #124b9f;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(3, 23, 58, 0.2);
}
.hero-full .btn-cta:hover {
  background: #e8f2ff;
  color: #082b68;
}
.hero-copy h1 {
  margin-bottom: var(--space-4);
}
.hero-ad {
  width: 100%;
  max-width: 300px;
  margin: 0 auto var(--space-4);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  text-align: center;
}
.hero-ad iframe {
  display: block;
  width: 300px;
  max-width: 100%;
  height: 250px;
  border: 0;
}
.hero-copy > :last-child {
  margin-bottom: 0;
}
.hero-media {
  width: min(100%, 640px);
  justify-self: center;
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(3, 23, 58, 0.3);
  border: 0;
  transform: rotate(1deg);
  z-index: 2;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 10px solid rgba(255, 255, 255, 0.78);
  border-radius: inherit;
}
.hero-action {
  margin-top: var(--space-6);
}

@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--space-12);
  }
}

/* ---------- Split sections: copy beside image ---------- */
.split {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  margin-bottom: var(--space-4);
}
.split > * {
  min-width: 0;
}
.split-copy > :last-child {
  margin-bottom: 0;
}
.split > .media-3-2 {
  width: min(100%, 400px);
  justify-self: center;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: var(--space-6);
  }
}

/* ---------- Media boxes: skeleton (shimmer) + fixed aspect ratio ---------- */
.media,
.media-3-2,
.embed {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-alt);
}
.media {
  aspect-ratio: 1200 / 630;
}
.media-3-2 {
  aspect-ratio: 3 / 2;
}
.embed {
  aspect-ratio: 16 / 9;
}
.media img,
.media-3-2 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.8) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

/* ---------- Grids and cards ---------- */
.grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.card,
.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover,
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.card > p,
.post-card > article > p {
  color: var(--ink-soft);
}
.card h3 {
  margin-top: var(--space-3);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
}
.post-card article {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.post-card a {
  text-decoration: none;
}
.post-card h3 a {
  color: var(--ocean-900);
}
.post-card .media {
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}
.post-card .meta {
  margin-top: auto;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-block: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  table-layout: auto;
}
caption {
  text-align: left;
  font-weight: 600;
  padding: var(--space-3) var(--space-4);
  color: var(--ocean-900);
  background: var(--sand-100);
}
th,
td {
  text-align: left;
  padding: var(--space-3);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.5;
}
th:last-child,
td:last-child {
  border-right: 0;
}
tbody tr:last-child td {
  border-bottom: 0;
}
th {
  background: var(--surface-alt);
  color: var(--ocean-900);
  font-weight: 600;
}
tbody tr:nth-child(even) td {
  background: #f8fcfc;
}
tbody tr:hover td {
  background: var(--ocean-100);
}
@media (max-width: 639px) {
  .split > .media-3-2 {
    width: min(100%, 480px);
  }
  th,
  td {
    padding: var(--space-2);
    font-size: 0.9rem;
  }
}

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--coral-500);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}
.faq-item[open] {
  box-shadow: var(--shadow);
}
.faq-item summary {
  cursor: pointer;
  min-height: 52px;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  color: var(--ocean-900);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
  color: var(--coral-600);
  flex: 0 0 auto;
}
.faq-item[open] summary::after {
  content: "–";
}
.faq-item[open] summary {
  border-bottom: 1px solid var(--line);
}
.faq-body {
  padding: var(--space-4);
}

/* ---------- Buttons, chips, actions ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-block: var(--space-4);
}
.btn,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  min-width: 44px;
  padding: var(--space-2) var(--space-4);
  border: 2px solid var(--ocean-600);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ocean-700);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn:hover,
.chip:hover {
  background: var(--ocean-100);
  transform: translateY(-1px);
}
.btn[aria-pressed="true"],
.chip[aria-pressed="true"] {
  background: var(--ocean-600);
  border-color: var(--ocean-600);
  color: #ffffff;
}
.btn[aria-pressed="true"]:hover,
.chip[aria-pressed="true"]:hover {
  background: var(--ocean-700);
}
.btn[disabled] {
  opacity: 0.6;
  cursor: wait;
}
.chip {
  padding: var(--space-2) var(--space-4);
  font-size: 0.95rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block: var(--space-4) var(--space-8);
}

/* ---------- Blog and post ---------- */
.page-head {
  padding-block: var(--space-16) var(--space-8);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-8);
}
.page-head p {
  color: var(--ink-soft);
  font-size: 1.1rem;
}
.meta {
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.crumbs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  padding: 0;
  margin: var(--space-8) 0 var(--space-4);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--ink-soft);
}
.post {
  max-width: 820px;
  margin-inline: auto;
  padding-top: var(--space-4);
}
.post > header h1 {
  margin-bottom: var(--space-3);
}
.post > .media {
  margin-block: var(--space-6);
}
.prose h2 {
  margin-top: var(--space-12);
}
.prose h3 {
  margin-top: var(--space-8);
}
.prose ul,
.prose ol {
  margin-bottom: var(--space-6);
}
.prose li {
  max-width: 72ch;
}
.prose blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 4px solid var(--coral-500);
  background: var(--sand-100);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.not-found {
  text-align: center;
  padding-block: var(--space-16);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  background: var(--ocean-900);
  color: #dbeaec;
  padding-block: var(--space-12) var(--space-8);
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--coral-500), var(--sand-300), var(--ocean-600));
}
.site-footer p {
  color: #dbeaec;
}
.site-footer strong,
.site-footer u {
  color: #ffffff;
}
.site-footer a {
  color: #ffffff;
}
.footer-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-4);
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-2);
  border-radius: 999px;
  text-decoration: none;
}
.footer-links a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Toast (optimistic UI feedback) ---------- */
.toast {
  position: fixed;
  left: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  max-width: 28rem;
  margin-inline: auto;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--ocean-900);
  color: #ffffff;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 60;
}
.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .skeleton::after {
    animation: none;
    display: none;
  }
  .card,
  .post-card,
  .btn,
  .chip,
  .toast,
  .nav a {
    transition: none;
  }
  .card:hover,
  .post-card:hover,
  .btn:hover,
  .chip:hover {
    transform: none;
  }
}
