/* ==========================================================================
   WisenutssX — "Calm Engineering" layer
   Loaded after style.css. Re-tones the shared tokens (so the legal pages,
   cookie banner and discovery modal match) and styles the new sections.
   ========================================================================== */

:root {
  --bg-canvas: #fbfaf7;
  --bg-canvas-subtle: #f4f2ec;
  --bg-surface: #ffffff;
  --bg-surface-low: #f4f2ec;
  --bg-surface-container: #efece4;
  --bg-surface-high: #e9e6dd;
  --bg-surface-highest: #e4e1d8;
  --text-primary: #131b2e;
  --text-secondary: #3d4559;
  --text-muted: #4a5268;          /* darker than before: passes 4.5:1 on cream */
  --border-subtle: rgba(19, 27, 46, 0.08);
  --border-card: #e4e1d8;
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;  /* legacy UI (tabs, labels, modal) stays sans */
  --c-serif: 'Newsreader', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-editorial: 'Newsreader', Georgia, serif;

  --c-ink: #131b2e;
  --c-ink-2: #3d4559;
  --c-ink-3: #4a5268;
  --c-rose: #e11d48;
  --c-rose-text: #b80035;
  --c-line: #e4e1d8;
  --c-line-art: #9aa3ba;
  --c-ease: cubic-bezier(.2, .7, .2, 1);
}

html { scroll-behavior: smooth; }
body.site-body { background: var(--bg-canvas); }
.ambient-canvas-wrapper { display: none; }

.c-container { max-width: 1180px; margin: 0 auto; padding: 0 32px; box-sizing: border-box; }
@media (max-width: 640px) { .c-container { padding: 0 20px; } }

/* ---------- Header ---------- */
.site-header.c-header {
  background: rgba(251, 250, 247, 0.92);
  box-shadow: none;
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.site-header.c-header.is-scrolled { border-bottom-color: var(--c-line); }
.c-header-row { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.c-brand { display: flex; align-items: center; gap: 10px; color: var(--c-ink); text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: .01em; }
.c-nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.c-nav a { color: var(--c-ink); text-decoration: none; }
.c-nav .tab-btn { font-family: var(--font-body); font-size: 15px; font-weight: 400; background: none !important; box-shadow: none !important; border-radius: 0; color: var(--c-ink) !important; padding: 6px 0; border-bottom: 2px solid transparent; transition: border-color .2s ease; }
.c-nav .tab-btn:hover, .c-nav .tab-btn.active { border-bottom-color: var(--c-line-art); }
.c-nav-cta { font-weight: 600; padding: 6px 0 4px !important; border-bottom: 2px solid var(--c-rose); }
@media (max-width: 900px) {
  .c-nav .tab-btn { display: none; }
}
.c-nav-cta { white-space: nowrap; }
.main-viewport { padding-top: 72px; }

/* ---------- Legal pages: serif titles at weights the font provides ---------- */
#view-legal .page-title-display, #view-legal h1, #view-legal h2 { font-family: var(--c-serif); font-weight: 500; letter-spacing: -0.01em; }
#view-legal .heartbeat-gradient, #view-legal .serif-italic-accent { color: var(--c-rose-text); -webkit-text-fill-color: currentColor; background: none; }

/* ---------- Type ---------- */
.c-eyebrow { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--c-ink-3); }
.c-h2 { margin: 0; font-family: var(--c-serif); font-weight: 400; font-size: clamp(34px, 4.4vw, 52px); line-height: 1.1; letter-spacing: -0.01em; color: var(--c-ink); }
.c-h2 em, .c-hero-title em { color: var(--c-rose-text); }
.c-h3 { margin: 0; font-family: var(--c-serif); font-weight: 500; font-size: 26px; line-height: 1.2; color: var(--c-ink); }
.c-lead { margin: 0; font-size: 19px; line-height: 1.6; color: var(--c-ink-2); max-width: 620px; }
.c-num { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-rose-text); }
.c-meta { margin: 0; font-size: 14px; color: var(--c-ink-3); }

/* ---------- Buttons & links ---------- */
.c-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 28px; border-radius: 999px; font: 600 15px var(--font-body); text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s var(--c-ease); }
.c-btn:active { transform: translateY(1px); }
.c-btn-dark { background: var(--c-ink); color: #fff; }
.c-btn-dark:hover { background: #26304a; color: #fff; }
.c-btn-outline { background: transparent; color: var(--c-ink); border-color: var(--c-ink); }
.c-btn-outline:hover { background: var(--c-ink); color: #fff; }
.c-btn-block { width: 100%; }
.c-btn:disabled { opacity: .6; cursor: progress; }
.c-link { color: var(--c-rose-text); font-weight: 600; text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .3s var(--c-ease); }
.c-link:hover { background-size: 100% 1px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--c-rose); outline-offset: 3px; }

/* ---------- Hero ---------- */
.c-hero { padding: 72px 0 56px; }
.c-hero-text { display: flex; flex-direction: column; gap: 24px; max-width: 900px; }
.c-hero-title { margin: 0; font-family: var(--c-serif); font-weight: 400; font-size: clamp(44px, 6.6vw, 80px); line-height: 1.03; letter-spacing: -0.015em; color: var(--c-ink); }
.c-hero-lead { margin: 0; font-size: 20px; line-height: 1.6; color: var(--c-ink-2); max-width: 640px; }
.c-lines { margin: 48px 0 0; }
.c-lines svg { display: block; width: 100%; height: clamp(120px, 16vw, 200px); overflow: visible; }
.c-lines path { stroke: var(--c-line-art); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.c-lines path.c-draw-accent { stroke: var(--c-rose); stroke-width: 2.2; }
.c-lines .c-beat { stroke: var(--c-rose); stroke-width: 1.2; fill: none; opacity: .35; }
.c-lines-caption { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; font-size: 14px; color: var(--c-ink-3); }
.c-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--c-line); }
@media (max-width: 640px) {
  .c-hero { padding: 40px 0 40px; }
  .c-lines-caption { flex-direction: column; gap: 4px; }
}

/* ---------- Sections ---------- */
.c-section { padding: 112px 0; }
.c-section-alt { background: var(--bg-canvas-subtle); }
.c-section-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 56px; max-width: 760px; }
@media (max-width: 640px) { .c-section { padding: 72px 0; } .c-section-head { margin-bottom: 36px; } }

.c-services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 860px) { .c-services { grid-template-columns: minmax(0, 1fr); } }
.c-service { display: flex; flex-direction: column; gap: 16px; padding: 36px; background: #fff; border: 1px solid var(--c-line); border-radius: 20px; transition: border-color .3s ease, transform .4s var(--c-ease); }
.c-service:hover { border-color: #cfcabd; transform: translateY(-2px); }
.c-service > p { margin: 0; color: var(--c-ink-2); line-height: 1.6; }
.c-service .c-link { margin-top: auto; align-self: flex-start; padding-top: 8px; }
.c-list { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; }
.c-list li { padding: 14px 0; border-top: 1px solid var(--c-line); color: var(--c-ink-2); line-height: 1.5; }
.c-list li strong { color: var(--c-ink); font-weight: 600; }
.c-strip { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 28px; border: 1px dashed #cfcabd; border-radius: 16px; }
.c-strip p { margin: 0; color: var(--c-ink-2); }
.c-strip strong { color: var(--c-ink); }

.c-principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
@media (max-width: 860px) { .c-principles { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.c-principle { display: flex; flex-direction: column; gap: 12px; padding-top: 24px; border-top: 1px solid var(--c-ink); }
.c-principle p { margin: 0; color: var(--c-ink-2); line-height: 1.6; }

/* ---------- Contact ---------- */
.c-contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: start; }
@media (max-width: 900px) { .c-contact { grid-template-columns: minmax(0, 1fr); gap: 40px; } }
.c-contact-intro { display: flex; flex-direction: column; gap: 18px; }
.c-email { font-family: var(--c-serif); font-size: 28px; color: var(--c-ink); text-decoration: none; border-bottom: 1px solid var(--c-rose); align-self: flex-start; margin-top: 8px; }
.c-email:hover { color: var(--c-rose-text); }
.c-form-box { background: #fff; border: 1px solid var(--c-line); border-radius: 20px; padding: 32px; }
@media (max-width: 640px) { .c-form-box { padding: 22px; } }
.c-form { display: flex; flex-direction: column; gap: 18px; }
.c-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 560px) { .c-form-row { grid-template-columns: minmax(0, 1fr); } }
.c-form .field-wrap label { color: var(--c-ink); font-weight: 500; }
.c-form .field-wrap input, .c-form .field-wrap select, .c-form .field-wrap textarea { background: var(--bg-canvas); border-color: var(--c-line); border-radius: 10px; min-height: 48px; font-size: 16px; }
.c-form .field-wrap input:focus, .c-form .field-wrap select:focus, .c-form .field-wrap textarea:focus { border-color: var(--c-ink); box-shadow: 0 0 0 3px rgba(19,27,46,.08); }
.c-form .contact-consent-label { font-size: 14px; color: var(--c-ink-2); }
.c-form .confirmation-card h4 { font-family: var(--c-serif); font-weight: 500; font-size: 22px; }

/* ---------- Footer ---------- */
.site-footer.c-footer { background: var(--c-ink); color: #c9cfe0; padding: 72px 0 32px; border: 0; }
.c-footer a { color: #fff; }
.c-footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
@media (max-width: 760px) { .c-footer-grid { grid-template-columns: minmax(0, 1fr); } }
.c-footer-brand { display: flex; flex-direction: column; gap: 12px; }
.c-footer-brand p { margin: 0; line-height: 1.6; }
.c-footer-name { font-family: var(--c-serif); font-size: 28px; color: #fff; }
.c-footer-col h4 { margin: 0 0 12px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #9aa3ba; font-weight: 600; }
.c-footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.c-footer .footer-tab-link { background: none; border: 0; padding: 6px 0; color: #e6e9f2; font: 400 15px var(--font-body); cursor: pointer; text-align: left; }
.c-footer .footer-tab-link:hover { color: #fff; text-decoration: underline; }
.c-footer-disclaimer { margin: 48px 0 0; padding-top: 24px; border-top: 1px solid #2c3754; font-size: 13px; line-height: 1.6; color: #a9b0c4; }
.c-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: 13px; color: #a9b0c4; }
.c-footer-bottom p { margin: 0; }

/* ==========================================================================
   Motion
   ========================================================================== */

/* Hero text rises once */
@keyframes cRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.c-rise { animation: cRise .8s var(--c-ease) both; animation-delay: var(--d, 0ms); }

/* Hero lines: tangled → straight, drawn once */
.c-lines path { stroke-dasharray: 1600; stroke-dashoffset: 1600; }
.c-ready .c-lines path { animation: cDraw 3.2s cubic-bezier(.4, 0, .2, 1) forwards; animation-delay: var(--d, 0s); }
@keyframes cDraw { to { stroke-dashoffset: 0; } }

/* One soft heartbeat, slow */
.c-ready .c-lines .c-beat { animation: cBeat 4s ease-in-out 3.4s infinite; }
@keyframes cBeat { 0%, 70%, 100% { opacity: .25; transform: scale(1); } 78% { opacity: 1; transform: scale(1.06); } }
.c-lines .c-beat { transform-box: fill-box; transform-origin: center; }

/* Scroll reveals (only when JS confirms motion is OK) */
.c-motion [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--c-ease), transform .8s var(--c-ease); transition-delay: var(--d, 0ms); }
.c-motion [data-reveal].is-in { opacity: 1; transform: none; }

/* Respect "reduce motion": everything visible, nothing moves */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .c-lines path { stroke-dashoffset: 0; }
  .c-motion [data-reveal] { opacity: 1; transform: none; }
}
