/* ==========================================================================
   Trifolix v3 — rebrand: navy + coral, light-first with dark mode
   Plain CSS, no build step. Alpine.js for interaction only.
   ========================================================================== */

:root {
  --navy: #1e293b;
  --ink: #0f1b2d;
  --ink-2: #334155;
  --muted: #64748b;

  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --line: #e6ecf4;

  --coral: #ff6b6b;
  --coral-strong: #ef4444;
  --coral-soft: #ffd9d6;
  --coral-tint: #fff1f0;

  --grad: linear-gradient(135deg, #ff8a7a, #ef4444);

  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .06);
  --shadow: 0 18px 40px -22px rgba(15, 27, 45, .35);
  --shadow-lg: 0 40px 80px -40px rgba(15, 27, 45, .5);

  --container: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --grid-line: rgba(30, 41, 59, .05);
}

[data-theme="dark"] {
  --ink: #eaf1f9;
  --ink-2: #b9c6d6;
  --muted: #8ea0b6;
  --bg: #0a101b;
  --surface: #111a29;
  --surface-2: #16202f;
  --line: #202c3d;
  --coral-soft: #46262a;
  --coral-tint: #241519;
  --grid-line: rgba(255, 255, 255, .05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--coral-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { padding: 0; list-style: none; }
[x-cloak] { display: none !important; }

h1, h2, h3, h4 { line-height: 1.1; letter-spacing: -0.025em; font-weight: 800; color: var(--ink); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--coral) 60%, white);
  outline-offset: 2px;
  border-radius: 6px;
}

.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;
}

/* --- Layout -------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 22px; }
.section { padding: 96px 0; }
.section--tight { padding: 64px 0; }

.grid-bg {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--coral-strong);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--grad); border-radius: 2px; }

.section__head { max-width: 760px; margin-bottom: 52px; }
.section__title { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.9rem); margin-top: 16px; }
.section__lead { color: var(--muted); margin-top: 16px; font-size: 1.08rem; }
.center { text-align: center; margin-inline: auto; }
.center .eyebrow::before { display: none; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .85em 1.5em; font: inherit; font-weight: 700; line-height: 1;
  color: #fff; background: var(--navy); border: 1px solid transparent;
  border-radius: var(--radius-pill); cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--coral { background: var(--grad); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--on-dark { background: #fff; color: var(--navy); }

/* --- Header -------------------------------------------------------------- */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--navy); color: #fff; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.site-header.is-scrolled { border-color: var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 20px; min-height: 72px; }

.brand { display: inline-flex; align-items: center; gap: .6rem; flex: none; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 32px; height: 32px; }
.brand__name { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--ink); }

.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: 2px; }
.nav__link { padding: .55em .9em; color: var(--ink-2); font-weight: 600; font-size: .95rem; border-radius: var(--radius-pill); }
.nav__link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav__link[aria-current="page"] { color: var(--coral-strong); }
.nav__cta { margin-left: 8px; padding: .7em 1.2em; }

.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

.nav-toggle { display: none; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle__bars { position: relative; width: 18px; height: 14px; }
.nav-toggle__bars span { position: absolute; left: 0; width: 100%; height: 2px; background: var(--ink); border-radius: 2px; transition: all .25s ease; }
.nav-toggle__bars span:nth-child(1) { top: 0; }
.nav-toggle__bars span:nth-child(2) { top: 6px; }
.nav-toggle__bars span:nth-child(3) { top: 12px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* --- Drawer -------------------------------------------------------------- */
.drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(15, 27, 45, .5); }
.drawer__panel { position: relative; width: min(360px, 86vw); height: 100%; background: var(--surface); padding: 22px; box-shadow: var(--shadow-lg); overflow-y: auto; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.drawer__close { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); font-size: 1.4rem; line-height: 1; color: var(--ink); cursor: pointer; }
.drawer__list { display: grid; gap: 4px; }
.drawer__link { display: block; padding: .85em .9em; border-radius: var(--radius-sm); color: var(--ink); font-weight: 600; font-size: 1.05rem; }
.drawer__link:hover { background: var(--surface-2); text-decoration: none; }
.drawer__cta { margin-top: 18px; width: 100%; justify-content: center; }
.drawer__theme { margin-top: 18px; width: 100%; justify-content: center; }

/* Logo swaps with theme (light-bg chip vs dark-bg chip). */
.logo-on-light { display: block; }
.logo-on-dark { display: none; }
[data-theme="dark"] .logo-on-light { display: none; }
[data-theme="dark"] .logo-on-dark { display: block; }

/* --- Hero ---------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: 32px 0 36px; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero__slides { display: grid; }
.hero__slide {
  grid-area: 1 / 1;
  align-self: start;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease;
}
.hero__slide.is-active { opacity: 1; visibility: visible; }
.hero__kicker {
  display: inline-flex; align-items: center; gap: .5em; margin-bottom: 20px;
  padding: .5em 1em; font-size: .8rem; font-weight: 700; color: var(--coral-strong);
  background: var(--coral-tint); border: 1px solid var(--coral-soft); border-radius: var(--radius-pill);
}
.hero__title {
  font-size: clamp(1.9rem, 1.1rem + 2.6vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.hero__title span { display: block; font-weight: 600; font-size: .5em; color: var(--muted); letter-spacing: -0.01em; margin-top: .5em; }

.hero__dots { grid-area: 2 / 1; display: flex; gap: 10px; margin-top: 44px; }
.hero__dot { width: 30px; height: 5px; padding: 0; border: 0; border-radius: var(--radius-pill); background: var(--line); cursor: pointer; transition: width .2s ease, background .2s ease; }
.hero__dot[aria-current="true"] { background: var(--grad); width: 44px; }

.hero__art { position: relative; display: grid; place-items: center; }
.hero__chip {
  width: min(250px, 62%);
  filter: drop-shadow(0 30px 50px rgba(239, 68, 68, .25));
  animation: float 7s ease-in-out infinite;
}
.hero__art::before {
  content: ""; position: absolute; inset: 8% 12%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--coral) 30%, transparent), transparent 68%);
  filter: blur(30px); z-index: -1;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* --- Bento cards --------------------------------------------------------- */
.bento { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
.tile {
  position: relative; overflow: hidden;
  padding: 32px 28px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--coral-soft); }
.tile--wide { grid-column: span 2; }
.tile__icon {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 20px;
  border-radius: 14px; color: var(--coral-strong); background: var(--coral-tint); border: 1px solid var(--coral-soft);
}
.tile__title { font-size: 1.25rem; margin-bottom: 10px; }
.tile__text { color: var(--muted); }
.tile__num { position: absolute; top: 24px; right: 28px; font-size: .78rem; font-weight: 800; letter-spacing: .1em; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.stat__num { font-size: clamp(1.8rem, 1.2rem + 1.6vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; }
.stat__label { color: var(--muted); margin-top: 4px; }

/* --- Segmented about ----------------------------------------------------- */
.segmented { display: inline-flex; gap: 4px; padding: 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-pill); margin-bottom: 32px; }
.seg { padding: .6em 1.2em; font: inherit; font-weight: 600; color: var(--ink-2); background: transparent; border: 0; border-radius: var(--radius-pill); cursor: pointer; transition: color .2s ease, background .2s ease; }
.seg[aria-selected="true"] { color: #fff; background: var(--navy); }
[data-theme="dark"] .seg[aria-selected="true"] { background: var(--coral); }
.about-panel { max-width: 780px; }
.about-panel h3 { font-size: 1.5rem; margin-bottom: 8px; }
.about-panel__sub { color: var(--coral-strong); font-weight: 700; margin-bottom: 16px; }
.about-panel p { color: var(--ink-2); }
.about-panel p + p { margin-top: 14px; }

/* --- Timeline (process) -------------------------------------------------- */
.timeline { position: relative; display: grid; gap: 18px; }
.tl {
  display: grid; grid-template-columns: 76px 1fr; gap: 22px; align-items: start;
  padding: 26px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.tl__num {
  display: grid; place-items: center; width: 56px; height: 56px;
  font-size: 1.1rem; font-weight: 800; color: var(--coral-strong);
  background: var(--coral-tint); border: 1px solid var(--coral-soft); border-radius: 16px;
}
.tl__title { font-size: 1.15rem; }
.tl__text { color: var(--muted); margin-top: 6px; }

/* --- Page hero ----------------------------------------------------------- */
.page-hero { position: relative; padding: 62px 0 50px; overflow: hidden; }
.page-hero h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); margin-top: 18px; }
.page-hero p { color: var(--muted); margin-top: 16px; max-width: 620px; font-size: 1.08rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); }
.crumb-sep { margin: 0 .5em; color: var(--coral); }

/* --- Services / clients -------------------------------------------------- */
.groups { display: grid; gap: 44px; }
.group__title { font-size: 1.2rem; margin-bottom: 18px; display: flex; align-items: center; gap: .6em; }
.group__title::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--grad); }
.tags { display: flex; flex-wrap: wrap; gap: 12px; }
.tag {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .7em 1.15em; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-pill); color: var(--ink-2); font-weight: 600; font-size: .95rem;
  box-shadow: var(--shadow-sm);
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.tag--plain::before { display: none; }

/* --- Marquee (clients) --------------------------------------------------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: 14px; width: max-content; animation: scroll-x 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* --- Contact ------------------------------------------------------------- */
.contact-grid { display: grid; gap: 24px; grid-template-columns: 1.1fr .9fr; align-items: start; }
.panel { padding: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 1.25rem; margin-bottom: 18px; }
.info-list { display: grid; gap: 20px; }
.info-list dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; }
.info-list dd { margin: 5px 0 0; font-size: 1.15rem; color: var(--ink); }
.panel .btn { margin-top: 26px; }
.panel p + p { margin-top: 12px; }

/* --- Legal --------------------------------------------------------------- */
.legal { max-width: 820px; margin-inline: auto; }
.legal h2 { margin-top: 36px; font-size: 1.4rem; }
.legal p { margin-top: 12px; color: var(--ink-2); }
.legal ul { list-style: disc; padding-left: 1.4em; margin-top: 12px; display: grid; gap: 8px; color: var(--ink-2); }
.legal .updated { color: var(--muted); font-size: .92rem; }

/* --- CTA ----------------------------------------------------------------- */
.cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
  padding: 52px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy), #0b1526);
  color: #fff; position: relative; overflow: hidden;
}
.cta::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 107, 107, .5), transparent 68%); pointer-events: none; }
.cta h2 { color: #fff; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); position: relative; }
.cta p { color: #c9d4e2; margin-top: 8px; position: relative; }
.cta .btn { position: relative; }

/* --- Footer -------------------------------------------------------------- */
.site-footer { background: #0b1526; color: #9fb0c3; padding-top: 68px; }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1.4fr 1fr 1fr; padding-bottom: 48px; }
.footer-brand .brand__name { color: #fff; }
.footer-brand img { width: 40px; height: 40px; margin-bottom: 18px; }
.footer-brand p { max-width: 320px; }
.footer__title { color: #fff; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 16px; }
.footer__list { display: grid; gap: 10px; }
.site-footer a { color: #9fb0c3; }
.site-footer a:hover { color: #fff; }
.footer-contact address { font-style: normal; display: grid; gap: 10px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 22px 0; font-size: .88rem; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__art { order: -1; }
  .hero__chip { width: min(180px, 46%); }
  .bento { grid-template-columns: 1fr 1fr; }
  .tile--wide { grid-column: span 2; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .icon-btn--theme { display: none; }
  .section { padding: 64px 0; }
  .hero { padding: 28px 0 36px; }
  .bento { grid-template-columns: 1fr; }
  .tile--wide { grid-column: auto; }
  .stats { grid-template-columns: 1fr; gap: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .cta { padding: 34px 26px; }
  .tl { grid-template-columns: 60px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
