:root {
  /* Palette pulled from the Trei logo — warm pastels + charcoal ink */
  --brand-primary: #8E7AA0;     /* muted lavender */
  --brand-primary-soft: #B49EC1;/* lighter lavender for gradients */
  --brand-cta: #E6A58A;          /* peach */
  --bg: #FAF6F2;                 /* cream */
  --surface: #FFFFFF;
  --surface-muted: #F3ECE4;      /* warm off-white panel */
  --text: #2A221F;               /* warm near-black */
  --text-muted: #6E6159;         /* warm taupe */
  --border: #EAE0D5;             /* soft sand */
  --shadow-sm: 0 1px 2px rgba(42, 34, 31, 0.05), 0 1px 3px rgba(42, 34, 31, 0.06);
  --shadow-md: 0 4px 12px rgba(42, 34, 31, 0.06), 0 2px 6px rgba(42, 34, 31, 0.04);
  --shadow-lg: 0 20px 40px rgba(42, 34, 31, 0.08), 0 8px 16px rgba(42, 34, 31, 0.04);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --header-h: 72px;
  --container: 1160px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Display tones for tiles / gradients / bars — harmonised with warm palette */
  --accent-blue: #6E8AB0;        /* dusted denim */
  --accent-amber: #D39242;       /* honey */
  --accent-slate: #7F6F66;       /* taupe */
  --accent-emerald: #6FA383;     /* sage */
  --accent-rose: #C97B86;        /* dusty rose */
  --accent-purple: #8E7AA0;      /* lavender (matches brand) */
  --accent-cyan: #7BA9B1;        /* dusty teal */
  --accent-teal: #719C90;        /* moss */
  --accent-orange: #D48067;      /* terracotta */
  /* Ink tones for pill / badge text — AA contrast on 14% tint over cream */
  --ink-blue: #3F5F82;
  --ink-amber: #7A4F18;
  --ink-slate: #4A3E36;
  --ink-emerald: #3C6A4C;
  --ink-rose: #934350;
  --ink-purple: #5C4A6D;
  --ink-cyan: #446F77;
  --ink-teal: #3F6458;
  --ink-orange: #8E4531;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1310;
    --surface: #241C18;
    --surface-muted: #332721;
    --text: #F3E8DE;
    --text-muted: #B0A297;
    --border: #3B2C24;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.55);
    /* Flip ink tokens to light accent tints for legibility on dark cocoa surfaces */
    --ink-blue:    color-mix(in srgb, var(--accent-blue)    35%, white);
    --ink-amber:   color-mix(in srgb, var(--accent-amber)   40%, white);
    --ink-slate:   color-mix(in srgb, var(--accent-slate)   30%, white);
    --ink-emerald: color-mix(in srgb, var(--accent-emerald) 35%, white);
    --ink-rose:    color-mix(in srgb, var(--accent-rose)    40%, white);
    --ink-purple:  color-mix(in srgb, var(--accent-purple)  35%, white);
    --ink-cyan:    color-mix(in srgb, var(--accent-cyan)    35%, white);
    --ink-teal:    color-mix(in srgb, var(--accent-teal)    35%, white);
    --ink-orange:  color-mix(in srgb, var(--accent-orange)  40%, white);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  .reveal, .reveal-hero > * { opacity: 1 !important; transform: none !important; }
}

/* ---- Animations ------------------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  60%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); }
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-emerald) 20%, transparent); }
  50%      { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent-emerald) 0%, transparent); }
}

/* Hero entrance — staggered */
.reveal-hero > * {
  opacity: 0;
  animation: fadeUp 600ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.reveal-hero > .hero-mark  { animation-name: scaleIn; animation-delay:  40ms; }
.reveal-hero > .eyebrow    { animation-delay: 160ms; }
.reveal-hero > .hero-title { animation-delay: 240ms; }
.reveal-hero > .hero-sub   { animation-delay: 340ms; }
.reveal-hero > .hero-ctas  { animation-delay: 440ms; }
.reveal-hero > .hero-meta  { animation-delay: 540ms; }

/* Scroll-triggered card reveal (toggled by IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-visible {
  animation: fadeUp 520ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
.badge:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-primary) 70%, transparent);
  outline-offset: 3px;
  border-radius: 8px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--text) 6%, transparent),
    0 2px 4px rgba(15, 23, 42, 0.08);
}
.brand-logo-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.nav a {
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  transition: color 160ms ease, background 160ms ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover {
  color: var(--text);
  background: var(--surface-muted);
}

/* Hero */
.hero {
  padding: 72px 0 56px;
  position: relative;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -160px 0 auto 0;
  height: 520px;
  background:
    radial-gradient(700px 300px at 18% 28%, color-mix(in srgb, var(--brand-primary) 22%, transparent), transparent 70%),
    radial-gradient(520px 260px at 86% 18%, color-mix(in srgb, var(--brand-cta) 22%, transparent), transparent 72%);
  z-index: -1;
  pointer-events: none;
}
.hero-mark {
  width: 104px;
  height: 104px;
  border-radius: 24px;
  overflow: hidden;
  margin: 0 0 24px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--text) 7%, transparent),
    0 16px 32px rgba(15, 23, 42, 0.12),
    0 4px 8px rgba(15, 23, 42, 0.06);
}
.hero-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin: 0 0 28px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-emerald) 20%, transparent);
  animation: dotPulse 2.4s ease-in-out infinite;
}
.hero-title {
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 20px;
  max-width: 18ch;
}
.grad-text {
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-cta) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-sub {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 58ch;
  margin: 0 0 32px;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: transform 160ms ease, box-shadow 200ms ease, background 160ms ease, color 160ms ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-cta) 100%);
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand-primary) 30%, transparent);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--brand-primary) 40%, transparent);
  filter: brightness(1.04);
}
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-muted); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
}
.hero-meta strong {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hero-meta .sep {
  color: color-mix(in srgb, var(--text-muted) 45%, transparent);
}

/* Section heads */
.section-head {
  margin-bottom: 32px;
}
.section-head h2 {
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  font-weight: 700;
}
.section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 17px;
}

/* Apps bento */
.apps {
  padding: 32px 0 80px;
}
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  grid-column: span 2;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease, border-color 220ms ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  opacity: 0.85;
  transition: height 220ms ease, opacity 220ms ease;
}
.card[data-accent="blue"]   { --accent: var(--accent-blue);    --ink: var(--ink-blue); }
.card[data-accent="amber"]  { --accent: var(--accent-amber);   --ink: var(--ink-amber); }
.card[data-accent="slate"]  { --accent: var(--accent-slate);   --ink: var(--ink-slate); }
.card[data-accent="emerald"]{ --accent: var(--accent-emerald); --ink: var(--ink-emerald); }
.card[data-accent="rose"]   { --accent: var(--accent-rose);    --ink: var(--ink-rose); }
.card[data-accent="purple"] { --accent: var(--accent-purple);  --ink: var(--ink-purple); }
.card[data-accent="cyan"]   { --accent: var(--accent-cyan);    --ink: var(--ink-cyan); }
.card[data-accent="teal"]   { --accent: var(--accent-teal);    --ink: var(--ink-teal); }
.card[data-accent="orange"] { --accent: var(--accent-orange);  --ink: var(--ink-orange); }
.card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent),
    var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.card:hover::before { opacity: 1; height: 4px; }

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--text) 6%, transparent),
    0 2px 4px rgba(15, 23, 42, 0.06);
}
.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.icon-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, white));
}

.card-body h3 {
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 6px 0 6px;
  font-weight: 700;
}
.card-body h3 .card-link {
  color: inherit;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1.5px;
  transition: background-size 220ms ease, color 220ms ease;
}
.card:hover .card-body h3 .card-link,
.card-body h3 .card-link:focus-visible {
  background-size: 100% 1.5px;
  color: var(--ink, var(--text));
}
.card-body .alias {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75em;
  letter-spacing: -0.005em;
}
.card-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
}
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink, var(--text));
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
  padding: 5px 10px;
  border-radius: 999px;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-radius: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}
.badge img {
  width: auto;
  display: block;
}
/* Tuned per brand: Google Play PNG has internal padding so it fills 48px;
   Apple's SVG is tighter so it reads heavier — render at 42px to match. */
.badge-play img  { height: 48px; }
.badge-apple img { height: 42px; }
.badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.badge-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.card-soon {
  background: var(--surface-muted);
}
.card-soon .card-icon {
  filter: saturate(0.4) opacity(0.85);
}
.card-soon::after {
  content: "Coming soon";
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--ink, var(--text));
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  animation: breathe 2.6s ease-in-out infinite;
}

/* About */
.about {
  padding: 40px 0 80px;
}
.about-wrap {
  max-width: 780px;
  margin: 0 0 40px;
}
.about h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.about-wrap p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
}

/* Principles grid */
.principles {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.principle {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease, border-color 220ms ease;
}
.principle[data-accent="purple"]  { --accent: var(--accent-purple);  --ink: var(--ink-purple); }
.principle[data-accent="emerald"] { --accent: var(--accent-emerald); --ink: var(--ink-emerald); }
.principle[data-accent="amber"]   { --accent: var(--accent-amber);   --ink: var(--ink-amber); }
.principle[data-accent="cyan"]    { --accent: var(--accent-cyan);    --ink: var(--ink-cyan); }
.principle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.principle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--ink, var(--text));
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.principle h3 {
  margin: 4px 0 0;
  font-size: 16px;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--text);
}
.principle p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 56px;
  background: var(--surface);
}
.footer-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
}
.footer-contact p {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.footer-contact .mail,
.footer-contact .whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid color-mix(in srgb, var(--brand-primary) 40%, transparent);
  padding-bottom: 2px;
  min-height: 32px;
}
.footer-contact .whatsapp {
  color: var(--text);
  border-color: color-mix(in srgb, #25D366 50%, transparent);
}
.footer-contact .whatsapp svg {
  color: #25D366;
}
.footer-contact .mail:hover {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.footer-contact .whatsapp:hover {
  color: #128C7E;
  border-color: #25D366;
}
.footer-nav {
  display: flex;
  gap: 8px;
}
.footer-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
.footer-nav a:hover {
  background: var(--surface-muted);
  color: var(--text);
}

/* Tablet */
@media (max-width: 960px) {
  .bento {
    grid-template-columns: repeat(4, 1fr);
  }
  .card {
    grid-column: span 2;
    grid-row: auto;
  }
  .principles { grid-template-columns: repeat(2, 1fr); }
}

/* Phablet — keep 2-col for small cards to reduce scroll */
@media (max-width: 640px) {
  .hero { padding: 56px 0 40px; }
  .bento { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .card { grid-column: auto; padding: 18px; }
  .card-body h3 { font-size: 17px; }
  .card-body p  { font-size: 14px; }
  .card-actions { gap: 8px; }
  .badge { height: 42px; }
  .badge-play img  { height: 42px; }
  .badge-apple img { height: 36px; }
  .badge-soon { height: 42px; padding: 0 12px; font-size: 12.5px; }
  .hero-meta { font-size: 13px; gap: 6px 10px; }
  .nav { gap: 2px; }
  .nav a { padding: 8px 10px; font-size: 14px; }
  .footer-wrap { flex-direction: column; align-items: flex-start; }
}

/* Small phone — collapse bento fully */
@media (max-width: 440px) {
  .bento { grid-template-columns: 1fr; }
  .card { grid-column: auto; }
  .principles { grid-template-columns: 1fr; }
}
