/* Theming + layout for the Olkano marketing site redesign.
   Palette source: OlkanoApp/constants/Colors.ts */

/* Fonts (served from OlkanoWebsite/assets/fonts via Eleventy passthrough) */
@font-face {
  font-family: "Florentia";
  src:
    url("/assets/fonts/Florentia-Regular.ttf") format("truetype"),
    url("/assets/fonts/Florentia-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Italic-VariableFont_opsz,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Light theme defaults (must stay aligned with existing website dark/light behavior) */
  --bg: #ffffff;
  --text: #11181C; /* Colors.light.text */
  --muted: #687076; /* Colors.light.icon */
  --border: #DDD; /* Colors.light.border */

  /* Brand */
  --primary: #FB806D; /* Colors.light.primary */
  --primary-gradient-start: #FF9B8C; /* Colors.light.primaryGradientStart */
  --primary-gradient-end: #F26A55; /* Colors.light.primaryGradientEnd */

  /* Semantic */
  --success: #2E7D32; /* Colors.light.success */
  --warning: #FF852E; /* Colors.light.warning */

  /* Components */
  --card-bg: #ffffff;
  --card-border: #e5e5e5;
  --shadow-soft: 0 10px 26px rgba(17, 24, 28, 0.08);
  --shadow-soft-2: 0 14px 34px rgba(17, 24, 28, 0.10);

  /* Radii */
  --radius-panel: 22px;
  --radius-card: 16px;
  --radius-pill: 999px;

  /* Typography */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Florentia", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;

  /* Layout */
  --container-max: 1200px;
  --container-pad: 24px;
  --section-gap: 76px; /* between major sections */
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode: keep current background/text feel */
    --bg: #000000;
    --text: #ECEDEE; /* Colors.dark.text */
    --muted: #9BA1A6; /* Colors.dark.icon */
    --border: #333333; /* Colors.dark.border */

    --card-bg: #0b0b0b;
    --card-border: #1f1f1f;
    --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.40);
    --shadow-soft-2: 0 14px 34px rgba(0, 0, 0, 0.48);

    --success: #4CAF50; /* Colors.dark.success */
    --warning: #FF9B4A; /* Colors.dark.warning */
  }
}

/* Explicit override via [data-theme] (set by theme.js) */
[data-theme="light"] {
  --bg: #ffffff;
  --text: #11181C;
  --muted: #687076;
  --border: #DDD;
  --card-bg: #ffffff;
  --card-border: #e5e5e5;
  --shadow-soft: 0 10px 26px rgba(17, 24, 28, 0.08);
  --shadow-soft-2: 0 14px 34px rgba(17, 24, 28, 0.10);
  --success: #2E7D32;
  --warning: #FF852E;
}

[data-theme="dark"] {
  --bg: #000000;
  --text: #ECEDEE;
  --muted: #9BA1A6;
  --border: #333333;
  --card-bg: #0b0b0b;
  --card-border: #1f1f1f;
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.40);
  --shadow-soft-2: 0 14px 34px rgba(0, 0, 0, 0.48);
  --success: #4CAF50;
  --warning: #FF9B4A;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
}

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* Header (E10) */
.site-header {
  background: transparent;
  height: 104px;
  padding: 0;
  margin: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  height: 104px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img { width: 200px; height: auto; }

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-left: auto; /* push nav + controls to the right side */
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
  font-weight: 520;
}

.nav-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.header-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.picker {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 0;
  padding: 6px 4px;
  font-size: 16px;
  font-weight: 520;
  cursor: pointer;
  transition: color 0.15s ease;
}

.picker:hover {
  color: var(--primary);
}

.picker:focus {
  outline: none;
  color: var(--primary);
}

main {
  padding: 0 0 34px;
}

section { margin: var(--section-gap) 0; }

/* Keep main content flush under the header (no extra gap above the first section) */
main > section:first-child { margin-top: 0; }
main > .container > section:first-child { margin-top: 0; }

.section-title {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.12;
  
  color: var(--primary);
  margin: 0 0 12px;
  text-align: center;
}

.section-intro,
.section-subtitle {
  color: var(--muted);
  font-size: 16px;
  margin: 0 auto 26px;
  max-width: 60ch;
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 400;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-primary {
  background: #ffffff;
  color: var(--primary);
}

.btn-secondary {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.78);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-invite {
  background: #ffffff;
  color: var(--primary);
}

.store-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.store-badges img { height: 40px; width: auto; }

/* Panels / cards */
.panel {
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-soft-2);
  overflow: hidden;
}

.panel-gradient {
  /* Light (top-left) -> Dark (bottom-right) */
  background: linear-gradient(to bottom right, var(--primary-gradient-start), var(--primary-gradient-end));
  color: #ffffff;
}

.panel-inner {
  padding: 54px 56px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 22px 22px;
}

/* Hero (E20) */
.hero-panel .panel-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 34px;
  align-items: stretch;
  /* Let the phone align flush to the panel bottom while keeping text padding */
  padding-bottom: 0;
}

.hero-panel .panel-inner > :first-child {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 64px; /* keep buttons ~64px from the panel bottom */
}

.hero-headline {
  font-family: var(--font-display);
  font-size: 54px;
  line-height: 1.08;
  margin: 0 0 18px;
  
  color: #ffffff;
}

.hero-subcopy {
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  max-width: 44ch;
  font-family: var(--font-display);
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-phone {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  align-self: end;
  /* Pull the phone left so it visually sits closer to the headline (PNG has large transparent shadow padding) */
  margin-left: -90px;
}

.hero-phone img {
  /* Size by height (not width) so the phone feels larger despite transparent margins */
  height: 85%;
  width: auto;
  max-height: 520px;
  filter: drop-shadow(0 16px 28px rgba(0,0,0,0.22));
}

/* Flow diagram (E33) */
.flow-wrap {
  max-width: 980px;
  margin: 0 auto;
}

/* New flowchart layout: fixed nodes, flexible connectors, horizontal scroll on narrow screens */
.flowchart-wrap {
  padding: 18px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.flowchart {
  /* Colors */
  --flow-line-color: var(--primary);

  /* Fixed node sizes (ONLY connectors flex) */
  --flow-start-w: 240px;
  --flow-start-h: 110px;

  --flow-node-w: 220px;
  --flow-node-h: 76px;

  /* Connector sizing (flexes until it hits min; then chart stops shrinking) */
  --flow-conn-min: 28px;
  --flow-conn2-min: 28px;
  --flow-conn-frac: 0.4fr;
  --flow-conn2-frac: 0.6fr;

  /* Layout rows (fixed) */
  --flow-row: 110px;
  --flow-gaprow: 40px;

  /* Connector thickness */
  --flow-line: 2px;

  /* IMPORTANT: minimum overall width so boxes never shrink */
  --flow-min-total:
    calc(
      var(--flow-start-w)
      + 190px
      + var(--flow-conn-min)
      + var(--flow-node-w)
      + var(--flow-conn2-min)
      + var(--flow-node-w)
    );

  display: grid;
  grid-template-columns:
    var(--flow-start-w)
    190px
    minmax(var(--flow-conn-min), var(--flow-conn-frac))
    var(--flow-node-w)
    minmax(var(--flow-conn2-min), var(--flow-conn2-frac))
    var(--flow-node-w);
  grid-template-rows: var(--flow-row) var(--flow-gaprow) var(--flow-row);
  column-gap: 0;
  row-gap: 0;
  align-items: center;

  width: 100%;
  max-width: 980px;
  min-width: var(--flow-min-total);
  margin: 0 auto;
  position: relative;
}

/* Nodes */
.flow-node {
  width: 100%;
  min-height: var(--flow-node-h);
  background: var(--card-bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft-2);

  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 16px 18px 14px;
  color: var(--text);
}

.flow-node__icon {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 4px;
}

.flow-node__icon-img {
  width: 18px;
  height: 18px;
  display: block;
}

.flow-node__title {
  font-size: 16px;
  line-height: 1.1;
}

.flow-node__subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.15;
  color: var(--muted);
}

/* Start node (fixed size) */
.flow-node--start {
  height: var(--flow-start-h);
  border: none;
  /* Light (top-left) -> Dark (bottom-right) */
  background: linear-gradient(to bottom right, var(--primary-gradient-start), var(--primary-gradient-end));
  box-shadow: var(--shadow-soft-2);
  color: #ffffff;
  padding: 18px 18px;
}

.flow-node--start .flow-node__title {
  font-size: 18px;
  font-weight: 780;
}

.flow-node--start .flow-node__subtitle {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
}

/* Connectors */
.flow-hline {
  height: var(--flow-line);
  width: 100%;
  background: var(--flow-line-color);
  border-radius: var(--radius-pill);
  margin-left: -2px;
  margin-right: -2px;
}

/* Split block draws trunk + vertical + branch stubs */
.flow-split {
  position: relative;
  width: 100%;
  height: 100%;

  --flow-top-y: calc(var(--flow-row) / 2);
  --flow-bottom-y: calc(var(--flow-row) + var(--flow-gaprow) + (var(--flow-row) / 2));
  --flow-mid-y: calc((var(--flow-row) + var(--flow-gaprow) + var(--flow-row)) / 2);

  --flow-jx: 72px;
}

.flow-split::before {
  content: "";
  position: absolute;
  left: -2px;
  top: var(--flow-mid-y);
  transform: translateY(-50%);
  width: calc(var(--flow-jx) + 2px);
  height: var(--flow-line);
  background: var(--flow-line-color);
  border-radius: var(--radius-pill);
}

.flow-split::after {
  content: "";
  position: absolute;
  left: var(--flow-jx);
  top: var(--flow-top-y);
  transform: translateX(-50%);
  width: var(--flow-line);
  height: calc(var(--flow-bottom-y) - var(--flow-top-y));
  background: var(--flow-line-color);
  border-radius: var(--radius-pill);
}

.flow-split__branch {
  position: absolute;
  left: var(--flow-jx);
  right: -2px;
  height: var(--flow-line);
  background: var(--flow-line-color);
  border-radius: var(--radius-pill);
  transform: translateY(-50%);
}

.flow-split__branch--top { top: var(--flow-top-y); }
.flow-split__branch--bottom { top: var(--flow-bottom-y); }

/* Yes/No pills inside the connector column */
.flow-pillwrap {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
  width: 100%;
  height: 100%;
}

.flow-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .2px;
  box-shadow: var(--shadow-soft);
  user-select: none;
  transform: translateX(-54px);
}

.flow-pillwrap--yes { grid-row: 1; }
.flow-pillwrap--no { grid-row: 3; }
.flow-pill--yes { background: var(--success); }
.flow-pill--no { background: var(--warning); }

/* Grid placement */
.flow-start { grid-column: 1; grid-row: 1 / span 3; }
.flow-split { grid-column: 2; grid-row: 1 / span 3; }

.flow-link-yes { grid-column: 3; grid-row: 1; }
.flow-link-no { grid-column: 3; grid-row: 3; }

.flow-allgood { grid-column: 4; grid-row: 1; }
.flow-missed { grid-column: 4; grid-row: 3; }

.flow-to-end { grid-column: 5; grid-row: 3; }
.flow-alerted { grid-column: 6; grid-row: 3; }

.flow-start,
.flow-allgood,
.flow-missed,
.flow-alerted {
  justify-self: stretch;
  align-self: center;
}

/* Features (E40) */
.features-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 34px;
  align-items: center;
}

.features-image {
  display: flex;
  justify-content: center;
}

.features-image img {
  max-width: 360px;
  filter: drop-shadow(0 16px 28px rgba(0,0,0,0.18));
}

.feature-list {
  display: grid;
  gap: 18px;
}

.feature-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  align-items: start;
  color: var(--muted);
  font-size: 16px;
}

.feature-icon {
  width: 32px;
  height: 32px;
  display: block;
}

.feature-icon svg { display: none; }

/* Benefits (E50) */
.benefits-subtitle {
  margin-top: -10px;
}

.benefits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 1040px;
  margin: 0 auto;
}

.benefit-photo {
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.benefit-photo img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 760;
}

.card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.card li { margin: 6px 0; }

/* CTA panel (E60) */
.cta-panel .panel-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 34px;
  align-items: center;
  font-family: var(--font-display);
}

.cta-title {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.1;
  margin: 0 0 8px;
  
  color: #ffffff;
}

.cta-subtitle {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  
}

.cta-body {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  max-width: 52ch;
}

.cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.cta-photo {
  overflow: hidden;
}

.cta-photo img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

/* Pricing (E70) */
.plans-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 1040px;
  margin: 0 auto;
}

.plan-label {
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.plan-price {
  margin: 10px 0 14px;
  font-size: 28px;
  font-weight: 820;
}

.plan-price small {
  font-size: 14px;
  color: var(--muted);
  
}

.plan-card ul { margin-top: 10px; }

/* Footer (E80) */
.site-footer {
  padding: 28px 0 34px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(157, 157, 157, 0.35);
}

.site-footer a:hover { color: var(--text); }

/* Legal / policy pages */
.legal-page {
  padding: 26px var(--container-pad) 56px;
  max-width: 920px;
  margin: 0 auto;
}

.legal-page h1 {
  font-family: var(--font-display);
  font-size: 34px;
  margin: 0 0 10px;
}

.legal-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 22px;
}

.legal-page h2 {
  font-size: 18px;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-page ul { padding-left: 20px; }
.legal-page li { margin-bottom: 4px; }

/* Responsive rules (breakpoint ~900px per spec) */
@media (max-width: 900px) {
  :root { --container-pad: 16px; --section-gap: 64px; }

  .nav-links { display: none; }

  .panel-inner { padding: 28px 22px; }

  .hero-panel .panel-inner,
  .cta-panel .panel-inner {
    grid-template-columns: 1fr;
  }

  .hero-headline { font-size: 42px; }
  .hero-phone { order: 2; }
  .hero-panel .panel-inner { padding-bottom: 28px; }
  .hero-panel .panel-inner > :first-child { padding-bottom: 0; justify-content: flex-start; }
  .hero-phone { align-self: auto; align-items: center; margin-left: 0; justify-content: center; }
  .hero-phone img { height: auto; width: min(340px, 85vw); max-height: none; }

  .features-layout { grid-template-columns: 1fr; }
  .features-image { order: 1; }

  .benefits-grid { grid-template-columns: 1fr; }

  .plans-row { grid-template-columns: 1fr; }

  /* Flowchart: keep single-row + horizontal scroll, but shrink fixed widths to reduce scrolling */
  .flowchart-wrap { padding: 14px 10px; }
  .flowchart {
    --flow-start-w: 220px;
    --flow-node-w: 200px;
    --flow-conn-min: 20px;
    --flow-conn2-min: 20px;
  }
}

/* Accessibility: screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


