/* meetsylou.eu — Sylou landing page
   Palette mirrors the app tokens (ethos-project-hub/src/index.css) and the
   FLOW band colors (src/lib/flowBands.ts). Light theme only for now: the
   logo wordmark is near-black and has no dark-background variant yet.
   Flip cards progressively enhance: without JS both faces render stacked. */

:root {
  --bg: hsl(0 20% 98%);
  --fg: hsl(235 25% 15%);
  --muted: hsl(220 9% 46%);
  --surface: hsl(34 12% 92%);
  --surface-tint: hsl(34 14% 95%);
  --card: hsl(0 0% 100%);
  --border: hsl(220 13% 91%);
  --primary: hsl(210 60% 45%);
  --primary-hover: hsl(210 60% 37%);
  --flow-accent: hsl(205 30% 51%);
  --ring: hsl(210 60% 45%);
  --radius: 8px;

  /* FLOW bands: AI-led -> Human-authored */
  --band-1: #6B2D8E;
  --band-2: #A06CB8;
  --band-3: #8A8F96;
  --band-4: #5D89A8;
  --band-5: #2F6699;
  --band-6: #1B4A7A;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  text-wrap: balance;
  line-height: 1.15;
}

p { text-wrap: pretty; }

a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: hsl(210 60% 45% / 0.35);
  text-underline-offset: 3px;
}

a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 2px;
}

.container {
  max-width: 1060px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.container--narrow { max-width: 760px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--fg);
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* The FLOW spectrum as a hairline signature at the very top of the page */
.flow-hairline {
  height: 4px;
  background: linear-gradient(90deg,
    var(--band-1), var(--band-2), var(--band-3),
    var(--band-4), var(--band-5), var(--band-6));
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(0 20% 98% / 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 3.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.82;
}

.site-nav a:hover { opacity: 1; color: var(--primary); }

@media (max-width: 820px) {
  .site-nav { display: none; }
  .header-inner { justify-content: space-between; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  border-radius: var(--radius);
  padding: 0.7rem 1.35rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-small { padding: 0.42rem 0.95rem; font-size: 0.92rem; }

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

.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid hsl(220 13% 80%);
}

.btn-secondary:hover { background: var(--surface); border-color: hsl(220 13% 70%); }

/* ---------- Hero ---------- */

.hero {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0 clamp(3rem, 7vw, 4.75rem);
  text-align: center;
}

.hero-logo {
  width: clamp(140px, 20vw, 176px);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.05rem, 5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 1.1rem;
}

/* Hand-drawn brush underline under "Process-based": a tapered SVG stroke
   filled with the FLOW band gradient, sized relative to the headline. */
.hand-underline {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.hand-underline-svg {
  position: absolute;
  left: -3%;
  bottom: -0.22em;
  width: 106%;
  height: 0.42em;
  overflow: visible;
  pointer-events: none;
}

.hand-underline-svg stop:nth-child(1) { stop-color: var(--band-1); }
.hand-underline-svg stop:nth-child(2) { stop-color: var(--band-2); }
.hand-underline-svg stop:nth-child(3) { stop-color: var(--band-3); }
.hand-underline-svg stop:nth-child(4) { stop-color: var(--band-4); }
.hand-underline-svg stop:nth-child(5) { stop-color: var(--band-5); }
.hand-underline-svg stop:nth-child(6) { stop-color: var(--band-6); }

.hero-sub {
  font-size: clamp(1.08rem, 2vw, 1.2rem);
  color: hsl(235 15% 30%);
  margin: 0 auto 2.1rem;
  text-wrap: balance;
}

/* Hand-drawn loop around a phrase in running text. The span's own line
   box is shrunk so the loop stays clear of the lines above and below;
   the side margins keep it clear of the neighbouring words. */
.hand-circle {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  line-height: 1.15;
  margin-inline: 0.45em 0.6em;
}

/* The viewBox matches the rendered box (~289x33 px for the current phrase
   at 17px) so the drawing is scaled ~1:1: no stroke distortion, and the
   pathLength-based draw-in stays exact. Re-derive both if the phrase
   changes. */
.hand-circle-svg {
  position: absolute;
  left: -0.6em;
  top: -0.4em;
  width: calc(100% + 1.2em);
  height: calc(100% + 0.8em);
  overflow: visible;
  pointer-events: none;
}

.hand-circle-svg stop:nth-child(1) { stop-color: var(--band-1); }
.hand-circle-svg stop:nth-child(2) { stop-color: var(--band-2); }
.hand-circle-svg stop:nth-child(3) { stop-color: var(--band-3); }
.hand-circle-svg stop:nth-child(4) { stop-color: var(--band-4); }
.hand-circle-svg stop:nth-child(5) { stop-color: var(--band-5); }
.hand-circle-svg stop:nth-child(6) { stop-color: var(--band-6); }

.hero-actions {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Demo video ---------- */

/* Nothing downloads until play is pressed (preload="none" + poster). */
.demo-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: hsl(235 25% 15%);
}

/* ---------- Sections ---------- */

.section { padding: clamp(3.5rem, 8vw, 5.25rem) 0; }

.section--tint { background: var(--surface-tint); }

.section h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.55rem, 3.2vw, 1.95rem);
  font-weight: 600;
}

.section-lead { max-width: 700px; }

/* ---------- FLOW methodology ---------- */

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2.25rem;
}

@media (max-width: 860px) { .pillar-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .pillar-grid { grid-template-columns: 1fr; } }

.pillar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.1rem;
}

.pillar-letter {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 8px;
  background: hsl(205 30% 51% / 0.13);
  color: var(--band-5);
  font-size: 1.45rem;
  font-weight: 700;
}

.pillar-card h3 {
  margin: 0.9rem 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.pillar-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.spectrum-block { margin-top: 3rem; }

.spectrum-title { font-weight: 600; margin-bottom: 1rem; }

.spectrum {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
}

.seg {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: center;
}

.chip {
  display: block;
  height: 10px;
  border-radius: 3px;
}

.seg:first-child .chip { border-radius: 6px 3px 3px 6px; }
.seg:last-child .chip { border-radius: 3px 6px 6px 3px; }

.chip-1 { background: var(--band-1); }
.chip-2 { background: var(--band-2); }
.chip-3 { background: var(--band-3); }
.chip-4 { background: var(--band-4); }
.chip-5 { background: var(--band-5); }
.chip-6 { background: var(--band-6); }

.seg-label {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
  padding-inline: 0.2rem;
}

@media (max-width: 700px) {
  .spectrum { grid-template-columns: 1fr; gap: 0.55rem; }
  .seg { flex-direction: row; align-items: center; gap: 0.7rem; text-align: left; }
  .chip, .seg:first-child .chip, .seg:last-child .chip {
    width: 1rem;
    height: 1rem;
    border-radius: 5px;
    flex: none;
  }
  .seg-label { font-size: 0.9rem; }
}

/* ---------- Why Sylou + video ---------- */

.why-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.why-text h2,
.why-video h2 { margin-bottom: 0.9rem; }

.why-text p { margin: 0 0 1rem; }

.why-text p:last-child { margin-bottom: 0; }

/* Pull quotes: the demo-video quote below Why Sylou, and the FLOW-section
   quotes below the spectrum. Adjacent quotes sit slightly separated. */
.pull-quote {
  margin: clamp(2.25rem, 5vw, 3rem) 0 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--flow-accent);
  max-width: 780px;
  font-style: italic;
  font-size: clamp(1.15rem, 1.8vw, 1.28rem);
  line-height: 1.65;
  color: hsl(235 15% 26%);
}

.pull-quote p { margin: 0; }

.pull-quote + .pull-quote { margin-top: 1.4rem; }

/* The FLOW band gradient underlining the reframed question */
.quote-underline {
  background-image: linear-gradient(90deg,
    var(--band-1), var(--band-2), var(--band-3),
    var(--band-4), var(--band-5), var(--band-6));
  background-repeat: no-repeat;
  background-size: 100% 3px;
  background-position: 0 100%;
  padding-bottom: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

@media (max-width: 820px) {
  .why-grid { grid-template-columns: 1fr; }
}

/* ---------- Examples: FLOW Pledge Badges ---------- */

/* Three projects across on desktop; columns wrap as space runs out.
   (1fr as the max keeps auto-fit counting columns by the 250px minimum.) */
.badge-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-top: 2rem;
}

.badge-figure { margin: 0; }

.badge-pair {
  display: grid;
  gap: 1rem;
}

/* Real badge exports (once the PNGs land) — placeholders keep their size. */
.badge-img {
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
}

.badge-figure figcaption {
  margin-top: 0.7rem;
  font-size: 0.92rem;
  color: hsl(235 15% 30%);
}

/* ---------- Functionalities: flip cards ---------- */

.fcard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2.25rem;
}

@media (max-width: 980px) { .fcard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .fcard-grid { grid-template-columns: 1fr; } }

/* Base (no JS): faces stack inside a bordered card, everything readable. */
.fcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.fcard-face {
  padding: 1.3rem 1.3rem 1.15rem;
  display: flex;
  flex-direction: column;
}

.fcard-back { border-top: 1px dashed var(--border); }

.fcard h3 {
  margin: 0 0 0.6rem;
  font-size: 1.06rem;
  font-weight: 600;
}

.fcard h4 {
  margin: 0 0 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--flow-accent);
}

.fcard p {
  margin: 0 0 0.9rem;
  font-size: 0.93rem;
  color: hsl(235 15% 28%);
}

.fcard-list,
.pillar-list {
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: hsl(235 15% 28%);
}

.fcard-list li { padding-left: 0.9rem; position: relative; }

.fcard-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--flow-accent);
}

.pillar-list li {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
}

.pillar-list em { color: var(--muted); }

.pl {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 5px;
  background: hsl(205 30% 51% / 0.13);
  color: var(--band-5);
  font-size: 0.82rem;
  font-weight: 700;
  transform: translateY(0.2rem);
}

.fcard-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.flip-btn {
  display: none;
  margin-top: auto;
  align-self: flex-end;
  border: none;
  background: none;
  padding: 0.25rem 0;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

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

/* Enhanced (JS present): 3D flip; grid stacking sizes the card to the
   taller face, so front and back always match heights. */
.js .flip-btn { display: inline-block; }

.js .fcard {
  background: transparent;
  border: none;
  perspective: 1200px;
  cursor: pointer;
}

.js .fcard-inner {
  display: grid;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.js .fcard.is-flipped .fcard-inner { transform: rotateY(180deg); }

.js .fcard-face {
  grid-area: 1 / 1;
  position: relative;
  backface-visibility: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 100%;
  padding-bottom: 2.9rem;
}

/* The shorter face (usually the front) centers its content against the
   card height set by the taller face. */
.js .fcard-front { justify-content: center; }

.js .flip-btn {
  position: absolute;
  right: 1.2rem;
  bottom: 0.95rem;
  margin-top: 0;
}

.js .fcard-back { transform: rotateY(180deg); border-top-style: solid; }

.js .fcard:hover .fcard-face { border-color: hsl(220 13% 80%); }

@media (prefers-reduced-motion: reduce) {
  .js .fcard-inner { transition: none; }
}

/* ---------- Help shape Sylou ---------- */

.embed-frame {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.embed-frame iframe {
  display: block;
  width: 100%;
  height: 640px;
  border: 0;
}

.embed-fallback {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.75rem 0 3rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.footer-brand p {
  margin: 0;
  font-size: 0.9rem;
  color: hsl(235 15% 28%);
  line-height: 1.7;
}

.footer-fine {
  font-size: 0.84rem;
  color: hsl(235 10% 42%);
}

.footer-fine a { color: inherit; }

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
}

.footer-nav a {
  font-size: 0.92rem;
  color: hsl(235 15% 28%);
  text-decoration: none;
}

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

/* ---------- Motion ----------
   Subtle, once-only, and fully disabled under prefers-reduced-motion.
   Hidden states only apply under .js (set in <head>), so content is
   always visible without JavaScript. */

@media (prefers-reduced-motion: no-preference) {
  /* Hero entrance on load */
  .js .hero-logo,
  .js .hero h1,
  .js .hero-sub,
  .js .hero-actions {
    opacity: 0;
    transform: translateY(10px);
    animation: rise-in 0.55s ease forwards;
  }

  .js .hero h1 { animation-delay: 0.08s; }
  .js .hero-sub { animation-delay: 0.16s; }
  .js .hero-actions { animation-delay: 0.24s; }

  /* The brush underline draws itself once the headline has settled */
  .js .hand-underline-svg {
    clip-path: inset(0 100% 0 0);
    animation: draw-in 0.6s cubic-bezier(0.25, 0.6, 0.3, 1) 0.75s forwards;
  }

  /* The loop draws itself once the phrase itself is on screen (own
     observer, same lower-10% line as the FLOW scale) */
  .js .hand-circle-svg path {
    stroke-dasharray: 1.01 2;
    stroke-dashoffset: 1.05;
    transition: stroke-dashoffset 0.8s ease-out 0.2s;
  }

  .js .hand-circle.is-visible .hand-circle-svg path { stroke-dashoffset: 0; }

  /* Sections fade up once on first scroll into view */
  .js .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  /* The FLOW spectrum draws itself, AI-led -> Human-authored, once the
     scale itself sits in the upper part of the viewport (own observer). */
  .js .spectrum .chip {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s cubic-bezier(0.25, 0.6, 0.3, 1);
  }

  .js .spectrum.is-visible .chip { transform: scaleX(1); }

  .js .spectrum .seg:nth-child(1) .chip { transition-delay: 0.05s; }
  .js .spectrum .seg:nth-child(2) .chip { transition-delay: 0.13s; }
  .js .spectrum .seg:nth-child(3) .chip { transition-delay: 0.21s; }
  .js .spectrum .seg:nth-child(4) .chip { transition-delay: 0.29s; }
  .js .spectrum .seg:nth-child(5) .chip { transition-delay: 0.37s; }
  .js .spectrum .seg:nth-child(6) .chip { transition-delay: 0.45s; }

  /* Arrow links nudge on hover/focus */
  .arr { display: inline-block; transition: transform 0.15s ease; }
  a:hover .arr,
  a:focus-visible .arr { transform: translateX(3px); }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .pillar-card,
  .badge-img {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }

  .js .fcard { transition: transform 0.18s ease; }
  .js .fcard .fcard-face { transition: box-shadow 0.18s ease; }

  .pillar-card:hover,
  .js .fcard:hover,
  .badge-pair a:hover .badge-img {
    transform: translateY(-2px);
  }

  .pillar-card:hover,
  .badge-pair a:hover .badge-img {
    box-shadow: 0 6px 16px hsl(235 25% 15% / 0.06);
  }

  .js .fcard:hover .fcard-face {
    box-shadow: 0 6px 16px hsl(235 25% 15% / 0.06);
  }
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes draw-in {
  to { clip-path: inset(0 0 0 0); }
}
