/* © 2026 Devello Inc. osmo.website: Remember, a film by osmo. The screen is the film's; words are written by hand in
 * Pacifico, as the Devello hero writes its name (Devello-Inc styles/globals.css, .devello-signature). */
:root {
  --ambient: #000;
  --ink: #f6efe8;
  --muted: rgba(243, 235, 227, 0.5);
  --serif: "Instrument Serif", "New York", Baskerville, Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: var(--ambient); color: var(--ink); font-family: var(--serif); transition: background-color .5s linear;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stage { position: fixed; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }

/* The film fills the screen as far as its shape allows, centred; its edges melt into the page, which takes the film's
 * edge colour. The frame is laid out by CSS alone, so an in-app browser that settles its viewport late still gets it
 * right; the egg, its glow and the end note sit on the frame in shares of it. */
.frame { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); container-type: inline-size;
  aspect-ratio: 16 / 9; width: min(100vw, 100vh * 16 / 9); }
.stage[data-shape="tall"] .frame { aspect-ratio: 4 / 5; width: min(100vw, 100vh * 4 / 5); }
@supports (height: 100dvh) {
  .frame { width: min(100vw, 100dvh * 16 / 9); }
  .stage[data-shape="tall"] .frame { width: min(100vw, 100dvh * 4 / 5); }
}
.film, .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block;
  background: transparent; pointer-events: none; opacity: 0; transition: opacity 1.8s ease;
  --feather: linear-gradient(to bottom, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: var(--feather); mask-image: var(--feather); }
@media (min-aspect-ratio: 16/9) { .stage[data-shape="wide"] :is(.film, .still) {
  --feather: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent); } }
@media (min-aspect-ratio: 4/5) { .stage[data-shape="tall"] :is(.film, .still) {
  --feather: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent); } }
.stage[data-scene="egg"] .film, .stage[data-scene="film"] .film { opacity: 1; }
.stage[data-scene="film"] .film { transition: none; }
/* The poster, held over the film from the egg until the film's first frame is drawn (no black blink on a phone). */
.stage[data-scene="egg"] .still { opacity: 1; }
.stage[data-scene="film"]:not([data-rolling]) .still { opacity: 1; transition: none; }
.stage[data-scene="film"][data-rolling] .still { opacity: 0; transition: opacity .2s linear; }
.stage[data-scene="end"] .film { opacity: 0; transition: opacity 2.5s ease; }

/* The end, under the stars: the first osmo.website's starfield, and osmo's ring among them (touch it). */
.stage { --ring: clamp(150px, 34vmin, 300px); }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; pointer-events: none;
  transition: opacity 3s ease; }
.stage[data-scene="end"] .stars { opacity: 1; }
.ring { position: absolute; left: 50%; top: 50%; width: calc(var(--ring) * 2); height: calc(var(--ring) * 2);
  transform: translate(-50%, -50%); opacity: 0; visibility: hidden; cursor: pointer; transition: opacity 2s ease 1.2s; }
.stage[data-scene="end"] .ring { opacity: 1; visibility: visible; }

/* The egg is the only thing that answers: a tap starts the film. Its light breathes while it waits. */
.egg, .glow { left: 37.5%; top: 22%; width: 25%; height: 60%; }
.stage[data-shape="tall"] :is(.egg, .glow) { left: 28%; top: 28%; width: 44%; height: 44%; }
.egg { position: absolute; border: 0; padding: 0; border-radius: 50%; background: transparent; cursor: pointer;
  visibility: hidden; }
.stage[data-scene="egg"] .egg { visibility: visible; }
.egg:disabled { cursor: default; }
.egg:focus-visible { outline: 1px solid rgba(255, 210, 166, 0.55); outline-offset: 6px; }
.glow { position: absolute; border-radius: 50%; pointer-events: none; opacity: 0; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 160, 80, 0.32), rgba(240, 122, 46, 0.12) 55%, transparent);
  transition: opacity 1.2s ease; }
.stage[data-scene="egg"] .glow { animation: breathe 4.6s ease-in-out 1.2s infinite; }
.stage[data-scene="egg"] .egg:hover ~ .glow, .stage[data-scene="egg"] .egg:focus-visible ~ .glow { opacity: .9; animation: none; }

/* Words, dead centre: Devello written by hand; the film's titles small and italic, as a film's are. */
.words { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; padding: 0 24px; }
.words > * { grid-area: 1 / 1; }
.words > svg { display: block; overflow: visible; color: var(--ink); font-size: clamp(40px, min(16vw, 13vh), 112px);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  transition: opacity .7s ease, filter .7s ease; }
.words > svg.leave { opacity: 0; filter: blur(6px) drop-shadow(0 0 10px rgba(255, 255, 255, 0)); }
.line { margin: 0; font-style: italic; font-size: clamp(16px, 1.45vw, 21px); letter-spacing: 0.035em; color: var(--ink);
  text-align: center; text-wrap: balance; opacity: 0; filter: blur(5px);
  transition: opacity 1.3s ease, filter 1.3s ease; }
.line.title { font-size: clamp(19px, 1.8vw, 26px); letter-spacing: 0.02em; }
.line.begin { letter-spacing: 0.06em; }
.line.howto { max-width: 30em; font-size: clamp(14px, 1.2vw, 18px); }
.line.howto.in { opacity: .7; }
.line.in { opacity: .92; filter: blur(0); }
.line.leave { opacity: 0; filter: blur(5px); transition-duration: 1.1s; }
.note { position: absolute; left: 0; right: 0; top: 71.5%; display: grid; justify-items: center; gap: .35em;
  padding: 0 24px; pointer-events: none; font-size: clamp(15px, 1.9vw, 26px); font-size: clamp(15px, 1.9cqw, 26px); }
.stage[data-shape="tall"] .note { top: 69%; font-size: clamp(15px, 4.6vw, 26px); font-size: clamp(15px, 4.6cqw, 26px); }
.stage[data-scene="end"] .note { top: calc(50% + var(--ring) * 0.56 + 12px); }
.note .line { font-size: inherit; letter-spacing: 0.03em; text-shadow: 0 1px 12px rgba(90, 25, 0, 0.45); }

.ink path {
  fill: currentColor; fill-opacity: 0; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 1; stroke-dashoffset: 1;
  animation:
    trace 1.15s cubic-bezier(0.65, 0, 0.35, 1) calc(var(--i) * var(--step) + 0.2s) forwards,
    ink 0.95s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i) * var(--step) + 0.95s) forwards;
}
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes ink { to { fill-opacity: 1; stroke-opacity: 0; } }
@keyframes breathe { 0%, 100% { opacity: .25; } 50% { opacity: .75; } }

footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center;
  align-items: baseline; gap: 4px 20px; padding: 10px 16px max(14px, env(safe-area-inset-bottom, 0px));
  font-size: 13px; letter-spacing: 0.04em; color: var(--muted);
  animation: arrive 1.4s ease .6s backwards; transition: transform 1.1s cubic-bezier(.6, 0, .2, 1), opacity 1.1s ease; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
footer a { color: var(--muted); text-decoration: none; transition: color .3s ease; }
footer a:hover, footer a:focus-visible { color: var(--ink); }
footer a:focus-visible { outline: 1px solid rgba(255, 210, 166, 0.55); outline-offset: 3px; border-radius: 3px; }
footer small { font-size: inherit; opacity: .75; }
/* The links step aside for the film and come back for the end. */
.stage[data-scene="film"] ~ footer { transform: translateY(110%); opacity: 0; pointer-events: none; visibility: hidden;
  transition: transform 1.1s cubic-bezier(.6, 0, .2, 1), opacity 1.1s ease, visibility 0s linear 1.1s; }
.stage[data-scene="end"] ~ footer { --muted: rgba(255, 240, 228, 0.78); transition-delay: 3.4s; }
@keyframes arrive { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ink path { animation: none; fill-opacity: 1; stroke-opacity: 0; stroke-dashoffset: 0; }
  .line, .line.leave { filter: none; }
  footer { transition: opacity .6s ease; }
  .stage[data-scene="film"] ~ footer { transform: none; }
  .stage[data-scene="egg"] .glow { animation: none; opacity: .4; }
  footer { animation: none; }
}
