/* issue 2: a desk, late at night, one warm lamp.
   Typed memos and handwritten confessions, accumulating. */

:root {
  --paper: #f6efdb;
  --paper-edge: #d9cfb4;
  --ink: #2e2a22;
  --ballpoint: #22346b;
  --ribbon-red: #b3312c;
  --rule-blue: rgba(112, 158, 186, 0.55);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Cutive Mono', monospace;
  color: #b9a883;
  background: radial-gradient(120% 90% at 50% -10%, #2f2414 0%, #1a1309 45%, #0c0905 100%) fixed;
  padding-bottom: 4rem;
}

/* the lamp: warm pool of light up top, darkness pressing in */
.lamp {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background:
    radial-gradient(75% 55% at 50% 0%, rgba(255, 195, 115, 0.16), transparent 65%),
    radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}

::selection {
  background: var(--ballpoint);
  color: var(--paper);
}

/* ---- paper ------------------------------------------------------- */

.card {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--paper-edge);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* strips of aged tape */
.card::before,
.card::after {
  content: '';
  position: absolute;
  top: -0.7rem;
  width: 5.5rem;
  height: 1.5rem;
  background: rgba(246, 242, 222, 0.45);
  border-left: 1px dashed rgba(0, 0, 0, 0.08);
  border-right: 1px dashed rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.card::before {
  left: 9%;
  transform: rotate(-5deg);
}

.card::after {
  right: 9%;
  transform: rotate(4deg);
}

/* ---- the memo ---------------------------------------------------- */

.memo {
  width: min(42rem, 92%);
  margin: 3.5rem auto 2.5rem;
  padding: 2rem 2.4rem 1.6rem;
  transform: rotate(-0.6deg);
  font-size: 1rem;
  line-height: 1.55;
}

.stamp {
  margin: 0 0 1.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: rgba(46, 42, 34, 0.55);
  border-bottom: 1px solid rgba(46, 42, 34, 0.25);
  padding-bottom: 0.5rem;
}

.memo h1 {
  margin: 0 0 0.4rem;
  font-size: 1.45rem;
  font-weight: normal;
  letter-spacing: 0.1em;
}

.tagline {
  margin: 0 0 1.2rem;
  color: rgba(46, 42, 34, 0.7);
}

.memo h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: normal;
  letter-spacing: 0.12em;
}

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

/* ---- the pile of notes ------------------------------------------- */

#anxiety {
  width: min(38rem, 94%);
  margin: 0 auto;
}

.note {
  position: relative;
  width: 100%;
  min-height: 7rem;
  padding: 1.75rem 1.6rem 1.6rem 4.1rem;
  font-family: 'Reenie Beanie', cursive;
  font-size: 1.65rem;
  line-height: 1.75rem;
  color: var(--ballpoint);
  transform: translateX(var(--dx, 0)) rotate(var(--rot, 0deg));
  background:
    linear-gradient(
      90deg,
      transparent 3.3rem,
      rgba(199, 74, 64, 0.5) 3.3rem,
      rgba(199, 74, 64, 0.5) calc(3.3rem + 1px),
      transparent calc(3.3rem + 1px)
    ),
    repeating-linear-gradient(
      #f8f2df 0,
      #f8f2df calc(1.75rem - 1px),
      var(--rule-blue) calc(1.75rem - 1px),
      var(--rule-blue) 1.75rem
    );
  border: 1px solid var(--paper-edge);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 2px 5px rgba(0, 0, 0, 0.3);
  animation: settle 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.note + .note {
  margin-top: -2.5rem;
}

/* tape on the notes too */
.note::before,
.note::after {
  content: '';
  position: absolute;
  top: -0.65rem;
  width: 4.5rem;
  height: 1.3rem;
  background: rgba(246, 242, 222, 0.45);
  border-left: 1px dashed rgba(0, 0, 0, 0.08);
  border-right: 1px dashed rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.note::before {
  left: 11%;
  transform: rotate(-4deg);
}

.note::after {
  right: 11%;
  transform: rotate(5deg);
}

@keyframes settle {
  0% {
    opacity: 0;
    transform: translateX(var(--dx, 0)) translateY(-1.75rem) rotate(calc(var(--rot, 0deg) - 3deg)) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateX(var(--dx, 0)) translateY(0) rotate(var(--rot, 0deg)) scale(1);
  }
}

/* ---- the ask ----------------------------------------------------- */

.center {
  text-align: center;
}

#download.tag {
  display: inline-block;
  width: min(24rem, 88%);
  margin: 3rem auto 0;
  padding: 1.3rem 1.6rem 1.5rem;
  transform: rotate(0.8deg);
  font-size: 0.95rem;
  line-height: 1.5;
}

#download p {
  margin: 0 0 1rem;
}

#download input[type='submit'] {
  appearance: none;
  font-family: 'Cutive Mono', monospace;
  font-size: 1rem;
  color: var(--ink);
  background: #efe6cc;
  border: 1px solid #8a7c64;
  border-radius: 2px;
  padding: 0.45em 1.4em;
  box-shadow: 0 3px 0 #8a7c64, 0 4px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

#download input[type='submit']:hover,
#download input[type='submit']:focus-visible {
  background: #f8f1dc;
}

#download input[type='submit']:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #8a7c64, 0 1px 2px rgba(0, 0, 0, 0.25);
}

#download input[type='submit']:focus-visible {
  outline: 2px solid var(--ribbon-red);
  outline-offset: 2px;
}

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

footer {
  margin: 3.5rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(185, 168, 131, 0.75);
}

footer a {
  color: inherit;
}

footer a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ---- small screens ----------------------------------------------- */

@media only screen and (max-width: 480px) {
  .memo {
    padding: 1.5rem 1.2rem 1.2rem;
    margin-top: 2rem;
  }

  .note {
    padding-left: 3.4rem;
    font-size: 1.45rem;
  }

  .note + .note {
    margin-top: -1.5rem;
  }
}

/* ---- decency ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .note {
    animation: none;
  }
}
