﻿/* Leroy Fun — leroyfun.com
   One page, no build step, no dependencies, no JavaScript. */

/* ---------------------------------------------------------------- tokens */
:root {
  --paper:      #f7f5f0;
  --paper-card: #fffdf9;
  --ink:        #17160f;
  --ink-soft:   #4a473c;
  --ink-mute:   #86816f;
  --rule:       rgba(23, 22, 15, .13);
  --dot:        rgba(23, 22, 15, .07);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14140f;
    --paper-card: #1d1c16;
    --ink:        #f2efe6;
    --ink-soft:   #c3bfb2;
    --ink-mute:   #857f70;
    --rule:       rgba(242, 239, 230, .14);
    --dot:        rgba(242, 239, 230, .06);
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2.5rem, 9vw, 6rem) clamp(1.15rem, 5vw, 2rem) 4rem;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem; top: 1rem;
  z-index: 10;
  padding: .55rem .9rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  text-decoration: none;
}

/* -------------------------------------------------------------- masthead */
.masthead { margin-bottom: clamp(2.5rem, 7vw, 4.25rem); }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: clamp(1.75rem, 6vw, 3rem);
}
.wordmark__dot {
  width: .5rem; height: .5rem;
  border-radius: 50%;
  background: currentColor;
  animation: blink 4.5s ease-in-out infinite;
}
@keyframes blink {
  0%, 88%, 100% { opacity: .9; }
  92%           { opacity: .15; }
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 10vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.022em;
  margin: 0 0 1.1rem;
}

.lede {
  margin: 0;
  max-width: 30rem;
  font-size: 1.06rem;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------------- index */
.index {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.row { border-bottom: 1px solid var(--rule); }

/* --a is the accent as actually painted. Each row sets --accent inline for the
   light palette; dark mode lifts it so it still reads against near-black. */
.row__link { --a: var(--accent); }
@media (prefers-color-scheme: dark) {
  .row__link { --a: color-mix(in srgb, var(--accent) 55%, #fff); }
}

.row__link {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: clamp(.9rem, 3vw, 1.25rem);
  padding: 1.35rem .3rem 1.4rem;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  border-radius: 12px;
  transition: background-color .22s ease, padding-left .22s ease;
}

/* the chip — a small tile of the project's own colour */
.chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  margin-top: .1rem;
  border-radius: 11px;
  background: color-mix(in srgb, var(--a) 13%, var(--paper-card));
  color: var(--a);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a) 24%, transparent);
  transition: transform .28s cubic-bezier(.2,.8,.3,1), background-color .22s ease;
}

.ico {
  width: 1.45rem;
  height: 1.45rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico use { color: inherit; }

/* the row's own text */
.row__body { min-width: 0; flex: 1 1 auto; }

.row__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem .65rem;
}

.num {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--ink-mute);
  transition: color .22s ease;
}

.name {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 3.6vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -.012em;
}

.tag {
  font-family: var(--mono);
  font-size: .63rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .12rem .48rem .16rem;
  white-space: nowrap;
  transition: color .22s ease, border-color .22s ease;
}

.blurb {
  display: block;
  margin-top: .3rem;
  max-width: 34rem;
  font-size: .95rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.arrow {
  position: relative;   /* keep it crisp above the watermark */
  z-index: 1;
  flex: none;
  align-self: center;
  font-size: 1.05rem;
  color: var(--ink-mute);
  opacity: .45;
  transition: transform .28s cubic-bezier(.2,.8,.3,1), opacity .22s ease, color .22s ease;
}

/* the oversized watermark that swims in on hover */
.ghost {
  position: absolute;
  right: -2.4rem;
  top: 50%;
  width: 10rem;
  height: 10rem;
  color: var(--a);      /* the sprite's filled dots read currentColor */
  fill: none;
  stroke: currentColor;
  stroke-width: .5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  transform: translate(1.5rem, -50%) rotate(-8deg);
  transition: opacity .32s ease, transform .45s cubic-bezier(.2,.8,.3,1);
}

/* ----- hover / focus ----- */
@media (hover: hover) {
  .row__link:hover {
    background: color-mix(in srgb, var(--a) 6%, var(--paper-card));
    padding-left: .85rem;
  }
  .row__link:hover .chip  { transform: scale(1.08) rotate(-4deg); background: color-mix(in srgb, var(--a) 20%, var(--paper-card)); }
  .row__link:hover .arrow { transform: translateX(.3rem); opacity: 1; color: var(--a); }
  .row__link:hover .num,
  .row__link:hover .tag   { color: var(--a); }
  .row__link:hover .tag   { border-color: color-mix(in srgb, var(--a) 40%, transparent); }
  .row__link:hover .ghost { opacity: .16; transform: translate(0, -50%) rotate(-8deg); }
}

.row__link:focus-visible {
  outline: 2px solid var(--a);
  outline-offset: 2px;
  background: color-mix(in srgb, var(--a) 6%, var(--paper-card));
}

/* ----- the one that isn't ready yet ----- */
.is-soon .row__link { cursor: default; }
.is-soon .name      { color: var(--ink-soft); }
.is-soon .chip      { opacity: .62; }
.is-soon .arrow     { opacity: .3; }
.is-soon .tag {
  border-style: dashed;
  color: var(--a);
  border-color: color-mix(in srgb, var(--a) 40%, transparent);
}

/* ---------------------------------------------------------------- footer */
.foot {
  margin-top: clamp(2.75rem, 8vw, 4.5rem);
  font-size: .9rem;
  color: var(--ink-soft);
}
.foot p { margin: 0 0 .9rem; max-width: 32rem; }

.foot__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.foot__meta a { color: inherit; }

/* --------------------------------------------------------------- narrow */
@media (max-width: 30rem) {
  body { font-size: 16px; }
  .row__link { gap: .8rem; padding: 1.15rem .15rem 1.2rem; }
  .chip { width: 2.35rem; height: 2.35rem; border-radius: 9px; }
  .ico  { width: 1.3rem; height: 1.3rem; }
  .arrow { display: none; }
  .ghost { display: none; }
  /* keep the number tied to its title and let long titles wrap in place,
     instead of the title jumping to its own line and orphaning the number */
  .row__head { gap: .35rem .5rem; }
  .name { flex: 1 1 0; min-width: 0; }
  .tag  { align-self: center; }
}

/* ------------------------------------------------------------ preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  body { background: #fff; color: #000; }
  .ghost, .chip { display: none; }
}
