/* ==========================================================================
   CrispyApps LLC — shared design system
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------- */
:root {
  --bg:            #fbfaf8;
  --bg-elevated:   #ffffff;
  --surface:       #ffffff;
  --surface-sunk:  #f4f2ee;
  --ink:           #16161a;
  --ink-soft:      #3d3d47;
  --ink-muted:     #6b6b78;
  --line:          rgba(22, 22, 26, 0.10);
  --line-strong:   rgba(22, 22, 26, 0.18);
  --accent:        #d97706;
  --accent-ink:    #b45309;
  --accent-wash:   rgba(217, 119, 6, 0.10);

  --shadow-sm: 0 1px 2px rgba(22, 22, 26, 0.05);
  --shadow-md: 0 4px 16px -4px rgba(22, 22, 26, 0.10), 0 2px 6px -2px rgba(22, 22, 26, 0.06);
  --shadow-lg: 0 24px 48px -20px rgba(22, 22, 26, 0.22), 0 8px 20px -12px rgba(22, 22, 26, 0.14);

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --page: 1140px;
  --gutter: clamp(1.25rem, 5vw, 3rem);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter,
          Roboto, Helvetica, Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #0e0e11;
    --bg-elevated:   #16161b;
    --surface:       #1a1a20;
    --surface-sunk:  #141419;
    --ink:           #f3f2ef;
    --ink-soft:      #d2d1cd;
    --ink-muted:     #9a9aa6;
    --line:          rgba(255, 255, 255, 0.10);
    --line-strong:   rgba(255, 255, 255, 0.18);
    --accent:        #fbbf24;
    --accent-ink:    #fcd34d;
    --accent-wash:   rgba(251, 191, 36, 0.12);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, 0.75), 0 8px 20px -12px rgba(0, 0, 0, 0.5);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.022em;
  font-weight: 700;
  color: var(--ink);
}

p { margin: 0 0 1rem; }

a { color: var(--accent-ink); }

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

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

.shell {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { flex: 1 0 auto; }

/* --- Site header --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}

.site-header.is-stuck { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand__name em {
  font-style: normal;
  color: var(--ink-muted);
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.site-nav a {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 550;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface-sunk);
}

@media (max-width: 560px) {
  .site-nav a { padding-inline: 0.55rem; font-size: 0.875rem; }
  .brand__name em { display: none; }
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease),
              background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  border-color: var(--ink-muted);
  transform: translateY(-1px);
}

.btn__icon { flex: none; }

.btn--sm {
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
}

/* Copy-to-clipboard confirmation */
.btn.is-copied {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent-ink);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

/* Keeps the copy button from crowding the paragraph above it */
.callout .btn { margin-top: 0.4rem; }

/* --- Sections ------------------------------------------------------------ */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }

.section--sunk {
  background: var(--surface-sunk);
  border-block: 1px solid var(--line);
}

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.section-head--center .eyebrow::before { display: none; }

.section-title {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  margin-bottom: 0.85rem;
}

.section-sub {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--ink-muted);
  max-width: 40rem;
}

.section-head--center .section-sub { margin-inline: auto; }

/* --- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 11vw, 8rem) clamp(3rem, 7vw, 5rem);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto;
  height: 90%;
  background:
    radial-gradient(42% 60% at 22% 40%, var(--accent-wash), transparent 70%),
    radial-gradient(38% 55% at 78% 30%, rgba(74, 90, 174, 0.13), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.hero__inner { position: relative; max-width: 52rem; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem 0.4rem 0.5rem;
  margin-bottom: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--ink-soft);
}

.hero__badge span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.25rem, 6.4vw, 4.25rem);
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin-bottom: 1.35rem;
  overflow-wrap: break-word;
}

/* Let the headline wrap naturally on narrow screens */
@media (max-width: 680px) {
  .hero h1 br { display: none; }
}

.hero h1 .accent {
  background: linear-gradient(100deg, var(--accent-ink), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lede {
  font-size: clamp(1.0625rem, 1.9vw, 1.3125rem);
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 38rem;
  margin-bottom: 2.25rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Trust strip */
.stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 1px;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stat {
  padding: 1.4rem 1.5rem;
  background: var(--surface);
}

.stat__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.15rem;
}

.stat__label {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

/* --- App grid (komorebi-inspired cards) ---------------------------------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

@media (min-width: 1000px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 2.5vw, 1.9rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              border-color 0.25s var(--ease);
}

/* Soft tint bloom keyed to each app's icon colour */
.app-card::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -15%;
  width: 60%;
  height: 110%;
  background: radial-gradient(circle at 30% 40%, var(--tint, transparent), transparent 62%);
  opacity: 0.16;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}

.app-card:hover::before { opacity: 0.3; }

.app-card__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.15rem;
}

.app-card__icon {
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.app-card__title {
  font-size: 1.1875rem;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-sunk);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

.app-card__desc {
  position: relative;
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.62;
  color: var(--ink-muted);
}

.app-card__foot { position: relative; margin-top: auto; }

/* App Store button */
.appstore-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.15;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.appstore-btn svg { flex: none; fill: currentColor; }

.appstore-btn small {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  opacity: 0.7;
  letter-spacing: 0.01em;
}

.app-card:hover .appstore-btn {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Odd card out — span the full row instead of leaving a gap beside it */
@media (min-width: 1000px) {
  .app-card--wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "head foot"
      "desc foot";
    align-items: center;
    column-gap: 3rem;
  }

  .app-card--wide .app-card__head { grid-area: head; margin-bottom: 0.85rem; }

  .app-card--wide .app-card__desc {
    grid-area: desc;
    margin-bottom: 0;
    max-width: 44rem;
  }

  .app-card--wide .app-card__foot { grid-area: foot; margin-top: 0; }

  .app-card--wide::before { width: 34%; }
}

/* --- Value props --------------------------------------------------------- */
.values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
}

.value {
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.value__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 1.1rem;
  border-radius: 12px;
  background: var(--accent-wash);
  color: var(--accent-ink);
}

.value h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.5rem;
}

.value p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

/* --- Closing CTA --------------------------------------------------------- */
.cta {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 6vw, 4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.cta::before {
  content: "";
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 120%;
  background: radial-gradient(50% 60% at 50% 100%, var(--accent-wash), transparent 70%);
  pointer-events: none;
}

.cta > * { position: relative; }

.cta h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.125rem);
  margin-bottom: 0.85rem;
}

.cta p {
  max-width: 34rem;
  margin: 0 auto 2rem;
  color: var(--ink-muted);
}

/* --- Page header (interior pages) ---------------------------------------- */
.page-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3rem, 7vw, 4.5rem) clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: -60% -20% auto -20%;
  height: 160%;
  background: radial-gradient(40% 50% at 30% 60%, var(--accent-wash), transparent 70%);
  pointer-events: none;
}

/* Keeps the shell's full width so the hero's left edge lines up with the
   .doc content below; the text measure is constrained on the children. */
.page-hero__inner { position: relative; }

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.75rem;
  max-width: 46rem;
}

.page-hero p:not(.eyebrow):not(.page-meta) {
  margin: 0;
  max-width: 46rem;
  color: var(--ink-muted);
  font-size: 1.0625rem;
}

.page-meta {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* --- Long-form document content ------------------------------------------ */
.doc {
  max-width: 46rem;
  padding-block: clamp(2.5rem, 6vw, 4rem);
  color: var(--ink-soft);
}

.doc > section + section { margin-top: 2.75rem; }

.doc h2 {
  font-size: 1.375rem;
  margin: 2.75rem 0 0.85rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.doc > section > h2:first-child { margin-top: 0; }

.doc h3 {
  font-size: 1.0625rem;
  margin: 1.75rem 0 0.5rem;
  color: var(--ink);
}

.doc p { margin: 0 0 1rem; }

.doc ul {
  margin: 0 0 1.25rem;
  padding-left: 1.1rem;
  list-style: none;
}

.doc li {
  position: relative;
  margin-bottom: 0.55rem;
  padding-left: 0.6rem;
}

.doc li::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.doc a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent-ink) 40%, transparent);
  overflow-wrap: anywhere;
}

.doc a:hover { text-decoration-color: currentColor; }

.doc strong { color: var(--ink); font-weight: 650; }

/* Callout card used for contact / support blocks */
.callout {
  padding: 1.5rem 1.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.callout--accent {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: linear-gradient(180deg, var(--accent-wash), transparent 60%), var(--surface);
}

.callout h2,
.callout h3 { margin-top: 0; padding-top: 0; border-top: 0; }

.callout p:last-child { margin-bottom: 0; }

.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.contact-line {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.0625rem;
}

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  flex: none;
  margin-top: auto;
  padding-block: clamp(2.5rem, 5vw, 3.5rem) 2rem;
  border-top: 1px solid var(--line);
  background: var(--surface-sunk);
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 2rem;
}

.site-footer__blurb {
  max-width: 24rem;
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
}

.footer-col h4 {
  margin-bottom: 0.85rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col li { margin-bottom: 0.5rem; }

.footer-col a {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

.footer-col a:hover { color: var(--accent-ink); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.site-footer__bottom p { margin: 0; }

/* --- Motion preferences --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
