/* Mainstreak — mainstreak.app
   Static stylesheet. No frameworks, no JavaScript. */

/* ------------------------------------------------------------------ reset */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body { margin: 0; }

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }

ul { padding: 0; }

a { color: inherit; }

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

:root {
  --paper:   #fbfaf7;
  --panel:   #f4f2ec;
  --ink:     #15161a;
  --ink-2:   #4b4d56;
  --ink-3:   #7d8089;
  --rule:    #e1ded6;
  --accent:  #a04a26;

  --max:     1080px;
  --gutter:  clamp(1.25rem, 5vw, 3.5rem);
  --measure: 63ch;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #101114;
    --panel:  #17181c;
    --ink:    #ecebe7;
    --ink-2:  #a9aab0;
    --ink-3:  #7c7f87;
    --rule:   #2a2c32;
    --accent: #d9814f;
  }
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.62;
  letter-spacing: -0.006em;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 0.6rem;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.85rem;
  border-radius: 2px;
  font-size: 0.8125rem;
}

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

/* ------------------------------------------------------------------ links */

.prose a,
.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.19em;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 120ms ease, color 120ms ease;
}
.prose a:hover,
.link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ----------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  flex-wrap: wrap;
  padding: 1.4rem 0 1.2rem;
  border-bottom: 1px solid var(--rule);
}

.topbar__mark {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.005em;
}
@media (max-width: 560px) {
  .nav { gap: 1.1rem; }
}
.nav a {
  color: var(--ink-2);
  text-decoration: none;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--ink); }

/* --------------------------------------------------------------- masthead */

.masthead {
  padding: clamp(3.5rem, 11vw, 7.5rem) 0 0;
}

.wordmark {
  font-size: clamp(2.9rem, 11.5vw, 5.4rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.038em;
}

.lede {
  margin-top: clamp(1.4rem, 3vw, 2rem);
  max-width: 24ch;
  font-size: clamp(1.2rem, 3.1vw, 1.7rem);
  line-height: 1.32;
  letter-spacing: -0.018em;
  font-weight: 400;
  color: var(--ink);
  text-wrap: balance;
}

.meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  margin-top: clamp(2.75rem, 7vw, 4.5rem);
  padding: 0.85rem 0 0.95rem;
  border-top: 1px solid var(--rule);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* --------------------------------------------------------------- sections */

.section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem 3rem;
  padding: clamp(3rem, 8vw, 5.5rem) 0;
  border-top: 1px solid var(--rule);
}

@media (min-width: 760px) {
  .section { grid-template-columns: 10rem minmax(0, 1fr); }
}

.label {
  margin: 0;
  padding-top: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.6rem;
  background: var(--accent);
  vertical-align: 0.08em;
}

.prose {
  max-width: var(--measure);
}
.prose > * + * { margin-top: 1.15em; }
.prose h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.008em;
}

.muted { color: var(--ink-2); }

/* ------------------------------------------------------------------- apps */

.apps {
  list-style: none;
  margin: 1.9rem 0 0;
  border-top: 1px solid var(--rule);
}

.app {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 0.35rem 1.15rem;
  align-items: start;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule);
}

.app__icon {
  grid-row: span 2;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.85rem;
  border: 1px solid var(--rule);
  background: var(--panel);
}

.app__name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app__desc {
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.5;
  max-width: 48ch;
}

.app__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-top: 0.45rem;
  font-size: 0.8125rem;
}

.app--empty {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem 1.25rem;
  color: var(--ink-2);
}

.app--empty .app__name {
  font-weight: 500;
  color: var(--ink-2);
}

.tag {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.3rem 0.55rem;
  white-space: nowrap;
}

.note {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--ink-3);
  max-width: 52ch;
}

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

.dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 2rem;
  margin: 0;
}
@media (min-width: 560px) {
  .dl { grid-template-columns: 7rem minmax(0, 1fr); }
}

.dl dt {
  padding-top: 0.32rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.dl dd {
  margin: 0 0 1.35rem;
}
.dl dd:last-of-type { margin-bottom: 0; }

address {
  font-style: normal;
  line-height: 1.5;
}

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

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  padding: 1.9rem 0 3.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ------------------------------------------------------------ legal pages */

.legal {
  max-width: 68ch;
  padding: clamp(2.75rem, 7vw, 4.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  counter-reset: sec;
}

.legal__title {
  font-size: clamp(1.85rem, 5.5vw, 2.6rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.028em;
}

.legal__dates {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.legal__intro {
  margin-top: 2rem;
  color: var(--ink-2);
}

.legal h2 {
  counter-increment: sec;
  counter-reset: sub;
  margin: 2.9rem 0 0.7rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.legal h2::before {
  content: counter(sec) ".";
  margin-right: 0.55rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.legal h3 {
  counter-increment: sub;
  margin: 1.75rem 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--ink-2);
}
.legal h3::before {
  content: counter(sec) "." counter(sub);
  margin-right: 0.55rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.legal p { margin-top: 0.85rem; }

.legal ul {
  margin-top: 0.85rem;
  padding-left: 1.15rem;
  list-style: none;
}
.legal li { position: relative; margin-top: 0.4rem; }
.legal li::before {
  content: "";
  position: absolute;
  left: -1.15rem;
  top: 0.72em;
  width: 5px;
  height: 1px;
  background: var(--ink-3);
}

.legal strong { font-weight: 600; }

/* Plain document pages (support): the measure and rhythm of the legal pages
   without the section numbering. Must follow the .legal rules to override. */
.legal--plain h2::before,
.legal--plain h3::before {
  content: none;
  margin-right: 0;
}
.legal--plain h3 { color: var(--ink); }

/* ------------------------------------------------------------------ print */

@media print {
  :root {
    --paper: #fff;
    --ink: #000;
    --ink-2: #333;
    --ink-3: #555;
    --rule: #ccc;
    --accent: #000;
  }
  .topbar, .footer__links, .skip { display: none; }
  body { font-size: 10.5pt; }
  .legal { max-width: none; }
  .legal h2, .legal h3 { break-after: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
