/* mattipolonen.com — theme stylesheet v2
   Typefaces are self-hosted WOFF2 (SIL Open Font License, see fonts/).
   No runtime font requests, no third-party resources. */

/* ------------------------------------------------------------- typefaces */

@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/bebas-neue-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}

/* ---------------------------------------------------------------- tokens */

:root {
  --f-display: 'Bebas Neue', 'Arial Narrow', ui-sans-serif, sans-serif;
  --f-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', 'Roboto Mono', Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: clamp(1.1rem, 0.95rem + 0.5vw, 1.28rem);
  --step-2: clamp(1.35rem, 1.05rem + 1.3vw, 1.9rem);
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3.1rem);
  --step-4: clamp(3.2rem, 1.6rem + 7.4vw, 7rem);

  --wrap: 70rem;
  --gutter: clamp(1.25rem, 4vw, 3.25rem);
  --band-pad: clamp(4.25rem, 9vw, 8rem);
}

html[data-theme='dark'] {
  --bg: #14181C;
  --bg-alt: #1B2025;
  --fg: #E2E5E7;
  --fg-muted: #9AA3AA;
  --line: rgba(226, 229, 231, 0.13);
  --line-strong: rgba(226, 229, 231, 0.3);
  --accent: #6FA6DE;
  --topbar: rgba(20, 24, 28, 0.9);
  color-scheme: dark;
}

html[data-theme='light'] {
  --bg: #EFEBE4;
  --bg-alt: #E4DFD6;
  --fg: #191C1F;
  --fg-muted: #585F66;
  --line: rgba(25, 28, 31, 0.15);
  --line-strong: rgba(25, 28, 31, 0.32);
  --accent: #1D5794;
  --topbar: rgba(239, 235, 228, 0.92);
  color-scheme: light;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--fg); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--bg);
  color: var(--fg);
  padding: 0.75rem 1rem;
  border: 1px solid var(--line-strong);
}
.skip:focus { left: 0; }

/* --------------------------------------------------------------- top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: 82rem;
  margin-inline: auto;
  padding: 0.55rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar__id { text-decoration: none; color: var(--fg); display: grid; line-height: 1.15; margin-right: auto; }
.topbar__name { font-family: var(--f-display); text-transform: uppercase; font-size: 1.2rem; letter-spacing: 0.04em; }
.topbar__role {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.nav__list { list-style: none; display: flex; gap: 0.95rem; }
.nav__list a {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.115em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.35rem 0;
  display: inline-block;
  border-bottom: 1px solid transparent;
}
.nav__list a:hover,
.nav__list a[aria-current='true'] { color: var(--fg); border-bottom-color: var(--accent); }

/* Mobile section navigation: native disclosure, no script required. */
.mobnav { display: none; position: relative; }
.mobnav__button {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border: 1px solid var(--line-strong);
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
}
.mobnav__button::-webkit-details-marker { display: none; }
.mobnav__button::after { content: '+'; color: var(--accent); font-size: 0.95rem; line-height: 1; }
.mobnav[open] .mobnav__button::after { content: '–'; }
.mobnav[open] .mobnav__button { color: var(--fg); border-color: var(--accent); }
.mobnav__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 14rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  padding: 0.35rem 0;
  list-style: none;
  z-index: 60;
}
.mobnav__panel a {
  display: block;
  padding: 0.7rem 1rem;
  min-height: 44px;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
}
.mobnav__panel a:hover { background: var(--bg-alt); color: var(--accent); }

@media (max-width: 1160px) {
  .nav { display: none; }
  .mobnav { display: block; }
}

/* The role line wraps to two lines below ~560px and doubles the bar height. */
@media (max-width: 560px) {
  .topbar__role { display: none; }
  .topbar__name { font-size: 1.35rem; }
}

.themetoggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--line-strong);
  padding: 0.5rem;
  width: 44px;
  height: 44px;
  cursor: pointer;
}
.themetoggle:hover { color: var(--fg); border-color: var(--accent); }
.themetoggle svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.themetoggle .icon--moon { display: none; }
html[data-theme='light'] .themetoggle .icon--sun { display: none; }
html[data-theme='light'] .themetoggle .icon--moon { display: block; }

/* ----------------------------------------------------------------- bands */

.band {
  --band-bg: var(--bg);
  background: var(--band-bg);
  padding-block: var(--band-pad);
  scroll-margin-top: 4.5rem;
  border-top: 1px solid var(--line);
}
.band--alt { --band-bg: var(--bg-alt); }
.band--hero { border-top: 0; padding-top: clamp(2.75rem, 6vw, 5rem); }

/* Signature device: a measured span, as annotated on an engineering drawing. */
.dimline {
  position: relative;
  height: 1px;
  background: var(--line-strong);
  margin-block: 1.5rem;
  transform-origin: left center;
}
.dimline::before,
.dimline::after {
  content: '';
  position: absolute;
  top: -5px;
  width: 2px;
  height: 11px;
  background: var(--accent);
}
.dimline::before { left: 0; }
.dimline::after { right: 0; }

.eyebrow {
  margin: 0 0 0.6rem;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.sechead { margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem); }
.sechead__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--step-3);
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 0.98;
  max-width: 22ch;
}
@media (min-width: 900px) {
  .sechead { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 2.5rem; }
  .sechead .eyebrow { margin-top: 0.5rem; }
}

/* ------------------------------------------------------------------ hero */

/* On a phone the portrait must be on the first screen, directly under the
   name and role — not pushed below three paragraphs of body copy. */
.hero {
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.5rem);
  align-items: start;
  grid-template-areas: 'id' 'portrait' 'copy';
}
.hero__id { grid-area: id; }
.portrait { grid-area: portrait; }
.hero__copy { grid-area: copy; }

@media (min-width: 880px) {
  .hero {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.82fr);
    grid-template-areas: 'id portrait' 'copy portrait';
    column-gap: clamp(2.5rem, 5vw, 4rem);
    row-gap: 0;
  }
}

.hero__name {
  font-family: var(--f-display);
  font-size: var(--step-4);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.86;
  letter-spacing: 0.005em;
  margin: 0.35rem 0 0.85rem;
}
.hero__role {
  font-family: var(--f-mono);
  font-size: clamp(0.86rem, 0.68rem + 0.8vw, 1.15rem);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.hero__lead { font-size: var(--step-2); line-height: 1.28; max-width: 22ch; font-weight: 300; }
.hero__body { max-width: 54ch; color: var(--fg-muted); }
.hero__meta {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  margin-top: 1.75rem;
}

.portrait { margin: 0; }
.portrait__img { width: 100%; border: 1px solid var(--line-strong); }
.portrait__cap {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 0.65rem;
}
.portrait__cap a { color: inherit; text-decoration-color: var(--line-strong); }
.portrait__cap a:hover { color: var(--accent); }

/* ---------------------------------------------------------- metric strip */

.metrics { margin-top: clamp(3rem, 7vw, 5.5rem); }
.metrics__lead {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.17em;
  margin: 0 0 1.5rem;
}
.metrics__lead .fig {
  font-family: var(--f-display);
  font-size: 1.55em;
  letter-spacing: 0.03em;
  color: var(--fg);
  vertical-align: -0.06em;
}

.metrics__grid { list-style: none; display: grid; }
@media (min-width: 620px) { .metrics__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .metrics__grid { grid-template-columns: repeat(4, 1fr); } }

.metric { border-top: 1px solid var(--line-strong); padding: 1.5rem 1.5rem 1.75rem 0; position: relative; }
.metric::before { content: ''; position: absolute; left: 0; top: -1px; width: 2px; height: 11px; background: var(--accent); }
.metric__figure {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.2rem + 2.1vw, 2.55rem);
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 0.98;
  margin: 0 0 0.6rem;
}
.metric__note { color: var(--fg-muted); font-size: 0.94rem; margin: 0; }
.metric__note .fig { color: var(--fg); font-weight: 600; }

/* ------------------------------------------------------------- footprint */

.footprint { margin-top: clamp(3rem, 6vw, 4.5rem); }
.footprint__grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
@media (min-width: 620px) { .footprint__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.footprint__title {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.footprint__col--dev .footprint__title { color: var(--fg-muted); }

.footprint__list { list-style: none; border-top: 1px solid var(--line-strong); }
.footprint__col--dev .footprint__list { border-top-color: var(--line); }
.footprint__list li {
  font-family: var(--f-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.55rem 0 0.55rem 1.1rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.footprint__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 7px;
  height: 1px;
  background: var(--accent);
}
.footprint__col--dev .footprint__list li { color: var(--fg-muted); font-size: 1.25rem; }
.footprint__col--dev .footprint__list li::before { background: var(--line-strong); }

/* ---------------------------------------------------------- capabilities */

.cols { display: grid; gap: clamp(2.25rem, 4vw, 3.25rem); }
@media (min-width: 800px) { .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.entry { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.entry__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--step-2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.85rem;
}
.entry__lead { max-width: 50ch; }
.entry__body { color: var(--fg-muted); max-width: 50ch; }
.entry__seq { font-family: var(--f-mono); font-size: var(--step--1); color: var(--accent); line-height: 1.9; margin-bottom: 1rem; }

/* ------------------------------------------------------ selected delivery */

.case { margin-bottom: clamp(3.5rem, 7vw, 6rem); }
.case:last-child { margin-bottom: 0; }
.case__head { border-top: 2px solid var(--line-strong); padding-top: 1.1rem; margin-bottom: 1.6rem; }
.case__index {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.85rem;
}
.case__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--step-3);
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 0.96;
}
.case__where {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0.7rem 0 0;
}
.case__body { max-width: 64ch; }
.case__body p { color: var(--fg-muted); }
.case__body .case__lead { color: var(--fg); font-size: var(--step-1); }
.case__sub { font-weight: 600; margin-top: 1.75rem; }

@media (min-width: 900px) {
  .case__split { display: grid; grid-template-columns: minmax(0, 1fr) 14rem; gap: 3rem; align-items: start; }
}

.figures { list-style: none; display: grid; gap: 1.35rem; }
@media (min-width: 480px) and (max-width: 899px) { .figures { grid-template-columns: repeat(3, 1fr); } }
.figures li { border-top: 1px solid var(--line-strong); padding-top: 0.75rem; position: relative; }
.figures li::before { content: ''; position: absolute; left: 0; top: -1px; width: 2px; height: 9px; background: var(--accent); }
.figures b {
  display: block;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 0.95;
}
.figures span {
  display: block;
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 0.4rem;
}

.taglist {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  color: var(--fg-muted);
  line-height: 1.9;
  margin-top: 1.5rem;
  max-width: 64ch;
}
.taglist__label {
  display: block;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.17em;
  font-size: 0.66rem;
  margin-bottom: 0.25rem;
}

/* route span — the dimension line applied to a physical link */
.route { margin-top: 2rem; }
.route__line { position: relative; height: 1px; background: var(--line-strong); margin: 1.9rem 0 0.9rem; transform-origin: left center; }
.route__line::before, .route__line::after { content: ''; position: absolute; top: -7px; width: 2px; height: 15px; background: var(--accent); }
.route__line::before { left: 0; }
.route__line::after { right: 0; }
.route__node { position: absolute; top: -4px; width: 1px; height: 9px; background: var(--line-strong); }
.route__node--a { left: 28%; }
.route__node--b { left: 52%; }
.route__node--c { left: 74%; }
.route__ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--f-display);
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.route__span {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-align: center;
}

/* delivery chain — one continuous process, both rows read left to right */
.chain__intro { font-weight: 600; margin-top: 2rem; }
.chain { list-style: none; counter-reset: step; display: grid; margin: 1.25rem 0 2.25rem; column-gap: 1.25rem; }
@media (min-width: 620px) { .chain { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .chain { grid-template-columns: repeat(4, 1fr); } }

.chain__step {
  counter-increment: step;
  position: relative;
  border-top: 1px solid var(--line-strong);
  padding: 2.35rem 0.75rem 1.4rem 0;
  font-size: 0.95rem;
  line-height: 1.35;
}
.chain__step::before { content: ''; position: absolute; left: 0; top: -1px; width: 2px; height: 11px; background: var(--accent); }
.chain__step::after {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.95rem;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.envlist { list-style: none; margin-top: 1rem; max-width: 38rem; }
.envlist__item { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.envlist__who { font-family: var(--f-display); font-size: 1.3rem; text-transform: uppercase; letter-spacing: 0.03em; }
.envlist__where { font-family: var(--f-mono); font-size: var(--step--1); color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.14em; }

/* ------------------------------------------------------------- experience */

.rail { display: none; }
@media (min-width: 900px) {
  .rail { display: block; margin-bottom: clamp(3rem, 5vw, 4.5rem); }
  .rail__scale { position: relative; height: 1.4rem; }
  .rail__year {
    position: absolute;
    font-family: var(--f-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: var(--fg-muted);
    transform: translateX(-50%);
  }
  .rail__year--start { left: 0; transform: none; }
  .rail__year--end { right: 0; transform: none; }
  .rail__year--y2004 { left: 24.14%; }
  .rail__year--y2015 { left: 62.07%; }
  .rail__axis { position: relative; height: 1px; background: var(--line-strong); transform-origin: left center; }
  .rail__axis::before, .rail__axis::after { content: ''; position: absolute; top: -6px; width: 2px; height: 13px; background: var(--accent); }
  .rail__axis::before { left: 0; }
  .rail__axis::after { right: 0; }
  .rail__lanes { margin-top: 0.9rem; }
  .rail__bar {
    position: relative;
    height: 2.3rem;
    margin-left: var(--from);
    width: calc(var(--to) - var(--from));
    border-left: 2px solid var(--accent);
    padding-left: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }
  .rail__bar::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
  .rail__label {
    font-family: var(--f-display);
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    background: var(--band-bg);
    padding-right: 0.5rem;
  }
  .rail__span {
    font-family: var(--f-mono);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    color: var(--fg-muted);
    position: relative;
    z-index: 1;
    background: var(--band-bg);
    padding-inline: 0.4rem;
    white-space: nowrap;
  }
  .rail__bar--sonera { --from: 0%; --to: 17.24%; }
  .rail__bar--palmionet { --from: 24.14%; --to: 100%; }
  .rail__bar--altiax { --from: 62.07%; --to: 75.86%; }
  .rail__bar--ecotelligent { --from: 68.97%; --to: 100%; }
}

.role { border-top: 1px solid var(--line); padding-top: 1.4rem; margin-bottom: clamp(2.25rem, 4vw, 3.25rem); }
.role__head { margin-bottom: 1rem; }
.role__org { font-family: var(--f-display); font-weight: 400; font-size: var(--step-2); text-transform: uppercase; letter-spacing: 0.02em; }
.role__meta { font-family: var(--f-mono); font-size: var(--step--1); color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.14em; margin: 0.5rem 0 0; }
.role p { color: var(--fg-muted); max-width: 64ch; }

.subsec { margin-top: clamp(2.75rem, 5vw, 4rem); }
.subsec__title {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.85rem;
}

.subsec__intro { max-width: 62ch; margin-bottom: 1.75rem; }

.ledger { list-style: none; border-top: 1px solid var(--line-strong); }
.ledger__row { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.ledger__what { display: grid; gap: 0.2rem; }
.ledger__name { font-family: var(--f-display); font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.1; }
.ledger__sub { font-size: 0.9rem; color: var(--fg-muted); }
.ledger__when { font-family: var(--f-mono); font-size: var(--step--1); color: var(--fg-muted); white-space: nowrap; letter-spacing: 0.1em; }

/* ---------------------------------------------------------------- method */

/* Deliberately unlike the technical components elsewhere: a numbered sequence
   with room to breathe, no ticks, no boxes. This is the human section. */
.method { list-style: none; counter-reset: principle; max-width: 54rem; }
.method__item {
  counter-increment: principle;
  padding-block: clamp(2rem, 4vw, 3.25rem);
}
.method__item + .method__item { border-top: 1px solid var(--line); }

.method__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--step-2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.02;
  margin-bottom: 0.85rem;
}
.method__item::before {
  content: counter(principle, decimal-leading-zero);
  display: block;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--fg-muted);
  margin-bottom: 0.8rem;
}
.method__note { color: var(--fg-muted); margin: 0 0 1rem; max-width: 56ch; }
.method__note:last-of-type { margin-bottom: 0; }
.method__line {
  font-family: var(--f-display);
  font-size: clamp(1.4rem, 1.05rem + 1.5vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 1.6rem 0 0;
}
.method__line + .method__line { margin-top: 0.3rem; color: var(--fg-muted); }

/* The counter pseudo-element becomes the first grid cell at wider widths,
   so the numbers form their own quiet column beside the text. */
@media (min-width: 860px) {
  .method__item { display: grid; grid-template-columns: 4rem minmax(0, 1fr); column-gap: 2.5rem; }
  .method__item::before { grid-column: 1; grid-row: 1; margin-bottom: 0; padding-top: 0.45rem; }
  .method__title, .method__note, .method__line { grid-column: 2; }
}

/* ---------------------------------------------------------- opportunities */

.prose { max-width: 60ch; }

/* Two ways the same experience can be engaged, given equal visual weight. */
/* Two alternatives, not two columns of a table — hence no dividing rule
   between them. Each carries its own short rule instead. */
.tracks { list-style: none; display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
@media (min-width: 620px) { .tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.track { max-width: 34ch; }
.track__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--step-2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
}
.track__title::after {
  content: '';
  display: block;
  width: 3.5rem;
  height: 1px;
  background: var(--line-strong);
  margin: 0.8rem 0 1rem;
}
.track__note { color: var(--fg-muted); margin: 0; }
/* A lead paragraph, not a second headline: it must not compete with the
   section title above it. */
.prose__lead {
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.45rem);
  font-weight: 300;
  line-height: 1.5;
  max-width: 44rem;
}
.prose__body { color: var(--fg-muted); }
.prose__meta {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 2rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------- contact */

.band--contact { padding-block: clamp(5.5rem, 11vw, 10rem); }
.contact__head {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: var(--step-3);
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 0.98;
  max-width: 20ch;
  margin-bottom: clamp(2.25rem, 4vw, 3.25rem);
}
.contact { max-width: 46rem; }
.contact__lead { font-size: var(--step-1); max-width: 50ch; margin-bottom: 2.25rem; }
.contact__name { font-family: var(--f-display); font-size: var(--step-2); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.5rem; }
.contact__mail { margin-bottom: 1.5rem; }
.maillink { font-family: var(--f-mono); font-size: clamp(1rem, 0.85rem + 0.75vw, 1.35rem); letter-spacing: 0.01em; text-decoration-color: var(--accent); }
.contact__meta { font-family: var(--f-mono); font-size: var(--step--1); color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.14em; }

/* ---------------------------------------------------------- back to top */

/* Hidden without scripting: it is a convenience control, and the page keeps a
   working anchor to the top regardless. */
.totop { display: none; }
html.js .totop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: calc(clamp(1rem, 3vw, 2rem) + env(safe-area-inset-bottom, 0px));
  width: 44px;
  height: 44px;
  z-index: 60;
  color: var(--fg-muted);
  background: var(--topbar);
  border: 1px solid var(--line-strong);
  backdrop-filter: saturate(140%) blur(10px);
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
html.js .totop.is-visible { opacity: 1; visibility: visible; transform: none; }
.totop:hover { color: var(--fg); border-color: var(--accent); }
.totop svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#profile:focus { outline: none; }

@media (prefers-reduced-motion: reduce) { html.js .totop { transition: none; } }

/* ---------------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--line); padding-block: 2.75rem; background: var(--bg); }
.footer__inner { display: grid; gap: 0.35rem; }
.footer__line { font-family: var(--f-mono); font-size: var(--step--1); color: var(--fg-muted); margin: 0; letter-spacing: 0.1em; }
.footer__line--muted { opacity: 0.72; }

/* ----------------------------------------------------------------- motion */

/* Only the measured rules animate. Text never depends on script to be
   visible, so a blocked or failed main.js costs at most a drawn line. */
html.js .dimline,
html.js .rail__axis,
html.js .route__line { transform: scaleX(0); }
html.js .dimline.in,
html.js .rail__axis.in,
html.js .route__line.in { transform: scaleX(1); transition: transform 0.7s cubic-bezier(0.22, 0.7, 0.3, 1); }

@media (prefers-reduced-motion: reduce) {
  html.js .dimline, html.js .rail__axis, html.js .route__line { transform: none; }
  html.js .dimline.in, html.js .rail__axis.in, html.js .route__line.in { transition: none; }
  html { scroll-behavior: auto; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

@media print {
  .topbar, .themetoggle, .mobnav, .totop { display: none; }
  body { background: #fff; color: #000; }
}
