/* Sito: the runnersofrome.com homepage in the look of the app (Notturna, 18/11/2026),
   on the shared base (ror.css, prefix ap-). The intent is at the top of
   templates/sito_home.html. The pieces are the base's: the melted logo
   (ap-mark), the keys (ap-key, ap-key--lead), the plates (ap-plate), the section title,
   the figures (ap-fig) and the serif titles (ap-run-title). This file only holds the
   layout: the page column, the row of three small keys and the inside of a rule's
   plate. Prefix sito-.
   Load order: ror.css, then this file (app_base.html, block page_css). Out of the
   design lab since 20/11/2026 (#70). */

/* Page: one centred column, as wide as the base's wide page (44rem); 16px gutters on a
   phone like every page of the app, 32px from 720px. */
.sito-page {
  max-width: calc(44rem + 32px);
  margin: 0 auto;
  padding: 0 16px 96px;
}

/* Top: the melted logo as wide as its column, the access pages' 30rem; Join events on
   its own under it; the other three apart, as a row of small grey keys (10/11/2026,
   after a runner asked whether "Instagram" was the way to sign up). */
.sito-top {
  max-width: 30rem;
  margin: 0 auto;
  padding: 24px 0 64px;
}

/* The icons the sprite has not got (runner, shirt, Instagram) are drawn like its own:
   20x20 line icons in the ink of their key. */
.sito-top svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sito-dot {
  fill: currentColor;
}

/* Join events: the base's lead key as it is, the label on the left and the arrow on
   the right. Its own icon sits beside the label. */
.sito-lead {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* The other three: one row of grey keys, the icon over a one-word name. */
.sito-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.sito-tile {
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-height: 80px;
  padding: 12px 4px;
  color: var(--ap-ink-2);
  font-size: 0.75rem;
}

.sito-tile:hover {
  color: var(--ap-ink);
}

.sito-tile svg {
  width: 22px;
  height: 22px;
}

/* Rules: each one an ap-plate (the base spaces them 16px apart), its number in a
   recessed well like the check-ins on the home. */
.sito-rule {
  display: grid;
  /* The spacer rows take what the well leaves over, so the text sits centred on its
     number with or without a second sentence. */
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-rows: 1fr auto auto 1fr;
  grid-template-areas:
    "n ."
    "n text"
    "n more"
    "n .";
  column-gap: 16px;
}

/* The number, an ap-fig in a well; proportional figures, so a lone 1 sits centred. */
.sito-rule__n {
  grid-area: n;
  display: grid;
  place-items: center;
  height: 56px;
  background: var(--ap-well);
  box-shadow: var(--ap-well-shadow);
  font-size: 32px;
  line-height: 1;
}

/* The rule: an ap-run-title, the serif in capitals, a size down from a run's so eight
   of them read as a list. */
.sito-rule__text {
  grid-area: text;
  font-size: clamp(1.5rem, 6.4vw, 1.75rem);
  text-wrap: balance;
}

.sito-rule__more {
  grid-area: more;
  margin-top: 6px;
  color: var(--ap-ink-2);
  font-size: 1rem;
  line-height: 1.45;
}

/* A link inside a rule: the rule's own face, underlined like an ap-textlink. */
.sito-rule a {
  color: var(--ap-ink);
  text-decoration: underline 1px var(--ap-underline);
  text-underline-offset: 0.16em;
}

.sito-rule a:hover {
  text-decoration-color: currentColor;
}

/* The last rule is the club's own line, set like the runner's name on the home: the
   serif in italic capitals, big. */
.sito-rule--last .sito-rule__text {
  font-size: clamp(2.75rem, 13vw, 4.5rem);
  font-style: italic;
  line-height: 0.9;
}

@media (prefers-reduced-motion: no-preference) {
  .sito-rule a {
    transition: text-decoration-color 0.15s ease;
  }
}

@media (min-width: 720px) {
  .sito-page {
    padding-inline: 32px;
    max-width: calc(44rem + 64px);
  }

  .sito-top {
    padding: 56px 0 88px;
  }

  .sito-rule {
    grid-template-columns: 80px minmax(0, 1fr);
    column-gap: 28px;
  }

  .sito-rule__n {
    height: 80px;
    font-size: 48px;
  }

  .sito-rule__text {
    font-size: 2.25rem;
  }

  .sito-rule__more {
    margin-top: 8px;
    font-size: 1.0625rem;
  }
}

/* Background: rows of "Runners of Rome" behind everything, very faint, the copies
   alternating white and orange like the run titles' tape on the home. All run left,
   each at its own pace; each row starts at another point of its loop (--i), so the
   copies do not line up. The whole set is turned 15 degrees; 52 rows of 20 copies
   cover a tall desktop screen; the track is two identical halves of 10, so -50% loops
   without a seam.
   Reduce Motion: they stand still. */
.sito-bg {
  position: fixed;
  inset: -25vmax; /* larger than the screen, so the turned rows still cover it */
  z-index: 0;
  display: grid;
  align-content: start;
  gap: 0.12em;
  overflow: hidden;
  opacity: 0.045;
  transform: rotate(-15deg); /* the rows climb to the right (18/11/2026) */
  pointer-events: none;
  user-select: none;
}

.sito-bg__row {
  font-style: italic; /* ap-run-title's font shorthand resets it, as .hm-tape does */
  white-space: nowrap;
  font-size: clamp(1.75rem, 7vw, 2.25rem);
}

.sito-bg__track {
  display: inline-flex;
  width: max-content;
}

.sito-bg__track span::after {
  content: "\a0";
}

.sito-bg__track span:nth-child(even) {
  color: var(--ap-accent);
}

.sito-page {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .sito-bg__track {
    animation: sito-bg 90s linear infinite;
    animation-delay: calc(var(--i, 1) * -13s);
  }

  /* Every row its own pace, between 50 and 149 s a loop, scrambled by row. */
  @supports (width: mod(3px, 2px)) {
    .sito-bg__track {
      animation-duration: calc(50s + mod(var(--i, 1) * 37, 100) * 1s);
    }
  }

  @supports not (width: mod(3px, 2px)) {
    .sito-bg__row:nth-child(even) .sito-bg__track {
      animation-duration: 110s;
    }
  }
}

@keyframes sito-bg {
  to {
    transform: translateX(-50%);
  }
}

/* Over the moving rows the keys' and plates' drop shadows read as black edges: on this
   page they go (Stefano, 18/11/2026), the tones alone set the surfaces apart. With
   "more contrast" the base's light edges stay. */
@media not (prefers-contrast: more) {
  .sito-page {
    --ap-key-shadow: none;
    --ap-relief: none;
    --ap-well-shadow: none;
  }
}

/* Foot: the privacy link (20/11/2026, #70), quiet, left on the column like the rules'
   title, a thumb's height. */
.sito-foot {
  margin-top: 40px;
}

.sito-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
