/* Latchly shared web design system — extends the app tokens for marketing + blog */

:root {
  /* Backgrounds */
  --cream: #FAF6F1;
  --cream-deep: #F2EADF;
  --cream-warm: #F6EFE4;
  --white: #ffffff;

  /* Brand — pinks */
  --pink: #E8A2AC;
  --pink-deep: #D4808E;
  --pink-soft: #F5D4D9;
  --pink-pale: #FBE8EC;
  --rose: #C76B7A;

  /* Text */
  --ink: #2A2723;
  --ink-2: #4A423B;
  --body: #7A736C;
  --muted: #B5AEA6;

  /* Structural */
  --border: #EBE4DB;
  --border-strong: #DDD3C5;

  /* Type */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Palatino", "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-card: 0 1px 2px rgba(80,40,40,0.04);
  --shadow-hero: 0 24px 60px -20px rgba(212,128,142,0.45), 0 10px 28px -12px rgba(212,128,142,0.28);
  --shadow-device: 0 40px 80px -30px rgba(60,30,40,0.25), 0 20px 40px -20px rgba(60,30,40,0.15);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 450;
  letter-spacing: -0.005em;
}

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

::selection { background: var(--pink-soft); color: var(--ink); }

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.container--narrow { max-width: 760px; }
.container--wide { max-width: 1320px; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  background: color-mix(in oklab, var(--cream) 82%, transparent);
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.logo__mark {
  width: 38px; height: 38px;
  background: url(assets/latchly-icon.png) center/contain no-repeat;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
}
.nav__links a { transition: color .2s var(--ease); }
.nav__links a:hover { color: var(--rose); }

/* mobile menu button — hidden on desktop */
.nav__toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  transition: background .15s var(--ease);
}
.nav__toggle:hover { background: var(--cream-deep); }
.nav__toggle .bar {
  display: block; position: relative;
  width: 16px; height: 1.5px;
  background: currentColor; border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s var(--ease), top .25s var(--ease);
}
.nav__toggle .bar::before,
.nav__toggle .bar::after {
  content: ""; position: absolute; left: 0;
  width: 100%; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform .25s var(--ease), top .25s var(--ease);
}
.nav__toggle .bar::before { top: -5px; }
.nav__toggle .bar::after  { top:  5px; }

body.menu-open .nav__toggle .bar { background: transparent; }
body.menu-open .nav__toggle .bar::before { top: 0; transform: rotate(45deg); }
body.menu-open .nav__toggle .bar::after  { top: 0; transform: rotate(-45deg); }

/* mobile menu panel */
.nav__panel {
  display: none;
  position: fixed;
  top: 68px;
  left: 0;
  width: 100%;
  max-width: 100vw;
  height: calc(100dvh - 68px);
  z-index: 49;
  background: var(--cream);
  padding: 32px 24px 40px;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  pointer-events: none;
  box-sizing: border-box;
}
.nav__panel a {
  display: block;
  padding: 14px 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  transition: color .15s var(--ease);
}
.nav__panel a:hover { color: var(--rose); }
.nav__panel .btn {
  display: flex;
  width: 100%;
  margin-top: 24px;
  padding: 0 22px;
  height: 52px;
  font-size: 16px;
  border-bottom: none;
  text-align: center;
  justify-content: center;
}
.nav__panel .btn--primary { color: var(--cream); }
.nav__panel .btn--pink { color: #fff; }
.nav__panel .btn--ghost { color: var(--ink); }
body.menu-open .nav__panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
body.menu-open { overflow: hidden; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: transform .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
  white-space: nowrap;
}

.btn--primary {
  background: var(--ink);
  color: var(--cream);
  position: relative;
  overflow: hidden;
}
.btn--primary::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #2A2723 0%, #4A3238 55%, var(--rose) 100%);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.btn--primary > * { position: relative; z-index: 1; }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -10px rgba(60,30,40,0.4); }
.btn--primary:hover::before { opacity: 1; }

.btn--pink {
  background: var(--pink-deep);
  color: white;
  box-shadow: 0 8px 20px -8px rgba(212,128,142,0.6);
}
.btn--pink:hover { transform: translateY(-1px); background: var(--rose); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.btn--ghost:hover { background: var(--cream-deep); }

.btn--appstore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 22px 0 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--cream);
  transition: transform .2s var(--ease), box-shadow .3s var(--ease);
}
.btn--appstore .as-apple { width: 26px; height: 26px; }
.btn--appstore .as-small { font-size: 11px; font-weight: 500; opacity: .8; letter-spacing: 0.01em; }
.btn--appstore .as-big { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }

/* ---------- type helpers ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose);
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pink-deep);
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.08;
  font-weight: 700;
  text-wrap: balance;
}

.h-display {
  font-size: clamp(48px, 7.2vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 700;
}
.h-1 { font-size: clamp(36px, 4.6vw, 58px); letter-spacing: -0.035em; line-height: 1.05; }
.h-2 { font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -0.03em; line-height: 1.1; }
.h-3 { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -0.025em; line-height: 1.15; }

.lead {
  font-size: clamp(18px, 1.5vw, 21px);
  color: var(--ink-2);
  line-height: 1.5;
  font-weight: 450;
  text-wrap: pretty;
}

.body-copy { color: var(--body); line-height: 1.6; }

.muted { color: var(--muted); }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 48px;
  margin-top: 120px;
  background: var(--cream);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer h5 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer li a {
  font-size: 15px;
  color: var(--ink-2);
  transition: color .2s var(--ease);
}
.footer li a:hover { color: var(--rose); }

.footer__bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.footer__blurb {
  font-size: 15px;
  color: var(--body);
  line-height: 1.55;
  max-width: 320px;
  margin-top: 12px;
}

/* ---------- placeholders ---------- */

.ph {
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--pink-pale) 90%, transparent) 0 10px,
      color-mix(in oklab, var(--pink-soft) 90%, transparent) 10px 20px);
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  color: var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ph::after {
  content: attr(data-label);
  background: var(--cream);
  border: 1px solid var(--pink-soft);
  padding: 6px 10px;
  border-radius: var(--r-pill);
  color: var(--rose);
}

/* ---------- tweaks panel ---------- */

#tweaks-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 280px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  z-index: 200;
  box-shadow: 0 20px 60px -20px rgba(60,30,40,0.25);
  font-size: 13px;
  display: none;
}
#tweaks-panel.open { display: block; }
#tweaks-panel h6 { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
#tweaks-panel .tw-row { margin-bottom: 14px; }
#tweaks-panel .tw-row:last-child { margin-bottom: 0; }
#tweaks-panel .tw-opts { display: flex; gap: 6px; flex-wrap: wrap; }
#tweaks-panel .tw-opt {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--cream);
  cursor: pointer; transition: all .15s var(--ease);
}
#tweaks-panel .tw-opt:hover { border-color: var(--pink); }
#tweaks-panel .tw-opt.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
#tweaks-panel .tw-title { font-weight: 700; font-size: 14px; margin-bottom: 12px; display:flex;justify-content:space-between;align-items:center; }
#tweaks-panel .tw-close { font-size: 18px; color: var(--muted); cursor:pointer; line-height: 1; }

/* ---------- responsive ---------- */

@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav__panel { display: flex; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer { margin-top: 80px; }
  .footer__bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}
