/* umbral — black and white, like the night sky. */

:root {
  --space: #000000;
  --star: #ffffff;
  --nebula: #9a9a9a;
  --dust: #262626;
  --pad: clamp(20px, 3vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

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

html { background: var(--space); scroll-behavior: smooth; }

/* One screen, no page scroll: the products come to the front and the arrow brings the sky back. */
html.js { overflow: hidden; }

body {
  margin: 0;
  background: transparent;
  color: var(--star);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--star); outline-offset: 4px; border-radius: 4px; }

/* Background stars that stretch with scroll speed (js/warp.js). */
/* As tall as the screen gets, so it doesn't stretch when a phone's browser bars hide. */
.warp { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; display: block; z-index: 0; pointer-events: none; }
main { position: relative; z-index: 1; }

/* Header */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(14px, 2vw, 26px) var(--pad);
  mix-blend-mode: difference; color: #fff;
  animation: up 1s 1.6s var(--ease) both;
}
.top::before {
  content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: linear-gradient(180deg, #000 0%, rgba(0,0,0,.86) 58%, rgba(0,0,0,0) 100%);
}
.top.solid { mix-blend-mode: normal; }
.top.solid::before { opacity: 1; }
.top-brand { font-weight: 700; font-size: 24px; letter-spacing: -0.05em; text-decoration: none; padding: 8px 0; }
/* With the products in front, the brand steps aside and the back arrow takes its place. */
.top-back {
  display: none; align-items: center; gap: 10px; border: 0; background: none; padding: 8px 0; cursor: pointer;
  color: #fff; font-family: inherit; font-weight: 700; font-size: 22px; letter-spacing: -0.05em;
}
.top-back span { display: inline-block; transition: transform .25s var(--ease); }
body.apps-open .top-back { display: inline-flex; animation: up .6s var(--ease) .15s both; }
body.apps-open .top-brand { display: none; }

/* Hero */
.hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: var(--space); }
/* The sky gives way to the products; it comes back the same way when the arrow closes them. */
.js .hero { transition: opacity .5s ease; }
body.apps-open .hero { opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s linear .5s; }
.hero-still, .hero-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-still { object-fit: cover; transition: opacity .6s; }
.gl-on .hero-still { opacity: 0; transition-delay: .7s; }
/* The 3D sky fades in over the photo once its first frame is drawn (no black flash). */
.hero-gl { opacity: 0; transition: opacity .6s; }
.gl-on .hero-gl { opacity: 1; }
.hero-copy {
  position: absolute; z-index: 2;
  left: clamp(16px, 2.4vw, 34px); right: clamp(20px, 3vw, 44px); bottom: clamp(96px, 11vh, 122px);
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 40px;
  pointer-events: none;
}
.wordmark { margin: 0; font-weight: 700; font-size: clamp(96px, 16vw, 236px); line-height: .82; letter-spacing: -0.06em; }
.wordmark-text { display: inline-block; }
.gl-on .wordmark-text { color: transparent; }
/* The word waits for its stars; if the 3D sky is slow or fails (.gl-off), the plain word fades in. */
.js .wordmark-text { opacity: 0; transition: opacity .8s ease; }
.js .gl-off .wordmark-text { opacity: 1; }
.hero-side { width: min(100%, 420px); display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-bottom: 6px; pointer-events: auto; }
.hero-side > * { animation: up 1s var(--ease) both; }
.hero-line { margin: 0; font-size: clamp(30px, 2.8vw, 42px); font-weight: 700; line-height: 1; letter-spacing: -0.04em; animation-delay: 1.2s !important; }
.hero-sub { margin: 0; color: rgba(255,255,255,.78); font-size: 17px; font-weight: 500; line-height: 1.4; animation-delay: 1.35s !important; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-top: 4px; animation-delay: 1.5s !important; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px;
  border: 1px solid rgba(255,255,255,.6); border-radius: 999px; text-decoration: none; font-size: 15px; font-weight: 600;
  transition: background-color .2s, color .2s;
}
.btn-arrow { display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.hint { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.55); font-size: 13px; font-weight: 500; }
.hint svg { width: 12px; height: 12px; fill: rgba(255,255,255,.75); }

/* Apps. They arrive over the sky, filling the same one screen; a scroll of their own only
   shows up where the cards don't fit (a phone). Without the script, the page simply scrolls. */
.apps { scroll-margin-top: 40px; }
.apps-inner { max-width: 1280px; margin: 0 auto; padding: clamp(72px, 9vw, 140px) clamp(16px, 4vw, 48px) clamp(96px, 10vw, 140px); }
.js .apps {
  position: fixed; inset: 0; z-index: 5;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2e2e2e transparent;
  visibility: hidden; opacity: 0; transition: opacity .5s ease, visibility 0s linear .5s;
}
.js body.apps-open .apps { visibility: visible; opacity: 1; transition: opacity .5s ease; }
.js .apps::-webkit-scrollbar { width: 8px; }
.js .apps::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 4px; }
/* min-height keeps the head and cards in the middle of the screen; whatever doesn't fit
   shrinks a little instead of scrolling (js/main.js). Old browsers without zoom still scroll
   inside this view, never the page under it. */
.js .apps-inner { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding-top: clamp(72px, 11vh, 130px); padding-bottom: clamp(96px, 12vh, 150px); }
@media (max-height: 800px) {
  .apps-head h2 { font-size: clamp(36px, 4.6vw, 56px); }
  .apps-head p { font-size: 15px; }
  .js .apps-inner { padding-top: 56px; padding-bottom: 84px; }
  .cards { margin-top: clamp(18px, 2.6vh, 32px); gap: 18px; }
  .card-body { padding: 16px 20px 18px; gap: 8px; }
  .card-text { font-size: 14.5px; }
  .card-btn { height: 38px; font-size: 14px; }
}
.apps-head h2 { margin: 0 0 14px; font-size: clamp(44px, 6vw, 88px); font-weight: 700; line-height: .92; letter-spacing: -0.055em; }
.apps-head p { margin: 0; max-width: 660px; text-wrap: pretty; color: rgba(255,255,255,.7); font-size: clamp(17px, 1.4vw, 20px); font-weight: 500; line-height: 1.45; }
.cards { margin-top: clamp(28px, 3.4vw, 48px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 24px; }

.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; text-decoration: none;
  border: 1px solid rgba(255,255,255,.14); border-radius: 22px; background: rgba(14,14,18,.82);
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
  transition: transform .35s var(--ease), box-shadow .35s ease, border-color .35s ease;
  backdrop-filter: blur(6px);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 4; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.13), rgba(255,255,255,0) 60%);
}
.card-art { position: relative; aspect-ratio: 600 / 340; min-height: 260px; overflow: hidden; transition: transform .6s ease; }
.card-body { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px 24px 26px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 22px; letter-spacing: -0.02em; }
.card-text { color: rgba(255,255,255,.68); font-size: 16px; line-height: 1.45; }
.card-btn { margin-top: 6px; display: inline-flex; align-items: center; height: 42px; padding: 0 18px; font-size: 15px; }

/* Loro, in Loro's own style */
.loro-art, .loro-body { font-family: "Geist", system-ui, sans-serif; }
.loro-art { background: #F6F8FA; }
.loro-body .card-title { font-weight: 600; }
.loro-btn { border-radius: 10px; background: #7CC4F4; color: #0F1B2D; font-weight: 600; }
.loro-icon { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: #0F1B2D; box-shadow: inset 0 0 0 1px #2A3B52; }
.loro-icon svg { width: 17px; height: 18px; shape-rendering: crispEdges; }
.px-body { fill: #7CC4F4; } .px-deep { fill: #4E7DA0; } .px-ink { fill: #0F1B2D; }
.lo-big { position: absolute; right: 26px; top: 30px; width: clamp(104px, 11vw, 156px); height: auto; shape-rendering: crispEdges; animation: lo-bob 3.2s ease-in-out infinite; }
.lo-said { position: absolute; left: 24px; top: 22px; width: min(54%, 330px); display: flex; flex-direction: column; gap: 6px; color: #4A5B70; font-family: "Geist Mono", ui-monospace, monospace; font-size: 13px; line-height: 1.5; }
.lo-said s { color: #9AA9B9; }
.lo-label { color: #5F6F83; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.lo-chat { position: absolute; left: 24px; top: 100px; width: min(54%, 330px); display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.35; }
.bubble { padding: 9px 12px; color: #0F1B2D; }
.bubble.in { align-self: flex-start; border: 1px solid #DCE3EA; border-radius: 14px 14px 14px 4px; background: #fff; }
.bubble.out { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: #E4F3FD; }
.lo-pill {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 12px;
  border: 1px solid #2A3B52; border-radius: 999px; background: #0F1B2D; color: #EAF3FB; white-space: nowrap;
  box-shadow: 0 10px 28px rgba(15,27,45,.28); font-size: 14px; font-weight: 600;
}
.lo-faces { display: grid; width: 22px; height: 24px; }
.lo-faces svg { grid-area: 1 / 1; width: 22px; height: 24px; shape-rendering: crispEdges; }
.lo-states { display: grid; align-items: center; }
.lo-states > span { grid-area: 1 / 1; display: flex; align-items: center; gap: 10px; }
.lo-bars { display: flex; align-items: center; gap: 3px; height: 18px; }
.lo-bars i { width: 3px; height: 18px; border-radius: 2px; background: #7CC4F4; animation: lo-bar .9s ease-in-out infinite; }
.lo-bars i:nth-child(1) { animation-delay: -.1s; } .lo-bars i:nth-child(2) { animation-delay: -.5s; } .lo-bars i:nth-child(3) { animation-delay: -.3s; } .lo-bars i:nth-child(4) { animation-delay: -.7s; } .lo-bars i:nth-child(5) { animation-delay: -.2s; }
.lo-done svg { width: 16px; height: 16px; fill: none; stroke: #6BD9A0; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lo-meta { color: #9FB3C8; font-family: "Geist Mono", ui-monospace, monospace; font-size: 12px; font-weight: 400; }
.lo-a { animation: lo-a 7s infinite; } .lo-b { animation: lo-b 7s infinite; } .lo-c { animation: lo-c 7s infinite; } .lo-pop { animation: lo-pop 7s infinite; }

/* Superpills, in Superpills' own style */
.sp-art { background: #F3F3F3; }
.sp-art > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sp-body { font-family: "Archivo", system-ui, sans-serif; }
.sp-body .card-title { font-weight: 800; }
.sp-icon { width: 30px; height: 30px; }
.sp-btn { border-radius: 999px; background: #A0CD34; color: #000; font-weight: 700; }
.sp-label { font: 600 13px "Archivo", system-ui, sans-serif; fill: #5C5C5C; }
.sp-number { font: 800 34px "Archivo", system-ui, sans-serif; fill: #000; }
.sp-chip { font: 700 12px "Archivo", system-ui, sans-serif; fill: #000; text-anchor: middle; }
.sp-line { fill: none; stroke: #000; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 420; animation: sp-draw 4s ease-out infinite; }
.sp-dot { fill: #A0CD34; stroke: #000; stroke-width: 2; animation: sp-dot 4s ease-out infinite; }
.sp-bob { transform-box: fill-box; transform-origin: center; animation: sp-bob 3s ease-in-out infinite; }
.sp-eye { transform-box: fill-box; transform-origin: center; animation: sp-blink 4.5s infinite; }
.sp-happy { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; opacity: 0; }

/* Footer. One slim line, always at the bottom of the screen, in the sky and in the products. */
.foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px;
  padding: 14px var(--pad) calc(16px + env(safe-area-inset-bottom, 0px));
  color: rgba(255,255,255,.6); font-size: 14px; font-weight: 500;
}
.foot::before {
  content: ""; position: absolute; inset: -16px 0 -40px; z-index: -1; pointer-events: none;
  background: linear-gradient(0deg, #000 34%, rgba(0,0,0,.62) 72%, rgba(0,0,0,0) 100%);
}
.foot nav, .foot-links { display: flex; align-items: baseline; gap: 24px; }
.foot .foot-lang { color: rgba(255,255,255,.6); }
.foot a { color: #fff; text-decoration: none; padding: 10px 0; }

/* Entrances on scroll (js/main.js adds .in). Without the script, everything simply shows. */
.js .reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s ease, transform 1.2s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* Only where there is a mouse: on a phone a finger would leave these stuck after a tap. */
@media (hover: hover) and (pointer: fine) {
  .hero { cursor: crosshair; }
  .btn:hover { background: #fff; color: #000; }
  .top-back:hover span { transform: translateX(-5px); }
  .card:hover::before { opacity: 1; }
  .card-loro:hover { border-color: rgba(124,196,244,.6); box-shadow: 0 30px 90px -30px rgba(124,196,244,.6); }
  .card-sp:hover { border-color: rgba(160,205,52,.6); box-shadow: 0 30px 90px -30px rgba(160,205,52,.55); }
  .card:hover .card-art { transform: scale(1.03); }
  .card:hover .lo-big { animation-duration: 1.1s; }
  .card:hover .sp-eye { opacity: 0; }
  .card:hover .sp-happy { opacity: 1; }
  .card:hover .sp-bob { animation-duration: .8s; }
  .foot a:hover { text-decoration: underline; text-underline-offset: 4px; }
}

/* A finger gets a small press instead. */
@media (hover: none) {
  .card:active { transform: scale(.985); }
  .btn:active { background: rgba(255,255,255,.14); }
}

@media (max-width: 560px) {
  /* The sky fits the phone's screen, so the button and the hint are never cut off. */
  .hero-copy { bottom: clamp(116px, 14vh, 140px); }
  /* Both products fit one phone screen, so each card is shorter. Loro's demo keeps what you
     said and the pill that writes it; the chat bubbles need room a phone doesn't have. */
  .js .apps-inner { padding-top: 72px; }
  .apps-head h2 { margin-bottom: 8px; font-size: clamp(32px, 9.5vw, 40px); }
  .apps-head p { font-size: 13.5px; line-height: 1.4; }
  .cards { margin-top: 16px; gap: 12px; }
  .card { border-radius: 18px; }
  .card-art { aspect-ratio: auto; min-height: 0; height: 132px; }
  .card-body { padding: 12px 16px 14px; gap: 6px; }
  .card-title { gap: 8px; font-size: 18px; }
  .loro-icon, .sp-icon { width: 24px; height: 24px; }
  .loro-icon svg { width: 14px; height: 15px; }
  .card-text { font-size: 13.5px; line-height: 1.4; }
  .card-btn { margin-top: 2px; height: 34px; padding: 0 14px; font-size: 13.5px; }
  .lo-big { right: 16px; top: 14px; width: 54px; }
  .lo-said { left: 16px; top: 12px; width: calc(100% - 96px); gap: 4px; font-size: 12px; line-height: 1.45; }
  .lo-label { font-size: 10px; }
  .lo-chat { display: none; }
  .lo-pill { bottom: 12px; height: 36px; gap: 8px; padding: 0 12px 0 10px; font-size: 13px; }
  .lo-meta { font-size: 11px; }
}

@keyframes up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@keyframes lo-a { 0%, 44.9% { opacity: 1; } 45%, 100% { opacity: 0; } }
@keyframes lo-b { 0%, 44.9% { opacity: 0; } 45%, 59.9% { opacity: 1; } 60%, 100% { opacity: 0; } }
@keyframes lo-c { 0%, 59.9% { opacity: 0; } 60%, 100% { opacity: 1; } }
@keyframes lo-pop { 0%, 59.9% { opacity: 0; transform: translateY(8px) scale(.96); } 63%, 100% { opacity: 1; transform: none; } }
@keyframes lo-bar { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@keyframes lo-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes sp-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes sp-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes sp-draw { 0% { stroke-dashoffset: 420; } 60%, 100% { stroke-dashoffset: 0; } }
@keyframes sp-dot { 0%, 58% { opacity: 0; } 62%, 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .lo-a, .lo-b { opacity: 0; }
  .lo-c, .lo-pop { opacity: 1; }
  html { scroll-behavior: auto; }
}
