/* Tyvin – site styles. Colours and type follow the app's dark theme. */

:root {
  --bg: #f5f3f0;
  --bg-raised: #ebe8e4;
  --fg: #141312;
  --fg-soft: #33302d;
  --muted: #6b6763;
  --line: #dedad5;
  --line-strong: #a9a49e;
  --accent: #ee3a20;
  --accent-ink: #141312;
  --link: #c22d16;
  --fill-top: #e3664c;
  --fill-bottom: #bf412d;
  --fill-ink: #141312;
  --phone-frame: #1f1d1c;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1120px;
  --narrow: 720px;
  --gutter: clamp(16px, 4vw, 40px);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --bg-raised: #1c1a19;
    --fg: #f3f1ee;
    --fg-soft: #d6d2cd;
    --muted: #8f8b87;
    --line: #2b2927;
    --line-strong: #55514d;
    --link: #ff6b4f;
    --phone-frame: #2a2827;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: calc(var(--narrow) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* Small spaced-out caps, as used for section labels in the app */
.label {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede { font-size: clamp(18px, 2vw, 21px); line-height: 1.5; color: var(--fg-soft); margin: 0; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  padding: 10px 16px; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* Buttons: square corners, heavy spaced caps */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 28px;
  font-size: 15px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; text-align: center;
  border: 2px solid transparent;
  transition: transform .15s ease, background-color .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ff4a2e; }
.btn-outline { border-color: var(--fill-ink); color: var(--fill-ink); }
.btn-outline:hover { background: var(--fill-ink); color: var(--fill-top); }
/* Shown instead of the download link while app_store_url is empty */
.btn-soon, .btn-soon:hover { transform: none; cursor: default; }
.btn-primary.btn-soon { background: transparent; border-color: var(--accent); color: var(--fg); }
.btn-outline.btn-soon { border-style: dashed; }
.btn-outline.btn-soon:hover { background: transparent; color: var(--fill-ink); }

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

.site-header { border-bottom: 1px solid var(--line); }

.header-inner {
  display: flex; align-items: center; gap: 12px 28px;
  min-height: 76px;
}

.brand { display: inline-flex; align-items: baseline; gap: 14px; color: var(--fg); text-decoration: none; }
.brand-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: 0.26em; text-transform: uppercase; }
.brand-sub { font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }

.site-nav { display: flex; gap: 24px; margin-left: auto; }
.site-nav a, .footer-col a {
  color: var(--fg); text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
}
.site-nav a { padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* Language switcher: segmented control like the app's settings */
.lang-switch { display: flex; border: 1px solid var(--line-strong); }
.lang-switch a {
  min-width: 42px; padding: 6px 10px; text-align: center;
  font-size: 12px; font-weight: 800; letter-spacing: 0.14em;
  color: var(--fg); text-decoration: none;
}
.lang-switch a + a { border-left: 1px solid var(--line-strong); }
.lang-switch a:hover { background: var(--bg-raised); }
.lang-switch a[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }

@media (max-width: 560px) {
  .header-inner { flex-wrap: wrap; padding-top: 14px; padding-bottom: 12px; }
  .brand-sub { display: none; }
  .lang-switch { margin-left: auto; }
  .site-nav { order: 3; width: 100%; margin-left: 0; gap: 20px; }
}

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

.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px); }

.hero-inner {
  display: grid; gap: 56px; align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
}

.hero h1 { font-size: clamp(44px, 6.6vw, 84px); margin: 18px 0 24px; }
.hero .lede { max-width: 34ch; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 36px; }

.hero-phone { display: flex; justify-content: center; }
.hero-phone .phone { width: min(330px, 100%); transform: rotate(2deg); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-phone .phone { width: min(300px, 78%); transform: none; }
}

/* Phone frame around screenshots */
.phone {
  margin: 0;
  padding: 9px;
  border-radius: 46px;
  background: var(--phone-frame);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 30px 60px -20px rgba(0,0,0,.45);
}
.phone img { width: 100%; border-radius: 37px; }

/* ---------- Home: sections ---------- */

.section { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--line); }

.section-head { margin-bottom: 40px; }
.section-head h2 { font-size: clamp(30px, 4.2vw, 50px); margin-top: 14px; max-width: 18ch; }

.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 32px; }
.feature { border-top: 2px solid var(--line-strong); padding-top: 18px; }
.feature h3 { font-size: 22px; margin: 14px 0 10px; letter-spacing: -0.01em; }
.feature p:last-child { margin: 0; color: var(--fg-soft); font-size: 16px; }

@media (max-width: 960px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; gap: 32px; } }

/* Screenshot gallery: grid on wide screens, swipeable row on narrow ones */
.gallery .section-head { margin-bottom: 32px; }
.gallery-track {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px;
}
.gallery-track figure { margin: 0; }
.gallery-track .phone { padding: 7px; border-radius: 36px; }
.gallery-track .phone img { border-radius: 29px; }
.gallery-track figcaption { margin-top: 16px; text-align: center; }

@media (max-width: 860px) {
  .gallery-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    gap: 20px; padding-bottom: 12px; scrollbar-width: none;
  }
  .gallery-track::-webkit-scrollbar { display: none; }
  .gallery-track figure { flex: 0 0 min(62vw, 260px); scroll-snap-align: center; }
}

/* ---------- Home: the orange "fill" band from the fast screen ---------- */

.fill {
  position: relative;
  margin-top: 40px;
  padding: clamp(48px, 7vw, 88px) 0 clamp(64px, 8vw, 104px);
  background: linear-gradient(180deg, var(--fill-top), var(--fill-bottom));
  color: var(--fill-ink);
}

.wave {
  position: absolute; left: 0; bottom: 100%;
  width: 200%; height: 60px;
  transform: translateY(1px);
  animation: drift 18s linear infinite;
  pointer-events: none;
}
.wave-back { fill: var(--fill-top); opacity: .45; }
.wave-front { fill: var(--fill-top); }
@keyframes drift { from { transform: translate(0, 1px); } to { transform: translate(-50%, 1px); } }

main { overflow-x: clip; }

.bubbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bubbles i {
  position: absolute; bottom: -12px;
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.35);
  animation: rise 14s linear infinite;
}
.bubbles i:nth-child(1) { left: 8%;  animation-delay: -2s; }
.bubbles i:nth-child(2) { left: 22%; width: 5px; height: 5px; animation-delay: -9s; animation-duration: 18s; }
.bubbles i:nth-child(3) { left: 41%; width: 12px; height: 12px; animation-delay: -5s; }
.bubbles i:nth-child(4) { left: 63%; width: 6px; height: 6px; animation-delay: -12s; animation-duration: 16s; }
.bubbles i:nth-child(5) { left: 79%; animation-delay: -7s; animation-duration: 20s; }
.bubbles i:nth-child(6) { left: 92%; width: 4px; height: 4px; animation-delay: -1s; }
@keyframes rise {
  from { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; }
  to { transform: translateY(-640px); opacity: 0; }
}

.fill-inner {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px 72px; align-items: end;
}
.fill .label { color: rgba(20,19,18,.72); }
.fill h2 { font-size: clamp(34px, 5vw, 60px); margin: 14px 0 20px; }
.fill-copy p { font-size: 18px; max-width: 40ch; margin: 0 0 16px; }
.fill a:not(.btn) { color: var(--fill-ink); font-weight: 700; text-decoration-thickness: 2px; }

.rows { margin: 0 0 32px; }
.rows div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid rgba(20,19,18,.22);
}
.rows div:first-child { border-top: 1px solid rgba(20,19,18,.22); }
.rows dt { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(20,19,18,.75); }
.rows dd { margin: 0; font-size: 19px; font-weight: 700; text-align: right; }
.fill-facts .btn { width: 100%; }

@media (max-width: 860px) { .fill-inner { grid-template-columns: 1fr; } }

/* ---------- Document pages (privacy, support) ---------- */

.doc { padding: clamp(48px, 7vw, 88px) 0 clamp(64px, 8vw, 112px); }
.doc-head h1 { font-size: clamp(40px, 6vw, 68px); margin-bottom: 18px; }
.doc-head .lede { margin-top: 4px; }
.doc-body { margin-top: 40px; }

.doc-body > p, .doc-body li { color: var(--fg-soft); }
.doc-body p { margin: 0 0 14px; }

.doc-body h2 {
  margin: 52px 0 18px; padding-bottom: 12px;
  border-bottom: 2px solid var(--line-strong);
  font-family: var(--font); font-size: 12px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; line-height: 1.4;
  color: var(--muted);
}

.callout {
  padding: 20px 22px; margin: 0 0 8px !important;
  background: var(--bg-raised); border-left: 3px solid var(--accent);
  color: var(--fg) !important; font-size: 18px;
}

.contact-card {
  padding: 28px; border: 1px solid var(--line-strong);
  display: grid; gap: 18px; justify-items: start;
}
.contact-card .btn { text-transform: none; letter-spacing: 0.02em; font-size: 17px; max-width: 100%; overflow-wrap: anywhere; }
.contact-card p:last-child { margin: 0; color: var(--fg-soft); font-size: 16px; }

.faq section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.faq section:first-child { padding-top: 6px; }
.faq h3 { font-size: 20px; letter-spacing: -0.01em; line-height: 1.25; margin-bottom: 8px; }
.faq p { margin: 0; color: var(--fg-soft); }

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

.site-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; background: var(--bg); }
.page-index .site-footer { border-top: 0; }

.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-brand p { margin: 14px 0 0; color: var(--muted); max-width: 32ch; font-size: 15px; }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-col h2 { margin-bottom: 6px; }
.footer-col a { font-size: 12px; }
.footer-col a:hover { color: var(--link); }
.footer-col a[href^="mailto:"] { text-transform: none; letter-spacing: 0.02em; font-size: 14px; font-weight: 500; }

.footer-legal { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wave, .bubbles i { animation: none; }
  .bubbles { display: none; }
  .btn { transition: none; }
}
