/* ==========================================================================
   Dailyish — dailyishapp.com
   The aesthetic of the app: a calm, low-chrome ground where the user's own
   habit colors do the painting. SF Pro Rounded everywhere. The 7-day dot
   trail is the site's signature graphic language — every section header
   carries a trail one dot further along, and the final CTA completes the week.
   ========================================================================== */

/* ---- Tokens ---------------------------------------------------------- */

:root {
  /* Brand chrome */
  --accent: #8E5AF5;

  /* Habit palette (hand-picked from the 24-color kit) */
  --c-blue:    #4A90D9;
  --c-indigo:  #5C7CFA;
  --c-purple:  #8E5AF5;
  --c-violet:  #C969E0;
  --c-magenta: #F26FB2;
  --c-rose:    #E84B6B;
  --c-orange:  #E8724A;
  --c-yellow:  #F5C542;
  --c-lime:    #A6D344;
  --c-green:   #50C878;
  --c-forest:  #34A853;
  --c-mint:    #3DC9B0;
  --c-teal:    #5BA8C8;
  --c-sky:     #3FB7E0;
  --c-cobalt:  #1F6FEB;
  --c-coral:   #FF6B6B;

  /* Neutral ground (light) */
  --bg: #FBFAFC;
  --surface: rgba(60, 55, 75, 0.055);
  --line: rgba(60, 55, 75, 0.12);
  --ink: #1C1B22;
  --ink-2: rgba(28, 27, 34, 0.62);
  --ink-3: rgba(28, 27, 34, 0.4);
  --card-bg: #FFFFFF;
  --check-ink: #FFFFFF;

  --radius: 16px;
  --wrap: 1080px;
  --pad: 20px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131218;
    --surface: rgba(235, 232, 245, 0.06);
    --line: rgba(235, 232, 245, 0.13);
    --ink: #F2F0F7;
    --ink-2: rgba(242, 240, 247, 0.64);
    --ink-3: rgba(242, 240, 247, 0.42);
    --card-bg: #1C1B23;
  }
}

/* ---- Base ------------------------------------------------------------ */

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

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

body {
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem; /* 17px, like the app's body */
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-wrap: balance;
}

/* ---- Dot trail: the signature ---------------------------------------- */

.trail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 0;
}

.trail i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tc, var(--accent));
  flex: none;
}

/* scheduled day, not done: 25% of habit color, like the app */
.trail i.off {
  background: color-mix(in srgb, var(--tc, var(--accent)) 25%, transparent);
}

/* not-scheduled day: smaller, fainter */
.trail i.rest {
  width: 6px;
  height: 6px;
  background: color-mix(in srgb, var(--tc, var(--accent)) 14%, transparent);
}

/* today, not yet done: ring */
.trail i.today {
  background: transparent;
  border: 2px solid color-mix(in srgb, var(--tc, var(--accent)) 65%, transparent);
}

/* Section-heading trails: progress through the page's "week" */
.section-trail { margin-bottom: 14px; }
.section-trail i { width: 11px; height: 11px; }

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

.site-header { padding: 18px 0; }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav a { color: var(--ink-2); }
.nav a:hover { color: var(--ink); text-decoration: none; }

.nav .pill {
  color: #fff;
  background: var(--accent);
  padding: 8px 16px;
  border-radius: 999px;
}
.nav .pill:hover { background: color-mix(in srgb, var(--accent) 88%, black); }

@media (max-width: 560px) {
  .nav { gap: 14px; font-size: 0.9rem; }
}

/* ---- Hero -------------------------------------------------------------- */

.hero { padding: 44px 0 72px; }

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 3.9rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.hero .lede {
  margin-top: 18px;
  font-size: 1.2rem;
  color: var(--ink-2);
  max-width: 36ch;
  text-wrap: pretty;
}

.hero .platform-line {
  margin-top: 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}

.cta-row {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.trust {
  font-size: 0.88rem;
  color: var(--ink-3);
  max-width: 32ch;
  text-wrap: pretty;
}

/* App Store badge */
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: var(--ink);
  color: var(--bg);
  padding: 11px 20px 11px 17px;
  border-radius: 13px;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.appstore-badge:hover { text-decoration: none; transform: scale(1.03); }
.appstore-badge:active { transform: scale(0.96); }

.appstore-badge svg { width: 24px; height: 30px; fill: currentColor; }

.appstore-badge .stack { display: flex; flex-direction: column; line-height: 1.15; }
.appstore-badge .small { font-size: 0.68rem; font-weight: 500; opacity: 0.8; }
.appstore-badge .big { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }

/* ---- Hero habit board (pure CSS, painted by hand) ----------------------- */

.habit-board {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 22px 18px 18px;
  box-shadow: 0 1px 2px rgba(20, 16, 35, 0.05), 0 14px 34px -20px rgba(20, 16, 35, 0.2);
  max-width: 420px;
  justify-self: end;
  width: 100%;
}

.board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 6px 14px;
}

.board-head .greeting {
  font-size: 0.95rem;
  color: var(--ink-2);
}

.board-head .date {
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.board-head .count {
  font-size: 1.35rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-align: right;
}
.board-head .count small {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.habit-row {
  --hc: var(--accent);
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  margin-top: 9px;
}

.habit-row.done {
  background: color-mix(in srgb, var(--hc) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--hc) 24%, transparent);
  padding: 11px 13px;
}

.habit-row .check {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.habit-row.done .check { background: var(--hc); }

.habit-row .check svg {
  width: 15px;
  height: 15px;
  stroke: var(--check-ink);
  stroke-width: 3.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* idle: ring */
.habit-row:not(.done):not(.partial) .check {
  border: 2px solid color-mix(in srgb, var(--hc) 42%, transparent);
  background: color-mix(in srgb, var(--hc) 7%, transparent);
}
.habit-row:not(.done) .check svg { display: none; }

/* partial multi-rep: conic arc + counter */
.habit-row.partial .check {
  background:
    conic-gradient(var(--hc) 0 var(--arc, 60%),
      color-mix(in srgb, var(--hc) 20%, transparent) var(--arc, 60%) 100%);
  position: relative;
}
.habit-row.partial .check::after {
  content: "";
  position: absolute;
  inset: 3.5px;
  border-radius: 50%;
  background: var(--card-bg);
}
.habit-row.partial .check b {
  position: relative;
  z-index: 1;
  font-size: 0.66rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.habit-row .meta { flex: 1; min-width: 0; }

.habit-row .name {
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.005em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.habit-row .streak {
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--ink-3);
  white-space: nowrap;
}

.habit-row .trail { --tc: var(--hc); margin-top: 6px; }
.habit-row .trail i { width: 8px; height: 8px; }
.habit-row .trail i.rest { width: 5px; height: 5px; }

.board-foot {
  margin-top: 14px;
  padding: 0 6px;
  font-size: 0.8rem;
  color: var(--ink-3);
  text-align: center;
}

/* ---- Sections ------------------------------------------------------------ */

.section { padding: 72px 0; }

.section-head {
  max-width: 640px;
  margin-bottom: 44px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.35rem);
  letter-spacing: -0.02em;
}

.section-head p {
  margin-top: 12px;
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 60ch;
  text-wrap: pretty;
}

/* ---- Feature rows (styled like completed habit rows) ---------------------- */

.feature-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.feature-row {
  --hc: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--hc) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--hc) 22%, transparent);
  padding: 20px 22px 18px;
}

.feature-row .row-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.feature-row .check {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--hc);
  display: grid;
  place-items: center;
}

.feature-row .check svg {
  width: 13px;
  height: 13px;
  stroke: var(--check-ink);
  stroke-width: 3.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-row h3 {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feature-row p {
  color: var(--ink-2);
  font-size: 0.97rem;
  max-width: 52ch;
  text-wrap: pretty;
}

.feature-row .trail {
  --tc: var(--hc);
  margin-top: auto;
  padding-top: 14px;
}

.feature-row.wide { grid-column: 1 / -1; }
.feature-row.wide p { max-width: 68ch; }

@media (max-width: 720px) {
  .feature-rows { grid-template-columns: 1fr; }
}

/* ---- Screenshot showcase --------------------------------------------------- */

.showcase-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 236px;
  gap: 18px;
  overflow-x: auto;
  padding: 6px 6px 22px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.showcase-strip .shot { scroll-snap-align: start; }

.showcase-strip img {
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px -16px rgba(20, 16, 35, 0.24);
}

.showcase-strip::-webkit-scrollbar { height: 8px; }
.showcase-strip::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 99px;
}
.showcase-strip::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 99px;
}

/* ---- Platforms --------------------------------------------------------------- */

.platforms {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.platform {
  --hc: var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 18px;
}

.platform .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hc);
  margin-bottom: 12px;
}

.platform .label { font-weight: 700; font-size: 1.02rem; }
.platform .sub { color: var(--ink-2); font-size: 0.88rem; margin-top: 3px; text-wrap: pretty; }

@media (max-width: 720px) {
  .platforms { grid-template-columns: 1fr 1fr; }
}

/* ---- Privacy passage ----------------------------------------------------------- */

.quiet { max-width: 660px; }

.quiet p {
  font-size: 1.15rem;
  color: var(--ink-2);
  max-width: 62ch;
  text-wrap: pretty;
}

.quiet p + p { margin-top: 14px; }

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

.quiet .more {
  margin-top: 18px;
  font-weight: 650;
  font-size: 0.98rem;
}

/* ---- Final CTA -------------------------------------------------------------------- */

.final-cta {
  text-align: center;
  padding: 64px 24px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.final-cta .week-trail {
  display: inline-flex;
  gap: 9px;
  margin-bottom: 26px;
}

.final-cta .week-trail i {
  width: 15px;
  height: 15px;
  border-radius: 50%;
}

.final-cta h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
}

.final-cta p {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 1.1rem;
  max-width: 44ch;
  margin-inline: auto;
  text-wrap: pretty;
}

.final-cta .appstore-badge { margin-top: 28px; }

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

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 36px 0 44px;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.site-footer .wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer .foot-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.site-footer .foot-brand img { width: 26px; height: 26px; border-radius: 7px; }

.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--ink); }

.footer-links {
  display: flex;
  gap: 20px;
  font-weight: 600;
}

.site-footer .foot-trail { margin-top: 12px; }
.site-footer .foot-trail i { width: 8px; height: 8px; }

/* ---- Legal / support page chrome ---------------------------------------------------------- */

.page-hero { padding: 40px 0 8px; }

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-hero .updated {
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 0.92rem;
  font-weight: 600;
}

.page-hero .section-trail { margin-bottom: 16px; }

.prose {
  max-width: 68ch;
  margin-inline: auto;
  padding: 28px var(--pad) 72px;
}

.prose h2 {
  font-size: 1.35rem;
  margin: 40px 0 12px;
  letter-spacing: -0.015em;
}

.prose p { margin: 12px 0; color: var(--ink-2); }
.prose p strong, .prose li strong { color: var(--ink); }

.prose ul {
  margin: 12px 0;
  padding-left: 24px;
  color: var(--ink-2);
}
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--accent); }

.prose details {
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 18px;
  margin: 10px 0;
}

.prose details[open] {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  padding: 13px 17px;
}

.prose summary {
  font-weight: 650;
  cursor: pointer;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 11px;
}
.prose summary::-webkit-details-marker { display: none; }

.prose summary::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  transition: background 0.2s, border-color 0.2s;
}
.prose details[open] summary::before {
  background: var(--accent);
  border-color: var(--accent);
}

.prose details > *:not(summary) { margin-left: 21px; }
.prose details ul { padding-left: 20px; }

/* ---- Responsive: hero stacks ------------------------------------------------------------------ */

@media (max-width: 880px) {
  .hero { padding-top: 20px; }
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .habit-board { justify-self: center; }
  .section { padding: 56px 0; }
}

@media (max-width: 400px) {
  .habit-row { gap: 10px; padding: 11px 12px; }
  .habit-row .streak { display: none; }
}

/* ---- Motion (progressive enhancement; JS adds .in to trails) ----------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .js .pop-trail i {
    transform: scale(0.2);
    opacity: 0;
    transition:
      transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
      opacity 0.3s ease-out;
  }
  .js .pop-trail.in i {
    transform: scale(1);
    opacity: 1;
  }
  .js .pop-trail i:nth-child(2) { transition-delay: 0.06s; }
  .js .pop-trail i:nth-child(3) { transition-delay: 0.12s; }
  .js .pop-trail i:nth-child(4) { transition-delay: 0.18s; }
  .js .pop-trail i:nth-child(5) { transition-delay: 0.24s; }
  .js .pop-trail i:nth-child(6) { transition-delay: 0.30s; }
  .js .pop-trail i:nth-child(7) { transition-delay: 0.36s; }
}
