/* Nearside website. Aluminium and graphite like the devices, with one accent: brick red.
   Flat colour only; the drawn screens wear the Nearside wallpaper, a graphite sky with a brick
   horizon (see vault/writing-and-design.md). */

:root {
  /* Spacing, four steps used everywhere: between sections, between blocks in a section,
     from a heading to its text, and between columns. */
  --space-section: clamp(48px, 6vw, 80px);
  --space-block: clamp(28px, 3.5vw, 44px);
  --space-text: 14px;
  --space-columns: clamp(24px, 4vw, 56px);
  --desk: #E8E9EC;
  --surface: #F6F6F8;
  --ink: #1C1C1F;
  --soft: #5D5F66;
  --line: #CFD1D6;
  --graphite: #1C1C1F;
  --alu: #C9CBD1;
  --bezel: #1C1C1F;
  --accent: #9E3A28;      /* brick: buttons, the band, the wallpaper's horizon */
  --accent-deep: #772B1E; /* the horizon's rim */
  --accent-text: #9E3A28; /* brick as text, focus rings and markers (5.6:1 on the desk) */
  --wallpaper: radial-gradient(circle at 68% 260%, var(--accent) 0 66%, var(--accent-deep) 66.15% 72%, transparent 72.15%), #1F1F23;
  --band: var(--accent);
  --on-band: #FFFFFF;
  --on-band-soft: rgba(255, 255, 255, .82);
  --ok: #34C759;
  --focus: var(--accent-text);
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --desk: #17171A;
    --surface: #202024;
    --ink: #F2F2F4;
    --soft: #9E9EA6;
    --line: #34343A;
    --alu: #3A3A40;
    --bezel: #2E2E34;
    --accent-text: #D96F57; /* lighter brick on dark (5.4:1) */
  }
  .mark rect:first-child { stroke: #3A3A40; stroke-width: 20; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: "Schibsted Grotesk", -apple-system, system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
a:focus-visible, .button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -0.025em; }
h1 { font-size: clamp(40px, 4.6vw, 68px); font-weight: 800; max-width: 14ch; }
h2 { font-size: clamp(30px, 3.8vw, 50px); font-weight: 750; max-width: 20ch; }
h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0; max-width: 62ch; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100% - 1200px) / 2));
  background: var(--desk);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 20px; text-decoration: none; letter-spacing: -0.01em; }
.mark { width: 30px; height: 30px; }
.top nav { display: flex; align-items: center; gap: 22px; font-size: 16px; }
.top nav a { text-decoration: none; color: var(--soft); }
.top nav a:hover { color: var(--ink); }
.top nav .pill { color: var(--ink); border: 1.5px solid var(--line); padding: 6px 14px; border-radius: 999px; }
@media (max-width: 760px) { .top nav a:not(.pill) { display: none; } }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.button {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px;
  border-radius: 12px; border: 1.5px solid var(--line); text-decoration: none;
  font-weight: 650; font-size: 17px; background: var(--surface);
}
.button:hover { border-color: var(--soft); }
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (prefers-color-scheme: dark) {
  .button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
}
.fine { margin-top: var(--space-text); font-size: 15px; color: var(--soft); }

/* Hero */
/* The first screen, exactly: the top bar (about 66 px) plus the hero fill it, its content centred
   in the space, and the next section starts below the fold. */
.hero {
  width: min(1200px, 100% - 32px); margin: 0 auto;
  min-height: calc(100vh - 66px); min-height: calc(100svh - 66px);
  padding: var(--space-block) 0;
  display: grid; grid-template-columns: minmax(0, 10fr) minmax(0, 13fr); gap: var(--space-columns);
  align-items: center; align-content: center;
}
.lede { margin-top: var(--space-text); font-size: 20px; color: var(--soft); max-width: 46ch; }
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 0; padding-top: 24px; }
  /* On a phone: the headline, then the animation, then the words and the download buttons. */
  .hero-text { display: contents; }
  .hero h1 { order: 1; }
  .stage { order: 2; margin-top: 24px; }
  .lede { order: 3; }
  .hero .actions { order: 4; }
  .hero .fine { order: 5; }
}

/* The stage: a Mac and a phone on the desk, drawn in a 100-unit-wide space (cqw). */
.stage { position: relative; container-type: inline-size; aspect-ratio: 100 / 47; }
.stage > * { position: absolute; }

.mac { left: 0; top: 2cqw; width: 70cqw; }
.screen {
  position: relative; width: 70cqw; height: 43cqw; overflow: hidden;
  background: var(--wallpaper); border: 1cqw solid var(--bezel); border-radius: 2cqw 2cqw 0.6cqw 0.6cqw;
}
.base { width: 78cqw; height: 1.7cqw; margin-left: -4cqw; background: var(--alu); border-radius: 0 0 1.4cqw 1.4cqw; }
.menubar { height: 2.2cqw; background: rgba(255, 255, 255, .12); display: flex; justify-content: flex-end; align-items: center; padding-right: 2cqw; }
.mini-mark { width: 1.2cqw; height: 1.2cqw; border-radius: .3cqw; background: #fff; opacity: .9; }

.landed { position: absolute; }
.window-landed { left: 5.1cqw; top: 5.6cqw; width: 11.5cqw; }
.toast, .banner {
  right: 2cqw; width: 25cqw; border-radius: 1.4cqw; font-size: 1.45cqw; line-height: 1.35;
  box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, .35); display: flex; align-items: center; gap: 1.1cqw;
}
.toast-text, .banner-text { display: grid; gap: .2cqw; min-width: 0; flex: 1; }
.who { color: rgba(255, 255, 255, .62); font-size: 1.25cqw; }
.app-icon { width: 3cqw; height: 3cqw; border-radius: .7cqw; flex: none; align-self: flex-start; }

/* The clip: Nearside's own card, light and plain, with what you can do next. */
.toast { top: 3.6cqw; padding: 1cqw 1.2cqw; background: #F6F6F8; color: #1C1C1F; }
.toast .who { color: #5D5F66; }
.clip-mark { width: 2.4cqw; height: 2.4cqw; flex: none; color: #1C1C1F; }
.toast kbd {
  flex: none; font: 600 1.15cqw/1 "Schibsted Grotesk", system-ui, sans-serif; color: #1C1C1F;
  padding: .45cqw .6cqw; border-radius: .6cqw; border: .12cqw solid #CFD1D6; background: #fff;
}

/* The message: a macOS notification banner, dark glass, with the app's icon. */
.banner { top: 13cqw; padding: 1.1cqw 1.3cqw; background: rgba(40, 40, 46, .8); color: #fff; backdrop-filter: blur(10px);
  border: .1cqw solid rgba(255, 255, 255, .12); }
.when { float: right; }
/* Its buttons, as the phone's notification has them (they work from the Mac). */
.actions-row { display: flex; gap: .6cqw; margin-top: .7cqw; }
.actions-row span {
  padding: .45cqw 1cqw; border-radius: 99px; background: rgba(255, 255, 255, .14);
  font-size: 1.2cqw; font-weight: 600; color: #fff;
}
.lock-actions { display: flex; gap: 1cqw; margin-top: .4cqw; font-size: .95cqw; font-weight: 600; color: #A8C7FA; }

.path { left: 71cqw; top: 9cqw; width: 11cqw; height: 6cqw; overflow: visible; }
.path path { fill: none; stroke: var(--soft); stroke-width: .5; stroke-dasharray: 1.4 2.2; vector-effect: non-scaling-stroke; opacity: .7; }

.phone {
  left: 82cqw; top: 7cqw; width: 17cqw; height: 36cqw; padding: .7cqw;
  background: var(--bezel); border-radius: 3cqw;
}
.phone-screen {
  width: 100%; height: 100%; border-radius: 2.4cqw; background: var(--wallpaper); color: #fff;
  display: flex; flex-direction: column; align-items: center; padding-top: 4.5cqw;
}
/* A notification on the lock screen, as the phone shows it. */
.lock-note {
  margin-top: 2.4cqw; width: 14.4cqw; padding: .8cqw 1cqw; border-radius: 1.3cqw;
  background: rgba(255, 255, 255, .16); backdrop-filter: blur(6px);
  font-size: 1.05cqw; line-height: 1.3; display: grid; gap: .15cqw; text-align: left;
}
.lock-note .who { font-size: .95cqw; display: flex; align-items: center; gap: .4cqw; }
.lock-note .app-icon { width: 1.4cqw; height: 1.4cqw; border-radius: .35cqw; align-self: center; }
.time { font-size: 4.6cqw; font-weight: 300; letter-spacing: -0.02em; line-height: 1; }
.locked { margin-top: auto; margin-bottom: 3cqw; display: flex; align-items: center; gap: .6cqw; font-size: 1.4cqw; color: rgba(255, 255, 255, .75); }
.locked svg { width: 1.6cqw; height: 1.6cqw; fill: currentColor; stroke: currentColor; }

.flyer { opacity: 0; pointer-events: none; }
.f-clip {
  padding: .9cqw 1.3cqw; border-radius: 1.2cqw; background: #fff; color: #1C1C1F;
  font-size: 1.4cqw; line-height: 1.3; white-space: nowrap; box-shadow: 0 1cqw 2.5cqw rgba(0, 0, 0, .25);
}
.f-app { width: 5cqw; }
.f-app img { border-radius: 50%; box-shadow: 0 .8cqw 2cqw rgba(0, 0, 0, .35); }

/* The sequence: each thing leaves the locked phone, crosses, and lands. */
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: land .35s ease-out 1.75s both; }
  .window-landed { animation: open-app .5s cubic-bezier(.2, .8, .2, 1) 3.35s both; }
  .f-clip { animation: cross-clip 1.2s cubic-bezier(.5, 0, .2, 1) .6s both; }
  .f-app { animation: cross-app 1.45s cubic-bezier(.5, 0, .2, 1) 2.2s both; }
  /* Last: a message arrives on both at the same moment. */
  .banner, .lock-note { animation: land .4s ease-out 4.5s both; }
}
@keyframes land { from { opacity: 0; transform: translateY(-.8cqw); } to { opacity: 1; transform: none; } }
@keyframes cross-clip {
  0% { left: 83cqw; top: 22cqw; opacity: 0; transform: scale(.7); }
  15% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; }
  100% { left: 43cqw; top: 7cqw; opacity: 0; }
}
/* The app leaves the phone as its icon and opens into a window on the Mac. */
@keyframes cross-app {
  0% { left: 88cqw; top: 20cqw; opacity: 0; transform: scale(.6); }
  12% { opacity: 1; transform: scale(1); }
  90% { opacity: 1; transform: scale(1); }
  100% { left: 9.5cqw; top: 19cqw; opacity: 0; transform: scale(1.6); }
}
@keyframes open-app { from { opacity: 0; transform: scale(.25); } to { opacity: 1; transform: none; } }

/* Phone apps: the brick band, where the dark app windows stand out. */
.band { background: var(--band); color: var(--on-band); padding: var(--space-section) 0; }
.band p, .band li { color: var(--on-band-soft); }
.band b { color: var(--on-band); font-weight: 650; }
.band a:focus-visible { outline-color: #fff; }
.band .pair p { color: var(--on-band-soft); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-columns); align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.copy > p { margin-top: var(--space-text); font-size: 19px; }

.windows { position: relative; aspect-ratio: 1 / 1; }
/* The windows themselves (no shadow margin in the pictures): as large as before, no larger. */
.windows .w { position: absolute; width: 38%; }
.w1 { left: 4%; top: 10%; z-index: 1; }
.w2 { left: 31%; top: 4%; z-index: 2; }
.w3 { left: 58%; top: 13%; z-index: 1; }


/* Everyday */
.everyday, .download { padding: var(--space-section) 0; }
.download { background: var(--surface); }
.everyday .pair:first-child { margin-top: 0; }
.pair { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-columns); align-items: center; margin-top: var(--space-block); }
.pair img { width: min(100%, 345px); max-height: 78vh; object-fit: contain; justify-self: center; }
.pair p { margin-top: 10px; color: var(--soft); font-size: 19px; }
.pair.flip > img { order: 2; }
.pair.launcher { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
.pair.launcher img { width: 100%; }
@media (max-width: 800px) { .pair, .pair.launcher { grid-template-columns: 1fr; } .pair.flip > img { order: 0; } }

.more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px var(--space-columns); margin: var(--space-block) 0 0; padding-top: var(--space-block); border-top: 1.5px solid var(--line); }
.more dt { font-weight: 700; font-size: 20px; }
.more dd { margin: 6px 0 0; color: var(--soft); }
@media (max-width: 900px) { .more { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 500px) { .more { grid-template-columns: 1fr; } }

/* Private: one plain line. */
.private { background: var(--surface); padding: var(--space-section) 0; text-align: center; }
.private h2 { margin-inline: auto; max-width: none; }
.private p { margin: var(--space-text) auto 0; color: var(--soft); font-size: 19px; }

/* Questions: one line each until opened. */
.faq { padding: var(--space-section) 0; }
.qa { margin-top: var(--space-block); max-width: 820px; border-top: 1.5px solid var(--line); }
.qa details { border-bottom: 1.5px solid var(--line); }
.qa summary { list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative; font-weight: 650; font-size: 19px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 24px; font-weight: 400; color: var(--accent-text); }
.qa details[open] summary::after { content: "\2212"; }
.qa summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.qa p { padding: 0 40px 20px 0; color: var(--soft); }

/* Get Nearside: the buttons again, and the one setup step. */
.download .setup { margin-top: var(--space-block); font-size: 19px; }

/* Footer */
.foot { padding: 40px 0 56px; border-top: 1.5px solid var(--line); font-size: 15px; color: var(--soft); }
.foot p + p { margin-top: 8px; }


