/* sidecrew.dev page styles. Spec: design/site/brief.md and rules.md.
   The hero is a still image of the desk (rendered from video/, HeroStill). */

:root {
  --night: #0b0c0e;
  --lamp: #1b2433;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --cap: linear-gradient(#2B2B2B, #212121);
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --m: clamp(20px, 5vw, 80px);
  --sec: 72px;
  color-scheme: dark;
}

/* Signal colors exist only inside the scene (rule 2). scene.css reads them. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: 100%;
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--ink-2);
  font: 400 1.125rem / 1.6875rem var(--sans);
  font-synthesis: none;
  hanging-punctuation: first last;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
h1, h2, h3 { color: var(--ink); font-weight: 600; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
b, strong, dt { color: var(--ink); font-weight: 600; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: rgb(255 255 255 / .2); color: var(--ink); }

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
a:focus-visible { border-radius: 2px; }

code {
  font-family: var(--mono);
  font-size: 1rem;                     /* 16 px: on the type scale (brief asks .875em = 15.75 px) */
  background: rgb(255 255 255 / .08);
  border-radius: 4px;
  padding: .1em .35em;
}

.small { font-size: .875rem; line-height: 1.3125rem; letter-spacing: .005em; }
.wrap { width: min(1120px, 100% - 2 * var(--m)); margin-inline: auto; }

/* ---------- Nav (64 tall, no bar) ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px;
  color: var(--ink); font-size: 1rem; line-height: 1.5rem; font-weight: 600; text-decoration: none;
}
.brand img { width: 32px; height: 32px; border-radius: 23%; }
.nav ul { display: flex; list-style: none; padding: 0; margin: 0 -12px 0 0; }
.nav li a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--ink-2); font-size: 1rem; line-height: 1.5rem; text-decoration: none;
}
.nav li a:hover { text-decoration-line: underline; }
.nav li a[aria-current="page"] { color: var(--ink); text-decoration-line: underline; }

/* ---------- Lamp light: wall cone (eased stops of --lamp over --night) and grain ----------
   Painted behind the content (z-index -1 in the root stacking context), so the grain never
   covers text or screens. The overlay blend keeps the grain's mean brightness neutral. */
.hero, .doc { position: relative; }
.hero::before, .hero::after, .doc::before, .doc::after {
  content: ""; position: absolute; left: 0; right: 0; top: -64px; bottom: 0;
  z-index: -1; pointer-events: none;
}
.hero::before {
  background: radial-gradient(75% 90% at 18% -10%,
    var(--lamp) 0%, rgb(27 36 51 / .8) 10%, rgb(27 36 51 / .63) 20%, rgb(27 36 51 / .49) 30%,
    rgb(27 36 51 / .37) 40%, rgb(27 36 51 / .26) 50%, rgb(27 36 51 / .17) 60%,
    rgb(27 36 51 / .09) 70%, rgb(27 36 51 / .03) 80%, rgb(27 36 51 / 0) 100%);
}
.doc::before, .doc::after { bottom: auto; height: 520px; }
.doc::before {
  background: radial-gradient(40vw 440px at 18% -40px,
    var(--lamp) 0%, rgb(27 36 51 / .8) 10%, rgb(27 36 51 / .63) 20%, rgb(27 36 51 / .49) 30%,
    rgb(27 36 51 / .37) 40%, rgb(27 36 51 / .26) 50%, rgb(27 36 51 / .17) 60%,
    rgb(27 36 51 / .09) 70%, rgb(27 36 51 / .03) 80%, rgb(27 36 51 / 0) 100%);
}
.hero::after, .doc::after {
  background: url("/assets/noise.png") 0 0 / 128px 128px repeat;
  opacity: .04;
  mix-blend-mode: overlay;
}

/* ---------- Keycap button (the page's only button) ---------- */
.key {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; margin: 0; padding: 11px 23px;      /* 12 x 24 including the 1 px highlight edge */
  border: 1px solid transparent; border-radius: 10px;
  background: var(--cap) padding-box,
    linear-gradient(rgb(255 255 255 / .09), rgb(255 255 255 / 0) 50%) border-box;
  box-shadow: 0 4px 0 #030303, 0 5px 12px rgb(0 0 0 / .6);
  color: var(--ink); font: 600 1rem / 1.5rem var(--sans); text-align: center; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  /* Only the :active press animates (Keys.swift: easeOut 0.07 s). */
  transition: transform 70ms cubic-bezier(0, 0, .58, 1), box-shadow 70ms cubic-bezier(0, 0, .58, 1);
}
.key:hover {
  background: var(--cap) padding-box,
    linear-gradient(rgb(255 255 255 / .14), rgb(255 255 255 / 0) 50%) border-box;
}
.key:active { transform: translateY(4px); box-shadow: 0 0 0 #030303, 0 1px 4px rgb(0 0 0 / .6); }
.key:focus-visible { outline-offset: 3px; border-radius: 10px; }

/* Download block: on touch screens with JS the label and note switch to "Send link to your Mac"
   in CSS, so nothing shifts when share.js runs. Without JS the DMG link stays as it is.
   share.js adds .no-share if Web Share is missing, or .share-on if (scripting) is unsupported. */
.dl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.for-share { display: none; }
@media (pointer: coarse) and (scripting: enabled) {
  html:not(.no-share) .for-share { display: inline; }
  html:not(.no-share) .for-mac { display: none; }
}
html.share-on .for-share { display: inline; }   /* browsers without the scripting media feature */
html.share-on .for-mac { display: none; }

/* ---------- Hero ---------- */
.hero { padding-top: 24px; }
.hero h1 { font-size: 2.25rem; line-height: 2.5rem; letter-spacing: -.01em; }
.lead { font-size: 1.125rem; line-height: 1.6875rem; }
.hero .lead { margin-top: 16px; max-width: 36em; }
.hero .dl { margin-top: 32px; }
.hero__ios { margin-top: 12px; }
.hero__scene { width: 100%; margin: 48px auto 0; }
/* The photo melts into the page instead of sitting in a box. */
.hero__img {
  display: block; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 88%, transparent);
  mask-composite: intersect;
}

/* ---------- Sections ---------- */
.sec { margin-top: var(--sec); }
.sec h2 { font-size: 1.5rem; line-height: 1.875rem; letter-spacing: -.01em; }
.sec__body { margin-top: 24px; max-width: 34em; }
.sec__body > p + p { margin-top: 16px; }
.sec .lead { color: var(--ink); }
.sec .lead + p { margin-top: 16px; }
.more { margin-top: 24px; }

.terms { margin-top: 24px; }
.terms > div + div { margin-top: 24px; }

.shot { margin-top: 32px; }
.shot img { width: 100%; border-radius: 6.3% / 13.7%; }   /* screen corner = 13.7% of its height */
.shot figcaption { margin-top: 12px; }

.steps { padding-left: 1.4em; }
.steps li { padding-left: .1em; }
.steps li + li { margin-top: 12px; }
.steps li::marker { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sec .steps { margin-top: 24px; max-width: 34em; }
.sec .dl { margin-top: 32px; }

.reqs { margin-top: 48px; }
.reqs h3, .doc h3 { font-size: 1.125rem; line-height: 1.6875rem; }
.list { padding-left: 1.2em; }
.list li + li { margin-top: 12px; }
.list li::marker { color: var(--ink-2); }
.reqs .list { margin-top: 12px; }

/* ---------- Footer ---------- */
.foot { margin-top: 72px; padding-bottom: 48px; }
.foot ul { display: flex; flex-wrap: wrap; gap: 0 24px; list-style: none; margin: 4px 0 0; padding: 0; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Long-form pages: /support, /privacy, 404 ---------- */
.doc { padding-top: 48px; }
.doc__col { max-width: 34em; }
.doc h1 { font-size: 2.25rem; line-height: 2.5rem; letter-spacing: -.01em; }
.doc__meta, .doc h1 + p { margin-top: 32px; }
.doc h2 { margin: 48px 0 12px; font-size: 1.3125rem; line-height: 1.75rem; letter-spacing: -.005em; }
.doc p + p, .doc ul + p, .doc ol + p { margin-top: 16px; }
.doc__meta + p { margin-top: 48px; }

.doc details + details { margin-top: 8px; }
.doc summary {
  display: block; min-height: 44px; padding: 8px 0;
  color: var(--ink); font-weight: 600; cursor: pointer; list-style: none;
}
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after {
  content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 0 3px 12px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(-45deg);
  transition: transform 150ms cubic-bezier(0, 0, .58, 1);
}
.doc details[open] > summary::after { transform: rotate(45deg); }
.doc details > p { margin: 0 0 8px; padding-top: 8px; }

/* ---------- 600 px and up ---------- */
@media (min-width: 600px) {
  :root { --sec: 120px; }
  .hero { padding-top: 48px; }
  .hero h1 { font-size: 3rem; line-height: 3.25rem; letter-spacing: -.012em; }
  .lead { font-size: 1.3125rem; line-height: 1.875rem; }
  .hero__scene { width: min(640px, 100% - 2 * var(--m)); }
  .sec h2 { font-size: 2.25rem; line-height: 2.625rem; }
  .shot { margin-top: 48px; }
  .reqs h3, .doc h3 { font-size: 1.3125rem; line-height: 1.75rem; }
  .doc { padding-top: 72px; }
  .doc h1 { font-size: 3rem; line-height: 3.25rem; letter-spacing: -.012em; }
  .doc h2 { font-size: 1.5rem; line-height: 1.875rem; }
}

/* ---------- Below 600 px: full-width keycap ---------- */
@media (max-width: 599.98px) {
  .dl { flex-direction: column; align-items: stretch; }
  .key { width: 100%; }
}

/* ---------- 1100 px and up: 12-column grid, side-by-side scene ---------- */
@media (min-width: 1100px) {
  .hero { padding-top: 24px; }
  .hero h1 { font-size: 3.75rem; line-height: 4rem; letter-spacing: -.016em; }
  .hero__scene { margin-top: 32px; width: min(1200px, 100% - 2 * var(--m) + 80px); }
  .grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 32px; align-items: start; }
  .c-1-5 { grid-column: 1 / 6; }
  .c-7-12 { grid-column: 7 / 13; }
  .c-1-7 { grid-column: 1 / 8; }
  .c-1-8 { grid-column: 1 / 9; }
  .c-2-11 { grid-column: 2 / 12; }
  .c-9-12 { grid-column: 9 / 13; }
  .grid > .sec__body.c-7-12 { margin-top: 0; }
  .reqs { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .key, .doc summary::after { transition: none; }
}
