/* ============================================================
   HappyOS — hand-drawn one-pager
   Breakpoints: mobile <720px, tablet 720–1023px, desktop >=1024px
   ============================================================ */

:root {
  --bg: #faf8f2;
  --ink: #1c1b1a;
  --muted: #6e6a64;
  --dots: #c9c4bb;
  --footnote: #7c7466;
  --font-hand: "Shantell Sans", system-ui, sans-serif;
  --font-script: "Caveat", system-ui, sans-serif;
  --header-h: 126px; /* fallback; measured by script.js */
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-hand);
  padding-top: var(--header-h);
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- dotted separator line (typeface dots) ---------- */
.dots-line {
  font-family: var(--font-hand);
  font-size: 13px;
  line-height: 1.4;
  color: var(--dots);
  white-space: nowrap;
  overflow: hidden;
  height: 1.4em;
  user-select: none;
}

/* ---------- fixed header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
}

.header-inner {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 32px 40px;
  max-width: 1200px; /* keeps the menu together on wide screens */
  margin: 0 auto;
}

.logo {
  display: inline-flex;
  line-height: 0;
}

.logo svg {
  width: 114px;
  height: 26px;
  overflow: visible;
}

.nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.nav-link:hover {
  text-decoration: underline wavy 1.5px;
  text-underline-offset: 6px;
}

.donate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 24px;
  font-size: 16px;
  white-space: nowrap;
  transform: rotate(2deg);
  transition: transform 0.2s ease;
}

.donate:hover {
  transform: rotate(-2deg) scale(1.05);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 96px 24px 72px;
  text-align: center;
}

.hero-media {
  position: relative;
  line-height: 0;
}

.hero-media video {
  width: 230px;
  height: 230px;
  max-width: 100%;
  object-fit: cover;
  display: block;
  /* the source videos have a near-white bg (~rgb(246)); brightness clips it
     to pure white, multiply then makes it invisible over the cream page;
     clip-path trims the darker edge pixels of the video frame */
  filter: brightness(1.08);
  mix-blend-mode: multiply;
  clip-path: inset(2.5%);
}

.hero-annotation {
  /* anchored to .hero-media so it always hugs the video */
  position: absolute;
  top: 2px;
  right: -34px;
}

.annotation {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
  transform: rotate(-12deg);
  white-space: nowrap;
  pointer-events: none;
}

.hero-title {
  font-size: 52px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}

.hero-tagline {
  font-family: var(--font-script);
  font-size: 28px;
  line-height: 34px;
  color: var(--muted);
  max-width: 620px;
}

.star {
  position: absolute;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  pointer-events: none;
}

.star-a {
  left: 31%;
  top: 45%;
  transform: rotate(-15deg);
}

.star-b {
  left: 73%;
  top: 18%;
  transform: rotate(39deg);
}

.star-c {
  left: 71%;
  top: 58%;
  font-size: 16px;
  transform: rotate(10deg);
}

/* ---------- squiggle divider ---------- */
.squiggle-divider {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

.squiggle {
  position: relative;
  width: 240px;
  height: 18px;
  overflow: hidden;
}

/* ---------- apps ---------- */
.apps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 56px 24px 96px;
}

.apps-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
}

.apps-sub {
  font-family: var(--font-script);
  font-size: 28px;
  line-height: 34px;
  color: var(--muted);
}

.app-list {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
}

.app-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 16px 16px;
  border-radius: 16px;
  transition: background-color 0.2s ease;
}

.app-row:hover {
  background-color: #f1ede2;
}

.app-icon,
.app-arrow {
  transition: transform 0.25s ease;
}

.app-row:hover .app-icon {
  transform: rotate(-6deg) scale(1.08);
}

a.app-row:hover .app-arrow {
  transform: translateX(6px);
}

a.app-row:hover .app-name {
  text-decoration: underline wavy 1.5px;
  text-underline-offset: 6px;
}

.app-rule {
  padding: 0 8px;
}

.app-icon {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-copy {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.app-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

.app-desc {
  font-size: 16px;
  line-height: 22px;
  color: var(--muted);
}

.app-arrow {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}

.footnote {
  font-family: var(--font-script);
  font-style: italic;
  font-size: 20px;
  color: var(--footnote);
  text-align: center;
}

/* ---------- about ---------- */
.about {
  padding: 80px 24px;
}

.about-inner {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 80px;
  max-width: 900px;
  margin: 0 auto;
}

.about-media {
  flex-shrink: 0;
  line-height: 0;
}

.about-media video {
  width: 161px;
  height: 161px;
  object-fit: cover;
  display: block;
  border-radius: 24px;
  transform: scaleX(-1);
  cursor: pointer;
  filter: brightness(1.08);
  mix-blend-mode: multiply;
  clip-path: inset(2.5%);
}

.about-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 520px;
}

.about-body {
  font-size: 16px;
  line-height: 22px;
  color: var(--muted);
}

.about-ps {
  font-family: var(--font-script);
  font-size: 24px;
  color: var(--ink);
}

/* ---------- contact ---------- */
.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 96px 24px 64px;
  text-align: center;
}

.contact-kicker {
  font-family: var(--font-script);
  font-size: 28px;
  line-height: 34px;
  color: var(--muted);
}

.email-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}

.email {
  font-size: 44px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-underline {
  width: 420px;
  max-width: 100%;
  height: 14px;
  overflow: visible;
}

.email-wrap:hover .email-underline path {
  stroke-width: 5;
}

.contact-note {
  font-size: 16px;
  line-height: 22px;
  color: var(--muted);
}

/* ---------- footer ---------- */
.site-footer {
  display: flex;
  justify-content: center;
  padding: 72px 24px 64px;
}

.site-footer p {
  font-family: var(--font-script);
  font-size: 20px;
  color: var(--muted);
}

/* ---------- section reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition:
      opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* anchor offset below fixed header */
.apps,
.about,
.contact {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

/* ============================================================
   Tablet: 720–1023px
   ============================================================ */
@media (max-width: 1023px) {
  .header-inner {
    padding: 24px 40px;
  }

  .hero {
    gap: 16px;
    padding: 80px 24px 56px;
  }

  .hero-media video {
    width: 200px;
    height: 200px;
  }

  .hero-title {
    font-size: 40px;
  }

  .hero-tagline {
    font-size: 24px;
    line-height: 30px;
    max-width: 560px;
  }

  .apps {
    gap: 32px;
    padding: 48px 24px 72px;
  }

  .section-title {
    font-size: 28px;
  }

  .apps-sub {
    font-size: 24px;
    line-height: 30px;
  }

  .app-list {
    max-width: 640px;
  }

  .about {
    padding: 64px 24px;
  }

  .about-inner {
    gap: 48px;
  }

  .about-copy {
    max-width: 440px;
  }

  .contact {
    padding: 72px 24px 56px;
  }

  .contact-kicker {
    font-size: 24px;
    line-height: 30px;
  }

  .email {
    font-size: 36px;
  }

  .email-underline {
    width: 400px;
    height: 13px;
  }
}

/* ============================================================
   Mobile: <720px
   ============================================================ */
@media (max-width: 719px) {
  :root {
    --header-h: 90px;
  }

  .header-inner {
    padding: 24px 20px;
  }

  .logo svg {
    width: 88px;
    height: 20px;
  }

  .nav {
    gap: 16px;
  }

  .nav-link {
    display: none;
  }

  .hero {
    gap: 20px;
    padding: 72px 24px 48px;
  }

  .hero-media video {
    width: 170px;
    height: 170px;
  }

  .hero-annotation {
    top: 0;
    right: -30px;
  }

  .hero-title {
    font-size: 34px;
  }

  .hero-tagline {
    font-size: 20px;
    line-height: 26px;
  }

  .hero-tagline br {
    display: none; /* let the tagline flow naturally on small screens */
  }

  .star-a {
    left: 8%;
    top: 40%;
  }

  .star-b {
    left: 86%;
    top: 16%;
  }

  .star-c {
    display: none;
  }

  .apps {
    gap: 32px;
    padding: 40px 24px 64px;
  }

  .section-title {
    font-size: 26px;
  }

  .apps-sub {
    font-size: 22px;
    line-height: 28px;
  }

  .app-row {
    gap: 16px;
  }

  .app-desc {
    white-space: normal;
  }

  .footnote {
    font-size: 18px;
  }

  .about {
    padding: 48px 24px;
  }

  .about-inner {
    flex-direction: column;
    gap: 28px;
    text-align: center;
  }

  .about-copy {
    align-items: center;
  }

  .contact {
    padding: 64px 24px 56px;
  }

  .contact-kicker {
    font-size: 28px;
  }

  .email {
    font-size: 26px;
  }

  .email-underline {
    width: 300px;
    height: 10px;
  }
}
