/* ==========================================================================
   LOOK: Horizon or Eclipse, chosen on the homepage. (The bar, the switch
   and the Dock footer for these pages live in chrome.css.)
   The chooser covers the homepage on a first visit (html.look-ask is set
   before first paint by the inline script in <head>). Afterwards the sun and
   moon in the bar change the choice. Product pages read the same key
   ("opti-design") and open in the design chosen here.
   ========================================================================== */
@font-face {
  font-family: "Funnel Display";
  src: url("../fonts/funnel-display-latin.woff2") format("woff2");
  font-weight: 300 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Funnel Sans";
  src: url("../fonts/funnel-sans-latin.woff2") format("woff2");
  font-weight: 300 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --look-ease: cubic-bezier(.16, 1, .3, 1);
  --look-ui: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ------------------------------------------------------------ the chooser */
.chooser { display: none; }
html.look-ask { overflow: hidden; }
html.look-ask .chooser {
  position: fixed; inset: 0; z-index: 400; display: block; background: #000; color: #f1f4f7;
  font-family: var(--look-ui); -webkit-font-smoothing: antialiased; outline: none;
}
.chooser.is-leaving { opacity: 0; transition: opacity .5s ease .55s; }
.chooser[data-chosen="later"].is-leaving { transition-delay: 0s; }

.chooser__head { position: absolute; z-index: 3; top: clamp(18px, 4.4vh, 44px); left: 0; right: 0; text-align: center; pointer-events: none; }
.chooser__brand { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; letter-spacing: -.005em; color: rgba(241, 244, 247, .78); }
.chooser__brand svg { width: 18px; height: 18px; }
.chooser__title { margin: 10px 0 0; font-size: clamp(22px, 2.2vw, 30px); font-weight: 600; font-stretch: 88%; letter-spacing: -.01em; line-height: 1.1; color: #fff; }

.chooser__halves { position: absolute; inset: 0; display: flex; }
.half {
  position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; display: block; color: inherit; text-decoration: none;
  transition: flex-grow .9s var(--look-ease); -webkit-tap-highlight-color: transparent; outline: none;
}
.half + .half { box-shadow: -1px 0 0 rgba(255, 255, 255, .07); }
.half::after { content: ""; position: absolute; inset: 10px; z-index: 4; border-radius: 22px; box-shadow: inset 0 0 0 2px #fff; opacity: 0; pointer-events: none; }
.half:focus-visible::after { opacity: .9; }
.half__art, .half__copy, .half__go { position: absolute; }
.half__art { inset: 0; }
.half__copy { left: 0; right: 0; top: 44%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; text-align: center; padding-inline: 24px; transition: transform .9s var(--look-ease), opacity .5s ease; }
.half__icon { width: 30px; height: 30px; margin-bottom: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.half__name { display: block; font-size: clamp(56px, 6.8vw, 108px); line-height: .95; font-weight: 600; }
.half__line { display: block; margin-top: 16px; font-size: clamp(16px, 1.35vw, 20px); line-height: 1.4; }
.half__go {
  left: 50%; bottom: 14%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 13px 22px; border-radius: 999px; font-size: 15px; font-weight: 600; letter-spacing: -.005em;
  transition: transform .5s var(--look-ease), box-shadow .3s ease;
}
.half__go svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .4s var(--look-ease); }

/* Horizon: night sky over a lit daylight horizon */
.half--horizon { background: linear-gradient(180deg, #04060d 0%, #0a1026 36%, #17224a 60%, #2c3c72 72%); }
.half--horizon .half__copy { font-family: "Funnel Sans", var(--look-ui); }
.half--horizon .half__name { font-family: "Funnel Display", var(--look-ui); letter-spacing: -.04em; }
.half--horizon .half__line { color: rgba(241, 244, 247, .74); }
.half__ground {
  position: absolute; left: 50%; top: 74%; width: max(260%, 1500px); aspect-ratio: 1; border-radius: 50%;
  transform: translateX(-50%); background: #f5f7f9;
  box-shadow: 0 -10px 36px -6px rgba(214, 226, 255, .8), 0 -50px 130px -24px rgba(150, 178, 255, .55);
  transition: transform 1.1s var(--look-ease);
}
.half__dawn { position: absolute; left: 50%; top: 74%; width: 96%; height: 26%; transform: translate(-50%, -62%); border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 236, 214, .62), rgba(214, 226, 255, .18) 55%, rgba(214, 226, 255, 0)); mix-blend-mode: screen; transition: opacity .8s ease, transform 1.1s var(--look-ease); }
.half--horizon .half__go { color: #fff; background: #12161e; box-shadow: 0 14px 30px -14px rgba(18, 22, 30, .6); font-family: "Funnel Sans", var(--look-ui); }

/* Eclipse: black, and a total eclipse with its diamond ring */
.half--eclipse { background: #000; }
.half--eclipse .half__name { font-stretch: 80%; letter-spacing: -.005em; }
.half--eclipse .half__line { color: #a6abb3; }
.half__disc {
  position: absolute; left: 50%; top: 44%; width: min(31vw, 50vh); aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .8), 0 0 14px 2px rgba(236, 241, 255, .55), 0 0 64px 14px rgba(150, 175, 255, .26), 0 0 190px 52px rgba(90, 115, 230, .13);
  transition: transform 1.1s var(--look-ease);
}
.half__disc::before { content: ""; position: absolute; inset: -18%; border-radius: 50%; background: radial-gradient(closest-side, transparent 72%, rgba(200, 215, 255, .2) 78%, transparent 100%); opacity: .6; transition: opacity .8s ease, transform 1.1s var(--look-ease); }
.half__disc::after { content: ""; position: absolute; left: 85.4%; top: 14.6%; width: 18%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, #fff 0 9%, rgba(255, 255, 255, .7) 18%, rgba(200, 215, 255, .28) 40%, transparent 68%); transition: transform 1.1s var(--look-ease), opacity .6s ease; }
.half--eclipse .half__go { color: #000; background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .3), 0 14px 34px -14px rgba(160, 185, 255, .45); }

.half__stars {
  position: absolute; inset: 0; opacity: .85;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 27% 61%, rgba(255, 255, 255, .7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 41% 9%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 58% 36%, rgba(255, 255, 255, .6) 50%, transparent 51%),
    radial-gradient(1px 1px at 73% 14%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 88% 47%, rgba(255, 255, 255, .8) 50%, transparent 51%),
    radial-gradient(1px 1px at 19% 83%, rgba(255, 255, 255, .5) 50%, transparent 51%), radial-gradient(1px 1px at 66% 78%, rgba(255, 255, 255, .55) 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 88%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 6% 52%, rgba(255, 255, 255, .6) 50%, transparent 51%),
    radial-gradient(1px 1px at 49% 92%, rgba(255, 255, 255, .5) 50%, transparent 51%), radial-gradient(1.5px 1.5px at 81% 66%, #fff 50%, transparent 51%);
}
.half--horizon .half__stars { bottom: 30%; opacity: .7; }

.chooser__foot {
  position: absolute; z-index: 3; left: 50%; bottom: clamp(14px, 3vh, 28px); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px; margin: 0; padding: 9px 10px 9px 18px; border-radius: 999px;
  font-size: 13.5px; line-height: 1.35; color: rgba(241, 244, 247, .78); text-align: center;
  background: rgba(10, 12, 18, .9); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 12px 30px -12px rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.chooser__later { padding: 6px 12px; border-radius: 999px; color: #fff; font-weight: 600; text-decoration: none; background: rgba(255, 255, 255, .1); transition: background .2s ease; }
.chooser__later:hover, .chooser__later:focus-visible { background: rgba(255, 255, 255, .2); outline: none; }

/* pointer over a half: it opens up, the other steps back */
@media (hover: hover) and (pointer: fine) {
  .chooser__halves:hover .half { flex-grow: .84; }
  .chooser__halves .half:hover { flex-grow: 1.16; }
  .chooser__halves:hover .half:not(:hover) .half__copy, .chooser__halves:hover .half:not(:hover) .half__go { opacity: .55; }
  .half--horizon:hover .half__ground { transform: translate(-50%, -1.6%); }
  .half--horizon:hover .half__dawn { transform: translate(-50%, -66%) scale(1.08); }
  .half--eclipse:hover .half__disc { transform: translate(-50%, -50%) scale(1.04); }
  .half--eclipse:hover .half__disc::before { opacity: 1; }
  .half:hover .half__go svg { transform: translateX(3px); }
}
.half:focus-visible .half__go svg { transform: translateX(3px); }

/* the choice is made: the chosen half takes the screen, then the page shows */
.chooser[data-chosen="horizon"] .half--horizon, .chooser[data-chosen="eclipse"] .half--eclipse { flex-grow: 1 !important; }
.chooser[data-chosen="horizon"] .half--eclipse, .chooser[data-chosen="eclipse"] .half--horizon { flex-grow: .0001 !important; }
.chooser[data-chosen] .half__go, .chooser[data-chosen] .chooser__foot, .chooser[data-chosen] .chooser__head { opacity: 0; transition: opacity .3s ease; }
.chooser[data-chosen="horizon"] .half__ground { transform: translate(-50%, -6%); }
.chooser[data-chosen="eclipse"] .half__disc { transform: translate(-50%, -50%) scale(1.12); }

/* the WebGL dawn (assets/stage/dawn.js) fades in over the drawing above,
   which then steps out; without WebGL the drawing simply stays */
.half__gl { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .9s ease; }
.half__gl.is-on { opacity: 1; }
.half--gl .half__stars, .half--gl .half__dawn, .half--gl .half__ground { opacity: 0; transition: opacity .9s ease; }
/* Horizon chosen: the half turns to daylight, so its words go to ink and
   then give way to the page; the seam between the halves goes at once */
.chooser[data-chosen="horizon"] .half--gl .half__copy { color: #12161e; opacity: 0; transition: color .45s ease .2s, opacity .5s ease .75s, transform .9s var(--look-ease); }
.chooser[data-chosen="horizon"] .half--gl .half__line { color: rgba(18, 22, 30, .62); transition: color .45s ease .2s; }
.chooser[data-chosen] .half + .half { box-shadow: none; }

/* phones and tall windows: Horizon above, Eclipse below */
@media (max-width: 734px), (orientation: portrait) and (max-width: 1024px) {
  .chooser__halves { flex-direction: column; }
  .half + .half { box-shadow: 0 -1px 0 rgba(255, 255, 255, .07); }
  .chooser__head { top: max(14px, env(safe-area-inset-top)); }
  .chooser__brand { font-size: 13px; }
  .chooser__title { margin-top: 6px; font-size: 20px; }
  .half__copy { top: 47%; }
  .half--horizon .half__copy { top: 50%; }
  .half__icon { width: 24px; height: 24px; margin-bottom: 10px; }
  .half__name { font-size: clamp(40px, 11.5vw, 72px); }
  .half__line { margin-top: 8px; font-size: 15px; }
  .half__go { bottom: 9%; padding: 10px 18px; font-size: 14px; }
  .half--horizon .half__ground { top: 77%; }
  .half--horizon .half__dawn { top: 77%; }
  .half--horizon .half__go { bottom: 6%; }
  .half__disc { top: 38%; width: min(52vw, 23vh); }
  .half--eclipse .half__copy { top: 38%; }
  .half--eclipse .half__go { bottom: calc(12% + 44px); }
  .chooser__foot { font-size: 12.5px; padding: 8px 8px 8px 14px; border-radius: 22px; }
  .chooser__note { flex: 1 1 200px; text-align: left; }
}
@media (max-width: 734px) and (max-height: 700px) {
  .half__line { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .half, .half__copy, .half__go, .half__ground, .half__dawn, .half__disc, .half__disc::before, .half__disc::after, .half__gl, .half__stars { transition: none !important; }
  .chooser.is-leaving { transition: none; }
}


/* going to the Horizon homepage: the chosen half holds the screen until it loads */
.chooser.is-going.is-leaving { opacity: 1; transition: none; }
