/* ==========================================================================
   Cekli — shared stylesheet
   Design tokens mirror the Memo app design system so the site and the apps
   feel like one family. Accent #FF6B2C is the shared Memo brand orange.
   ========================================================================== */

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* --- Tokens: light (default) --------------------------------------------- */
:root {
  --bg:            #FAFAFA;
  --bg-alt:        #F5F5F5;
  --surface:       #FFFFFF;
  --text:          #1A1A1A;
  --text-2:        #666666;
  --text-3:        #999999;
  --border:        #E0E0E0;

  --accent:        #FF6B2C;
  --accent-press:  #E55A1B;
  --accent-soft:   #FFF0E8;
  --on-accent:     #FFFFFF;

  /* The Cekli logo has its own, softer orange than the app accent above.
     Keep it separate so the mark stays true to the brand artwork. */
  --logo:          #FA8954;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.04);

  --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 24px;  --r-full: 999px;

  --wrap: 1120px;
  --pad: clamp(20px, 5vw, 32px);

  --font: "Inter", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* --- Tokens: dark (opt-in per page, and inside .band--dark) --------------- */
[data-theme="dark"] {
  --bg:        #121212;
  --bg-alt:    #1A1A1A;
  --surface:   #2C2C2C;
  --text:      #E8E8E8;
  --text-2:    #A0A0A0;
  --text-3:    #6E6E6E;
  --border:    #333333;
  --accent-soft: #3D2A1A;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
}

/* --- Base ----------------------------------------------------------------- */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); letter-spacing: -0.01em; }
p  { text-wrap: pretty; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.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;
}
.skip-link {
  position: absolute; left: 50%; translate: -50% -120%;
  z-index: 100; background: var(--accent); color: var(--on-accent);
  padding: 10px 18px; border-radius: 0 0 var(--r-md) var(--r-md); font-weight: 600;
  transition: translate .15s ease;
}
.skip-link:focus { translate: -50% 0; text-decoration: none; }

/* --- Header --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 20px;
  min-height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 1.4rem; letter-spacing: -0.045em;
  color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; }
/* The house mark from the Cekli logo. Sized to the cap height of the wordmark
   beside it, and drawn in currentColor so it reads on light and dark bands. */
.brand__mark {
  width: 30px; height: 30px; flex: none;
  color: var(--logo);
}

.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: 4px; list-style: none; padding: 0; }
.nav__list a {
  display: block; padding: 8px 14px; border-radius: var(--r-full);
  color: var(--text-2); font-weight: 500; font-size: .95rem;
}
.nav__list a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.nav__list a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--border); border-radius: var(--r-sm);
  width: 42px; height: 42px; cursor: pointer; color: var(--text);
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 2px;
  background: currentColor; border-radius: 2px; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span::before { transform: translateY(-6px); }
.nav-toggle span::after  { transform: translateY(4px); }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: rotate(-45deg) translateY(0); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; inset: 68px 0 auto; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px var(--pad) 16px; display: none;
    box-shadow: var(--shadow-md);
  }
  .nav[data-open="true"] { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav__list a { padding: 12px 14px; border-radius: var(--r-md); }
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 26px; border-radius: var(--r-full);
  font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background-color .15s ease, transform .12s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.975); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-press); }
.btn--ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
/* A dark band on a light-themed page still resolves --text/--border to their
   light values, which would paint dark text on near-black. Pin them here. */
.band--dark .btn--ghost { border-color: #3A3A3A; color: #E8E8E8; }
.band--dark .btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn__icon { width: 20px; height: 20px; flex: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* --- Sections / bands ----------------------------------------------------- */
.band { padding-block: clamp(56px, 9vw, 104px); }
.band--tight { padding-block: clamp(40px, 6vw, 68px); }
.band--alt  { background: var(--bg-alt); }
.band--dark { background: #121212; color: #E8E8E8; }

.band-head { max-width: 62ch; margin-bottom: clamp(32px, 5vw, 52px); }
.band-head p { color: var(--text-2); font-size: 1.08rem; margin-top: 14px; }
.band--dark .band-head p { color: #A0A0A0; }

.eyebrow {
  display: inline-block; margin-bottom: 14px;
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent);
}

/* --- Hero (landing) ------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: #121212; color: #E8E8E8;
  padding-block: clamp(72px, 12vw, 132px);
}
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 140%;
  background:
    radial-gradient(ellipse 50% 45% at 22% 18%, rgba(255,107,44,.22), transparent 62%),
    radial-gradient(ellipse 45% 40% at 82% 8%, rgba(255,138,76,.13), transparent 60%);
  pointer-events: none;
}
.hero > .wrap { position: relative; }
.hero h1 { max-width: 16ch; }
.hero__lede {
  max-width: 56ch; margin-top: 22px;
  font-size: clamp(1.05rem, 2.1vw, 1.25rem); color: #B4B4B4;
}
.hero .btn-row { margin-top: 34px; }
.hero .btn--ghost { border-color: #3A3A3A; color: #E8E8E8; }
.hero .btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero__meta {
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  margin-top: 34px; padding-top: 26px; border-top: 1px solid #262626;
  color: #8A8A8A; font-size: .92rem;
}
.hero__meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta svg { width: 16px; height: 16px; color: var(--accent); flex: none; }

/* --- Product cards (landing) ---------------------------------------------- */
.products { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.pcard {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: clamp(24px, 3.5vw, 34px);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.pcard__top { display: flex; align-items: center; gap: 16px; }
.pcard__icon { width: 62px; height: 62px; border-radius: 15px; flex: none; box-shadow: var(--shadow-sm); }
.pcard__name { font-size: 1.5rem; letter-spacing: -0.025em; }
.pcard__tag { color: var(--accent); font-weight: 600; font-size: .95rem; margin-top: 2px; }
.pcard__body { color: var(--text-2); margin-top: 18px; }
.pcard__list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.pcard__list li { display: flex; gap: 11px; align-items: flex-start; font-size: .96rem; color: var(--text-2); }
.pcard__list li::before {
  content: ""; flex: none; width: 7px; height: 7px; margin-top: .55em;
  border-radius: 50%; background: var(--accent);
}
.pcard__foot { margin-top: auto; padding-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }

/* --- Feature grid --------------------------------------------------------- */
.features { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 26px;
}
.band--dark .feature { background: #1E1E1E; border-color: #2E2E2E; }
.feature__icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 16px;
}
.feature__icon svg { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--text-2); font-size: .97rem; }
.band--dark .feature p { color: #A0A0A0; }

/* --- Split (text + phone) -------------------------------------------------- */
.split {
  display: grid; gap: clamp(32px, 6vw, 72px); align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--flip .split__media { order: -1; }
}
.split__body h2 { margin-bottom: 16px; }
.split__body p { color: var(--text-2); font-size: 1.05rem; }
.band--dark .split__body p { color: #A0A0A0; }
.split__body p + p { margin-top: 14px; }

.checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 13px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); }
.band--dark .checks li { color: #A0A0A0; }
.checks svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: .18em; }
.checks strong { color: var(--text); font-weight: 600; }
.band--dark .checks strong { color: #E8E8E8; }

.phone {
  margin-inline: auto; max-width: 300px; width: 100%;
  border-radius: 30px; padding: 9px;
  background: linear-gradient(150deg, #3A3A3A, #141414);
  box-shadow: var(--shadow-lg);
}
.phone img { border-radius: 22px; width: 100%; height: auto; background: #000; }

/* --- Screenshot gallery ---------------------------------------------------- */
.shots {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 0 22px; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad);
  scrollbar-width: thin;
}
.shots::-webkit-scrollbar { height: 8px; }
.shots::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.shot {
  flex: 0 0 auto; width: 224px; scroll-snap-align: start;
  background: none; border: 0; padding: 0; cursor: zoom-in; text-align: left;
}
.shot img {
  width: 100%; height: auto; border-radius: var(--r-lg);
  border: 1px solid var(--border); background: #000;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.shot:hover img { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.shot figcaption { margin-top: 11px; font-size: .87rem; color: var(--text-2); line-height: 1.45; }
.band--dark .shot figcaption { color: #A0A0A0; }
.band--dark .shot img { border-color: #303030; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.92);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.lightbox[data-open="true"] { display: flex; }
.lightbox img {
  max-width: min(92vw, 420px); max-height: 88vh; width: auto; height: auto;
  border-radius: var(--r-lg); box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.lightbox__close {
  position: absolute; top: 18px; right: 18px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff;
  border: 0; cursor: pointer; font-size: 1.5rem; line-height: 1;
  display: grid; place-items: center;
}
.lightbox__close:hover { background: rgba(255,255,255,.22); }
.lightbox__cap {
  position: absolute; left: 0; right: 0; bottom: 22px;
  text-align: center; color: #C8C8C8; font-size: .92rem; padding-inline: 24px;
}

/* --- Steps (ShareZone flow) ------------------------------------------------ */
.steps {
  display: grid; gap: 18px; counter-reset: step;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.step {
  position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px 22px;
}
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  font-size: .92rem; font-weight: 700; margin-bottom: 14px;
}
.step h3 { font-size: 1.02rem; margin-bottom: 6px; }
.step p { color: var(--text-2); font-size: .93rem; }
/* Same trap as .btn--ghost: without this the card keeps its white --surface
   while the heading inherits the dark band's light text, and vanishes. */
.band--dark .step { background: #1E1E1E; border-color: #2E2E2E; }
.band--dark .step p { color: #A0A0A0; }

/* --- Privacy / trust block ------------------------------------------------- */
.trust {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.trust__item {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px;
}
.band--dark .trust__item { background: #1E1E1E; border-color: #2E2E2E; }
.trust__item svg { width: 21px; height: 21px; color: var(--accent); flex: none; margin-top: .12em; }
.trust__item strong { display: block; font-size: .98rem; }
.trust__item span { color: var(--text-2); font-size: .9rem; }
.band--dark .trust__item span { color: #A0A0A0; }

/* --- Filename example ------------------------------------------------------ */
.filename {
  font-family: var(--mono); font-size: clamp(.8rem, 1.9vw, .98rem);
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 15px 18px;
  overflow-x: auto; white-space: nowrap; color: var(--text);
}
.band--dark .filename { background: #1A1A1A; border-color: #2E2E2E; }
.filename b { color: var(--accent); font-weight: 600; }

/* --- Cross-promo ----------------------------------------------------------- */
.crosspromo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: clamp(24px, 4vw, 36px);
}
.band--dark .crosspromo { background: #1E1E1E; border-color: #2E2E2E; }
.crosspromo img { width: 64px; height: 64px; border-radius: 16px; flex: none; }
.crosspromo__text { flex: 1 1 260px; }
.crosspromo__text h3 { margin-bottom: 6px; }
.crosspromo__text p { color: var(--text-2); font-size: .98rem; }
.band--dark .crosspromo__text p { color: #A0A0A0; }

/* --- CTA band -------------------------------------------------------------- */
.cta { text-align: center; }
.cta h2 { max-width: 20ch; margin-inline: auto; }
.cta p { color: var(--text-2); max-width: 52ch; margin: 16px auto 0; font-size: 1.05rem; }
.band--dark .cta p { color: #A0A0A0; }
.cta .btn-row { justify-content: center; margin-top: 32px; }

/* --- Footer ---------------------------------------------------------------- */
.site-footer {
  background: #121212; color: #9A9A9A;
  padding-block: clamp(44px, 6vw, 64px) 32px;
  font-size: .93rem;
}
.site-footer a { color: #C8C8C8; }
.site-footer a:hover { color: var(--accent); }
.footer-grid {
  display: grid; gap: 34px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.footer-grid h4 {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: #6E6E6E; margin-bottom: 14px; font-weight: 700;
}
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: 9px; }
.site-footer .brand { color: #F2F2F2; }
.site-footer__blurb { margin-top: 14px; max-width: 34ch; color: #8A8A8A; }
.site-footer__bottom {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid #262626;
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
  color: #6E6E6E; font-size: .88rem;
}

/* --- Motion --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
