/* Seaglass site (docs/DEVELOPMENT.md). One family (Albert Sans); a dark "ambience" by default and a light one
   for light system themes; glass only where the product uses it: the bar, the install steps, the phone. */

:root {
  /* the palette of docs/BRAND.md */
  --water: #0a1d3d;          /* cobalt, the deep end */
  --dusk: #0b4a52;           /* deep teal, the other end */
  --ink: #eef8f6;            /* text */
  --mist: #a3c4c4;           /* secondary text */
  --highlight: #5fe6cb;      /* aqua: links and focus */
  --ember: linear-gradient(135deg, #ffd38a, #ff9a5c 55%, #f2575f);  /* the plus and the download button only */
  --on-ember: #2b1206;
  --badge: #ff4956;          /* the notification badge */
  --glass: rgba(255, 255, 255, 0.07);
  --glass-edge: rgba(255, 255, 255, 0.16);
  --bezel: #05070d;
  --code: rgba(255, 255, 255, 0.06);
  --on-highlight: #04121c;

  --font: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* type scale: a perfect fourth from 1rem */
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.333rem;
  --step-2: 1.777rem;
  --step-3: 2.369rem;
  --step-5: clamp(3.5rem, 9vw, 7.5rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 38rem;
  --radius-screen: 1.6rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --water: #eaf6f3;
    --dusk: #d3e9ec;
    --ink: #0d2a33;
    --mist: #456470;
    --highlight: #0f6e63;
    --glass: rgba(255, 255, 255, 0.55);
    --glass-edge: rgba(15, 26, 51, 0.12);
    --bezel: #121a2b;
    --code: rgba(15, 26, 51, 0.06);
    --on-highlight: #ffffff;
  }
}

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

html {
  background: var(--water);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--font);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  /* the ambience: deep water lit from the top left, indigo towards the bottom right */
  background:
    radial-gradient(60rem 40rem at 12% -10%, rgba(32, 164, 200, 0.28), transparent 70%),
    radial-gradient(50rem 50rem at 100% 110%, rgba(74, 47, 181, 0.35), transparent 70%),
    linear-gradient(160deg, var(--water), var(--dusk));
  background-attachment: fixed;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

img { max-width: 100%; height: auto; display: block; }

/* anchors land below the bar */
[id] { scroll-margin-top: 5rem; }

a { color: var(--highlight); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--highlight); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-weight: 300; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.6em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 500; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--code); padding: 0.1em 0.35em; border-radius: 0.3em; }
pre { background: var(--code); padding: 0.9em 1.1em; border-radius: 0.6em; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; }

.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--highlight); color: var(--on-highlight);
  padding: 0.5rem 1rem; border-radius: 0.5rem; z-index: 10; }
.skip:focus { left: 0.5rem; }

/* The bar: glass, as the app grid */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.7rem var(--gutter);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--glass-edge);
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 500; }
.brand img { width: 2rem; height: 2rem; }
.bar nav { display: flex; gap: 1.25rem; margin-left: auto; }
.bar nav a { color: var(--mist); text-decoration: none; font-size: var(--step--1); white-space: nowrap; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--ink); }
.bar .button { padding: 0.45rem 1rem; font-size: var(--step--1); white-space: nowrap; }
/* a narrow bar keeps the docs, the source and the support link; the rest is on the page */
@media (max-width: 52rem) { .bar nav a.optional { display: none; } }
@media (max-width: 30rem) { .bar { gap: 1rem; } .bar nav { gap: 1rem; } .bar .button { display: none; } }

.button {
  display: inline-block; padding: 0.75rem 1.4rem; border-radius: 999px;
  border: 1px solid var(--glass-edge); color: var(--ink); text-decoration: none; font: inherit; font-weight: 500;
  background: var(--glass); cursor: pointer;
}
.button.primary { background: var(--ember); border-color: transparent; color: var(--on-ember); }
.button:hover { text-decoration: none; filter: brightness(1.08); }

/* The phone: the Jolla Phone's screen proportions, a thin bezel */
.phone {
  margin: 0;
  width: min(100%, 19rem);
  padding: 0.55rem;
  border-radius: calc(var(--radius-screen) + 0.55rem);
  background: var(--bezel);
  box-shadow: 0 2.5rem 5rem -1.5rem rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.phone .screen {
  position: relative;
  aspect-ratio: 1032 / 2272;
  border-radius: var(--radius-screen);
  overflow: hidden;
  background: #000;
}
.phone .screen img { width: 100%; }
/* a picture of the screen's upper part only: the phone runs out of the frame below it */
.phone.cut {
  padding-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; box-shadow: none;
  -webkit-mask-image: linear-gradient(#000 94%, transparent); mask-image: linear-gradient(#000 94%, transparent);
}
.phone.cut .screen { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.wrap { max-width: 72rem; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--gutter);
  max-width: 72rem; margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) var(--gutter) 3rem;
}
.hero h1 {
  /* as thin as the lock screen's clock */
  font-size: var(--step-5); font-weight: 200; letter-spacing: -0.035em; line-height: 0.95; margin-bottom: 0.3em;
}
.lead { font-size: var(--step-1); max-width: 32rem; line-height: 1.45; }
.hero-note, .requires { color: var(--mist); max-width: 32rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.requires { font-size: var(--step--1); margin: 1.5rem 0 0; }
.requires + .requires { margin-top: 0.3rem; }
.hero-phone { width: min(74vw, 18.5rem); position: relative; margin-right: 3.4rem; }
@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; }
  .hero-phone { justify-self: center; margin: 1.5rem 0 0; }
}

/* The motif (docs/BRAND.md): a glass clock card lifted out of the phone, past its edge, and the ember pebble. The
   card reaches into the page's margin, so only the page clips it (a narrow screen's edge), never the hero's box */
main { overflow-x: clip; }
.lift {
  position: absolute; top: 8%; right: -3.4rem; min-width: 64%; width: max-content;
  display: grid; grid-template-columns: auto auto; justify-content: space-between; align-items: center;
  column-gap: 1rem; white-space: nowrap;
  padding: 0.9rem 1.1rem; border-radius: 1.2rem; color: #ffffff;
  background: rgba(243, 251, 249, 0.16); border: 1px solid rgba(255, 255, 255, 0.38);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 1.5rem 3rem -1rem rgba(0, 0, 0, 0.55);
  transform: rotate(-8deg);
}
.lift-time { font-size: 2.1rem; font-weight: 200; line-height: 1; letter-spacing: -0.02em; }
.lift-date { grid-column: 1; font-size: 0.8rem; opacity: 0.85; margin-top: 0.3rem; }
.lift-ring {
  grid-column: 2; grid-row: 1 / span 2; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 4px solid rgba(127, 240, 216, 0.4); border-top-color: #7ff0d8; border-right-color: #7ff0d8;
}
.pebble {
  position: absolute; right: -1.7rem; bottom: 7%; width: 4.4rem; height: 4rem;
  border-radius: 48% 52% 46% 54% / 55% 48% 52% 45%; background: var(--ember);
  box-shadow: 0 1rem 2rem -0.6rem rgba(0, 0, 0, 0.5), inset 0.5rem 0.5rem 0.8rem rgba(255, 255, 255, 0.35);
}
.pebble::before, .pebble::after {
  content: ""; position: absolute; left: 50%; top: 50%; background: #ffffff; border-radius: 0.2rem;
  transform: translate(-50%, -50%);
}
.pebble::before { width: 1.9rem; height: 0.45rem; }
.pebble::after { width: 0.45rem; height: 1.9rem; }
@media (max-width: 52rem) {
  .lift { right: -1.6rem; }
  .pebble { right: -0.9rem; }
}
/* one moment on arrival: the card lifts out of the screen */
@media (prefers-reduced-motion: no-preference) {
  .lift { animation: lift 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 400ms both; }
  @keyframes lift {
    from { opacity: 0; transform: translate(-3rem, 1.2rem) rotate(0deg) scale(0.92); }
    to { opacity: 1; transform: rotate(-8deg); }
  }
}

/* What is on the page: the chapters by name */
.contents { max-width: 72rem; margin: 0 auto; padding: 1rem var(--gutter) 0; }
.contents ul {
  list-style: none; margin: 0; padding: 1.1rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem;
  border-top: 1px solid var(--glass-edge); border-bottom: 1px solid var(--glass-edge);
}
.contents a { color: var(--mist); text-decoration: none; }
.contents a:hover { color: var(--ink); }

/* Chapters: a feature's text and its moments on the left, one phone on the right. With scripts the phone shows
   the moment chosen in the list; without them every moment has its own phone */
.features { max-width: 72rem; margin: 0 auto; padding: 1rem var(--gutter) 2rem; }
.chapter { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.chapter > h2, .chapter-text h2 { margin-bottom: 0.5em; }
.chapter-lead { font-size: var(--step-1); line-height: 1.45; max-width: 34rem; margin-bottom: 1.6rem; }
.moments { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2.5rem var(--gutter); }
.moment h3 { margin-bottom: 0.4em; }
.moment p { color: var(--mist); max-width: var(--measure); }
.moment .phone { width: min(70vw, 15rem); margin-top: 1.2rem; }
.chapter-more { margin: 1.6rem 0 0; }
.chapter-stage { display: none; }

.js .chapter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: 2.5rem var(--gutter);
  align-items: start; }
.js .chapter-text { padding-top: clamp(0rem, 3vw, 2.5rem); }
.js .moments { display: block; max-width: 34rem; }
.js .moment { border-left: 2px solid var(--glass-edge); padding: 0.1rem 0 0.1rem 1.2rem; }
.js .moment.active { border-left-color: var(--highlight); }
.js .moment h3 { margin: 0; }
.js .moment button {
  display: block; width: 100%; padding: 0.55rem 0; border: 0; background: none; cursor: pointer; text-align: left;
  font: inherit; color: var(--mist);
}
.js .moment button:hover, .js .moment.active button { color: var(--ink); }
.js .moment p { display: none; margin: 0; padding-bottom: 0.7rem; }
.js .moment.active p { display: block; }
.js .moment .phone { display: none; }
.js .chapter-stage { display: flex; justify-content: center; }
.js .chapter-stage .phone { width: min(70vw, 18rem); }
.js .chapter-stage .screen img { position: absolute; inset: 0 0 auto; opacity: 0; transition: opacity 250ms ease; }
.js .chapter-stage .screen img.shown { opacity: 1; }
@media (max-width: 52rem) {
  .js .chapter { grid-template-columns: 1fr; }
  .js .chapter-stage .phone { margin: 0 auto; }
}

/* The settings: its pages side by side, scrolled sideways */
.shots-intro { max-width: 72rem; margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) var(--gutter) 0; }
.shots-intro p { color: var(--mist); max-width: var(--measure); }
.shots-intro .chapter-lead { color: var(--ink); }
.shots {
  display: flex; gap: 1.5rem; overflow-x: auto; scroll-snap-type: x proximity;
  padding: 1.5rem max(var(--gutter), calc((100vw - 72rem) / 2 + var(--gutter))) 2.5rem; scrollbar-width: thin;
}
.shots figure { margin: 0; flex: 0 0 auto; scroll-snap-align: center; }
.shots .phone { width: 14rem; }
.shots figcaption { margin-top: 0.8rem; text-align: center; color: var(--mist); font-size: var(--step--1); }

/* Install: a real sequence, so numbered */
.install { max-width: 72rem; margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) var(--gutter) 2rem; }
.install-intro { color: var(--mist); max-width: var(--measure); margin-bottom: 2rem; }
.install-steps {
  list-style: none; counter-reset: step; padding: 0; margin: 0 0 3rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem;
}
.install-steps li {
  counter-increment: step; padding: 1.4rem 1.4rem 0.6rem;
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 1.2rem;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.install-steps li::before {
  content: counter(step); display: block; font-size: var(--step-3); font-weight: 200; line-height: 1;
  color: var(--highlight); margin-bottom: 0.6rem;
}
.install-steps p { color: var(--mist); }
.install-steps pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 0.6em; }
.copy {
  padding: 0.3rem 0.9rem; margin-bottom: 1em; border-radius: 999px; border: 1px solid var(--glass-edge);
  background: none; color: var(--highlight); font: inherit; font-size: var(--step--1); cursor: pointer;
}
.copy:hover { background: var(--glass); }

/* After the install: what to know, in short */
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0.5rem var(--gutter); }
.notes h3 { margin-bottom: 0.4em; }
.notes p { color: var(--mist); }
.notes code { white-space: nowrap; }

/* How it works, privacy and the source */
.facts {
  max-width: 72rem; margin: 0 auto; padding: 3rem var(--gutter);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem var(--gutter);
}
.facts h2 { font-size: var(--step-2); }
.facts p { color: var(--mist); max-width: var(--measure); }

/* Support: a sea glass cup of coffee, its steam rising; a cup on the button */
.support { max-width: 72rem; margin: 0 auto; padding: 1rem var(--gutter) 5rem; }
.support-inner {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.5rem 2rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 1.6rem;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.support h2 { font-size: var(--step-2); margin-bottom: 0.4em; }
.support p { color: var(--mist); max-width: var(--measure); margin: 0; }
.support-cup { display: block; width: 6.5rem; height: 6.5rem; overflow: visible; }
.support-cup .glass { fill: url(#cup-glass); stroke: var(--highlight); stroke-width: 1.6; }
.support-cup .handle { fill: none; stroke: var(--highlight); stroke-width: 4; stroke-linecap: round; opacity: 0.8; }
.support-cup .glint { fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; opacity: 0.55; }
.support-cup .saucer { fill: url(#cup-glass); stroke: var(--glass-edge); }
.support-cup .steam { fill: none; stroke: var(--mist); stroke-width: 2.4; stroke-linecap: round; opacity: 0.7; }
.support-button { display: inline-flex; align-items: center; gap: 0.6rem; border-color: rgba(255, 154, 92, 0.55);
  white-space: nowrap; }
.support-button svg { width: 1.4rem; height: 1.4rem; flex: none; }
.support-button:hover { box-shadow: 0 0 0 1px rgba(255, 154, 92, 0.5), 0 0.6rem 1.6rem -0.6rem rgba(255, 154, 92, 0.6); }
@media (max-width: 52rem) {
  .support-inner { grid-template-columns: auto minmax(0, 1fr); }
  .support-inner > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 30rem) {
  .support-inner { grid-template-columns: 1fr; }
  .support-cup { width: 5rem; height: 5rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .support-cup .steam { animation: steam 3.6s ease-in-out infinite both; transform-box: fill-box;
    transform-origin: 50% 100%; }
  .support-cup .steam:nth-of-type(2) { animation-delay: 1.2s; }
  .support-cup .steam:nth-of-type(3) { animation-delay: 2.4s; }
  @keyframes steam {
    0% { opacity: 0; transform: translateY(6px) scaleY(0.7); }
    35% { opacity: 0.75; }
    100% { opacity: 0; transform: translateY(-8px) scaleY(1.1); }
  }
}

.footer {
  border-top: 1px solid var(--glass-edge); padding: 2rem var(--gutter) 3rem; color: var(--mist);
  font-size: var(--step--1);
}
.footer-inner { max-width: 72rem; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  justify-content: space-between; }
.footer p { margin: 0; max-width: 40rem; }
.footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* Docs: a sidebar, the text at a reading measure, the page's sections on wide screens */
.doc {
  max-width: 80rem; margin: 0 auto; padding: 2rem var(--gutter) 4rem;
  display: grid; grid-template-columns: 15rem minmax(0, 1fr) 13rem; gap: 2.5rem;
}
.doc-nav, .doc-toc { position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 6rem); overflow-y: auto;
  font-size: var(--step--1); }
.doc-nav h2, .doc-toc h2 { font-size: var(--step--1); font-weight: 600; color: var(--ink); margin: 1.4em 0 0.5em; }
.doc-nav h2:first-child, .doc-toc h2:first-child { margin-top: 0; }
.doc-nav ul, .doc-toc ul { list-style: none; margin: 0; padding: 0; }
.doc-nav li, .doc-toc li { margin: 0.15rem 0; }
.doc-nav a, .doc-toc a { color: var(--mist); text-decoration: none; display: block; padding: 0.2rem 0.6rem;
  border-radius: 0.4rem; }
.doc-nav a:hover, .doc-toc a:hover { color: var(--ink); background: var(--code); }
.doc-nav a[aria-current="page"] { color: var(--ink); background: var(--glass); box-shadow: inset 2px 0 0 var(--highlight); }
.doc-body { max-width: 46rem; min-width: 0; }
.doc-body h1 { font-size: var(--step-3); font-weight: 300; }
.doc-body h2 { font-size: var(--step-2); margin-top: 2.2em; scroll-margin-top: 5rem; }
.doc-body h3 { font-size: var(--step-1); margin-top: 1.8em; scroll-margin-top: 5rem; }
.doc-body table { border-collapse: collapse; width: 100%; font-size: var(--step--1); margin: 0 0 1.5em;
  display: block; overflow-x: auto; }
.doc-body th, .doc-body td { text-align: left; padding: 0.55em 0.8em; border-bottom: 1px solid var(--glass-edge);
  vertical-align: top; }
.doc-body th { font-weight: 600; }
.doc-body img { border-radius: 0.8rem; }
.doc-body p[align="center"] { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.doc-body li { margin: 0.25em 0; }
.doc-body blockquote { margin: 0 0 1em; padding: 0.2em 1em; border-left: 3px solid var(--highlight); color: var(--mist); }
.doc-edit { margin-top: 3rem; font-size: var(--step--1); color: var(--mist); }
@media (max-width: 72rem) { .doc { grid-template-columns: 13rem minmax(0, 1fr); } .doc-toc { display: none; } }
@media (max-width: 48rem) {
  .doc { grid-template-columns: 1fr; }
  .doc-nav { position: static; max-height: none; border-bottom: 1px solid var(--glass-edge); padding-bottom: 1rem; }
}
