/* design tokens shared with studies.laurentfintoni.com */

:root {
  --red: #E74C4C;
  --yellow: #FCD438;
  --paper: #e1dcd8;
  --ink: #222125;
  --border: 0.438rem solid black;
}

/* body */

body {
  margin: 0;
  font-family: 'Libre Baskerville', serif;
  background-color: var(--paper);
  color: var(--ink);
  overflow-x: clip;
}

a {
  color: var(--ink);
  text-decoration-color: var(--red);
  text-decoration-thickness: 0.125rem;
}

a:hover {
  color: var(--red);
}

/* the cover */

.cover {
  min-height: 100svh;
  display: flex;
  align-items: stretch;
  padding: 1rem 0;
}

.cover-frame {
  background-color: white;
  background-image: url('../img/laurent_fintoni.jpg');
  background-position: center 40%;
  background-repeat: no-repeat;
  background-size: cover;
  border: var(--border);
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  min-width: 0; /* flex item: allow shrinking below min-content on phones */
}

.issue-line {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.125rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  border-bottom: var(--border);
  background-color: rgba(255, 255, 255, 0.92);
  padding: 0.375rem 0.5rem 0.5rem;
  margin: -0.5rem -0.625rem 1rem;
}

.issue-red {
  color: var(--red);
}

.masthead {
  font-family: 'Alfa Slab One', serif;
  text-transform: uppercase;
  color: var(--red);
  text-shadow: 0.06em 0.06em 0 black;
  font-size: clamp(2.5rem, 11.5vw, 9.5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin: 0;
}

.tagline {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.125rem, 3.5vw, 2rem);
  letter-spacing: 0.06em;
  margin: 0.75rem 0 0;
  min-height: 1.5em;
  position: relative; /* anchor for the stacked .type spans */
  color: white;
  text-shadow: 0.05em 0.05em 0 black, -0.05em -0.05em 0 black, 0.05em -0.05em 0 black, -0.05em 0.05em 0 black;
}

/* typewriter (adapted from the 2023 draft) */

.type {
  overflow: hidden;
  white-space: nowrap;
  position: absolute; /* all phrases stack on the same spot, flush with the left edge */
  left: 0;
  top: 0;
  width: max-content;
  padding-right: 0.6ch; /* breathing room so the caret sits after the last letter, not on it */
  /* second animation: the span is only visible during its slot — the
     0.6ch padding means a collapsed span still shows a sliver of its
     first letter otherwise */
  animation-duration: 25s, 25s;
  animation-timing-function: steps(22, end), steps(1, end);
  animation-iteration-count: infinite;
}

.type-1 { animation-name: type1, slot1; }
.type-2 { animation-name: type2, slot2; color: var(--red); }
.type-3 { animation-name: type3, slot3; }
.type-4 { animation-name: type4, slot4; color: var(--red); }
.type-5 { animation-name: type5, slot5; }

/* each caret blinks (opacity) and shares its span's slot visibility */
.type::after {
  content: "|";
  position: absolute;
  right: 0;
  transform: translateY(-0.08em); /* lift the caret level with the caps; more negative = higher */
  animation-duration: 1s, 25s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.type-1::after { animation-name: caret, slot1; }
.type-2::after { animation-name: caret, slot2; }
.type-3::after { animation-name: caret, slot3; }
.type-4::after { animation-name: caret, slot4; }
.type-5::after { animation-name: caret, slot5; }

/* slot windows: with steps(1, end) each value holds until the next keyframe */
@keyframes slot1 {
  0% { visibility: visible; }
  20%, 100% { visibility: hidden; }
}

@keyframes slot2 {
  0% { visibility: hidden; }
  20% { visibility: visible; }
  40%, 100% { visibility: hidden; }
}

@keyframes slot3 {
  0%, 20% { visibility: hidden; }
  40% { visibility: visible; }
  60%, 100% { visibility: hidden; }
}

@keyframes slot4 {
  0%, 40% { visibility: hidden; }
  60% { visibility: visible; }
  80%, 100% { visibility: hidden; }
}

@keyframes slot5 {
  0%, 60% { visibility: hidden; }
  80%, 100% { visibility: visible; }
}

/* max-width (not width) animates the reveal, so the caret hugs the
   text end even though the targets overshoot the actual text length.
   Five phrases share a 25s cycle: each gets a 20% slot — type in over
   6%, hold to 17%, collapse by 20%. */
@keyframes type1 {
  0%, 100% { max-width: 0; }
  6%, 17% { max-width: 24ch; }
  20% { max-width: 0; }
}

@keyframes type2 {
  0%, 20%, 100% { max-width: 0; }
  26%, 37% { max-width: 24ch; }
  40% { max-width: 0; }
}

@keyframes type3 {
  0%, 40%, 100% { max-width: 0; }
  46%, 57% { max-width: 24ch; }
  60% { max-width: 0; }
}

@keyframes type4 {
  0%, 60%, 100% { max-width: 0; }
  66%, 77% { max-width: 24ch; }
  80% { max-width: 0; }
}

@keyframes type5 {
  0%, 80% { max-width: 0; }
  86%, 97% { max-width: 24ch; }
  100% { max-width: 0; }
}

@keyframes caret {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .type {
    animation: none;
    max-width: none;
    position: static;
    padding-right: 0;
  }
  .type::after {
    content: none;
  }
  .type:not(.type-1) {
    display: none;
  }
}

/* cover lines */

.coverlines {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.coverline {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.125rem, 2.6vw, 1.625rem);
  line-height: 1.3;
  text-decoration: none;
  border-top: 0.125rem solid black;
  padding-top: 0.625rem;
  color: white;
  text-shadow: 0.05em 0.05em 0 black, -0.05em -0.05em 0 black, 0.05em -0.05em 0 black, -0.05em 0.05em 0 black;
}

.coverline:hover {
  color: var(--yellow);
}

.coverline-kicker {
  background-color: black;
  color: white;
  padding: 0.063rem 0.5rem;
  margin-right: 0.375rem;
}

.coverline-kicker-yellow {
  background-color: var(--yellow);
  color: black;
}

.coverline-kicker, .coverline-kicker-yellow, .coverline-kicker-red {
  text-shadow: none;
}

.coverline-kicker-red {
  background-color: var(--red);
  color: white;
}

/* inside pages */

.section-pad {
  padding: 1rem 0;
}

.panel {
  background-color: white;
  border-top: var(--border);
  border-right: var(--border);
  padding: 1rem 1.25rem 1.5rem;
}

.section-head {
  font-family: 'Alfa Slab One', serif;
  text-transform: uppercase;
  font-size: clamp(2rem, 6vw, 3.25rem);
  letter-spacing: 0.125rem;
  margin: 0 0 1rem;
}

.head-red {
  color: var(--red);
}

/* bio */

.bio-open::first-letter {
  font-family: 'Alfa Slab One', serif;
  font-size: 4.25em;
  float: left;
  line-height: 0.85;
  padding-right: 0.15em;
  text-transform: uppercase;
  color: var(--red);
}

.bio-close {
  font-family: 'Glegoo', serif;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0;
}

/* things */

.things-kicker {
  font-family: 'Alfa Slab One', serif;
  color: var(--red);
  text-transform: uppercase;
  font-size: 2rem;
  letter-spacing: 0.063rem;
  margin: 0.5rem 0;
}

.thing {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.number {
  font-family: 'Alfa Slab One', serif;
  font-size: 2rem;
  line-height: 1;
}

.thing-title {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
}

.thing-text {
  font-family: 'Glegoo', serif;
  font-size: 1.125rem;
  margin: 0.25rem 0 0;
}

.emoji {
  font-size: 1.25rem;
}

.breaker {
  background-color: black;
  padding: 0.625rem;
  margin-top: 1.5rem;
}

.breaker-text {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--yellow);
  margin: 0;
  text-align: center;
}

.breaker-text a {
  color: white;
}

/* neolib */

.neolib-open {
  padding-top: 1rem;
}

.neolib-close {
  font-family: 'Glegoo', serif;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0;
}

.neolib-open::first-letter {
  font-family: 'Alfa Slab One', serif;
  font-size: 4.25em;
  float: left;
  line-height: 0.85;
  padding-right: 0.15em;
  text-transform: uppercase;
  color: var(--red);
}

.neolib-title {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
}

.neolib-text {
  margin: 0.25rem 0 0;
}

/* contact */

.contact-strip {
  background-color: black;
  border-right: 0.438rem solid var(--red);
  color: white;
  text-align: center;
  padding: 2rem 1.25rem;
}

.contact-head {
  font-family: 'Alfa Slab One', serif;
  text-transform: uppercase;
  color: var(--yellow);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  letter-spacing: 0.125rem;
  margin: 0 0 1rem;
}

.contact-mail {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.25rem, 4vw, 2rem);
  color: white;
  text-decoration-color: var(--red);
}

.contact-line {
  margin: 0 0 0.75rem;
  overflow-wrap: anywhere;
}

.contact-sub {
  font-family: 'Glegoo', serif;
  margin: 0;
}

.contact-sub a {
  color: var(--yellow);
}

/* footer */

.footer-strip {
  background-color: black;
  text-align: center;
  margin-bottom: 1rem;
}

.footer-line {
  font-family: 'Glegoo', serif;
  text-transform: uppercase;
  font-size: 1.125rem;
  color: white;
  padding: 0.625rem;
  margin: 0;
}

.footer-span {
  color: var(--red);
}

/* larger screens */

@media (min-width: 768px) {
  .cover-frame {
    padding: 1.5rem 2rem;
  }

  .panel {
    padding: 1.5rem 2rem 2rem;
  }

  .coverlines {
    gap: 1.25rem;
  }
}
