/* Strai site.
   The homepage is only its hero, in one of two layouts:
   - flow (the default; phones, tablets, touch, and no JavaScript): the overview and every product are
     full-height panels stacked down the page over a background that stays pinned behind them.
   - hover (wide screens with a mouse, see the media query near the end): the hero is a single screen
     that does not scroll, and the product menu swaps which panel is shown.
   Index, Services and Contact are pages of their own (body.subpage): a title over a quiet band of
   the same line art, the content, and a footer.
   Going from one page to another, the background stays where it is and only the copy changes: see
   "moving between pages" near the end. */

/* ---------- typefaces ----------
   Served from this site, not from a font host: no third-party request, and the files can be preloaded
   (see the <head> of each page). Latin only. Geist is one variable file covering both weights. */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("assets/fonts/geist-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/instrument-serif-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/instrument-serif-italic-latin.woff2") format("woff2");
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light dark;
  --paper: #f0e8d8;
  --ink: #1b1712;
  --ink-soft: rgb(27 23 18 / 0.68);
  --ink-quiet: rgb(27 23 18 / 0.62);
  --rule: rgb(27 23 18 / 0.14);
  --bar: rgb(240 232 216 / 0.82);
  --accent: #5b3fd6;
  --tile: rgb(255 255 255 / 0.85);
  --tile-edge: rgb(27 23 18 / 0.08);
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(20px, 4.4vw, 64px);
  --nav-h: 64px;
  --menu-h: 132px;
}
.scene-contenter { --accent: #d4521a; }
.scene-mytaste { --accent: #c82e6c; }
.scene-journal { --accent: #0e8a6e; }
.scene-ruverse { --accent: #3457d8; }

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15120e;
    --ink: #f1eadc;
    --ink-soft: rgb(241 234 220 / 0.7);
    --ink-quiet: rgb(241 234 220 / 0.5);
    --rule: rgb(241 234 220 / 0.16);
    --bar: rgb(21 18 14 / 0.8);
    --accent: #a996ff;
    --tile: rgb(255 255 255 / 0.07);
    --tile-edge: rgb(255 255 255 / 0.14);
  }
  .scene-contenter { --accent: #ff9a66; }
  .scene-mytaste { --accent: #ff7fb0; }
  .scene-journal { --accent: #4fd8b8; }
  .scene-ruverse { --accent: #86a6ff; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
em { font-style: italic; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--paper); }
main:focus { outline: none; }
/* Read out, not shown: what a logotype says, and that a link opens a new tab. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* First stop for the keyboard: jump past the top bar. Out of sight until it has focus. */
.skip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 30;
  padding: 0.6em 1em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  background: var(--bar);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.875rem;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.nav-links { display: flex; gap: clamp(14px, 2.5vw, 36px); }
.nav-links a {
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 10px 0;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }

/* ---------- hero: flow layout ---------- */
.stage { position: relative; margin-top: calc(-1 * var(--nav-h)); }
.field {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  margin-bottom: -100vh;
  margin-bottom: -100lvh;
  pointer-events: none;
}
.field-canvas { display: block; width: 100%; height: 100%; }
.hero-zone { position: relative; z-index: 1; }

.panel {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 16px) var(--gutter) 56px;
}
.panel-overview {
  min-height: calc(100vh - var(--menu-h));
  min-height: calc(100svh - var(--menu-h));
  padding-bottom: 8px;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 11.4vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.display-line { display: block; }
/* A product whose name is set as its own logotype. Sized in em, so it follows the headline size in
   every layout. */
.logotype { display: block; width: auto; margin-inline: auto; fill: currentColor; overflow: visible; }
.display-logo { margin-bottom: 0.14em; }
.logotype-ruverse { height: 0.74em; }
.logotype-mytaste { height: 1.5em; }
.accent { color: var(--accent); }
.lede {
  max-width: 40rem;
  margin-top: 1.6rem;
  font-size: clamp(1.03rem, 1.32vw, 1.19rem);
  line-height: 1.55;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.logo-tile {
  width: 64px;
  height: 64px;
  margin-bottom: 1.4rem;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--tile);
  border: 1px solid var(--tile-edge);
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent) 38%, transparent);
}
.logo-tile-letter { font-family: var(--serif); font-size: 2.15rem; line-height: 1; color: var(--accent); }
.pitch {
  margin-top: 0.85rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.55rem, 3.05vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: var(--accent);
  text-wrap: balance;
}
.desc { max-width: 34rem; margin-top: 1.3rem; color: var(--ink-soft); text-wrap: pretty; }
.cta {
  margin-top: 1.6rem;
  padding: 0.55em 0 0.3em;
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.cta:hover { border-bottom-color: currentColor; }

.product-menu {
  min-height: var(--menu-h);
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: baseline;
  justify-content: center;
  gap: 2px 22px;
  padding: 0 var(--gutter) 28px;
}
.product-menu a {
  padding: 10px 4px;
  font-size: 1.06rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.8;
  transition: opacity 0.25s;
}
.product-menu a:hover, .product-menu a:focus-visible { opacity: 1; }
.product-menu.has-active a { opacity: 0.38; }
.product-menu.has-active a.is-active { opacity: 1; }

/* ---------- pages: Index, Services, Contact ---------- */
.page-head {
  position: relative;
  margin-top: calc(-1 * var(--nav-h));
  min-height: clamp(360px, 60vh, 580px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 36px) var(--gutter) 48px;
}
.page-head > * { position: relative; }
.page-head > .page-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 45%, transparent 96%);
}
/* The canvas is as large as the homepage's (a full screen), so the grid sits in exactly the same
   place on every page and stays put when one page gives way to another. Only the part behind the
   page's header shows. */
.page-field .field-canvas { height: 100vh; height: 100lvh; }
.page-title {
  max-width: 14ch;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.7rem, 7.4vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.page-title-long { max-width: 18ch; font-size: clamp(2.4rem, 5.6vw, 4.5rem); }
.page-title em { color: var(--accent); }
.page-head .button { margin-top: 2.2rem; }
.person + .button { margin-top: 1.8rem; }
.page-body { max-width: calc(1120px + 2 * var(--gutter)); margin: 0 auto; padding: clamp(8px, 2vw, 28px) var(--gutter) clamp(72px, 10vw, 136px); }
/* Contact: who reads the inbox. A small round portrait beside the name and the address, set like a
   signature between the lede and the button. */
.person { display: flex; align-items: center; gap: 18px; margin-top: 2.2rem; text-align: left; }
.person-photo {
  flex: none;
  width: 77px;
  height: 77px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--tile);
  box-shadow: 0 0 0 1px var(--rule);
}
.person-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.person-name { font-family: var(--serif); font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.005em; }
.person-role {
  margin-left: 6px;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
.contact-address { margin-top: 2px; font-size: 0.94rem; color: var(--ink-soft); }

/* Lists set as ruled rows: the Index, the phases on Services, and the lists beside a section's title. */
.rows > li { padding: 22px 0; border-top: 1px solid var(--rule); }
.rows > li:last-child { border-bottom: 1px solid var(--rule); }
.rows h2, .index-name { font-family: var(--serif); font-weight: 400; font-size: 1.9rem; line-height: 1.1; letter-spacing: -0.01em; }
.rows h3, .kinds a { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.005em; }
.step-num { font-size: 0.78rem; letter-spacing: 0.09em; color: var(--ink-quiet); }
.label, .index-kind {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-quiet);
}
/* Quiet text links: a hairline under the words that firms up on hover. */
.index-links, .row-links { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 0.94rem; }
.index-links a, .row-links a, .contact-address a, .more {
  padding: 4px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s;
}
.index-links a:hover, .row-links a:hover, .contact-address a:hover, .more:hover { border-bottom-color: currentColor; }
.more { font-size: 0.94rem; font-weight: 500; }

/* Index: a product per row. */
.index-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.index-line { color: var(--ink-soft); }

/* Services: a phase per row. Its number and name, what happens, and what comes out of it. */
.phase { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.phase-text { color: var(--ink-soft); text-wrap: pretty; }
.phase-gets { margin-top: 10px; }
.ticks li { position: relative; padding-left: 1.3em; color: var(--ink-soft); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 0.65em; height: 1px; background: var(--accent); }

/* A section of a page: its title and a note on one side, a list of rows on the other. */
.section { margin-top: clamp(72px, 9vw, 128px); scroll-margin-top: calc(var(--nav-h) + 16px); }
.page-body > .section:first-child { margin-top: clamp(28px, 5vw, 72px); }
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.section-note { max-width: 30rem; margin-top: 0.9rem; color: var(--ink-soft); text-wrap: pretty; }
.section-more { margin-top: 1.2rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.kinds > li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; padding: 14px 0; }
.kind { color: var(--ink-soft); }
.kinds a { text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.kinds a:hover { border-bottom-color: currentColor; }
.topics > li, .points > li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 24px; }
.topics p, .points p { color: var(--ink-soft); }
.topics .row-links { margin-top: 8px; }
.points > li { grid-template-columns: 2.6rem minmax(0, 1fr); align-items: baseline; }
.points p { grid-column: 2; }

.page-cta { margin-top: clamp(80px, 10vw, 136px); display: flex; flex-direction: column; align-items: center; text-align: center; }
.page-cta .button { margin-top: 1.8rem; }

.eyebrow { margin-bottom: 18px; font-size: 0.78rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-quiet); }
.button {
  display: inline-block;
  padding: 0.85em 1.7em;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.97rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.button:hover { background: var(--ink); color: var(--paper); }

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: 86px;
  padding: 20px var(--gutter);
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--ink-quiet);
}
.foot-links { display: flex; flex-wrap: wrap; gap: 2px 22px; }
.foot-links a { padding: 8px 0; text-decoration: none; color: var(--ink-soft); transition: color 0.2s; }
.foot-links a:hover, .foot-links a[aria-current="page"] { color: var(--ink); }

@media (min-width: 720px) {
  .index-row { grid-template-columns: minmax(170px, 0.8fr) minmax(0, 2fr) minmax(200px, 0.9fr); gap: 8px 32px; align-items: baseline; }
  .index-links { justify-content: flex-end; }
  .rows > .phase { grid-template-columns: 2.4rem minmax(120px, 0.62fr) minmax(0, 1.5fr) minmax(220px, 1.05fr); gap: 8px 32px; align-items: baseline; padding: 30px 0; }
  .phase-gets { margin-top: 0; }
  .topics > li { grid-template-columns: minmax(0, 1fr) auto; }
  .topics .row-links { grid-column: 2; grid-row: 1 / span 2; align-self: center; justify-content: flex-end; margin-top: 0; }
}
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); gap: 64px; align-items: start; }
}

/* ---------- hero: hover layout ----------
   Keep this query in step with hoverQuery in main.js. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .js, .subpage { --nav-h: 104px; }
  .js .nav, .subpage .nav {
    position: absolute;
    inset: 0 0 auto;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .js .display { font-size: clamp(3.6rem, 6.9vw, 6.5rem); }
  /* Exactly one screen: on a wide screen with a mouse the homepage does not scroll. */
  .js .stage { margin-top: 0; height: 100vh; height: 100svh; min-height: 540px; overflow: hidden; }
  .js .field { position: absolute; inset: 0; height: auto; margin: 0; }
  .js .hero-zone {
    position: absolute;
    inset: var(--nav-h) 0 0;
    width: min(1160px, 100% - 2 * var(--gutter));
    margin-inline: auto;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .js .panel {
    grid-area: 1 / 1;
    min-height: 0;
    padding: 0 0 3vh;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.3s;
  }
  .js .panel.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0.12s, 0.12s, 0s;
  }
  .js .product-menu {
    grid-area: 2 / 1;
    min-height: 0;
    gap: 0 40px;
    padding: 0 0 clamp(34px, 7.2vh, 66px);
  }
  .subpage .page-head { margin-top: 0; }
  /* The homepage's canvas here is the whole window, scrollbar included (the homepage does not
     scroll), and at least 540px tall. */
  .page-field .field-canvas { width: 100vw; height: max(100vh, 540px); height: max(100svh, 540px); }
}

/* Short windows (small laptops): tighten the one-screen hero so it still fits without scrolling. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) and (max-height: 720px) {
  .js, .subpage { --nav-h: 80px; }
  .js .display { font-size: clamp(2.9rem, min(6.9vw, 12.4vh), 6.5rem); }
  .js .logo-tile { width: 52px; height: 52px; margin-bottom: 0.9rem; border-radius: 14px; }
  .js .logo-tile-letter { font-size: 1.8rem; }
  .js .pitch { margin-top: 0.6rem; font-size: clamp(1.5rem, min(3.05vw, 5.4vh), 2.75rem); }
  .js .lede, .js .desc { margin-top: 1rem; }
  .js .cta { margin-top: 0.9rem; }
  .js .product-menu { padding-bottom: clamp(22px, 5vh, 40px); }
}

/* ---------- moving between pages ----------
   The background is the same picture in the same place on every page (see .page-field and
   topo-field.js), so a page change only has to swap the copy:
   - where the browser can blend one page into the next (cross-document view transitions), the old
     page fades out over the new one and the grid, being identical in both, does not appear to move;
   - on every browser the new page's copy rises into place, one block after another.
   None of this runs with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }

  .panel-overview .display-line, .panel-overview .lede, .product-menu,
  .page-head > :not(.page-field), .page-body {
    /* Held back until the page before has mostly faded, so two headlines never sit on top of each
       other. `backwards` keeps a block hidden while it waits and lets go of it once it has arrived. */
    animation: arrive 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
    animation-delay: calc(120ms + var(--order, 0) * 55ms);
  }
  .panel-overview .display-line + .display-line, .page-head > :nth-child(3) { --order: 1; }
  .panel-overview .lede, .page-head > :nth-child(4) { --order: 2; }
  .page-head > :nth-child(5) { --order: 3; }
  .product-menu, .page-head > :nth-child(n + 6), .page-body { --order: 4; }
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(12px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .panel, .js .panel.is-active { transition: none; transform: none; }
}
