/* =============================================================================
   Solvity — Swiss / International Typographic design system
   -----------------------------------------------------------------------------
   One stylesheet powers every page. The look is built on the Swiss principles:
   a modular grid, hairline rules, Helvetica, a strict monochrome palette, and a
   single accent colour used with restraint.

   Re-colouring a product is done with ONE variable: --accent (see each product's
   theme.css). Everything that should carry the product's colour — the hero mark,
   the primary button, links, section ticks, the CTA block, the feature numbers —
   reads from it automatically.
   ========================================================================== */

:root {
  /* --- Brand accent — override --accent per product in theme.css ---------- */
  --accent: #7B1B38;          /* Solvity burgundy */
  --accent-strong: #5E1429;   /* deeper tone for hover */
  --accent-contrast: #ffffff; /* text/icons sitting on the accent */

  /* --- Ink (monochrome scale) -------------------------------------------- */
  --ink: #111111;             /* primary text + strong rules */
  --ink-2: #565654;           /* secondary text */
  --ink-3: #8d8d8a;           /* labels, muted metadata */

  /* --- Surfaces ----------------------------------------------------------- */
  --paper: #ffffff;           /* main background */
  --paper-2: #f3f3f1;         /* secondary block */
  --rule: #111111;            /* structural hairline */
  --rule-soft: #e3e3e0;       /* light grid hairline */

  /* --- Layout / rhythm ---------------------------------------------------- */
  --nav-h: 68px;
  --max: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3.25rem);
  --col-gap: clamp(1rem, 2.4vw, 2rem);
  --section-gap: clamp(3.5rem, 7vw, 6.5rem);
  --rule-w: 1.5px;

  color-scheme: light;
}

/* ----------------------------- Reset ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  line-height: 1.5;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; cursor: pointer; background: transparent; color: inherit; }

::selection { background: var(--accent); color: var(--accent-contrast); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ----------------------------- Typography ------------------------------ */
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5.25rem); line-height: 0.98; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 4vw, 3.1rem); line-height: 1.02; letter-spacing: -0.022em; }
h3 { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.2; letter-spacing: -0.01em; }
p  { margin: 0; }
strong { font-weight: 700; color: var(--ink); }

/* Uppercase label with a short accent tick — the Swiss "marker" */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ----------------------------- Layout helpers -------------------------- */
.shell {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Every content section opens with a full-bleed hairline + breathing room */
.section { border-top: var(--rule-w) solid var(--rule); padding-top: clamp(2.25rem, 4.5vw, 3.5rem); }
.hero { border-top: none; }

.section-head { max-width: 64ch; margin-bottom: clamp(1.9rem, 3.6vw, 3rem); }
.section-head h2::before {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--accent);
  margin-bottom: 1.1rem;
}
.section-sub {
  color: var(--ink-2);
  max-width: 54ch;
  margin-top: 0.95rem;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.55;
}

/* ----------------------------- Buttons --------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0 1.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border: var(--rule-w) solid var(--ink);
  border-radius: 0;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn svg { width: 1.15em; height: 1.15em; }
.btn-lg { min-height: 58px; padding: 0 2rem; font-size: 0.8rem; }

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.text-link {
  color: var(--accent);
  font-weight: 700;
  border-bottom: 1.5px solid currentColor;
  transition: opacity 0.18s ease;
}
.text-link:hover { opacity: 0.6; }

/* ----------------------------- Navigation ------------------------------ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 var(--gutter);
  background: var(--paper);
  border-bottom: var(--rule-w) solid var(--ink);
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; flex-shrink: 0; }
.brand img { height: 23px; width: auto; }
.brand .brand-divider { width: 1px; height: 20px; background: var(--ink); opacity: 0.35; }
.brand .brand-product {
  font-weight: 700; font-size: 0.95rem; color: var(--ink);
  letter-spacing: 0.02em; text-transform: uppercase;
}

.nav-links { list-style: none; display: flex; align-items: center; gap: clamp(1.4rem, 3vw, 2.6rem); margin: 0; padding: 0; }
.nav-links a {
  position: relative;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-bottom: 2px;
  transition: color 0.18s ease;
}
.nav-links a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.18s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-right { display: flex; align-items: center; gap: 1rem; }

.menu-toggle { display: none; flex-direction: column; gap: 5px; padding: 10px; }
.menu-toggle span {
  width: 24px; height: 2px; background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.menu-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(17, 17, 17, 0.35);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.menu-backdrop.open { opacity: 1; pointer-events: auto; }

/* ----------------------------- Hero ------------------------------------ */
.hero { padding-top: clamp(2.5rem, 6vw, 4.75rem); }
.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  padding-bottom: clamp(1.1rem, 2vw, 1.4rem);
  border-bottom: var(--rule-w) solid var(--ink);
  margin-bottom: clamp(1.7rem, 4vw, 2.8rem);
}
.hero-loc {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-3);
}
.hero-title { max-width: 18ch; }
.lead {
  font-size: clamp(1.08rem, 1.55vw, 1.32rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 56ch;
  margin-top: clamp(1.3rem, 2.6vw, 2rem);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: clamp(1.6rem, 3vw, 2.2rem); }

/* Product hero — the real app icon, then the same flush-left layout */
.product-mark {
  width: clamp(54px, 7vw, 66px);
  height: clamp(54px, 7vw, 66px);
  margin-bottom: clamp(1.3rem, 2.6vw, 1.9rem);
}
.product-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.product-hero .store-links { margin-top: clamp(1.5rem, 3vw, 2.2rem); }

/* ----------------------------- Products grid --------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: var(--rule-w) solid var(--ink);
  border-left: var(--rule-w) solid var(--ink);
}
.product-card {
  --card-accent: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: clamp(280px, 32vw, 340px);
  padding: clamp(1.5rem, 2.6vw, 2.1rem);
  border-right: var(--rule-w) solid var(--ink);
  border-bottom: var(--rule-w) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  transition: background 0.22s ease, color 0.22s ease;
}
.product-card--ubiboard { --card-accent: #7c4dff; }
.product-card--falline  { --card-accent: #14b8a6; }
.product-card--sudoku   { --card-accent: #3b82f6; }

.product-card__top { display: flex; align-items: center; justify-content: space-between; }
.product-card__index {
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--card-accent); font-variant-numeric: tabular-nums;
}
.product-card__tag {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--card-accent);
  border: 1.5px solid var(--card-accent);
  padding: 0.18rem 0.5rem;
}
.product-card__name {
  font-size: clamp(1.45rem, 2.1vw, 1.95rem);
  font-weight: 700; line-height: 1.04; letter-spacing: -0.02em;
}
.product-card__desc { color: var(--ink-2); line-height: 1.55; flex: 1; }
.product-card__cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: auto;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--card-accent);
}
.product-card__cta svg { width: 1.05em; height: 1.05em; flex-shrink: 0; transition: transform 0.2s ease; }

.product-card:hover { background: var(--card-accent); color: var(--accent-contrast); }
.product-card:hover .product-card__index,
.product-card:hover .product-card__cta { color: var(--accent-contrast); }
.product-card:hover .product-card__tag { color: var(--accent-contrast); border-color: var(--accent-contrast); }
.product-card:hover .product-card__desc { color: rgba(255, 255, 255, 0.82); }
.product-card:hover .product-card__cta svg { transform: translateX(4px); }

/* ----------------------------- Feature grid ---------------------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: var(--rule-w) solid var(--ink);
  border-left: var(--rule-w) solid var(--ink);
}
.feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: clamp(1.5rem, 2.8vw, 2.2rem);
  border-right: var(--rule-w) solid var(--ink);
  border-bottom: var(--rule-w) solid var(--ink);
}
.feature-card__index {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.feature-card__icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: var(--rule-w) solid var(--ink);
  color: var(--ink);
}
.feature-card__icon svg { width: 21px; height: 21px; }
.feature-card h3 { margin-top: 0.2rem; }
.feature-card p { color: var(--ink-2); line-height: 1.55; }

/* ----------------------------- Company / about ------------------------- */
.company-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.company-body p { color: var(--ink-2); line-height: 1.7; max-width: 46ch; font-size: 1.05rem; }
.company-body p + p { margin-top: 1.1rem; }

.company-card { border-top: var(--rule-w) solid var(--ink); padding-top: 1.3rem; }
.company-card h3 {
  font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; margin-bottom: 1.1rem;
}
.company-card address { font-style: normal; color: var(--ink); line-height: 1.65; margin-bottom: 1.4rem; }
.detail-list { margin: 0; display: grid; gap: 0; }
.detail-list .row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--rule-soft);
}
.detail-list .row:first-child { border-top: 1px solid var(--rule-soft); }
.detail-list dt { color: var(--ink-3); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.07em; font-weight: 700; }
.detail-list dd { margin: 0; font-weight: 700; color: var(--ink); text-align: right; }

/* ----------------------------- Store / app links ----------------------- */
/* Official App Store / Google Play badge SVGs — both fill their viewBox, so an
   equal height aligns them. Height matches the old button footprint. */
.store-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; }
.store-badge {
  display: inline-flex;
  transition: opacity 0.18s ease;
}
.store-badge:hover { opacity: 0.82; }
.store-badge img { height: 52px; width: auto; display: block; }

/* ----------------------------- CTA block ------------------------------- */
.cta-band {
  background: var(--accent);
  color: var(--accent-contrast);
  padding: clamp(2.4rem, 5.5vw, 4.25rem) clamp(1.6rem, 5vw, 4rem);
}
.cta-band h2 { color: var(--accent-contrast); max-width: 16ch; }
.cta-band p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 46ch;
  margin: 1rem 0 2rem;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.55;
}
.cta-band .btn-ghost { border-color: var(--accent-contrast); color: var(--accent-contrast); }
.cta-band .btn-ghost:hover { background: var(--accent-contrast); color: var(--accent); }

/* ----------------------------- Legal pages ----------------------------- */
.legal { border-top: none; padding-top: clamp(2rem, 4vw, 3.25rem); }
.legal-card { max-width: 74ch; margin: 0; }
.legal-card h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); line-height: 1.02; margin-bottom: 0.6rem; }
.legal-card .legal-meta {
  color: var(--ink-3); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 700; margin-bottom: 2.4rem;
}
.legal-card h2 {
  font-size: clamp(1.2rem, 1.9vw, 1.4rem);
  margin: 2.6rem 0 0.9rem;
  padding-top: 1.6rem;
  border-top: var(--rule-w) solid var(--ink);
}
.legal-card h2:first-of-type { border-top: none; padding-top: 0; margin-top: 1.6rem; }
.legal-card p, .legal-card li { color: var(--ink-2); line-height: 1.75; }
.legal-card p { margin: 0 0 1rem; }
.legal-card ul { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: 0.45rem; }
.legal-card a { color: var(--accent); font-weight: 700; border-bottom: 1.5px solid currentColor; }
.legal-card a:hover { opacity: 0.6; }
.legal-card address {
  font-style: normal; color: var(--ink);
  border-left: 3px solid var(--accent);
  padding: 0.3rem 0 0.3rem 1.1rem; line-height: 1.7;
  margin-bottom: 1rem;
}

/* ----------------------------- Footer ---------------------------------- */
.site-footer {
  color: var(--paper);
  background: var(--ink);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding: clamp(3rem, 5vw, 4.25rem) var(--gutter) clamp(2rem, 4vw, 3rem);
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}
.footer-brand img { height: 26px; width: auto; margin-bottom: 1.2rem; }
.footer-brand p { color: rgba(255, 255, 255, 0.6); max-width: 32ch; line-height: 1.6; font-size: 0.92rem; }
.footer-col h4 {
  color: var(--paper); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 700; margin-bottom: 1.1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.footer-col a { color: rgba(255, 255, 255, 0.68); font-size: 0.92rem; transition: color 0.18s ease; }
.footer-col a:hover { color: var(--paper); }

.footer-legal {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem var(--gutter) 2.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}
.footer-legal address { font-style: normal; display: inline; }
.footer-legal .sep { opacity: 0.5; margin: 0 0.1rem; }

/* ----------------------------- 404 ------------------------------------- */
.notfound {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  align-content: center;
  display: grid;
  padding: clamp(3.5rem, 11vw, 8rem) var(--gutter);
}
.notfound .code {
  font-size: clamp(5rem, 17vw, 12rem);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: -0.05em;
  color: var(--ink);
  margin-top: 0.9rem;
}
.notfound h1 { margin-top: 1.5rem; }
.notfound p { color: var(--ink-2); margin: 1rem 0 2rem; max-width: 40ch; font-size: 1.05rem; }

/* ----------------------------- Scroll reveal --------------------------- */
[data-animate] {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
[data-animate].is-visible { opacity: 1; transform: none; }

/* ----------------------------- Responsive ------------------------------ */
@media (max-width: 880px) {
  .company-grid { grid-template-columns: 1fr; gap: clamp(1.8rem, 5vw, 2.8rem); }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    z-index: 95;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.4rem;
    background: var(--paper);
    border-bottom: var(--rule-w) solid var(--ink);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links li { width: 100%; border-bottom: 1px solid var(--rule-soft); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a { display: block; width: 100%; padding: 0.95rem 0; font-size: 0.82rem; }
  .nav-links a::after { display: none; }
  .menu-toggle { display: flex; }
  .nav-right .btn { display: none; }
  .menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.open span:nth-child(2) { opacity: 0; }
  .menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .feature-grid { grid-template-columns: 1fr; }
  .footer-legal { flex-direction: column; gap: 0.4rem; }
}

@media (max-width: 560px) {
  .product-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { scroll-behavior: auto !important; }
}
