/* Dayward home page. Loaded after styles.css, which the policy pages share and which stays unchanged.
   Tokens follow the app's Material 3 theme (ui/theme/Theme.kt): paper, ink, indigo, coral. */
:root {
  color-scheme: light dark;
  --bg: #FFF8F2; --surface: #F7EEE8; --surface-2: #F1E7E1; --ink: #14142B; --muted: #4A4550;
  --link: #2B2D6B; --accent: #B83A2A; --on-accent: #FFFFFF; --line: #E4DAD2; --field: #FFFFFF;
  --field-line: #7B7580; --focus: #2B2D6B; --chip: #FFDAD3; --on-chip: #5A1409;
  --radius-s: 12px; --radius-m: 20px; --radius-l: 28px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14142B; --surface: #1E1D34; --surface-2: #26253F; --ink: #EDE8F2; --muted: #CDC5D6;
    --link: #C3C1FF; --accent: #FFB4A8; --on-accent: #5A1409; --line: #3A3852; --field: #1E1D34;
    --field-line: #9A93A6; --focus: #C3C1FF; --chip: #8C2B1E; --on-chip: #FFDAD3;
  }
}

.home [hidden] { display: none !important; }
body.home { background: var(--bg); color: var(--ink); }
.home .shell { width: min(72rem, calc(100% - 2rem)); }
.home a { color: var(--link); }
.home header { border-bottom-color: var(--line); }
.home .brand { color: var(--link); }
.home nav a { color: var(--muted); }
.home p, .home li, .home dd { color: var(--muted); }
.home main { padding: 0 0 4rem; }
.home footer { border-top-color: var(--line); color: var(--muted); }
.home h2 { font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.2; margin: 0 0 1.2rem; color: var(--ink); }
.home section { padding: 3.5rem 0 0; }

.skip { position: absolute; left: 1rem; top: -4rem; padding: .6rem 1rem; border-radius: var(--radius-s); background: var(--ink); color: var(--bg); z-index: 10; }
.skip:focus { top: 1rem; }
.home :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.home .button, .home .button-quiet {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin: 0;
  padding: .75rem 1.3rem; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.home .button { background: var(--accent); color: var(--on-accent); border: 0; }
.home .button-quiet { background: transparent; color: var(--link); border: 2px solid var(--line); }
.home .button:hover { filter: brightness(1.08); } .home .button-quiet:hover { border-color: var(--link); }
.home .fine { font-size: .92rem; }

/* Hero */
.home .hero { display: grid; gap: 2.5rem; align-items: center; padding: 3rem 0 0; }
.home .hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.05; margin: 0 0 1rem; color: var(--ink); letter-spacing: -.01em; max-width: 17ch; }
.home .lede { font-size: 1.2rem; max-width: 34rem; margin: 0 0 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0 0 1rem; }
@media (min-width: 880px) { .home .hero { grid-template-columns: 1fr 1.05fr; padding-top: 4rem; } }

/* Home-screen stage with live widgets */
.stage { margin: 0; }
.wallpaper {
  display: grid; grid-template-columns: 1fr; gap: 14px; padding: clamp(14px, 3vw, 22px); border-radius: var(--radius-l);
  background: linear-gradient(160deg, #3F3C8E 0%, #1C1B4B 55%, #14142B 100%);
}
.wallpaper .widget-small { width: min(62%, 220px); justify-self: center; }
@media (min-width: 560px) {
  .wallpaper { grid-template-columns: 1fr 2fr; align-items: stretch; }
  .wallpaper .widget-small { width: auto; }
  .wallpaper .widget-wide { grid-column: auto; }
}
.stage figcaption { margin-top: .6rem; font-size: .9rem; color: var(--muted); text-align: center; }
.widget {
  position: relative; overflow: hidden; border-radius: var(--radius-m); color: #fff;
  background: #2F3A4B center / cover no-repeat; isolation: isolate;
}
.widget p, .widget dd, .widget dt { color: #fff; margin: 0; }
.widget-small, .ww-cover { aspect-ratio: 1 / 1; display: flex; flex-direction: column; padding: 14px 16px; }
.widget-small::before, .ww-cover::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10,10,30,.62) 0%, rgba(10,10,30,.38) 45%, rgba(10,10,30,.72) 100%);
}
.widget-wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; background: #2F3A4B; }
.ww-cover { position: relative; isolation: isolate; background: center / cover no-repeat; aspect-ratio: auto; min-height: 100%; }
.widget .w-title { font-weight: 700; font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
.widget .w-number { font-weight: 800; font-size: clamp(2.6rem, 9vw, 3.6rem); line-height: 1; margin-top: auto !important; font-variant-numeric: tabular-nums; }
.widget .w-number.is-text { font-size: clamp(1.8rem, 6vw, 2.4rem); }
.widget .w-unit { font-size: .95rem; margin-top: .15rem !important; }
.widget .w-date { font-size: .85rem; opacity: .9; margin-top: .4rem !important; }
.ww-facts { margin: 0; padding: 16px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.widget .ww-facts dt { font-size: .82rem; opacity: .85; }
.widget .ww-facts dd { margin: 0; font-weight: 700; font-size: 1rem; }

/* Maker */
.maker form { background: var(--surface); border-radius: var(--radius-l); padding: clamp(1.1rem, 3vw, 2rem); }
.ideas { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.4rem; }
.ideas-label { color: var(--muted); margin-right: .25rem; }
.ideas button {
  min-height: 44px; padding: .45rem 1rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--chip); color: var(--on-chip); font: inherit; font-weight: 600;
}
.fields { display: grid; gap: 1rem 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .fields { grid-template-columns: 1fr 1fr; } .field-name { grid-column: 1 / -1; } }
@media (min-width: 960px) { .fields { grid-template-columns: 2fr 1fr 1fr; } .field-name { grid-column: auto; } }
.field { margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.field label { font-weight: 600; color: var(--ink); }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field select {
  min-height: 48px; padding: .6rem .8rem; border-radius: var(--radius-s); border: 1px solid var(--field-line);
  background: var(--field); color: var(--ink); font: inherit; width: 100%;
}
.field-check { flex-direction: row; align-items: center; gap: .6rem; min-height: 48px; align-self: end; }
.field-check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
.field-error { color: #B3261E; font-weight: 600; margin: .6rem 0 0; }
@media (prefers-color-scheme: dark) { .field-error { color: #F2B8B5; } }

.looks { border: 0; padding: 0; margin: 1.6rem 0 0; min-width: 0; }
.looks legend { font-weight: 600; color: var(--ink); padding: 0; margin-bottom: .6rem; }
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: .55rem; }
.look { position: relative; }
.look input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.look label {
  display: block; aspect-ratio: 4 / 3; border-radius: var(--radius-s); cursor: pointer;
  background: center / cover no-repeat; border: 3px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.look input:checked + label { border-color: var(--accent); }
.look input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

.result { margin: 1.6rem 0 1rem; padding: 1rem 1.2rem; border-radius: var(--radius-m); background: var(--surface-2); color: var(--ink); font-size: 1.1rem; }
.result strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.share-status { color: var(--ink); font-weight: 600; }

/* Shared countdown */
.shared { padding-top: 2.5rem !important; }
.shared-card {
  position: relative; isolation: isolate; overflow: hidden; border-radius: var(--radius-l); color: #fff;
  padding: clamp(1.5rem, 5vw, 3rem); min-height: min(70vh, 520px); display: flex; flex-direction: column;
  background: #2F3A4B center / cover no-repeat;
}
.shared-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10,10,30,.66) 0%, rgba(10,10,30,.38) 45%, rgba(10,10,30,.78) 100%);
}
.shared-card p, .shared-card h2 { color: #fff; margin: 0; }
.shared-from { font-size: 1rem; opacity: .95; }
.shared-card .shared-title { color: #fff; font-size: clamp(2rem, 7vw, 3.6rem); line-height: 1.05; margin-top: .4rem !important; overflow-wrap: anywhere; }
.shared-count { margin-top: auto !important; display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .8rem; }
.shared-number { font-size: clamp(5rem, 22vw, 10rem); font-weight: 800; line-height: .9; font-variant-numeric: tabular-nums; }
.shared-number.is-text { font-size: clamp(3rem, 12vw, 6rem); }
.shared-unit { font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 700; }
.shared-clock { font-size: clamp(1.2rem, 4vw, 1.8rem); font-variant-numeric: tabular-nums; margin-top: .6rem !important; }
.shared-date { font-size: 1.05rem; margin-top: .6rem !important; }
.shared-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }

/* Inside the app */
.shots { list-style: none; padding: 0; margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr);
  gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
.shots li { scroll-snap-align: start; display: flex; flex-direction: column; gap: .6rem; }
.shots img { width: 100%; height: auto; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--surface); }
.shots span { color: var(--ink); font-weight: 600; }

/* Trust facts */
.trust dl { margin: 0; display: grid; gap: 1.2rem 2rem; }
@media (min-width: 720px) { .trust dl { grid-template-columns: 1fr 1fr; } }
.trust dt { font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.trust dd { margin: .25rem 0 0; }
.trust .hero-actions { margin-top: 1.8rem; }

.legal ul { padding-left: 1.2rem; }

@media (prefers-reduced-motion: no-preference) {
  .home .button, .home .button-quiet, .look label { transition: filter .15s, border-color .15s; }
}
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
