/* ==========================================================================
   CalendarWrite — public site styles
   Senior-friendly: large type, high contrast, 44px+ touch targets.
   All motion is disabled for users with "Reduce motion" turned on.
   ========================================================================== */

:root {
  --cw-paper: #FBF9F4;
  --cw-white: #FFFFFF;
  --cw-ink: #1B1A2E;
  --cw-text: #3F3D52;
  --cw-muted: #55526A;
  --cw-line: #E7E3D8;
  --cw-accent: #3730A3;      /* indigo from the logo */
  --cw-accent-dark: #1E1B6B;
  --cw-accent-soft: #EEECFB;
  --cw-accent-tint: #E4E2FB;
  --cw-green: #15803D;       /* CTA green (darker than app green for contrast) */
  --cw-green-soft: #DDF3E4;
  --cw-green-ink: #14532D;
  --cw-orange: #C2410C;
  --cw-red: #B91C1C;
  --cw-phone: #15141C;

  --cw-font-display: 'Lexend', system-ui, sans-serif;
  --cw-font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --cw-font-hand: 'Caveat', cursive;

  --cw-max: 1200px;
  --cw-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cw-paper);
  color: var(--cw-ink);
  font-family: var(--cw-font-body);
  font-size: 20px;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--cw-accent); }
a:hover { color: var(--cw-accent-dark); }
:focus-visible { outline: 3px solid var(--cw-accent); outline-offset: 3px; border-radius: 6px; }

.cw-skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  padding: 12px 20px; background: var(--cw-ink); color: #fff; border-radius: 12px; font-weight: 700;
}
.cw-skip:focus { top: 16px; color: #fff; }

.cw-container { max-width: var(--cw-max); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.cw-section { padding-top: 88px; padding-bottom: 88px; }

.cw-eyebrow {
  margin: 0 0 12px; font-family: var(--cw-font-hand); font-size: 34px; font-weight: 700;
  color: var(--cw-orange); line-height: 1.1;
}
.cw-h1 {
  margin: 0; font-family: var(--cw-font-display); font-weight: 700;
  font-size: clamp(42px, 6vw, 68px); line-height: 1.08; letter-spacing: -0.02em;
}
.cw-h2 {
  margin: 0; font-family: var(--cw-font-display); font-weight: 700;
  font-size: clamp(32px, 4vw, 44px); line-height: 1.15; letter-spacing: -0.01em;
}
.cw-h3 { margin: 20px 0 8px; font-family: var(--cw-font-display); font-weight: 600; font-size: 26px; line-height: 1.25; }
.cw-lead { margin: 16px 0 0; font-size: 22px; color: var(--cw-text); max-width: 680px; }

/* ---------- Header ---------- */
.cw-header { position: relative; z-index: 2; border-bottom: 1px solid var(--cw-line); background: rgba(251, 249, 244, .9); }
.cw-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.cw-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--cw-ink); }
.cw-brand:hover { color: var(--cw-ink); }
.cw-brand img { width: 52px; height: 52px; border-radius: 12px; }
.cw-brand span { font-family: var(--cw-font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; }
.cw-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cw-nav a { padding: 12px 16px; color: var(--cw-ink); text-decoration: none; font-weight: 700; }
.cw-nav a[aria-current="page"] { color: var(--cw-accent); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 3px; }
.cw-nav .cw-nav__login { margin-left: 8px; padding: 10px 22px; border: 2px solid var(--cw-green); border-radius: 999px; color: var(--cw-green); }
.cw-nav .cw-nav__login:hover { background: var(--cw-green); color: #fff; }

/* ---------- Hero ---------- */
.cw-hero-wrap { position: relative; overflow: hidden; }
.cw-hero { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-top: 64px; padding-bottom: 96px; }
.cw-hero__copy { flex: 1 1 520px; min-width: 0; }
.cw-hero__media { flex: 0 1 280px; min-width: 0; display: flex; justify-content: center; position: relative; }
.cw-hero__text { margin: 34px 0 0; font-size: 23px; line-height: 1.55; color: var(--cw-text); max-width: 560px; }
.cw-hero__accent { color: var(--cw-accent); position: relative; }
.cw-hero__underline { position: absolute; left: 0; bottom: -14px; width: 100%; height: 22px; overflow: visible; }
.cw-trial { margin: 22px 0 0; display: flex; align-items: center; gap: 10px; font-size: 19px; color: var(--cw-text); }
.cw-trial strong { color: var(--cw-green); }

.cw-chip {
  margin: 0 0 22px; display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 18px 8px 14px; background: #FFF1E6; border: 1px solid #FCD3B4; color: #9A3412;
  border-radius: 999px; font-weight: 700; font-size: 17px;
}
.cw-chip__dot { width: 10px; height: 10px; border-radius: 50%; background: #EA580C; }

.cw-note { position: absolute; right: -20px; top: 180px; display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; }
.cw-note p { margin: 0; font-family: var(--cw-font-hand); font-size: 32px; font-weight: 700; color: #DC2626; transform: rotate(-6deg); }
.cw-note svg { margin-right: 40px; }

/* Background decorations */
.cw-blob { position: absolute; border-radius: 50%; pointer-events: none; }
.cw-blob--a { width: 520px; height: 520px; right: 4%; top: 40px; background: radial-gradient(circle, rgba(124, 108, 240, .30), rgba(124, 108, 240, 0) 68%); }
.cw-blob--b { width: 420px; height: 420px; right: 22%; top: 320px; background: radial-gradient(circle, rgba(31, 184, 154, .22), rgba(31, 184, 154, 0) 68%); animation-delay: -6s; }
.cw-doodle { position: absolute; pointer-events: none; }
.cw-doodle--star { left: 3%; top: 48px; opacity: .7; }
.cw-doodle--heart { left: 44%; bottom: 56px; opacity: .6; animation-delay: -3s; }
.cw-doodle--wave { right: 3%; top: 26px; opacity: .6; }
.cw-doodle--spiral { left: 36%; top: 30px; opacity: .45; }

/* ---------- Phone mockup ---------- */
.cw-phone { width: 220px; padding: 10px; background: var(--cw-phone); border-radius: 36px; box-shadow: 0 40px 70px -24px rgba(40, 34, 120, .45); }
.cw-phone img { display: block; width: 100%; height: auto; border-radius: 28px; }
.cw-phone--sm { width: 200px; padding: 9px; border-radius: 32px; box-shadow: 0 34px 60px -24px rgba(40, 34, 120, .4); }
.cw-phone--sm img { border-radius: 24px; }

/* ---------- Store buttons ---------- */
.cw-stores { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 16px; }
.cw-store {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 26px 10px 20px;
  border-radius: 16px; text-decoration: none; background: var(--cw-white); color: var(--cw-ink);
  border: 2px solid var(--cw-ink);
}
.cw-store__label { display: flex; flex-direction: column; line-height: 1.15; }
.cw-store__small { font-size: 15px; color: var(--cw-muted); }
.cw-store__big { font-family: var(--cw-font-display); font-weight: 600; font-size: 24px; }
a.cw-store { background: var(--cw-green); border-color: var(--cw-green); color: #fff; transition: transform .25s var(--cw-ease), box-shadow .25s; }
a.cw-store .cw-store__small { color: #E7F6EC; }
a.cw-store:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 14px 28px -14px rgba(21, 128, 61, .6); }
.cw-stores--on-dark { margin-top: 0; }
.cw-stores--on-dark .cw-store { border-color: #fff; }
.cw-stores--on-dark a.cw-store { background: #fff; border-color: #fff; color: var(--cw-ink); }
.cw-stores--on-dark a.cw-store .cw-store__small { color: var(--cw-muted); }

/* ---------- Marquee ---------- */
.cw-marquee { background: var(--cw-accent); color: #fff; overflow: hidden; white-space: nowrap; padding: 18px 0; }
.cw-marquee__track { display: inline-flex; gap: 48px; padding-right: 48px; font-family: var(--cw-font-hand); font-size: 34px; font-weight: 700; }

/* ---------- Features ---------- */
.cw-features { background: var(--cw-white); border-bottom: 1px solid var(--cw-line); }
.cw-grid-3 { margin-top: 48px; display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 24px; }
.cw-card { padding: 32px; background: var(--cw-paper); border: 1px solid var(--cw-line); border-radius: 24px; transition: transform .35s var(--cw-ease), box-shadow .35s; }
.cw-card:hover { transform: translateY(-8px); box-shadow: 0 22px 44px -22px rgba(55, 48, 163, .45); }
.cw-card p { margin: 0; color: var(--cw-text); }
.cw-icon { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; transition: transform .35s var(--cw-ease); }
.cw-card:hover .cw-icon { transform: rotate(-8deg) scale(1.08); }
.cw-icon--indigo { background: #E8E6FB; color: var(--cw-accent); }
.cw-icon--orange { background: #FDEBDD; color: #B4430B; }
.cw-icon--green  { background: var(--cw-green-soft); color: #166534; }
.cw-icon--blue   { background: #E0ECFC; color: #1D4ED8; }
.cw-icon--purple { background: #F3E4F8; color: #86198F; }
.cw-icon--red    { background: #FCE4E4; color: var(--cw-red); }

/* ---------- Steps ---------- */
.cw-steps { margin: 48px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; }
.cw-step { display: flex; flex-direction: column; gap: 8px; }
.cw-step__num { font-family: var(--cw-font-hand); font-size: 76px; font-weight: 700; line-height: 1; }
.cw-step__title { font-family: var(--cw-font-display); font-weight: 600; font-size: 26px; }
.cw-step__text { color: var(--cw-text); }

/* ---------- Share spotlight ---------- */
.cw-share { background: var(--cw-accent-soft); }
.cw-share__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 64px; }
.cw-share__media { flex: 0 1 320px; min-width: 0; display: flex; justify-content: center; }
.cw-share__copy { flex: 1 1 460px; min-width: 0; }
.cw-checks { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.cw-checks li { display: flex; gap: 14px; align-items: flex-start; }
.cw-checks svg { flex: none; margin-top: 2px; color: var(--cw-green); }

/* ---------- CTA band ---------- */
.cw-cta { position: relative; overflow: hidden; background: var(--cw-accent); color: #fff; border-radius: 32px; padding: 64px 48px; }
.cw-cta__lines { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .16; pointer-events: none; }
.cw-cta__inner { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; }
.cw-cta__copy { flex: 1 1 420px; min-width: 0; }
.cw-cta__eyebrow { margin: 0 0 8px; font-family: var(--cw-font-hand); font-size: 32px; font-weight: 700; color: #FDE68A; line-height: 1.1; }
.cw-cta__text { margin: 12px 0 0; font-size: 22px; color: var(--cw-accent-tint); }

/* ---------- Inner pages (About / legal) ---------- */
.cw-page { padding-top: 72px; padding-bottom: 96px; }
.cw-page .cw-h1 { font-size: clamp(40px, 5.5vw, 60px); }
.cw-updated { margin: 16px 0 0; font-size: 18px; color: var(--cw-muted); }
.cw-intro { margin: 28px 0 0; font-size: 24px; line-height: 1.55; color: var(--cw-text); max-width: 760px; }
.cw-two-col { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start; }

.cw-toc { flex: 1 1 240px; min-width: 0; max-width: 300px; }
.cw-toc p { margin: 0 0 12px; font-family: var(--cw-font-display); font-weight: 600; font-size: 18px; color: var(--cw-muted); }
.cw-toc ul { margin: 0; padding: 0; list-style: none; font-size: 18px; }
.cw-toc a { display: block; padding: 6px 0; }

.cw-prose { flex: 999 1 560px; min-width: 0; max-width: 760px; line-height: 1.7; }
.cw-prose h2 { margin: 48px 0 12px; font-family: var(--cw-font-display); font-weight: 700; font-size: 30px; line-height: 1.25; scroll-margin-top: 24px; }
.cw-prose p { margin: 0; }
.cw-prose p + p { margin-top: 1em; }
.cw-prose ul { margin: 16px 0; padding-left: 28px; display: flex; flex-direction: column; gap: 6px; }
.cw-prose a { font-weight: 700; }

.cw-callout { padding: 28px 32px; border-radius: 24px; display: flex; gap: 18px; align-items: flex-start; }
.cw-callout svg { flex: none; margin-top: 2px; }
.cw-callout__title { margin: 0; font-family: var(--cw-font-display); font-weight: 600; font-size: 22px; }
.cw-callout--green { background: var(--cw-green-soft); color: var(--cw-green-ink); margin-bottom: 36px; }
.cw-callout--indigo { background: var(--cw-accent-soft); margin-top: 20px; display: block; }
.cw-callout--indigo ul { margin-top: 8px; }

.cw-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 24px;
  border-radius: 999px; text-decoration: none; font-weight: 700;
}
.cw-btn--green { background: var(--cw-green); color: #fff; }
.cw-btn--green:hover { color: #fff; background: #116A32; }
.cw-btn--danger { margin-top: 20px; min-height: 52px; border: 2px solid var(--cw-red); color: var(--cw-red); }
.cw-btn--danger:hover { background: var(--cw-red); color: #fff; }

.cw-about-list { margin: 0; padding: 0; list-style: none; }
.cw-about-list li { display: flex; gap: 18px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--cw-line); }
.cw-about-list svg { flex: none; margin-top: 2px; }
.cw-aside { flex: 1 1 320px; min-width: 0; padding: 36px; background: var(--cw-accent-soft); border-radius: 28px; }
.cw-aside h2 { margin: 0; font-family: var(--cw-font-display); font-weight: 700; font-size: 28px; }
.cw-aside p { margin: 12px 0 20px; color: var(--cw-text); }

/* ---------- Footer ---------- */
.cw-footer { border-top: 1px solid var(--cw-line); background: var(--cw-white); }
.cw-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; padding-top: 48px; padding-bottom: 48px; }
.cw-footer__brand { display: flex; flex-direction: column; gap: 10px; }
.cw-footer__brand .cw-brand img { width: 44px; height: 44px; border-radius: 10px; }
.cw-footer__brand .cw-brand span { font-size: 22px; }
.cw-footer__tagline { margin: 0; font-family: var(--cw-font-hand); font-size: 28px; font-weight: 700; color: var(--cw-muted); }
.cw-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: flex-start; }
.cw-footer__nav a { padding: 8px 0; font-weight: 700; }
.cw-footer__copy { padding-bottom: 40px; font-size: 17px; color: var(--cw-muted); }

/* ==========================================================================
   Motion
   ========================================================================== */
@keyframes cwRise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes cwDraw { to { stroke-dashoffset: 0; } }
@keyframes cwDrawLoop { 0% { stroke-dashoffset: 1; } 35%, 70% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
@keyframes cwFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes cwBob { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-10px) rotate(6deg); } }
@keyframes cwDrift { to { background-position: 56px 56px; } }
@keyframes cwBlob { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -24px) scale(1.12); } 100% { transform: translate(-20px, 18px) scale(.95); } }
@keyframes cwPulse { 0% { box-shadow: 0 0 0 0 rgba(234, 88, 12, .55); } 80%, 100% { box-shadow: 0 0 0 12px rgba(234, 88, 12, 0); } }
@keyframes cwSlide { to { transform: translateX(-50%); } }

.cw-word { display: inline-block; opacity: 0; animation: cwRise .9s var(--cw-ease) forwards; }
.cw-in { opacity: 0; animation: cwRise .9s var(--cw-ease) forwards; }
.cw-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: cwDraw 1.1s ease-out forwards; }
.cw-loop { stroke-dasharray: 1; stroke-dashoffset: 1; animation: cwDrawLoop 7s ease-in-out infinite; }
.cw-float { animation: cwFloat 6s ease-in-out infinite; }
.cw-bob { animation: cwBob 7s ease-in-out infinite; }
.cw-paper-grid { background-image: radial-gradient(#DCD6C6 1.6px, transparent 1.6px); background-size: 28px 28px; animation: cwDrift 14s linear infinite; }
.cw-blob { animation: cwBlob 12s ease-in-out infinite alternate; }
.cw-pulse { animation: cwPulse 2s ease-out infinite; }
.cw-marquee__track { animation: cwSlide 40s linear infinite; }

/* Delays */
.cw-d1 { animation-delay: .1s; }  .cw-d2 { animation-delay: .2s; }  .cw-d3 { animation-delay: .32s; }
.cw-d4 { animation-delay: .5s; }  .cw-d5 { animation-delay: .62s; } .cw-d6 { animation-delay: .76s; }
.cw-d7 { animation-delay: 1s; }   .cw-d8 { animation-delay: 1.15s; } .cw-d9 { animation-delay: 1.3s; }
.cw-d10 { animation-delay: 1.4s; } .cw-dn2 { animation-delay: -2s; } .cw-dn3 { animation-delay: -3s; } .cw-dn4 { animation-delay: -4s; }

/* Scroll reveal (progressive enhancement: browsers without support just show content) */
@supports (animation-timeline: view()) {
  .cw-reveal { animation: cwRise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cw-word, .cw-in { opacity: 1; }
  .cw-draw, .cw-loop { stroke-dashoffset: 0; }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  body { font-size: 19px; }
  .cw-section { padding-top: 64px; padding-bottom: 64px; }
  .cw-hero { padding-top: 40px; padding-bottom: 64px; gap: 40px; }
  .cw-phone { width: 180px; padding: 8px; border-radius: 30px; }
  .cw-phone img { border-radius: 24px; }
  .cw-phone--sm { width: 160px; }
  .cw-note { display: none; }
  .cw-doodle--spiral, .cw-doodle--heart { display: none; }
  .cw-cta { padding: 40px 24px; border-radius: 24px; }
  .cw-nav .cw-nav__login { margin-left: 0; }
}
