/* bedtimelabs.com, the company page. The Dawn world, inherited from the Bedtime Labs board (WORLDS.md):
   a real morning sky with the moon still up, a white sheet rising over it, Host Grotesk, deep ink, one morning blue.
   Light by choice under any theme. Everything here is served from this domain. */

@font-face { font-family: "Host Grotesk"; src: url("/fonts/host-grotesk-300.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Host Grotesk"; src: url("/fonts/host-grotesk-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Host Grotesk"; src: url("/fonts/host-grotesk-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Host Grotesk"; src: url("/fonts/host-grotesk-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #FFFFFF;
  --sky: #5683AC;          /* the toned photograph's own blue, shown until it paints */
  --ink: #15161A;
  --ink-2: #4B5160;        /* 7.9:1 on paper */
  --ink-3: #535968;        /* 7.0:1 on paper */
  --line: #E4E8EE;
  --moon: #737884;         /* the mark's moon on paper: gray, the founder's call */
  --on-photo: #FFFFFF;
  --accent: #3A6CB0;       /* morning blue: the sky, deepened to carry type (5.3:1 on paper) */
  --font: "Host Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

html { background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow-x: clip; }
a { color: inherit; }
.wrap { max-width: 68rem; margin: 0 auto; padding-inline: 16px; box-sizing: border-box; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the mark: the house outlines, lowercase, the moon as the full stop. On the sky it reverses to white. */
.mark { display: block; height: auto; aspect-ratio: 6453.2 / 800; color: var(--on-photo); --moon-c: var(--on-photo); }
.mark .m { fill: var(--moon-c); }
.home { display: inline-block; border-radius: 4px; }
.home .mark { width: 10.5rem; }

/* the sky */
.sky { position: relative; isolation: isolate; overflow: hidden; background: var(--sky); color: var(--on-photo); height: clamp(22rem, 80svh, 46rem); }
.sky img.photo { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 66% 40%; display: block; }
/* a wash over the top of the sky only, so white type clears 3:1 against the brightest blue it sits on */
.sky::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(180deg, rgba(14, 34, 64, .2) 0%, rgba(14, 34, 64, .08) 45%, rgba(14, 34, 64, .06) 100%); pointer-events: none; }
/* fine grain over the sky only: it keeps a smoothed, deepened sky from reading as plastic, and dithers its gradient */
.sky::after { content: ""; position: absolute; z-index: 1; inset: 0; background: url("/img/grain.svg") repeat 0 0 / 240px 240px; mix-blend-mode: overlay; opacity: .16; pointer-events: none; }
.sky .wrap { position: relative; z-index: 2; padding-top: max(2.4rem, calc(env(safe-area-inset-top) + 1.6rem)); }
.line { margin: 2.4rem 0 0; font-weight: 300; font-size: clamp(2.6rem, min(12.4vw, 12svh), 4.4rem); line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; max-width: 11em; }

/* tonight's moon (moon.js; without script the photograph shows the moon as shot): the moon redrawn at tonight's phase
   from the photograph's own surface, over the sky's own blue around it (measured from img/sky-*.webp); then the note */
.sky .shade { position: absolute; z-index: 0; pointer-events: none; overflow: visible; }
/* tonight's moon, written beside the photographed one */
.tonight { position: absolute; z-index: 2; margin: 0; display: flex; align-items: center; gap: .7rem; color: var(--on-photo); pointer-events: none; opacity: 0; transition: opacity .25s ease-out; }
.tonight.on { opacity: 1; }
.tonight[hidden] { display: none; }
.tonight .lead { width: 2.4rem; height: 1px; background: rgba(255, 255, 255, .8); box-shadow: 0 0 6px rgba(10, 26, 52, .3); flex: none; }
.tonight .txt { display: grid; line-height: 1.15; white-space: nowrap; text-shadow: 0 0 1px rgba(10, 26, 52, .55), 0 1px 12px rgba(10, 26, 52, .5); }
.tonight .k { font-size: .9rem; font-weight: 500; }
.tonight .v { font-size: 1rem; font-weight: 600; margin-top: .15rem; }
.tonight.left { flex-direction: row-reverse; text-align: right; }

/* the sheet */
.sheet { position: relative; z-index: 2; margin-top: -2.4rem; background: var(--paper); border-radius: 28px 28px 0 0; padding-top: 2.4rem; }
.intro { margin: 0 0 2rem; font-weight: 500; font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.015em; }
.s-contact { margin-top: 1.6rem; }

/* the app itself: a real screen from a current build, standing on the footer's rule, cut where the sheet ends */
.s-screen { margin: 2.4rem 0 0; }
.screen { display: block; box-sizing: border-box; width: min(100%, 16rem); height: auto; border: .45rem solid var(--ink); border-radius: 2.4rem; background: var(--ink); box-shadow: 0 1px 2px rgba(21, 22, 26, .06), 0 24px 48px rgba(21, 22, 26, .12); }   /* a named exception (design tokens): the device keeps its own black rim */
footer.end.flush { margin-top: 3.4rem; }

/* the one product, presented rather than listed: its own mark, its name at size, one line, where to see it */
.product { display: block; text-decoration: none; color: var(--ink); border-radius: 15px; }
.product .icon { width: 4.5rem; height: 4.5rem; display: block; border-radius: 22.5%; box-shadow: 0 0 0 1px rgba(21, 22, 26, .06); }
.p-text { display: block; margin-top: 1.1rem; }
.p-name { display: block; font-weight: 500; font-size: 2.2rem; line-height: 1.05; letter-spacing: -0.025em; }
.p-line { display: block; margin-top: .6rem; font-size: 1.15rem; line-height: 1.4; color: var(--ink-2); }
.p-meta { display: block; margin-top: .2rem; font-size: .95rem; color: var(--ink-2); }
.p-go { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.1rem; min-height: 44px; padding: 0 1.1rem; border-radius: 12px; background: var(--accent); color: var(--on-photo); font-weight: 600; font-size: 1rem; }   /* the board's button: the one accent, at the one decision */
.p-go svg { width: .75rem; height: .75rem; transition: transform .2s ease-out; }
.product:active .p-go { transform: translateY(1px); }
.product:hover .p-go svg { transform: translate(2px, -2px); }
.product:hover .p-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em; }

.mail { margin: 0; font-size: 1.15rem; line-height: 1.4; color: var(--ink-2); }
.mail a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em; text-decoration-color: rgba(21, 22, 26, .35); padding-block: .6rem; }
.mail a:hover { text-decoration-color: currentColor; }

/* the end */
footer.end { margin-top: 4.5rem; border-top: 1px solid var(--line); padding-block: 1.6rem 2.4rem; padding-bottom: max(2.4rem, calc(env(safe-area-inset-bottom) + 1.6rem)); color: var(--ink-3); font-size: .78rem; line-height: 1.6; }
footer.end .mark { width: 7.5rem; color: var(--ink); --moon-c: var(--moon); margin-bottom: 1.1rem; }
footer.end p { margin: 0; max-width: 34rem; text-wrap: pretty; }
footer.end p + p { margin-top: .5rem; }
footer.end a { text-underline-offset: 2px; }
footer.end .legal a { display: inline-block; padding-block: .6rem; margin-block: -.6rem; }

a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.sky a:focus-visible { outline-color: var(--on-photo); }

/* plain pages (privacy, not found): a short band of the same sky, then the reading column, the footer kept at the foot */
body.plain { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
body.plain main { flex: 1 0 auto; }
.sky.short { height: clamp(11rem, 26svh, 15rem); }
.sky.short img.photo { object-position: 70% 30%; }
.doc { padding-top: 2.4rem; }
.doc h1 { margin: 0; font-weight: 300; font-size: clamp(2.6rem, 11vw, 3.8rem); line-height: 1.05; letter-spacing: -0.035em; }
.doc .body { max-width: 34rem; margin-top: 1.6rem; }
.doc .body p { margin: 0; font-size: 1.05rem; color: var(--ink-2); }
.doc .body p + p { margin-top: 1rem; }
.doc .body strong { color: var(--ink); font-weight: 600; }
.doc .body a { color: var(--ink); text-underline-offset: .2em; text-decoration-thickness: 1px; }
.doc .updated { margin-top: 1.6rem; font-size: .9rem; color: var(--ink-3); }

@media (min-width: 900px) {
  .wrap { padding-inline: 40px; }
  .home .mark { width: 12rem; }
  .sky { height: clamp(34rem, 70vh, 48rem); }
  .sky img.photo { object-position: 50% 0%; }
  .sky .wrap { padding-top: 3.4rem; }
  /* signature: breaks t-hero (4.4rem). The line is the whole hero, set the board's way: weight 300 at size */
  .line { margin-top: clamp(2.4rem, 5vh, 3.4rem); font-size: 5.2rem; }
  .tonight { gap: .9rem; }
  .tonight .lead { width: 3.4rem; }
  .tonight .k { font-size: 1rem; }
  .tonight .v { font-size: 1.2rem; }
  .sheet { margin-top: -4rem; border-radius: 32px 32px 0 0; padding-top: 3.4rem; }
  .sheet-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 3.4rem; align-items: start; }
  /* the words start level with the phone's screen, so the product and its button sit in the first screen */
  .sheet-grid { grid-template-rows: auto auto auto 1fr; }
  .intro { grid-column: 1 / span 7; grid-row: 1; font-size: 1.9rem; margin: 2.4rem 0 2.4rem; }
  .s-product { grid-column: 1 / span 7; grid-row: 2; }
  .s-contact { grid-column: 1 / span 7; grid-row: 3; margin-top: 2.4rem; padding-left: 9rem; }
  .s-screen { grid-column: 8 / span 5; grid-row: 1 / span 4; margin: 0; justify-self: end; }
  .screen { width: 17rem; border-width: .5rem; border-radius: 2.8rem; }
  .product { display: grid; grid-template-columns: 7rem minmax(0, 1fr); column-gap: 2rem; align-items: start; }
  .product .icon { width: 7rem; height: 7rem; }
  .p-text { margin-top: .2rem; }
  .p-name { font-size: 2.6rem; }
  .p-line { font-size: 1.25rem; margin-top: .7rem; }
  .p-meta { font-size: 1rem; }
  .p-go { font-size: 1.05rem; margin-top: 1.2rem; }
  .mail { font-size: 1.25rem; }
  footer.end { margin-top: 6rem; padding-block: 2rem 3.4rem; display: block; }
  footer.end p { max-width: 44rem; }
  .sky.short { height: 17rem; }
  .sky.short img.photo { object-position: 50% 43%; }
  .doc { padding-top: 3.4rem; }
}

/* a short laptop screen: lift the line clear of the pine */
@media (min-width: 900px) and (max-height: 860px) {
  .sky .wrap { padding-top: 2.4rem; }
  .line { margin-top: 2rem; font-size: clamp(4.4rem, 6vw, 5.2rem); }
}

@media (prefers-reduced-motion: reduce) {
  .tonight, .p-go svg { transition: none; }
}
