/* Shared design tokens, navigation and signature footer; homepage layout. */
:root {
  color-scheme: light dark;
  --background: #faf8f5;
  --text: #302a2e;
  --muted: #716a6e;
  --accent: #c05243;
  --accent-hover: #a44336;
  --line: #ded8d5;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --container: 1328px;
  --gutter: clamp(24px, 5.4vw, 80px);
  --header-height: 88px;
  --footer-sky: #b9dcf0;
  /* Bottom grass from footer-meadow.webp (grass-only ~#7f8433; rendered edge ~#8e8f3f). */
  --footer-meadow: #8e8f3f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 24px); }
/* Safari samples the page canvas behind its toolbars and during overscroll.
   Keep plum behind cinematic heroes; once the header is solid, continue the
   meadow so rubber-banding under the footer is grass, not sky or plum. */
html {
  background: var(--text);
  overscroll-behavior-y: none;
}
html:has(.home-header.is-solid) { background: var(--footer-meadow); }
body {
  margin: 0;
  background: var(--text);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body:has(.home-header.is-solid) { background: var(--footer-meadow); }
/* Keep the content ivory. Do not cover the safe areas with fixed layers. */
body > main { background: var(--background); }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; height: auto; }
svg { display: block; width: 24px; height: 24px; flex: 0 0 24px; }
.cta-arrow { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease; }
.home-button-primary:hover .cta-arrow, .button.primary:hover .cta-arrow { transform: translate(2px, -2px); }
/* U+2197 text presentation — Helvetica Neue has no glyph, so iOS otherwise falls back to Apple Color Emoji. */
.ext-arrow {
  font-family: "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols 2", Times, "Times New Roman", serif;
  font-style: normal;
  font-weight: 400;
  font-variant-emoji: text;
  color: inherit;
}
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
main:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 400; }
.no-wrap { white-space: nowrap; }
em { color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-weight: 400; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 100;
  padding: 14px 20px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  transform: translateY(calc(-100% - 24px));
}
.skip-link:focus { transform: translateY(0); }

.home-header {
  position: fixed;
  top: var(--safe-top);
  left: 0;
  width: 100%;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--header-height);
  padding: 18px max(var(--gutter), calc((100% - var(--container)) / 2));
  border-bottom: 1px solid #fff8ed1a;
  color: #fff8ed;
  background: #30202e24;
  backdrop-filter: blur(12px);
  transition: background 220ms ease, color 220ms ease, border-color 220ms ease,
    box-shadow 220ms ease, border-radius 220ms ease, top 220ms ease,
    left 220ms ease, width 220ms ease, min-height 220ms ease, padding 220ms ease;
}
.home-header.is-moving { background: #30202ed9; }
.home-header.is-solid { background: rgba(250, 248, 245, 0.97); color: var(--text); border-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 600; letter-spacing: -0.8px; }
.brand img { width: 40px; height: 40px; border-radius: 11px; }
.site-nav { display: flex; gap: 28px; margin-inline: auto; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.home-language { display: flex; align-items: center; gap: 2px; color: inherit; font-size: 13px; }
.home-language a { display: grid; place-items: center; min-height: 44px; min-width: 30px; }
.home-language a[aria-current], .home-language a:hover { text-decoration: underline; text-underline-offset: 5px; }
.nav-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 1px solid currentColor; border-radius: 99px; background: transparent; color: inherit; font-size: 13px; white-space: nowrap; transition: background 180ms, border-color 180ms, color 180ms, transform 180ms; }
.nav-cta:hover { background: #ffffff18; }
.home-header.is-solid .nav-cta {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.home-header.is-solid .nav-cta:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.home-header a:focus-visible, .home-header summary:focus-visible { outline-color: currentColor; }
.mobile-nav { display: none; position: relative; }
.mobile-nav summary { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 14px; list-style: none; cursor: pointer; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary::after { content: ""; width: 16px; height: 8px; border-block: 1px solid currentColor; }
.mobile-nav[open] summary::after { transform: rotate(90deg); }
.mobile-nav nav { position: absolute; z-index: 40; top: calc(100% + 16px); right: 0; width: 220px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--background); color: var(--text); box-shadow: 0 12px 30px #302a2e12; }
.mobile-nav nav a { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 6px; font-size: 16px; }
.mobile-nav nav a:hover { background: #f0eae5; }

.home-intro, .home-areas, .home-footer-inner {
  width: min(calc(100% - var(--gutter) * 2), var(--container));
  margin-inline: auto;
}
.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: max(700px, 100svh);
  background: #574052;
  color: #fff8ed;
}
.home-hero-copy {
  position: relative;
  z-index: 2;
  width: min(calc(100% - var(--gutter) * 2), 1200px);
  margin-inline: auto;
  padding-top: clamp(136px, 17svh, 200px);
  padding-bottom: 250px;
  text-align: center;
  transform: translate3d(0, var(--copy-shift, 0px), 0);
}
.home-hero h1 { font-size: clamp(64px, 6.65vw, 108px); font-weight: 400; letter-spacing: -0.055em; line-height: 1.02; text-shadow: 0 2px 30px #30202e18; }
.home-hero h1 em { display: block; margin-top: 4px; color: inherit; font-size: 1.12em; letter-spacing: -0.065em; }
.home-hero-lede { max-width: 58ch; margin: 30px auto 0; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.55; text-wrap: balance; }
.home-hero-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 16px 32px; margin-top: 30px; }
.home-primary-cta { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; }
.home-button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 54px; font-size: 15px; }
.home-button-primary { padding: 0 26px; border-radius: 99px; background: #fff1dc; color: var(--text); transition: background 180ms ease, transform 180ms ease; }
.home-button-primary:hover { background: #fffaf3; transform: translateY(-2px); }
.android-beta-link { color: currentColor; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.beta-note { color: currentColor; font-size: 12px; line-height: 1.3; opacity: .78; }
.home-hero a:focus-visible { outline-color: #fff8ed; }
.home-hero-visual { position: absolute; inset: 0; z-index: -2; transform: translate3d(0, var(--image-shift, 0px), 0); }
.home-hero-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center 70%; }
.hero-video-stack { background: #574052 url('/assets/generated/duolock-general-hero-wide.webp') center 70% / cover no-repeat; }
.home-hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; opacity: 0; transition: opacity 900ms ease; }
.home-hero-video.is-visible { opacity: 1; }
.home-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, #281828ad 0%, #30203999 58%, #39243c00 80%, #251c326b 100%); }
.home-scroll-cue { position: absolute; right: var(--gutter); bottom: 32px; display: grid; place-items: center; width: 48px; height: 56px; transition: transform 180ms ease; }
.home-scroll-cue svg { width: 36px; height: 36px; }
.home-scroll-cue:hover { transform: translateY(5px); }

.home-intro {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  column-gap: clamp(48px, 8vw, 128px);
  align-items: end;
  padding-block: clamp(96px, 10vw, 160px);
  border-block: 1px solid var(--line);
}
.home-section-label { color: var(--accent); font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: 0.16em; text-transform: uppercase; }
.home-intro .home-section-label { grid-column: 1 / -1; margin-bottom: 28px; }
.home-intro h2 { font-size: clamp(36px, 4.4vw, 64px); line-height: 1.1; letter-spacing: -0.045em; }
.home-intro > p:last-child { max-width: 37ch; padding-bottom: 4px; color: var(--muted); font-size: 19px; line-height: 1.65; }
.home-areas { padding-block: clamp(80px, 8vw, 128px); }
.home-section-heading { margin-bottom: 48px; }
.home-section-heading h2 { margin-top: 20px; font-size: clamp(34px, 3.7vw, 54px); line-height: 1.12; letter-spacing: -0.04em; }
.home-area-friends { margin-top: 56px; }
.home-area-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.home-area-card { display: block; min-width: 0; border-radius: 12px 12px 0 0; }
.home-area-image { overflow: hidden; aspect-ratio: 1.15; border-radius: 12px; background: #f2dfdb; }
.home-area-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.home-area-friends .home-area-image { background: #e8ede2; }
.home-area-family .home-area-image { background: #e9e2ef; }
.home-area-card:hover .home-area-image img { transform: scale(1.035); }
.home-area-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.home-area-label { font-size: 28px; line-height: 1.2; letter-spacing: -0.8px; }
.home-area-title svg { color: var(--accent); }
.home-area-card:hover .home-area-title svg { transform: translate(2px, -2px); }
.home-area-card > p { max-width: 38ch; margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.6; }

@font-face {
  font-family: "Caveat";
  src: url("/assets/fonts/caveat-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

.home-footer {
  position: relative;
  isolation: isolate;
  min-height: max(680px, 56vw);
  padding-block: 56px 0;
  /* Sky behind the illustration; meadow at the last edge so grass meets the canvas. */
  background:
    linear-gradient(var(--footer-sky), var(--footer-sky)) top / 100% calc(100% - 32px) no-repeat,
    var(--footer-meadow);
  color: #243f4a;
}
/* Fade only the sky edge; keep the meadow and mascots at full color. */
.home-footer::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("/assets/generated/footer-meadow.webp") center bottom / max(100%, 1020px) auto no-repeat;
  mask-image: linear-gradient(to bottom, transparent, #000 80px);
  pointer-events: none;
}
.home-footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 48px; }
.home-footer .brand { display: none; }
.home-footer .brand img { width: 36px; height: 36px; border-radius: 10px; }
.home-footer p {
  position: absolute;
  top: 180px;
  left: 50%;
  width: max-content;
  max-width: 80%;
  margin: 0;
  transform: translateX(-50%) rotate(-6deg);
  text-align: center;
  font-family: "Caveat", cursive;
  font-weight: 500;
  font-size: clamp(44px, 4.6vw, 66px);
  line-height: .95;
  letter-spacing: -1.5px;
  color: #243f4a;
}
.home-footer p::after { content: "♡"; display: block; margin-top: 12px; font-size: 36px; }
.footer-links { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0 20px; font-size: 14px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 5px; }
.footer-links .footer-language { display: flex; align-items: center; gap: 2px; margin: 0; }
.footer-links .footer-language { position: relative; padding-left: 20px; }
.footer-links .footer-language::before { content: ""; display: block; position: absolute; left: 0; height: 24px; border-left: 1px solid currentColor; opacity: .5; }
.footer-links .footer-language a { min-width: auto; }
.footer-links .footer-social { justify-content: center; flex-shrink: 0; }
.footer-links .footer-social[aria-label="Instagram"] { position: relative; padding-left: 20px; }
.footer-links .footer-social[aria-label="Instagram"]::before { content: ""; position: absolute; left: 0; height: 24px; border-left: 1px solid currentColor; opacity: .5; }
.footer-social svg { display: block; }
.home-footer a:focus-visible { outline-color: #243f4a; }
.home-footer .footer-links a:hover { color: #243f4a; text-decoration: underline; }

@media (max-width: 1100px) {
  .home-header { gap: 18px; }
  .site-nav { gap: 18px; }
  .home-language { margin-left: auto; }
  .nav-cta { display: none; }
  .home-area-grid { gap: 24px; }
  .home-footer-inner { align-items: start; }
}
@media (max-width: 760px) {
  :root { --gutter: 24px; --header-height: 76px; --home-hero-edge: #654250; }
  /* Match the composited video edge while the homepage hero is in view.
     After the header turns solid, html/body use meadow so bottom overscroll
     continues the grass instead of sky or plum. */
  html:has(.duolock-home-page .home-header:not(.is-solid)),
  .duolock-home-page:has(.home-header:not(.is-solid)) { background: var(--home-hero-edge); }
  .duolock-home-page .home-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 64px;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(var(--home-hero-edge), transparent);
  }
  /* A header flush with the top edge makes Safari 26 keep an opaque status bar.
     Give it the same top clearance before and after it becomes a floating pill. */
  .home-header {
    top: calc(var(--safe-top) + 12px);
    gap: 20px;
    padding-block: 14px;
    /* Fade new border sides in from transparent, not the white currentColor. */
    border-top-color: transparent;
    border-inline-color: transparent;
  }
  .brand { gap: 9px; font-size: 21px; }
  .brand img { width: 36px; height: 36px; border-radius: 10px; }
  .site-nav { display: none; }
  .mobile-nav { display: block; order: 3; margin-left: auto; }
  .home-language { font-size: 12px; }
  .home-language a { min-width: 26px; }
  .home-header.is-moving {
    top: calc(var(--safe-top) + 12px);
    left: var(--gutter);
    width: calc(100% - var(--gutter) * 2);
    min-height: 64px;
    padding: 8px 14px;
    border: 1px solid #fff8ed38;
    border-radius: 24px;
    background: #30202edb;
    box-shadow: 0 12px 30px #30202e26;
  }
  .home-header.is-moving.is-solid {
    border-color: var(--line);
    background: #faf8f5f2;
    box-shadow: 0 12px 30px #302a2e18;
  }
  .home-header.is-moving .mobile-nav nav { top: calc(100% + 12px); }
  /* Use the full viewport, including the space behind retractable browser UI. */
  .home-hero { min-height: max(800px, 100vh); min-height: max(800px, 100lvh); }
  .home-hero-copy { padding-top: calc(128px + var(--safe-top)); padding-bottom: 240px; }
  .home-hero-copy, .home-hero-visual { transform: none; }
  .home-hero h1 { max-width: 11ch; margin-inline: auto; font-size: clamp(48px, 10.5vw, 76px); line-height: 1.02; }
  .home-hero h1 em { margin-top: 8px; font-size: 1.08em; }
  .home-hero-lede { max-width: 28ch; margin-top: 26px; font-size: 17px; }
  .home-hero-actions { flex-direction: column; margin-top: 24px; gap: 12px; }
  .home-primary-cta { width: min(100%, 320px); }
  .home-primary-cta .home-button-primary { width: 100%; }
  .home-hero-visual img, .home-hero-video { object-position: 51% center; }
  .home-scroll-cue { bottom: calc(20px + var(--safe-bottom)); right: 16px; }
  .home-intro { grid-template-columns: 1fr; gap: 24px; padding-block: 72px; }
  .home-intro .home-section-label { margin-bottom: 0; }
  .home-intro h2 { max-width: 17ch; font-size: clamp(36px, 6.6vw, 48px); }
  .home-intro > p:last-child { font-size: 17px; }
  .home-areas { padding-block: 72px; }
  .home-section-heading { margin-bottom: 36px; }
  .home-section-heading h2 { max-width: 20ch; font-size: 36px; }
  .home-area-grid { grid-template-columns: 1fr; gap: 40px; }
  .home-area-friends { margin-top: 0; }
  .home-area-image { aspect-ratio: 1.5; }
  .home-area-title { margin-top: 20px; }
  .home-area-card > p { max-width: 42ch; }
  .home-footer {
    min-height: calc(800px + var(--safe-bottom));
    padding-block: 40px 0;
  }
  .home-footer::before {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    height: 520px;
    background-size: cover;
    background-position: center bottom;
  }
  .home-footer-inner { flex-direction: column; gap: 24px; }
  .home-footer p { top: 420px; font-size: 48px; }
  .footer-links { width: 100%; justify-content: flex-start; gap: 0 20px; }
  .footer-links a { min-height: 44px; }

}

@media (prefers-reduced-motion: reduce) {
  .home-hero-video { display: none; }
}
@media (max-width: 380px) {
  .home-header { gap: 12px; }
  .mobile-nav { margin-left: auto; }
  .home-hero h1 { font-size: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
