/* Habuddy's home page: the app's own navy night, its type, and the week grid
   as the thing everything else hangs on. */
@font-face { font-family: "Jakarta"; src: url(fonts/PlusJakartaSans_500Medium.ttf) format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url(fonts/PlusJakartaSans_700Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url(fonts/PlusJakartaSans_800ExtraBold.ttf) format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --night: #0E1820;
  --deep: #122333;
  --card: #1A2B3B;
  --cell: #22364A;
  --line: rgba(255, 255, 255, 0.09);
  --ink: #F2F6FA;
  --muted: #9DB0C1;
  --sky: #A8CCE6;
  --sky-strong: #7FB3DA;
  --cream: #F2ECE1;
  --font: "Jakarta", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 500 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }

.kicker { margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sky); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; }
h1 em, h2 em { font-style: normal; color: var(--sky); }

/* Masthead */
.masthead { position: absolute; inset: 0 0 auto; z-index: 5; padding-top: 22px; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.masthead nav a { text-decoration: none; font-weight: 700; font-size: 14.5px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); }
.masthead nav a:hover { border-color: var(--sky); }

/* Hero */
.hero {
  position: relative;
  padding: 130px 0 70px;
  background:
    radial-gradient(900px 600px at 80% 20%, rgba(120, 170, 210, 0.2), transparent 70%),
    radial-gradient(800px 700px at 0% 100%, rgba(70, 120, 170, 0.16), transparent 70%),
    linear-gradient(180deg, var(--night), var(--deep));
}
.hero .wrap { display: grid; grid-template-columns: 1fr 1.05fr; gap: 40px; align-items: center; }
.hero-copy { min-width: 0; }
h1 { font-size: clamp(46px, 6.4vw, 84px); line-height: 1.02; }
.lead { margin: 26px 0 0; max-width: 33em; font-size: 19px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.badges img { height: 52px; width: auto; }
.facts-inline { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 26px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.facts-inline li { display: flex; align-items: center; gap: 8px; }
.facts-inline li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sky); }

.art { position: relative; min-width: 0; height: min(760px, 84vh); min-height: 560px; display: grid; place-items: center; }
.art canvas.scene { position: absolute; inset: -10% -14%; width: 128%; height: 120%; opacity: 0; transition: opacity 0.8s ease; pointer-events: none; }
.art.is-3d canvas.scene { opacity: 1; }
.art.is-3d .hero-phone { opacity: 0; }

.phone {
  width: min(320px, 78vw);
  border-radius: 46px;
  padding: 10px;
  background: #05090D;
  box-shadow: 0 0 0 1.5px #2A3947, 0 50px 110px rgba(0, 0, 0, 0.55);
}
.phone img { border-radius: 37px; width: 100%; }
.hero-phone { transition: opacity 0.6s ease; transform: rotate(-4deg); }

/* The notification that keeps arriving over the hero. */
.toast {
  position: absolute;
  left: -2%;
  top: 66%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(360px, 88%);
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(30, 46, 62, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  transform: rotate(-2deg);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.toast img { width: 46px; height: 46px; border-radius: 50%; flex: none; object-fit: cover; }
.toast div { min-width: 0; display: grid; }
.toast b { font-size: 15px; }
.toast span { font-size: 14px; color: #B5C5D3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast i { margin-left: auto; align-self: flex-start; font-style: normal; font-size: 12px; color: #8197AA; }
.toast.out { opacity: 0; transform: translateY(-14px) rotate(-2deg); }

/* Ticker */
.ticker { overflow: hidden; border-block: 1px solid var(--line); background: var(--deep); padding: 18px 0; }
.ticker-track { display: flex; align-items: center; gap: 28px; width: max-content; animation: ticker 38s linear infinite; font-weight: 700; font-size: 18px; color: var(--muted); white-space: nowrap; }
.ticker-track i { width: 22px; height: 22px; border-radius: 7px; background: var(--cell); box-shadow: inset 0 0 0 6px var(--cell), inset 0 0 0 11px var(--sky-strong); flex: none; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Features */
.feature { padding: 110px 0; }
.feature .wrap { display: grid; grid-template-columns: 1fr auto; gap: 70px; align-items: center; }
.feature.flip .copy { order: 2; }
.feature .copy { max-width: 520px; min-width: 0; }
.feature h2 { font-size: clamp(36px, 4.6vw, 58px); line-height: 1.04; margin-bottom: 22px; }
.feature p { color: var(--muted); margin: 0 0 14px; font-size: 18px; }
.feature strong { color: var(--ink); }
.phone.tilt { width: min(300px, 74vw); transform: perspective(1200px) rotateY(var(--ry, -10deg)) rotateX(var(--rx, 4deg)); transition: transform 0.2s ease-out; }
.feature.flip .phone.tilt { --ry: 10deg; }

/* Demo */
.demo { padding: 40px 0 60px; }
.demo-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
  align-items: center;
  padding: 44px;
  border-radius: 36px;
  background: linear-gradient(160deg, #18293A, #111F2C);
  border: 1px solid var(--line);
}
.demo-copy { min-width: 0; }
.demo-copy h2 { font-size: clamp(32px, 3.8vw, 48px); line-height: 1.05; margin-bottom: 16px; }
.demo-copy p { color: var(--muted); margin: 0 0 12px; }
.demo-status { color: var(--ink) !important; font-weight: 700; min-height: 1.6em; }
.demo-grid { display: grid; gap: 10px; min-width: 0; }
.demo-days, .demo-row { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); gap: 8px; align-items: center; }
.demo-days span { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.demo-days .today { background: #2A4258; color: var(--ink); border-radius: 8px; padding: 2px 0; }
.demo-row img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.demo-row.me { padding: 6px; margin: -6px; border-radius: 16px; background: rgba(168, 204, 230, 0.07); }
.demo-row > i, .demo-row > button { aspect-ratio: 1; border-radius: 12px; background: var(--cell); display: grid; place-items: center; border: 0; padding: 0; font: inherit; color: inherit; }
.demo-row > i:not(.empty):not(.later) { position: relative; }
.demo-row > i:not(.empty):not(.later)::after { content: ""; position: absolute; inset: 13%; border-radius: 50%; background: var(--p) center / cover; }
.demo-row > i.empty { background: #172736; }
.demo-row > i.later { background: transparent; box-shadow: inset 0 0 0 1.5px #2A3E52; }
.demo-row > button { cursor: pointer; background: transparent; box-shadow: inset 0 0 0 1.5px var(--sky-strong); color: var(--sky); transition: transform 0.15s ease, background 0.2s ease; }
.demo-row > button:hover { transform: scale(1.06); background: rgba(168, 204, 230, 0.1); }
.demo-row > button:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.demo-row > .slot span { font-size: 24px; font-weight: 700; line-height: 1; }
.demo-row > .bell { box-shadow: none; background: transparent; outline: 1.5px dashed var(--sky-strong); outline-offset: -2px; }
.demo-row > .bell svg { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.demo-row > .bell.sent { outline-style: solid; background: rgba(168, 204, 230, 0.16); animation: ring 0.6s ease; }
.demo-row > .slot.done { box-shadow: none; position: relative; background: var(--cell); cursor: default; animation: pop 0.45s cubic-bezier(.2, 1.6, .4, 1); }
.demo-row > .slot.done::after { content: ""; position: absolute; inset: 13%; border-radius: 50%; background: url(img/moves/move-18.webp) center / cover; }
.demo-row > .slot.done span { display: none; }
@keyframes pop { from { transform: scale(0.6); } to { transform: scale(1); } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

/* Facts */
.facts { padding: 70px 0 30px; }
.facts ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.facts li { padding: 26px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); }
.facts h3 { font-size: 20px; margin-bottom: 8px; letter-spacing: -0.02em; }
.facts p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* Call to action */
/* Questions: one column of open-and-close answers */
.faq { padding: 80px 0 10px; }
.faq h2 { font-size: clamp(32px, 3.8vw, 48px); line-height: 1.05; margin-bottom: 26px; }
.faq-list { display: grid; gap: 10px; max-width: 820px; }
.faq details { border-radius: 20px; background: var(--card); border: 1px solid var(--line); padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 30px 18px 0; position: relative; font-size: 17.5px; font-weight: 700; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 24px; font-weight: 600; color: var(--sky); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:focus-visible { outline: 2px solid var(--sky); outline-offset: 4px; border-radius: 8px; }
.faq details p { margin: 0 0 20px; color: var(--muted); font-size: 15.5px; max-width: 68ch; }
.cta { padding: 110px 0 120px; text-align: center; }
.cta .wrap { display: flex; flex-direction: column; align-items: center; }
.cta-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); margin-bottom: 26px; }
.cta h2 { font-size: clamp(38px, 5vw, 64px); line-height: 1.04; }
.cta p { color: var(--muted); margin: 16px 0 0; }
.cta .badges { justify-content: center; }
.cta .formerly { font-size: 14px; margin-top: 26px; }

footer { border-top: 1px solid var(--line); padding: 34px 0 44px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }
footer p { margin: 0; }

/* Rising in */
.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .phone.tilt.reveal.in { transform: perspective(1200px) rotateY(var(--ry, -10deg)) rotateX(var(--rx, 4deg)); }

@media (max-width: 920px) {
  .hero { padding-top: 110px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .art { height: 620px; min-height: 0; }
  .feature { padding: 70px 0; }
  .feature .wrap { grid-template-columns: 1fr; justify-items: center; gap: 40px; }
  .feature.flip .copy { order: 0; }
  .demo-card { grid-template-columns: 1fr; padding: 28px 20px; }
  .facts ul { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .lead { font-size: 17px; }
  .badges img { height: 46px; }
  .art { height: 540px; }
  .toast { top: auto; bottom: 2%; left: 0; }
  .facts ul { grid-template-columns: 1fr; }
  .demo-days, .demo-row { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); gap: 5px; }
  .demo-row img { width: 34px; height: 34px; }
  .demo-row > i, .demo-row > button { border-radius: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
