/* ============================================================
   Brilango — global stylesheet
   Ported from Source_Mateiral/style.css, with a responsive
   layer (mobile nav, collapsing grids, fluid type) added.
   ============================================================ */

:root {
  --navy: #0F1E38;
  --navy-mid: #162644;
  --navy-light: #1E3360;
  --blue: #3A6BC8;
  --blue-bright: #4A7FE8;
  --sky: #E8F0FB;
  --sky-light: #F2F6FD;
  --teal: #1F7A8C;
  --teal-light: #E6F3F6;
  --text: #0F1E38;
  --text-mid: #4A5568;
  --text-light: #718096;
  --border: #D8E3F0;
  --white: #FFFFFF;
  --off-white: #FAFBFD;

  /* Families loaded from Google Fonts in base.html (the Next.js app
     loaded the same families via next/font/google) */
  --font-body: "DM Sans", sans-serif;
  --font-serif: "DM Serif Display", serif;
  --font-display: "Playfair Display", serif;

  /* Invisible content container: full-bleed bands (nav, hero, sections,
     footer) keep their backgrounds edge-to-edge, while their content is
     capped at --container and centered. The padding grows once the
     viewport exceeds --container + 2×--gutter, so below that everything
     behaves exactly as before. */
  --container: 1240px;
  --gutter: 48px;
  --bleed-pad: max(var(--gutter), calc((100% - var(--container)) / 2));
}

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--white);
  font-size: 18px;
  line-height: 1.6;
  /* Sticky footer: pin the footer to the bottom of the viewport
     even on short pages (contact, privacy, terms) */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

/* ── NAV ─────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--bleed-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-mid);
  font-size: 14px;
  font-weight: 400;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.active { color: var(--navy); font-weight: 600; }
.nav-cta {
  background: var(--navy) !important;
  color: white !important;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 500 !important;
}
.nav-cta:hover { background: var(--navy-light) !important; }

/* Language picker (globe trigger + dropdown menu) */
.lang-switch { position: relative; }
.lang-trigger {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-mid);
  padding: 6px;
  border-radius: 6px;
  transition: color 0.2s;
}
.lang-trigger:hover { color: var(--navy); }
.lang-trigger svg { width: 20px; height: 20px; display: block; }
.lang-caret { font-size: 10px; line-height: 1; }
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,30,56,0.12);
  padding: 6px 0;
  list-style: none;
  z-index: 200;
}
.lang-switch.open .lang-menu { display: block; }
.lang-menu a {
  display: block;
  padding: 9px 18px;
  font-size: 14px;
  color: var(--text-mid);
  text-decoration: none;
  white-space: nowrap;
}
.lang-menu a:hover { background: var(--sky-light); color: var(--navy); }
.lang-menu a.lang-current { color: var(--navy); font-weight: 600; }

/* Mobile menu toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--navy);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── SECTIONS ────────────────────────────────────── */
.section { padding: 72px var(--bleed-pad); }
.section-alt { background: var(--off-white); }
.section-sky { background: var(--sky-light); }
.section-dark { background: var(--navy); color: white; }

.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}
.section-dark .section-label { color: #7AA8E8; }

.section-title {
  font-family: var(--font-serif);
  font-size: 38px;
  color: var(--navy);
  line-height: 1.15;
  margin-bottom: 12px;
}
.section-dark .section-title { color: white; }

.section-tagline {
  font-size: 38px;
  color: #4A90D9;
  font-style: italic;
  margin-bottom: 48px;
  font-family: var(--font-serif);
}
.section-dark .section-tagline { color: #7EC8F0; }

.section-body {
  font-size: 16px;
  color: var(--text-mid);
  line-height: 1.8;
  max-width: 780px;
  margin-bottom: 48px;
}
.section-dark .section-body { color: rgba(255,255,255,0.75); }

/* Tightens the gap between two consecutive intro paragraphs
   (replaces the inline style="margin-top: -24px" in the source HTML) */
.section-body + .section-body { margin-top: -24px; }

/* ── HERO (homepage) ─────────────────────────────── */
.hero {
  padding: 80px var(--bleed-pad);
  display: grid;
  /* minmax(0, …) lets columns shrink below the hub SVG's intrinsic width;
     the visual column gets extra room for the wide hub diagram */
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 56px;
  align-items: center;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(63,227,240,0.18), transparent 60%),
    radial-gradient(800px 400px at 8% 110%, rgba(15,178,194,0.14), transparent 60%),
    linear-gradient(160deg, #060E1C 0%, #091526 55%, #0B1D36 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
  font-family: var(--font-serif);
  /* Fluid size keeps the longest line ("One Imaging Platform." ≈ 10.03em)
     inside the 0.425fr text column at any viewport, so the <br>-separated
     lines never wrap; nowrap guards the intent. */
  font-size: clamp(30px, 4.2vw - 8px, 48px);
  line-height: 1.1;
  color: #F4FAFD;
  margin-bottom: 24px;
  white-space: nowrap;
}
.hero h1 .hero-accent { font-style: italic; color: #0FB2C2; }
.hero-body {
  font-size: 17px;
  color: rgba(234,242,248,0.75);
  line-height: 1.75;
  max-width: 480px;
}
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── HUB DIAGRAM ─────────────────────────────────── */
.hub { width: 100%; max-width: 720px; margin: 0 auto; display: block; }

/* Dashed energy flowing along the spokes */
.hub .spoke { stroke-dasharray: 5 8; animation: hub-dash 30s linear infinite; }
@keyframes hub-dash { to { stroke-dashoffset: -260; } }

/* Slow counter-rotating orbital ring */
.hub .hub-orbit { stroke-dasharray: 2 10; animation: hub-dash 90s linear infinite reverse; }

/* Breathing glass ring around the core */
.hub .hub-pulse-soft { animation: hub-breathe 3.8s ease-in-out infinite; }
@keyframes hub-breathe { 0%,100% { opacity: .35; } 50% { opacity: .9; } }

/* Gentle float on each stakeholder disc (desynced via delays) */
.hub .hub-float { animation: hub-float 7s ease-in-out infinite; }
@keyframes hub-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Staggered page-load reveal */
.hub .hub-enter { opacity: 0; animation: hub-fade-in .8s ease-out forwards; }
@keyframes hub-fade-in { to { opacity: 1; } }

/* Hover: discs light up */
.hub .hub-disc { transition: stroke .3s, fill .3s; }
.hub .hub-node:hover .hub-disc { stroke: #7FF0F8; fill: rgba(63,227,240,0.1); }
.hub .hub-halo { transition: opacity .3s; opacity: .5; }
.hub .hub-node:hover .hub-halo { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .hub .spoke, .hub .hub-orbit, .hub .hub-pulse-soft, .hub .hub-float { animation: none; }
  .hub .hub-enter { animation: none; opacity: 1; }
}
.spoke-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex-shrink: 0; }
.spoke-dot.blue { background: var(--blue); }
.spoke-dot.navy { background: var(--navy); }

/* ── PAGE HERO (inner pages) ─────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 0 var(--bleed-pad);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.page-hero h1 {
  font-family: var(--font-serif);
  font-size: 44px;
  color: white;
  line-height: 1.1;
  margin-top: 48px;
  margin-bottom: 36px;
}
.page-hero .tagline {
  font-size: 44px;
  color: #7EC8F0;
  font-style: italic;
  font-family: var(--font-serif);
  margin-bottom: 48px;
}

/* ── AUDIENCE CARDS (Who We Serve) ───────────────── */
.audience-icon { width: 46px; height: 46px; color: #0A8794; margin-bottom: 14px; display: block; }
.audience-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px;
}
.audience-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  background: white;
  transition: all 0.2s;
}
.audience-card:hover { border-color: var(--blue); box-shadow: 0 4px 20px rgba(27,42,74,0.1); }
.audience-title {
  font-size: 1.28rem;
  font-weight: 500;
  font-family: var(--font-display);
  color: var(--navy);
  margin-bottom: 10px;
  text-decoration: none;
  display: block;
  min-height: 3.2em;
}
.audience-title:hover { color: var(--blue); }
.audience-body { font-size: 15px; color: var(--text-mid); line-height: 1.7; }

/* ── HOW IT WORKS ────────────────────────────────── */
.how-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.how-card { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 32px 28px; }
.how-title { font-size: 0.95rem; font-weight: 500; font-family: var(--font-display); color: var(--navy); margin-bottom: 6px; }
.how-tagline { font-size: 1.28rem; color: var(--blue); font-style: italic; font-family: var(--font-serif); margin-bottom: 14px; }
.how-body { font-size: 15px; color: var(--text-mid); line-height: 1.7; }

/* ── PLATFORM COMPONENTS ─────────────────────────── */
.comp-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.comp-card {
  background: var(--off-white);
  border: none;
  border-radius: 0;
  padding: 24px 8px 28px;
  transition: all 0.2s;
}
.comp-card:hover .comp-title { color: var(--blue); }
.comp-title {
  font-size: 1.28rem;
  font-weight: 500;
  font-family: var(--font-display);
  color: var(--navy);
  margin-bottom: 10px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.comp-title::before {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background: var(--navy);
  border-radius: 1px;
}
.comp-dot { display: none; }
.comp-body { font-size: 15px; color: var(--text-mid); line-height: 1.7; }

/* Final row of the platform grid: a single card kept at one-column
   width (replaces inline span/width styles in the source HTML) */
.comp-row-span {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
}
.comp-row-span .comp-card { width: calc(33.33% - 7px); text-align: left; }

/* ── DEPLOYMENT OPTIONS ──────────────────────────── */
.deploy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.deploy-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  background: white;
  transition: all 0.2s;
}
.deploy-card:hover { border-color: var(--blue); box-shadow: 0 4px 20px rgba(27,42,74,0.1); }
.deploy-title { font-size: 1.28rem; font-weight: 500; font-family: var(--font-display); color: var(--navy); margin-bottom: 12px; }
.deploy-body { font-size: 15px; color: var(--text-mid); line-height: 1.75; }

/* ── FEATURE GRID (solution pages) ──────────────── */
.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px 48px; }
.feature-entry { position: relative; padding-left: 0; }
.feature-entry .fnum {
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  font-style: italic;
  color: #7EC8F0;
  line-height: 1;
  margin-bottom: 10px;
  background: none;
  border: none;
  border-radius: 0;
  width: auto;
  height: auto;
  position: static;
}
.feature-entry h3 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 9px;
  line-height: 1.2;
}
.feature-entry p { font-size: 15px; color: var(--text-mid); line-height: 1.75; }

/* ── CONTACT ─────────────────────────────────────── */
.contact-section { min-height: 360px; }
.contact-block { max-width: 100%; margin-top: 24px; }
.contact-block p {
  font-size: 16px;
  color: var(--text-mid);
  line-height: 1.8;
  max-width: 100%;
  margin-bottom: 0;
}
.contact-email {
  display: inline;
  font-size: inherit;
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid var(--blue);
  padding-bottom: 2px;
  transition: color 0.2s;
}
.contact-email:hover { color: var(--navy); border-color: var(--navy); }

.contact-form {
  margin-top: 40px;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}
.field-optional { font-weight: 400; color: var(--text-light); }
.form-field input,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--sky);
}
.form-field .input-error { border-color: #C0392B; }
.phone-group { display: flex; gap: 8px; }
.phone-group select {
  flex: 0 0 auto;
  max-width: 220px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.phone-group select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--sky);
}
.phone-group input { flex: 1 1 auto; min-width: 0; }
.field-error { font-size: 13px; color: #C0392B; }
.form-status {
  font-size: 15px;
  padding: 12px 16px;
  border-radius: 6px;
  line-height: 1.5;
}
.form-status.success { background: var(--teal-light); color: var(--teal); }
.form-status.error { background: #FBEAE8; color: #C0392B; }
.form-submit {
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  background: var(--navy);
  border: none;
  border-radius: 6px;
  padding: 12px 28px;
  cursor: pointer;
  transition: background 0.2s;
}
.form-submit:hover { background: var(--navy-light); }
.form-submit:disabled { opacity: 0.6; cursor: default; }
.contact-alt { font-size: 15px; color: var(--text-mid); margin-top: 4px; }

/* ── LEGAL PAGES (terms of use, privacy policy) ──── */
/* Long-form prose: a narrower measure than the full container, since these
   pages are read line by line rather than scanned like the marketing bands. */
.legal-section { min-height: 360px; }
.legal-doc { max-width: 820px; margin-top: 24px; }
.legal-doc p {
  font-size: 16px;
  color: var(--text-mid);
  line-height: 1.8;
}
.legal-updated {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 32px;
}
/* Spanish twins prefix the English text with a binding-version notice */
.legal-notice {
  font-size: 15px;
  color: var(--text-mid);
  line-height: 1.7;
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--sky-light);
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  max-width: 820px;
}
/* Clause numbers come from a CSS counter so the markup carries no hardcoded
   numbers — inserting or removing a clause renumbers the rest automatically */
.legal-clauses { list-style: none; counter-reset: legal-clause; }
.legal-clauses > li { counter-increment: legal-clause; margin-bottom: 30px; }
.legal-clauses > li:last-child { margin-bottom: 0; }
.legal-clauses > li > h3 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 8px;
}
.legal-clauses > li > h3::before {
  content: counter(legal-clause) ". ";
  color: var(--blue);
}
.legal-doc p + p { margin-top: 12px; }

/* ── FOOTER ──────────────────────────────────────── */
footer {
  background: var(--navy);
  padding: 32px var(--bleed-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy { font-size: 13px; color: rgba(255,255,255,0.45); }
.footer-links { display: flex; gap: 24px; list-style: none; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,0.55); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: white; }

/* ============================================================
   RESPONSIVE LAYER
   ============================================================ */

/* Large tablets / small laptops */
@media (max-width: 1080px) {
  .audience-grid { grid-template-columns: 1fr 1fr; }
  .comp-grid { grid-template-columns: 1fr 1fr; }
  .comp-row-span .comp-card { width: calc(50% - 10px); }
  .hero { gap: 48px; }
}

/* Tablets — mobile nav kicks in */
@media (max-width: 900px) {
  :root { --gutter: 24px; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 8px 0 16px;
    box-shadow: 0 12px 24px rgba(15,30,56,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block;
    padding: 12px 24px;
    font-size: 16px;
  }
  .nav-links .nav-cta {
    margin: 8px 24px 0;
    border-radius: 6px;
    text-align: center;
  }
  /* In the stacked mobile menu, drop the globe and show the languages inline */
  .lang-switch {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .lang-trigger { display: none; }
  .lang-menu {
    display: block;
    position: static;
    min-width: 0;
    border: none;
    box-shadow: none;
    padding: 0;
  }
  .lang-menu a { padding: 12px 24px; font-size: 16px; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 56px;
    gap: 48px;
  }
  /* Single column again — fixed size, the full width easily fits 40px */
  .hero h1 { font-size: 40px; }
  .how-grid { grid-template-columns: 1fr; }
  .deploy-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }

  .section { padding-block: 56px; }
  .page-hero h1 { font-size: 36px; }
  .page-hero .tagline { font-size: 32px; }
  .section-title { font-size: 32px; }
  .section-tagline { font-size: 30px; }
}

/* Phones */
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  body { font-size: 17px; }
  .audience-grid { grid-template-columns: 1fr; }
  .comp-grid { grid-template-columns: 1fr; }
  .comp-row-span .comp-card { width: 100%; }
  .audience-title { min-height: 0; }

  .hero { padding-block: 48px; }
  /* (100vw − 2×gutter) / 10.3em-per-line keeps narrow phones (≤360px) from wrapping */
  .hero h1 { font-size: min(33px, (100vw - 40px) / 10.3); }
  /* Keep hub labels legible when the wide SVG scales far down */
  .hub .hub-label { font-size: 23px; }
  .section { padding-block: 48px; }
  .page-hero h1 { font-size: 31px; margin-top: 40px; margin-bottom: 24px; }
  .page-hero .tagline { font-size: 26px; margin-bottom: 40px; }
  .section-title { font-size: 28px; }
  .section-tagline { font-size: 24px; margin-bottom: 32px; }

  footer { flex-direction: column; align-items: flex-start; }
}
