/* Righteous, shared with the Scroll pages. */
@import url("/scroll/assets/css/custom-fonts.css");

:root {
  color-scheme: light dark;
  --bg: #f4f5f8;
  --lift: rgba(255, 255, 255, 0.85);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.2 0 0 0 -.45'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.1'/%3E%3C/svg%3E");
  --stripe: rgba(20, 30, 60, 0.025);
  --ink: #15161a;
  --muted: #5d606a;
  --line: rgba(20, 22, 30, 0.12);
  --menubar: rgba(250, 251, 253, 0.72);
  --select: #0b7a70;
  --wash: 0.09;
  --glow: 0.12;
  --pane-text: #33353c;
  --font: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d11;
    --lift: rgba(255, 255, 255, 0.045);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1.2 0 0 0 -.45'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
    --stripe: rgba(255, 255, 255, 0.022);
    --ink: #f3f4f6;
    --muted: #a3a6ae;
    --line: rgba(255, 255, 255, 0.12);
    --menubar: rgba(22, 23, 28, 0.68);
    --wash: 0.11;
    --glow: 0.12;
    --pane-text: #d6d8de;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 3.5rem; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  /* Fine film grain, with a soft lift in tone at the top of the page. */
  background-image:
    var(--grain),
    radial-gradient(90rem 50rem at 50% -8rem, var(--lift), transparent);
  background-size: 240px 240px, auto;
  background-repeat: repeat, no-repeat;
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
img { display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid var(--select); outline-offset: 3px; }

.page {
  width: min(100% - 2rem, 76rem);
  margin-inline: auto;
}

/* Menu bar */
.menubar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 2.125rem;
  padding-inline: 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--menubar);
  -webkit-backdrop-filter: saturate(1.8) blur(18px);
  backdrop-filter: saturate(1.8) blur(18px);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.wordmark { font-family: "Righteous", var(--font); font-size: 0.9375rem; font-weight: 400; }

.links {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a:hover { color: var(--select); }

main { padding-top: clamp(2.5rem, 4.5vw, 4rem); }

/* Inset to line up with the icons in the panes below. */
.intro {
  margin-bottom: 3rem;
  padding-inline: 1.5rem;
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  line-height: 1.3;
  text-wrap: balance;
}

/* Snapped pairs of app windows */
.snap {
  display: flex;
  gap: 0.375rem;
  min-height: 13rem;
  /* Wide enough that the soft edges of neighbouring rows stay apart. */
  margin-bottom: 3rem;
}

.pane {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-width: 0;
}

/* Soft-edged colour: a faint wash of the app's tint, blurred so it melts into the page. */
.pane::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -0.75rem;
  background: var(--tint);
  opacity: var(--wash);
  filter: blur(22px);
  pointer-events: none;
}

/* The app's own icon, blown up and blurred, gives each pane its wallpaper. */
.glow {
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  object-fit: cover;
  filter: blur(46px) saturate(1.5);
  opacity: var(--glow);
  pointer-events: none;
}

.body {
  display: grid;
  flex: 1;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 1rem;
  align-content: center;
  padding: 2rem 1.75rem;
}

.icon {
  grid-row: 1 / span 2;
  align-self: center;
  width: 6.5rem;
  height: 6.5rem;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.32));
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Only where hovering is real: on touch screens a tap would leave the icon stuck large. */
@media (hover: hover) {
  .pane:hover .icon { transform: scale(1.1); }
}

.body h2 {
  margin-bottom: 0.3rem;
  font-size: clamp(1.625rem, 2.4vw, 2.125rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.012em;
}

/* Capped to keep lines a comfortable length. */
.body p { max-width: 22.5rem; color: var(--pane-text); }

/* Three on a line: icon beside the name, description below. */
@media (min-width: 981px) {
  .trio .body { align-content: start; padding: 1.75rem 1.5rem; }
  .trio .icon { grid-row: 1; }
  .trio .body h2 { align-self: center; margin-bottom: 0; }
  .trio .body p { grid-column: 1 / -1; max-width: 20.5rem; margin-top: 0.75rem; font-size: 1rem; }
}

/* Posts: a Finder-style list window */
.posts { margin-bottom: clamp(3rem, 7vw, 5rem); }

/* Read by screen readers and search engines, but not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.post-list { margin: 0; padding: 0; list-style: none; }
.post-list li:nth-child(odd) .post { background: var(--stripe); }

.post {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 0.625rem;
}

.post img {
  width: 3.25rem;
  height: 3.25rem;
  filter: grayscale(1);
  opacity: 0.85;
}

.post h3 {
  margin-bottom: 0.15rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.3;
}

.post p { max-width: 70ch; color: var(--muted); font-size: 0.9375rem; line-height: 1.45; }

/* Selected row */
.post-list li .post:hover { background: var(--select); color: #fff; }
.post:hover p { color: rgba(255, 255, 255, 0.9); }
.post:hover img { filter: none; opacity: 1; }

/* Footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 0 2.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 980px) {
  .snap { flex-direction: column; min-height: 0; }
  .pane { flex: none; }
  .intro { padding-inline: 1.75rem; }
  .body p { max-width: none; }
}

@media (max-width: 560px) {
  .intro { padding-inline: 1.25rem; }
  .body { column-gap: 0.875rem; padding: 1.125rem 1.25rem 1.375rem; }
  .icon { grid-row: 1; width: 4.5rem; height: 4.5rem; }
  .body h2 { align-self: center; margin-bottom: 0; }
  .body p { grid-column: 1 / -1; margin-top: 0.625rem; }
  .menubar { padding-inline: 0.75rem; }
  .links { gap: 0.75rem; }
  .post { grid-template-columns: 2.5rem minmax(0, 1fr); gap: 0.875rem; align-items: start; padding-inline: 0.75rem; }
  .post img { width: 2.5rem; height: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .pane:hover .icon { transform: none; }
}
