/* yfranko.com
   Concept: every app measures a distance between two points and helps close it.
   The palette encodes that axis - cool = far, amber = near. */

:root {
  /* ground */
  --ground:   #0C2E3D;
  --ground-2: #0A2532;
  --panel:    #123A4C;
  --panel-2:  #16465A;
  --rule:     #1F5670;

  /* ink */
  --chalk:    #E9F2F4;
  --mist:     #8FB2C0;
  --mist-dim: #5F8A99;

  /* the distance axis */
  --far:      #3E7E9C;
  --near:     #FFC145;
  --near-hot: #FFD37A;

  --radius:   14px;
  --measure:  68ch;

  --display: "Bricolage Grotesque", "Assistant", system-ui, sans-serif;
  --body:    "Assistant", system-ui, -apple-system, sans-serif;
  --mono:    "Space Mono", ui-monospace, "SFMono-Regular", monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

/* the bar is sticky - keep it off anchored targets */
:target,
.apps,
.about,
.rec { scroll-margin-top: 5.5rem; }

body {
  margin: 0;
  background-color: var(--ground);
  /* faint survey contours - the ground is a chart, not a void */
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(62,126,156,0.20), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 63px, rgba(31,86,112,0.16) 63px 64px),
    repeating-linear-gradient(90deg, transparent 0 63px, rgba(31,86,112,0.11) 63px 64px);
  background-attachment: fixed;
  color: var(--chalk);
  font-family: var(--body);
  font-size: clamp(16px, 0.55vw + 14.5px, 18px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

.he { font-family: var(--body); font-weight: 700; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--near); color: #10222b; padding: 0.7rem 1.1rem;
  font-family: var(--mono); font-size: 0.8rem; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--near);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─────────────────────────────  instrument bar  ───────────────────────────── */

.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  background: rgba(12,46,61,0.78);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid rgba(31,86,112,0.7);
}

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none;
}
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__plate { fill: var(--panel-2); stroke: var(--rule); stroke-width: 1; }
.brand__span  { stroke: var(--far); stroke-width: 2; }
.brand__a     { fill: var(--far); }
.brand__b     { fill: var(--near); }
.brand:hover .brand__span { stroke: var(--near); transition: stroke 0.3s var(--ease); }

.brand__name {
  font-family: var(--mono); font-weight: 700;
  font-size: 0.95rem; letter-spacing: 0.02em;
}

.bar__nav { display: flex; gap: 1.4rem; }
.bar__nav a {
  font-family: var(--mono); font-size: 0.78rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--mist); text-decoration: none;
  transition: color 0.2s var(--ease);
}
.bar__nav a:hover { color: var(--near); }

/* ──────────────────────────────────  intro  ────────────────────────────────── */

.eyebrow {
  margin: 0 0 1.2rem;
  font-family: var(--mono); font-size: 0.76rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--far);
}
.eyebrow::before {
  content: ""; display: inline-block;
  width: 26px; height: 1px; margin-right: 0.7rem; vertical-align: 0.3em;
  background: var(--far);
}

.intro {
  margin-bottom: clamp(2.25rem, 5vw, 3.25rem);
}

.intro__title {
  margin: 0 0 1.1rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.1rem, 4.4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.intro__lede {
  margin: 0;
  max-width: 54ch;
  font-size: 1.05rem;
  color: var(--mist);
}

/* ───────────────────────────────────  apps  ─────────────────────────────────── */

.apps {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 5vw, 3rem) 0;
}

.section-h {
  margin: 0 0 2rem;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.rec {
  padding: clamp(1.4rem, 3.5vw, 2.4rem);
  margin-bottom: clamp(1rem, 2vw, 1.4rem);
  background: linear-gradient(180deg, rgba(18,58,76,0.9), rgba(10,37,50,0.9));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.rec:hover { border-color: var(--far); }

.rec__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: clamp(0.9rem, 2.5vw, 1.4rem);
  margin-bottom: 1.4rem;
}

.rec__icon {
  width: 72px; height: 72px;
  border-radius: 18px;
  border: 1px solid rgba(233,242,244,0.12);
  flex: none;
}

.rec__id { min-width: 0; }

.rec__kind {
  margin: 0 0 0.35rem;
  font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--far);
}

.rec__name {
  margin: 0 0 0.3rem;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.rec__name .he { font-size: 1.05em; }
.rec__name-sub {
  font-family: var(--body); font-weight: 400;
  font-size: 0.72em; color: var(--mist);
  letter-spacing: 0;
}

.rec__cat {
  margin: 0;
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--mist);
}
.rec__cat .he { font-weight: 400; }

.rec__rating {
  margin: 0; text-align: right; white-space: nowrap;
  font-family: var(--mono); font-size: 1rem; font-weight: 700;
  color: var(--chalk);
}
.rec__rating .star { color: var(--near); }
.rec__rating-n {
  display: block;
  font-size: 0.68rem; font-weight: 400; color: var(--mist);
}
.rec__rating--new {
  font-size: 0.68rem; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--far);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}

.rec__copy {
  margin: 0 0 1.1rem;
  max-width: var(--measure);
  color: var(--chalk);
}

/* the meter - a small distance readout, calibrated per app */
.meter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(0.6rem, 1.6vw, 1.1rem);
  padding: 1.15rem 1.25rem 1.5rem;
  margin: 1.6rem 0;
  background: rgba(10,37,50,0.6);
  border: 1px solid rgba(31,86,112,0.55);
  border-radius: 10px;
}

.meter__end {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--mist); line-height: 1.35;
  max-width: 14ch;
  text-wrap: balance;
}
.meter__end--b { text-align: right; }

.meter__track {
  position: relative; height: 2px;
  background: repeating-linear-gradient(90deg, var(--rule) 0 5px, transparent 5px 10px);
}
.meter__fill {
  position: absolute; inset: 0 auto 0 0; width: 0;
  background: linear-gradient(90deg, var(--far), var(--near));
  transition: width 1.6s var(--ease) 0.15s;
}
.meter__dot {
  position: absolute; top: 50%; left: 0;
  width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--far);
  transition: left 1.6s var(--ease) 0.15s, background-color 1.6s var(--ease) 0.15s,
              box-shadow 1.6s var(--ease) 0.15s;
}
.meter.is-closed .meter__dot {
  background: var(--near);
  box-shadow: 0 0 0 4px rgba(255,193,69,0.16), 0 0 16px rgba(255,193,69,0.45);
}

.meter__readout {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 0.15rem;
  font-family: var(--mono); font-size: 0.82rem; font-weight: 700;
  color: var(--mist);
  transition: color 1.6s var(--ease) 0.15s;
}
.meter.is-closed .meter__readout { color: var(--near); }

/* links */
.rec__links {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  list-style: none; margin: 0; padding: 0;
}

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--panel-2);
  font-family: var(--mono); font-size: 0.78rem;
  text-decoration: none; color: var(--chalk);
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease),
              color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  border-color: var(--near);
  color: var(--near);
}
.btn__glyph { width: 15px; height: 15px; fill: currentColor; flex: none; }
/* the globe is drawn in strokes, not fills - CSS would otherwise
   override its fill="none" and collapse it into a solid dot */
.btn__glyph--globe { fill: none; stroke: currentColor; }

.btn--web {
  background: transparent;
  color: var(--mist);
}
.btn--web:hover { color: var(--near); }

.btn--play {
  background: var(--near);
  border-color: var(--near);
  color: #10222b;
  font-weight: 700;
}
.btn--play:hover {
  background: var(--near-hot);
  border-color: var(--near-hot);
  color: #10222b;
}

/* ───────────────────────────────────  about  ────────────────────────────────── */

.about {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.25rem, 5vw, 3rem);
}

.about__grid { max-width: var(--measure); }

.about__lead {
  margin: 0 0 1.2rem;
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.about__body {
  margin: 0 0 1.1rem;
  color: var(--mist);
}
.about__body a { color: var(--near); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ───────────────────────────────────  foot  ─────────────────────────────────── */

.foot {
  border-top: 1px solid var(--rule);
  padding: 2.5rem clamp(1.25rem, 5vw, 3rem);
  max-width: 1080px;
  margin: 0 auto;
}

.foot__mark {
  margin: 0 0 1rem;
  font-family: var(--mono); font-weight: 700;
  color: var(--mist);
}

.foot__nav {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  margin-bottom: 1.5rem;
}
.foot__nav a {
  font-size: 0.9rem; color: var(--mist);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.foot__nav a:hover { color: var(--near); }

.foot__meta {
  margin: 0;
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--mist);
}
.foot__meta a { color: var(--mist); }
.foot__meta a:hover { color: var(--near); }

/* ────────────────────────────────  responsive  ──────────────────────────────── */

@media (max-width: 720px) {
  .rec__head {
    grid-template-columns: auto 1fr;
    row-gap: 0.8rem;
  }
  .rec__rating {
    grid-column: 2;
    text-align: left;
    justify-self: start;
  }
  .rec__rating--new { display: inline-block; }
  .rec__icon { width: 56px; height: 56px; border-radius: 14px; }

  /* The rail needs the full width on a narrow screen, so the two ends sit
     above it as a pair. Placed explicitly - auto-placement drops the rail
     between the labels. */
  .meter {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 1rem;
    padding: 1.1rem;
  }
  .meter__end     { grid-row: 1; grid-column: 1; max-width: none; }
  .meter__end--b  { grid-row: 1; grid-column: 2; text-align: right; }
  .meter__track   { grid-row: 2; grid-column: 1 / -1; margin: 0.8rem 0 0.3rem; }
  .meter__readout { grid-row: 3; grid-column: 1 / -1; justify-self: start; }

  .btn { padding: 0.55rem 0.85rem; font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
