/* Assignment — the sheet.
   ==========================================================================
   Two pages torn off a notepad, lying on the studio's dark desk. The first
   carries the name, scribbled in ballpoint with the S's facing each other; the
   second is the brief, filled in like homework. White ruled paper, a red
   margin, a torn top, a dog-eared corner, yellowed edges, the grain of cheap
   stock. Nothing moves, so there is nothing for prefers-reduced-motion to stop.
   One responsive page, no m/ twin.
   ========================================================================== */

:root{
  --ink: #0B0712;
  --paper: #F7F3E8;
  --paper-deep: #E9E2CF;
  --rule: #A9C0DC;
  --margin: #E3807A;
  --pen: #1E3A9C;
  --pencil: #6E6A62;
  --sepia: rgba(110, 82, 36, 0.32);

  --font-hand: "Segoe Print", "Bradley Hand", "Comic Sans MS", "Brush Script MT", "Noteworthy", cursive;
  --font-body: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --line: 32px;           /* the ruling */
  --margin-x: 64px;       /* where the red line sits */
}

*{ box-sizing: border-box; }
html{ background: var(--ink); -webkit-text-size-adjust: 100%; }
body{
  margin: 0;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(255,230,190,0.07), transparent 70%),
    var(--ink);
  color: #23201C;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection{ background: var(--pen); color: #fff; }
a:focus-visible{ outline: 2px solid var(--pen); outline-offset: 3px; }

.sr-only{
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
a.sr-only:focus{
  position: fixed; left: 1rem; top: 1rem; width: auto; height: auto; margin: 0;
  padding: 0.5rem 0.8rem; clip: auto; background: var(--paper); color: var(--pen);
  font-family: var(--font-hand); z-index: 50;
}
.defs{ position: absolute; width: 0; height: 0; }

/* ================================================================= the desk */

.desk{
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) 1rem clamp(2rem, 5vw, 3.5rem);
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
}

/* ================================================================ the sheet */

.sheet{
  position: relative;
  padding: calc(var(--line) * 2.2) clamp(1.2rem, 4vw, 3rem) calc(var(--line) * 1.6) calc(var(--margin-x) + 1rem);
  color: #23201C;
  background:
    /* the red margin */
    linear-gradient(90deg, transparent calc(var(--margin-x) - 1px), var(--margin) calc(var(--margin-x) - 1px), var(--margin) calc(var(--margin-x) + 1px), transparent calc(var(--margin-x) + 1px)),
    /* the ruling, starting below the torn strip */
    repeating-linear-gradient(180deg, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line)),
    /* yellowed towards the edges */
    radial-gradient(120% 100% at 50% 40%, var(--paper) 50%, var(--paper-deep) 100%);
  background-position: 0 0, 0 calc(var(--line) * 0.4), 0 0;
  box-shadow:
    inset 0 0 70px var(--sepia),
    0 24px 40px rgba(0,0,0,0.55),
    0 2px 0 rgba(255,255,255,0.3);
  transform: rotate(-0.8deg);
  overflow: hidden;
}
.sheet--form{ transform: rotate(0.6deg); }

/* the grain of the stock, laid over everything that is paper */
.grain{
  position: absolute;
  inset: 0;
  pointer-events: none;
  filter: url(#grain);
  background: #fff;
  mix-blend-mode: multiply;
  opacity: 0.9;
  z-index: 0;
}
.sheet > :not(.grain):not(.holes):not(.dogear):not(.boltz){ position: relative; z-index: 1; }

/* a fold across the sheet, and a few grey smudges where a hand rested */
.sheet::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(172deg, transparent 49.3%, rgba(0,0,0,0.07) 49.7%, rgba(255,255,255,0.35) 50.1%, transparent 50.6%),
    radial-gradient(14% 10% at 82% 78%, rgba(60,55,50,0.10), transparent 70%),
    radial-gradient(10% 8% at 18% 30%, rgba(60,55,50,0.08), transparent 70%),
    radial-gradient(20% 6% at 60% 96%, rgba(60,55,50,0.14), transparent 70%);
}

/* torn along the top: the strip left behind when a sheet comes off the pad */
.sheet--title{
  clip-path: polygon(
    0.0% 0.06%, 2.2% 1.83%, 3.4% 0.33%, 5.4% 1.96%, 7.4% 0.35%, 8.4% 1.2%, 9.7% 0.39%, 11.1% 1.19%, 12.5% 0.29%, 13.8% 1.03%, 15.6% 0.29%, 16.9% 1.51%, 17.8% 0.41%, 19.3% 1.65%, 21.0% 0.04%, 22.3% 1.58%, 23.4% 0.08%, 24.4% 1.36%, 26.0% 0.01%, 27.6% 1.76%, 29.4% 0.23%, 31.2% 1.05%, 33.1% 0.25%, 34.6% 1.76%, 36.6% 0.4%, 38.7% 1.15%, 40.2% 0.44%, 41.6% 1.49%, 42.6% 0.31%, 43.5% 1.96%, 44.6% 0.33%, 45.8% 1.18%, 47.0% 0.29%, 48.4% 1.99%, 49.3% 0.37%, 51.0% 2.18%, 52.8% 0.33%, 53.9% 2.17%, 54.8% 0.37%, 56.7% 1.62%, 58.2% 0.18%, 60.3% 1.65%, 61.5% 0.03%, 62.5% 1.82%, 64.4% 0.44%, 66.0% 1.68%, 68.1% 0.42%, 69.6% 1.3%, 71.7% 0.2%, 73.8% 1.37%, 74.7% 0.42%, 76.0% 2.09%, 78.0% 0.44%, 78.9% 1.61%, 80.4% 0.39%, 81.3% 1.15%, 82.9% 0.44%, 84.2% 1.78%, 85.3% 0.42%, 87.2% 1.36%, 88.4% 0.32%, 90.5% 1.54%, 92.2% 0.47%, 93.5% 1.62%, 94.6% 0.12%, 95.9% 1.42%, 97.3% 0.01%, 99.4% 1.04%, 100.0% 0.4%,
    100% 100%, 0 100%
  );
}
/* the perforation holes along that top strip */
.holes{
  position: absolute;
  left: 0; right: 0; top: 10px;
  display: flex;
  justify-content: space-evenly;
  pointer-events: none;
  z-index: 2;
}
.holes i{
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.25), 0 0 0 1.5px rgba(0,0,0,0.18);
}

/* a dog-eared corner */
.dogear{
  position: absolute;
  right: 0; bottom: 0;
  width: 58px; height: 58px;
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(225deg, var(--ink) 0 50%, transparent 50%),
    linear-gradient(225deg, transparent 0 50%, #FFFDF6 50%, #D9D1BC 100%);
  box-shadow: -3px -3px 6px rgba(0,0,0,0.18);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
.dogear--left{
  right: auto; left: 0;
  transform: scaleX(-1);
}

/* ============================================================ sheet 1: name */

.scrawl{
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  margin-top: calc(var(--line) * 0.6);
}
.pen-line{
  margin: calc(var(--line) * 0.5) 0 0 2%;
  font-family: var(--font-hand);
  font-size: clamp(1.3rem, 0.8rem + 2.2vw, 2.2rem);
  color: var(--pen);
  letter-spacing: 0.02em;
  transform: rotate(-1.5deg);
  transform-origin: left center;
  line-height: var(--line);
}

/* =========================================================== sheet 2: brief */

.form-title{
  margin: 0 0 var(--line);
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: clamp(1.6rem, 1rem + 2.4vw, 2.6rem);
  line-height: var(--line);
  color: var(--pen);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  text-decoration-skip-ink: none;
  transform: rotate(-0.8deg);
  transform-origin: left center;
}
.form{
  margin: 0;
  display: grid;
  gap: 0;
}
.form > div{
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  line-height: var(--line);
  min-height: var(--line);
}
.form dt{
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pencil);
}
.form dd{
  margin: 0;
  font-family: var(--font-hand);
  font-size: clamp(1.05rem, 0.8rem + 1vw, 1.45rem);
  color: var(--pen);
}
.body-pen{
  margin: var(--line) 0 0;
  max-width: 58ch;
  font-family: var(--font-hand);
  font-size: clamp(1rem, 0.8rem + 0.9vw, 1.3rem);
  line-height: var(--line);
  color: #2B2A5A;
}

/* The way back: pencil, in the margin, turned up the page. */
.boltz{
  position: absolute;
  left: 14px;
  bottom: calc(var(--line) * 2.4);
  transform: rotate(-90deg);
  transform-origin: left bottom;
  font-family: var(--font-hand);
  font-size: 0.95rem;
  color: var(--pencil);
  opacity: 0.55;
  text-decoration: none;
  cursor: default;
  white-space: nowrap;
  z-index: 2;
}
.boltz:hover, .boltz:focus-visible{ opacity: 1; color: var(--pen); }

/* ================================================================= the kerb */

.kerb{
  padding: 1rem 1rem 3rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(169,155,184,0.55);
}
.kerb p{ margin: 0; }

/* =================================================================== phones */

@media (max-width: 640px){
  :root{ --margin-x: 44px; --line: 28px; }
  .sheet{ padding-right: 1rem; padding-left: calc(var(--margin-x) + 0.6rem); }
  .form > div{ grid-template-columns: 1fr; gap: 0; }
  .form dt{ line-height: 1.2; padding-top: 0.5rem; }
  .holes i{ width: 9px; height: 9px; }
  .holes i:nth-child(2n){ display: none; }
  .boltz{ left: 8px; font-size: 0.8rem; }
}
