/* boyfarmer.cc — one screen: the name on the bottom edge, the rides on the map behind it */

/* Schibsted Grotesk, variable weight, SIL Open Font License (fonts/OFL.txt) */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #e2e2e2;
  --surface: #d6d6d6;
  --ink: #7d0c14;
  --muted: #7a4a4e;
  --accent: #7d0c14;
  --accent-ink: #e2e2e2;

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);

  --margin: clamp(1.25rem, 2.2vw, 2rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
  --t-reveal: 800ms;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--step-body); line-height: 1.5;
  font-kerning: normal; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}
h1, h2, p { margin: 0; }
svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
h1 { font-weight: inherit; hyphens: none; }
p { text-wrap: pretty; }
.small { font-size: var(--step-small); line-height: 1.45; }
.lead { font-size: var(--step-lead); line-height: 1.3; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0 1.1rem;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
}
.button:active { transform: scale(0.97); }
.link { font-weight: 600; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration-color: currentColor; }
  .button:hover { background: #5e080f; }
}

/* ---------- the screen ---------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden; background: var(--bg);
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto;
}
.hero__map { position: absolute; inset: 0; }
.hero__map svg { width: 100%; height: 100%; }

.top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem var(--margin); }
.top__mark { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; text-decoration: none; }
.top__mark svg { width: 28px; height: 28px; }
.top__links { display: flex; align-items: center; gap: 1.4rem; }
.top__links .link, .top__links .button { display: none; }

.ride {
  position: relative; z-index: 2; grid-row: 2; grid-column: 1; justify-self: end; align-self: start;
  margin: 0.25rem var(--margin) 0; width: min(300px, calc(100% - 2 * var(--margin)));
  padding: 0.8rem 0.9rem 0.9rem; background: var(--bg); text-align: right;
}
.ride__name { font-weight: 600; line-height: 1.15; }
.ride__figs { margin-top: 0.2rem; }
.ride__blurb { margin-top: 0.1rem; }
.ride__profile { width: 100%; height: 56px; margin-top: 0.7rem; }
.ride__profile path { fill: var(--ink); }
.ride__hint { margin-top: 0.5rem; color: var(--muted); }
.only-fine { display: none; }
@media (hover: hover) and (pointer: fine) { .only-fine { display: inline; } }

.hero__foot { position: relative; z-index: 2; grid-row: 3; padding: 1.5rem var(--margin) 1.4rem; }
.hero__row { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: 0.9rem; }
.hero__say { max-width: 34ch; background: var(--bg); padding: 0.5rem 0.7rem 0.5rem 0; }
.hero__act { flex: none; display: flex; align-items: center; gap: 1.4rem; }
.name {
  display: inline-block; width: 100%; max-width: none; white-space: nowrap;
  font-weight: 800; letter-spacing: -0.05em; line-height: 0.88;
  font-size: 15.5vw; margin-left: -0.03em; color: var(--ink); text-decoration: none;
  pointer-events: none;
}
.name__b { display: inline; }

/* ---------- map drawing ---------- */
.map .forest { fill: url(#forest); }
.map .city { fill: url(#streets); }
.map .ring { fill: none; stroke: var(--muted); stroke-width: 2.2; opacity: 0.55; }
.map .lake { fill: var(--surface); }
.map .river { fill: none; stroke: var(--surface); stroke-width: 24; stroke-linecap: round; stroke-linejoin: round; }
.map .river--small { stroke-width: 8; }
.map .road { fill: none; stroke: var(--muted); stroke-width: 2.4; opacity: 0.45; stroke-linecap: round; stroke-linejoin: round; }
.map .road--main { stroke-width: 3.4; opacity: 0.55; }
.map .road--minor { stroke-width: 1.5; opacity: 0.35; }
.map .cycleway { fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-dasharray: 7 5; opacity: 0.65; stroke-linecap: round; }
.map .route { fill: none; stroke: var(--ink); stroke-width: 3; opacity: 0.26; stroke-linecap: round; stroke-linejoin: round; }
.map .route.is-active { opacity: 1; stroke-width: 5.5; }
.map .route.is-hot { opacity: 0.7; }
.map .hit { fill: none; stroke: transparent; stroke-width: 24; pointer-events: stroke; cursor: pointer; }
.map .label { font-family: var(--font); font-size: 16px; font-weight: 600; fill: var(--muted); }
.map .label--city { font-size: 20px; font-weight: 800; fill: var(--ink); }
.map .home { fill: var(--ink); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(18px); animation: ad-rise var(--t-reveal) var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
  .js .name { transform: translateY(108%); animation: ad-line 1100ms var(--ease-out) forwards; animation-delay: 220ms; }
  .map .route { transition: opacity 1.6s ease, stroke-width 1.6s ease; }
}
@keyframes ad-rise { to { opacity: 1; transform: none; } }
@keyframes ad-line { to { transform: none; } }

/* ---------- tablet and below: the action in the top bar ---------- */
@media (max-width: 60em) {
  .top__links .link { display: inline; }
  .top__links .button { display: inline-flex; min-height: 2.5rem; }
  .hero__act .button { display: none; }
}

/* ---------- phone: its own composition ---------- */
@media (max-width: 40em) {
  .ride { justify-self: start; text-align: left; width: min(250px, calc(100% - 2 * var(--margin))); padding: 0.6rem 0.7rem 0.6rem; }
  .ride__blurb, .ride__hint { display: none; }
  .ride__profile { height: 36px; margin-top: 0.5rem; }
  .hero__row { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .hero__say { padding-right: 0.5rem; }
  .hero__act { display: none; }
  .name { font-size: 20vw; }
  .name__b { display: block; text-align: right; }
}
