/* Dawn Routine — shared styles
   Light and dark follow the visitor's system setting. Fonts are self-hosted (no third-party requests). */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #fbfaf7;
  --bg-soft: #f4f1ea;
  --surface: #ffffff;
  --ink: #0d1330;
  --muted: #565c73;
  --faint: #8a8fa3;
  --line: #e7e3da;
  --accent: #b9570f;          /* links and small text accents */
  --display: #d9691a;         /* serif highlight words */
  --sun: #ffb648;
  --glow: rgba(255, 150, 60, 0.30);
  --chip: #f3eee5;
  --feature-ico: #1f8fe0;
  --shadow-sm: 0 1px 2px rgba(13, 19, 48, 0.05);
  --shadow: 0 1px 2px rgba(13, 19, 48, 0.04), 0 18px 40px -18px rgba(13, 19, 48, 0.18);
  --radius: 22px;
  --wrap: 1120px;
  --hero-bg:
    radial-gradient(70% 55% at 72% 62%, rgba(255, 183, 110, 0.38), transparent 70%),
    radial-gradient(120% 80% at 50% 120%, #fde2c2 0%, rgba(253, 226, 194, 0) 60%),
    linear-gradient(180deg, #fbfaf7 0%, #fbf4ea 100%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070a16;
    --bg-soft: #0a0f20;
    --surface: #0f1529;
    --ink: #eef0f8;
    --muted: #a3aac1;
    --faint: #6f7792;
    --line: #1b2340;
    --accent: #ffb35c;
    --display: #ffb35c;
    --glow: rgba(255, 140, 40, 0.28);
    --chip: #151c35;
    --feature-ico: #5fd7ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.7);
    --hero-bg:
      radial-gradient(60% 50% at 72% 60%, rgba(255, 140, 40, 0.20), transparent 70%),
      radial-gradient(110% 70% at 50% 125%, rgba(255, 130, 40, 0.30) 0%, rgba(255, 130, 40, 0) 60%),
      linear-gradient(180deg, #060914 0%, #0a1029 100%);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }

h1, h2, h3, h4 { color: var(--ink); margin: 0; letter-spacing: -0.02em; }

h1 em, h2 em {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--display);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--sun), transparent);
}

.lede { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 22px 0 0; }

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }

.nav nav { display: flex; gap: 6px; }
.nav nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  transition: color .2s, background .2s;
}
.nav nav a:hover { color: var(--ink); background: var(--chip); }

/* ---------- Buttons & chips ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 0.97rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.btn.ghost { color: var(--ink); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.btn.ghost:hover { border-color: var(--faint); }
.btn svg { width: 18px; height: 18px; flex: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--chip);
  color: var(--muted);
  white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px rgba(255, 182, 72, 0.18); }
.pill.live .dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18); }

/* ---------- Home hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  border-bottom: 1px solid var(--line);
}
.hero-in {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
  padding: 104px 24px 120px;
}
.hero h1 {
  font-size: clamp(2.7rem, 6.2vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 650;
}
.hero h1 em { letter-spacing: -0.02em; }

.hero-art { position: relative; display: grid; place-items: center; }
.hero-art::before {
  content: "";
  position: absolute;
  width: 115%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 62%);
  filter: blur(10px);
}
.hero-logo {
  position: relative;
  width: min(340px, 72vw);
  height: auto;
  border-radius: 24%;
  box-shadow: 0 40px 80px -30px rgba(10, 20, 60, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) both;
}

.horizon {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -1px;
  height: 120px;
  background: radial-gradient(60% 100% at 50% 100%, color-mix(in srgb, var(--sun) 35%, transparent), transparent 70%);
  pointer-events: none;
  opacity: .6;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.fade-up { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.fade-up.d1 { animation-delay: .08s; }
.fade-up.d2 { animation-delay: .16s; }
.fade-up.d3 { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

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

.section { padding: 112px 0; }
.section.soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head p { max-width: 620px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -0.035em; font-weight: 650; }
.section-head p { color: var(--muted); font-size: 1.08rem; margin: 18px 0 0; }

/* ---------- App cards ---------- */

.apps { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .3s, box-shadow .3s;
}
a.app-card { color: inherit; text-decoration: none; }
a.app-card:hover { transform: translateY(-3px); }
.app-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--card-tint, var(--sun)), transparent);
  opacity: .8;
}
.app-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.app-icon { width: 76px; height: 76px; border-radius: 22%; box-shadow: 0 14px 28px -14px rgba(10, 30, 90, 0.6); }
.app-card h3 { font-size: 1.6rem; letter-spacing: -0.03em; margin-top: 28px; font-weight: 650; }
.app-card .tagline { margin: 6px 0 0; color: var(--display); font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: 1.3rem; }
.app-card .desc { color: var(--muted); margin: 16px 0 0; }
.app-card .more {
  margin-top: auto;
  padding-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.app-card .more svg { width: 16px; height: 16px; transition: transform .25s; }
a.app-card:hover .more svg { transform: translateX(4px); }
.app-card .more.quiet { color: var(--faint); font-weight: 500; }
.app-card.trigo { --card-tint: #2fb8ff; }
.app-card.vehicle { --card-tint: #3a7bff; }

/* ---------- Principles ---------- */

.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.principle {
  padding: 32px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.principle .ico {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--sun) 28%, transparent), color-mix(in srgb, var(--sun) 6%, transparent));
  color: var(--display);
}
.principle .ico svg { width: 22px; height: 22px; }
.principle h3 { font-size: 1.15rem; margin-top: 22px; font-weight: 650; }
.principle p { color: var(--muted); margin: 8px 0 0; font-size: 0.98rem; }

/* ---------- Contact ---------- */

.contact {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.3fr auto;
  align-items: center;
  gap: 32px;
  padding: 56px;
  border-radius: 28px;
  background:
    radial-gradient(70% 120% at 100% 100%, rgba(255, 140, 40, 0.35), transparent 60%),
    linear-gradient(140deg, #0a1233 0%, #0b1a44 55%, #142259 100%);
  color: #eef0f8;
  box-shadow: var(--shadow);
}
.contact h2 { color: #fff; font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -0.035em; line-height: 1.1; font-weight: 650; }
.contact h2 em { color: #ffc177; }
.contact p { color: #b9c0d9; margin: 14px 0 0; max-width: 520px; }
.contact .btn.primary { background: #fff; color: #0b1a44; }

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

.foot { border-top: 1px solid var(--line); margin-top: 112px; }
.foot-in { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding: 56px 24px 40px; }
.foot-brand p { color: var(--muted); font-size: 0.93rem; margin: 14px 0 0; max-width: 260px; }
.foot h4 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 14px; }
.foot-col a, .foot-col span { display: block; color: var(--muted); text-decoration: none; font-size: 0.94rem; padding: 4px 0; }
.foot-col a:hover { color: var(--ink); }
.foot-col span { color: var(--faint); }
.foot-base { display: flex; justify-content: space-between; gap: 16px; padding: 22px 24px 40px; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.86rem; }

/* ---------- Product page (TrigoCalc) ---------- */

.product-hero {
  position: relative;
  overflow: hidden;
  color: #eef3ff;
  background:
    radial-gradient(55% 60% at 78% 45%, rgba(0, 170, 255, 0.28), transparent 70%),
    radial-gradient(80% 60% at 20% 110%, rgba(40, 90, 255, 0.30), transparent 70%),
    linear-gradient(170deg, #040a1f 0%, #071434 55%, #0a1c4a 100%);
}
.product-hero::before {
  /* faint geometric grid, a nod to trigonometry */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 170, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 255, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 70% at 60% 40%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 70% at 60% 40%, #000, transparent 75%);
}
.product-in {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 40px;
  padding: 88px 24px 0;
}
.product-copy { padding-bottom: 96px; }
.product-copy .app-icon { width: 88px; height: 88px; }
.product-hero .eyebrow { color: #8fb4ff; margin-top: 28px; }
.product-hero .eyebrow::before { background: linear-gradient(90deg, #38d0ff, transparent); }
.product-hero h1 { color: #fff; font-size: clamp(2.8rem, 6vw, 4.6rem); line-height: 1; letter-spacing: -0.045em; font-weight: 700; }
.product-hero h1 em { color: #5fd7ff; }
.product-hero .lede { color: #b4c3e6; }
.product-hero .btn.primary { background: #fff; color: #071434; }
.product-hero .btn.ghost { color: #eef3ff; border-color: rgba(160, 190, 255, 0.28); background: rgba(255, 255, 255, 0.04); }
.product-hero .btn.ghost:hover { border-color: rgba(160, 190, 255, 0.6); }
.btn.soon { cursor: default; }
.btn.soon:hover { transform: none; }

.product-meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 36px; color: #8ea0c8; font-size: 0.9rem; }
.product-meta span { display: inline-flex; align-items: center; gap: 8px; }
.product-meta svg { width: 16px; height: 16px; color: #5fd7ff; }

.phones { position: relative; display: flex; justify-content: center; align-items: flex-end; min-height: 560px; }
.phone {
  width: 290px;
  padding: 9px;
  border-radius: 40px;
  background: linear-gradient(160deg, #2a3350, #0b0f1d 40%);
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.phone img { width: 100%; height: auto; border-radius: 32px; aspect-ratio: 720 / 1248; object-fit: cover; background: #0e0e16; }
.phones .phone.front { position: relative; z-index: 2; margin-left: -110px; transform: translateY(40px); }
.phones .phone.back { position: relative; z-index: 1; transform: translateY(-30px) rotate(-5deg) scale(.9); }

/* Screens gallery */
.gallery { display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px; }
.gallery figure { margin: 0; }
.gallery .phone { width: 100%; padding: 7px; border-radius: 32px; box-shadow: var(--shadow); }
.gallery .phone img { border-radius: 26px; }
.gallery figcaption { margin-top: 16px; text-align: center; font-size: 0.92rem; color: var(--muted); }
.gallery figcaption strong { display: block; color: var(--ink); font-weight: 600; font-size: 0.98rem; }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature { background: var(--surface); padding: 30px 28px 32px; }
.feature .ico {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(160deg, rgba(47, 184, 255, 0.22), rgba(58, 123, 255, 0.08));
  color: var(--feature-ico);
}
.feature .ico svg { width: 20px; height: 20px; }
.feature h3 { font-size: 1.02rem; margin-top: 20px; font-weight: 650; letter-spacing: -0.01em; }
.feature p { margin: 8px 0 0; color: var(--muted); font-size: 0.93rem; line-height: 1.55; }

.support-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 32px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.support-strip h3 { font-size: 1.25rem; font-weight: 650; }
.support-strip p { margin: 6px 0 0; color: var(--muted); }
.support-strip .links { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Legal documents ---------- */

.doc-hero { background: var(--hero-bg); border-bottom: 1px solid var(--line); }
.doc-hero .wrap { max-width: 820px; padding-top: 80px; padding-bottom: 56px; }
.doc-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.04em; line-height: 1.05; font-weight: 650; }
.doc-hero .meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.doc { max-width: 820px; margin: 0 auto; padding: 56px 24px 0; }
.doc > p:first-child { font-size: 1.12rem; color: var(--ink); }
.doc p, .doc li { color: var(--muted); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc h2 {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 52px 0 12px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.doc h3 { font-size: 1.05rem; font-weight: 650; margin: 28px 0 8px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 8px 0; }
.doc li::marker { color: var(--display); }

/* ---------- 404 ---------- */

.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; background: var(--hero-bg); padding: 80px 16px; }
.notfound h1 { font-size: clamp(3rem, 9vw, 6rem); letter-spacing: -0.05em; font-weight: 650; }
.notfound p { color: var(--muted); }
.notfound .actions { justify-content: center; }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .hero-in, .product-in { grid-template-columns: 1fr; }
  .hero-in { padding: 72px 24px 88px; gap: 56px; }
  .hero-art { order: -1; }
  .hero-logo { width: min(240px, 60vw); }
  .product-copy { padding-bottom: 24px; }
  .phones { min-height: 0; }
  .phones .phone { width: 220px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 18px; padding: 4px 24px 12px; margin: 0 -24px; scrollbar-width: none; }
  .gallery::-webkit-scrollbar { display: none; }
  .gallery figure { flex: 0 0 210px; scroll-snap-align: center; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero-in { padding: 56px 16px 72px; }
  .product-in { padding: 64px 16px 0; }
  .section { padding: 80px 0; }
  .section-head { margin-bottom: 40px; }
  .apps, .principles { grid-template-columns: 1fr; }
  .app-card, .principle { padding: 28px; }
  .contact { grid-template-columns: 1fr; padding: 36px 28px; }
  .features { grid-template-columns: 1fr; }
  .phones .phone { width: 170px; }
  .phones .phone.front { margin-left: -64px; }
  .gallery { padding: 4px 16px 12px; margin: 0 -16px; }
  .nav nav a.hide-sm { display: none; }
  .nav nav a { padding: 8px 10px; }
  .doc-hero .wrap { padding-top: 56px; padding-bottom: 40px; }
  .doc { padding: 40px 16px 0; }
  .foot { margin-top: 80px; }
  .foot-in { padding: 48px 16px 32px; }
  .foot-base { flex-direction: column; padding: 20px 16px 32px; }
  .support-strip { padding: 26px; }
}

a.pill { text-decoration: none; }
a.pill:hover { color: var(--ink); }
