/* Image Lantern website: the shared parts.
   Reset, buttons, the trial button, the nav, keys, questions and the footer. main.css themes them with custom
   properties and lays the page out on top. */

:root {
  --pad: clamp(20px, 4.6vw, 80px);
  --nav: 66px;
  --max: 1360px;
  --out: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav); }  /* in-page jumps land just under the fixed bar */
body { margin: 0; font-family: var(--body); font-size: 18px; line-height: 1.55; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 3px; border-radius: 6px; }
/* Text in a gradient. The gradient is painted into the letters (background-clip: text), so it reaches only as far
   as the text's box, and a box no taller than its line leaves the tails of g, p and y, and the tops of tall letters,
   unpainted, and so invisible. The padding takes the box past the line on every side; the matching negative margin
   keeps everything exactly where it was. Every gradient on text uses this class, with its colours in --grad. */
.grad-text { padding: .14em .06em .24em; margin: -.14em -.06em -.24em; background-image: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
/* a title's words pull into focus (base.js). Each word is blurred as a box of its own, and the blur is clipped to
   that box (in Safari), so the box reaches past the line on every side, the tails of g, p and y included; the
   matching negative margin keeps every word exactly where it was */
.word { padding: .14em .06em .26em; margin: -.14em -.06em -.26em; transform-origin: 50% 85%; }
/* a phrase in a title that keeps one gradient across its words focuses as one piece (data-focus; base.js leaves it whole) */
.grad-text[data-focus] { display: inline-block; transform-origin: 50% 85%; }
.is-held :is(.word, [data-focus], [data-fade]) { filter: none !important; opacity: 1 !important; transform: none !important; }  /* sharp, over its animation, until it's been off the screen */
/* a line that rises into place as it comes into view (base.js), on every page: held low and hidden until then */
.rises [data-rise] { transition: opacity .9s var(--out), translate .9s var(--out); }
.rises .tile[data-rise] { transition: opacity .9s var(--out), translate .9s var(--out), background-color .3s; }  /* a pane keeps its hover's */
.rises [data-rise]:not(.risen) { opacity: 0; translate: 0 28px; visibility: hidden; }
.wrap { width: min(100% - 2 * var(--pad), var(--max)); margin-inline: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--btn-bg); color: var(--btn-ink); font: 600 var(--t-small) var(--body); letter-spacing: -.005em; white-space: nowrap; cursor: pointer; transition: background-color .25s, color .25s, box-shadow .25s, transform .2s var(--out); }
.btn:hover { box-shadow: var(--btn-glow); }  /* lit: a glow held close, the cyan of the lantern */
.btn:active { transform: scale(.975); }
.btn--s { height: 36px; padding: 0 16px; font-size: var(--t-small); }
.btn--wide { width: 100%; }
.btn--line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--btn-line); }
.btn--line:hover { background: var(--btn-bg); color: var(--btn-ink); box-shadow: inset 0 0 0 1px var(--btn-bg), var(--btn-glow); }

/* the trial: a button, and a note hanging under it */
.cta { position: relative; display: flex; justify-content: center; margin-bottom: 34px; }
.cta__note { position: absolute; top: calc(100% + 12px); left: 50%; width: max-content; max-width: min(36em, calc(100vw - 32px)); translate: -50% 0; text-align: center; text-wrap: balance; font: 400 var(--t-small) var(--body); color: #8c9196; }

/* nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--nav); padding-inline: var(--pad); display: flex; align-items: center; justify-content: space-between; gap: 24px; transition: background-color .35s, box-shadow .35s, color .35s; }
.nav.is-solid { background: var(--nav-bg); backdrop-filter: blur(15px) saturate(1.4); -webkit-backdrop-filter: blur(15px) saturate(1.4); }
.nav__brand { display: inline-flex; align-items: center; gap: 10px; font: 600 18px var(--display); letter-spacing: -.015em; }
.nav__mark { width: 21px; height: 28px; flex: none; }
.nav__end { display: flex; align-items: center; gap: 20px; font-size: var(--t-small); font-weight: 500; }
.nav__link { color: var(--dim); transition: color .2s; }
.nav__link:hover { color: var(--ink); }

/* the menu: a panel from the right, the page blurred behind it */
/* the menu's button: three bars that fold into a cross as the menu opens and back as it closes. It sits above both the
   nav (which keeps its place, .nav__space) and the panel, so it never moves */
.nav__space { flex: none; width: 40px; height: 40px; margin: 0 -10px 0 -6px; }
.burger { position: fixed; top: calc((var(--nav) - 40px) / 2); right: calc(var(--pad) - 10px); z-index: 90; display: grid; place-content: center; gap: 5px; width: 40px; height: 40px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.burger span { width: 20px; height: 1.5px; border-radius: 1px; background: currentColor; transition: transform .5s var(--out), opacity .3s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.menu { position: fixed; inset: 0; z-index: 80; visibility: hidden; transition: visibility 0s .45s; }
.menu.is-open { visibility: visible; transition: none; }
.menu__veil { position: absolute; inset: 0; background: var(--veil, rgba(0, 0, 0, .35)); -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15); opacity: 0; transition: opacity .4s; }
.menu.is-open .menu__veil { opacity: 1; transition-duration: .55s; }
.menu__panel { position: absolute; inset: 0 0 0 auto; display: flex; flex-direction: column; width: min(100%, calc(360px + 2 * var(--pad))); overflow-y: auto; overscroll-behavior: contain; padding: calc(var(--nav) + clamp(0px, 2.4svh, 48px)) var(--pad) calc(16px + env(safe-area-inset-bottom)); background: var(--menu-bg, #0b0b0d); box-shadow: -1px 0 0 var(--line); transform: translateX(100%); transition: transform .4s cubic-bezier(.5, 0, .75, 0); }
.menu.is-open .menu__panel { transform: none; transition: transform .65s var(--out); }
.menu__label { font-size: var(--t-tiny); font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--mute); }
.menu__pages { margin: 12px 0 clamp(14px, 3.2svh, 56px); border-top: 1px solid var(--line); }
.menu__pages li { border-bottom: 1px solid var(--line); }
.menu__pages a { display: flex; align-items: baseline; gap: 18px; padding: clamp(5px, 1.15svh, 15px) 0; font: 600 var(--t-sub)/1.15 var(--display); letter-spacing: -.02em; transition: color .2s; }
.menu__pages b { flex: none; width: 20px; font: 500 var(--t-tiny) var(--body); letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--a); }
.menu__more { display: grid; justify-items: start; margin-top: 10px; }
.menu__more a { display: block; padding: clamp(2px, .55svh, 5px) 0; font-size: var(--t-body); color: var(--dim); transition: color .2s; }
.menu__pages a:hover, .menu__pages a.is-here { color: var(--a); }
.menu__more a:hover, .menu__more a.is-here { color: var(--ink); }
.menu__end { display: flex; align-items: center; gap: 22px; margin-top: clamp(14px, 2.8svh, 40px); font-size: var(--t-small); }  /* the trial button right under the links */
.menu__end .btn { flex: 1; }
/* the panel's contents follow it in, a beat behind */
.menu__label, .menu__panel li, .menu__end { opacity: 0; transform: translateX(24px); transition: opacity .2s, transform .3s; }
.menu.is-open :is(.menu__label, li, .menu__end) { opacity: 1; transform: none; transition: opacity .5s, transform .8s var(--out); transition-delay: calc(140ms + var(--i, 0) * 30ms); }
html.menu-open { overflow: hidden; scrollbar-gutter: stable; }

/* keys */
kbd { display: inline-grid; place-items: center; min-width: 25px; height: 25px; padding: 0 6px; margin: 0 1px; font: 600 var(--t-tiny) var(--body); color: var(--ink); border-radius: 6px; background: var(--key, rgba(127, 127, 127, .18)); box-shadow: inset 0 0 0 1px var(--line); vertical-align: 1px; }

/* questions */
details { border-bottom: 1px solid var(--line); }
summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; cursor: pointer; list-style: none; font: var(--q-font); letter-spacing: -.012em; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(currentColor 0 0) center / 100% 1.5px no-repeat, linear-gradient(currentColor 0 0) center / 1.5px 100% no-repeat; transition: transform .35s var(--out); }
details[open]:not(.is-closing) summary::after { transform: rotate(45deg); }  /* a cross while open; back to a plus as soon as it starts closing */
details p { padding: 0 60px 26px 0; color: var(--dim); max-width: 38em; }

/* footer */
.foot { padding: clamp(50px, 6vw, 90px) 0 40px; }
.foot__cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px 24px; padding-bottom: 40px; }
.foot__brand { display: flex; gap: 12px; font: 600 19px/1.25 var(--display); }
.foot__cols h4 { font: 600 var(--t-tiny) var(--body); color: var(--ink); margin-bottom: 12px; }
.foot__cols a { display: block; width: fit-content; padding: 4px 0; font-size: var(--t-small); color: var(--dim); transition: color .2s; }
.foot__cols a:hover { color: var(--ink); }
.foot__base { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--line); font-size: var(--t-tiny); color: var(--mute); }

/* a piece of a larger capture (see crops.js) */
.crop { display: block; background-repeat: no-repeat; }

@media (max-width: 1000px) {
  .foot__cols { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .nav__link { display: none; }
  .menu__panel { width: 100%; box-shadow: none; }  /* on a phone the menu is the whole screen, edge to edge */
  /* and the height it doesn't need goes into its spacing: past a 600 px screen every space grows with it (the second
     term in each max), so a tall phone's menu breathes and a short one's still fits */
  .menu__panel { padding-top: calc(var(--nav) + clamp(0px, max(2.4svh, 7.9svh - 33px), 60px)); }
  .menu__pages { margin-bottom: clamp(14px, max(3.2svh, 8.7svh - 33px), 64px); }
  .menu__pages a { padding-block: clamp(5px, max(1.15svh, 3.9svh - 16.5px), 22px); }
  .menu__more a { padding-block: clamp(2px, max(.55svh, 1.47svh - 5.5px), 10px); }
  .menu__end { margin-top: clamp(14px, max(2.8svh, 8.3svh - 33px), 56px); }
  details p { padding-right: 0; }
}
@media (max-height: 620px) {  /* a very short screen: the whole menu still fits */
  .menu__pages a { font-size: 18px; }
  .menu__more a { font-size: var(--t-small); }
  .menu__panel { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
