/* sandler.in
   No inline styles anywhere, so the page runs under a strict style-src 'self'.
   Numbers in em below are Archivo Black metrics: baseline .914, x-height .531, cap height .703
   from the top of a 1.16em row. */

@font-face {
  font-family: "Archivo Black";
  src: url("/fonts/archivo-black.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #1b1d1e;
  --mint: #23e298;
  --mint-pressed: #12c784;
  --tape: rgba(208, 128, 16, 0.86);
  --row: 1.16em;
  --pad: clamp(24px, 3.4vw, 48px);
  --screen: 100vh;
  --ease: cubic-bezier(0.3, 0.1, 0.15, 1);
  --text: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Archivo Black", "Arial Black", Impact, sans-serif;
  color-scheme: light dark;
}

@supports (height: 100svh) {
  :root {
    --screen: 100svh;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1d1e;
    --ink: #f1f2f2;
  }
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.4 var(--text);
}

::selection {
  background: var(--mint);
  color: #1b1d1e;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

@media (hover: hover) {
  a:hover {
    background: var(--mint);
    color: #1b1d1e;
  }
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation; /* fast repeated taps must not zoom the page */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* Without JavaScript the buttons stay disabled: same look, nothing to click. */
button:disabled {
  color: inherit;
  cursor: default;
}

.page {
  min-height: var(--screen);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: var(--pad);
}

.name {
  margin: 0;
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
}

/* The bench sets the big type size once; everything in the stack is in em of it.
   It is as large as the width allows (the longest row has to fit), but never so large that
   the page stops fitting on one screen. --rest is what the name, the gaps, the sticker and
   the links need. The stack is 4.64em tall, and the line under it takes another 0.37em while
   it scales with the type (first formula) or 1.525rem once it is at its smallest (second). */
.bench {
  --rest: calc(13.25rem + 2 * var(--pad));
  --fit: min(
    calc((var(--screen) - var(--rest)) / 5.01),
    calc((var(--screen) - var(--rest) - 1.525rem) / 4.64)
  );
  position: relative;
  padding-left: 0.64em;
  font-size: min(10.6vw, max(2.25rem, var(--fit)), 15rem);
}

/* ---------- the stack ---------- */

.stack {
  position: relative;
  height: calc(4 * var(--row));
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.subject {
  position: absolute;
  left: -0.64em;
  top: 0;
  color: color-mix(in srgb, currentColor 50%, transparent);
}

/* Every row sits at the top and is moved to its slot, so a reorder is one transform. */
.row {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--row);
  white-space: nowrap;
  transform: translateY(calc(var(--pos) * var(--row)));
  transition: transform 0.76s var(--ease);
  transition-delay: calc(var(--pos) * 70ms);
}

.row[data-pos="0"] { --pos: 0; }
.row[data-pos="1"] { --pos: 1; }
.row[data-pos="2"] { --pos: 2; }
.row[data-pos="3"] { --pos: 3; }

.comma {
  transition: opacity 0.3s;
}

.row[data-pos="3"] .comma {
  opacity: 0;
}

.verb {
  vertical-align: baseline;
  transition: opacity 0.15s;
}

@media (hover: hover) {
  .verb:enabled:hover {
    opacity: 0.74;
  }
}

.verb:enabled:active {
  opacity: 0.74;
  transform: translateY(0.012em);
}

/* ---------- take apart ---------- */

.apart {
  display: inline-flex;
  align-items: baseline;
  justify-content: space-between;
  width: 6.88em; /* the width of "overengineer" */
  transition: width 0.7s var(--ease), opacity 0.15s;
}

.apart[data-level="0"] { width: 5.46em; } /* back together */
.apart[data-level="2"] { width: calc(100% - 0.4em); } /* across the page */

.apart .l {
  display: block;
  transform: translateY(var(--y, 0em)) rotate(var(--r, 0deg));
  transition: transform 0.6s var(--ease);
}

.apart .gap {
  flex: 0 0 0.3em;
}

.apart[data-level="1"] .l:nth-child(1) { --r: -2deg; --y: 0.01em; }
.apart[data-level="1"] .l:nth-child(2) { --r: 1.5deg; --y: -0.012em; }
.apart[data-level="1"] .l:nth-child(3) { --r: -1deg; --y: 0.008em; }
.apart[data-level="1"] .l:nth-child(4) { --r: 2deg; --y: -0.006em; }
.apart[data-level="1"] .l:nth-child(6) { --r: -1.5deg; --y: 0.01em; }
.apart[data-level="1"] .l:nth-child(7) { --r: 2.5deg; --y: -0.01em; }
.apart[data-level="1"] .l:nth-child(8) { --r: -2deg; --y: 0.006em; }
.apart[data-level="1"] .l:nth-child(9) { --r: 1deg; --y: 0.012em; }
.apart[data-level="1"] .l:nth-child(10) { --r: -2.5deg; --y: -0.008em; }

.apart[data-level="2"] .l:nth-child(1) { --r: -9deg; --y: 0.05em; }
.apart[data-level="2"] .l:nth-child(2) { --r: 7deg; --y: -0.06em; }
.apart[data-level="2"] .l:nth-child(3) { --r: -5deg; --y: 0.04em; }
.apart[data-level="2"] .l:nth-child(4) { --r: 11deg; --y: -0.03em; }
.apart[data-level="2"] .l:nth-child(6) { --r: -8deg; --y: 0.06em; }
.apart[data-level="2"] .l:nth-child(7) { --r: 6deg; --y: -0.05em; }
.apart[data-level="2"] .l:nth-child(8) { --r: -12deg; --y: 0.03em; }
.apart[data-level="2"] .l:nth-child(9) { --r: 9deg; --y: 0.05em; }
.apart[data-level="2"] .l:nth-child(10) { --r: -6deg; --y: -0.04em; }

/* ---------- break ---------- */

.brk,
.fix {
  display: inline-flex;
  align-items: baseline;
}

.brk .l {
  position: relative;
  display: block;
  transition: color 0.14s;
}

.brk .l[data-state="broken"] {
  color: transparent;
}

/* A broken letter becomes a missing-glyph box. */
.brk .l::before {
  content: "";
  position: absolute;
  left: 0.05em;
  right: 0.07em;
  top: 0.211em;
  height: 0.703em;
  border: 0.075em solid var(--ink);
  opacity: 0;
  transition: opacity 0.14s;
}

.brk .l[data-state="broken"]::before {
  opacity: 1;
}

/* A fixed letter keeps its tape. */
.brk .l::after,
.fix .x::before,
.fix .x::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.648em;
  background: var(--tape);
  clip-path: polygon(0% 0%, 3% 16.6%, 0% 33.3%, 3% 50%, 0% 66.6%, 3% 83.3%, 0% 100%, 100% 100%, 97% 83.3%, 100% 66.6%, 97% 50%, 100% 33.3%, 97% 16.6%, 100% 0%);
}

.brk .l::after {
  width: 0.66em;
  height: 0.17em;
  clip-path: polygon(0% 0%, 4% 16.6%, 0% 33.3%, 4% 50%, 0% 66.6%, 4% 83.3%, 0% 100%, 100% 100%, 96% 83.3%, 100% 66.6%, 96% 50%, 100% 33.3%, 96% 16.6%, 100% 0%);
  transform: translate(-50%, -50%) rotate(var(--lean, 0deg));
  opacity: 0;
  transition: opacity 0.16s;
}

.brk .l[data-state="fixed"]::after {
  opacity: 1;
}

.brk .l:nth-child(1) { --lean: -14deg; }
.brk .l:nth-child(2) { --lean: 9deg; }
.brk .l:nth-child(3) { --lean: -7deg; }
.brk .l:nth-child(4) { --lean: 12deg; }
.brk .l:nth-child(5) { --lean: -10deg; }

/* ---------- fix ---------- */

/* The x is still in the markup. What you see is two strips of tape. */
.fix .x {
  position: relative;
  display: block;
  color: transparent;
}

.fix .x::before,
.fix .x::after {
  width: 0.96em;
  height: 0.2em;
  transition: transform 0.24s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.fix .x::before {
  transform: translate(-50%, -50%) rotate(calc(38deg + var(--wobble, 0deg)));
}

.fix .x::after {
  transform: translate(-50%, -50%) rotate(calc(-38deg + var(--wobble, 0deg) / 2));
}

/* ---------- overengineer ---------- */

.over {
  position: relative;
  display: inline-block;
}

.spec {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: color-mix(in srgb, currentColor 62%, transparent);
  font-family: var(--text);
  font-weight: 500;
  letter-spacing: 0;
}

.spec > * {
  position: absolute;
}

.spec .dim {
  left: 0;
  right: 0.02em;
  top: 0.095em;
  height: 1px;
  background: currentColor;
}

.spec .end {
  top: 0.03em;
  width: 1px;
  height: 0.14em;
  background: currentColor;
}

.spec .end.a { left: 0; }
.spec .end.b { right: 0.02em; }

.spec .ruler {
  inset: 0;
}

.spec .ruler i {
  position: absolute;
  top: 0.06em;
  width: 1px;
  height: 0.07em;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.2s;
}

/* One tick at every letter boundary of "overengineer". */
.spec .ruler i:nth-child(1) { left: 0.647em; }
.spec .ruler i:nth-child(2) { left: 1.238em; }
.spec .ruler i:nth-child(3) { left: 1.885em; }
.spec .ruler i:nth-child(4) { left: 2.309em; }
.spec .ruler i:nth-child(5) { left: 2.956em; }
.spec .ruler i:nth-child(6) { left: 3.603em; }
.spec .ruler i:nth-child(7) { left: 4.25em; }
.spec .ruler i:nth-child(8) { left: 4.563em; }
.spec .ruler i:nth-child(9) { left: 5.21em; }
.spec .ruler i:nth-child(10) { left: 5.857em; }
.spec .ruler i:nth-child(11) { left: 6.504em; }

/* A zero-size anchor on the dimension line, so the label can use its own font size. */
.spec .at {
  left: 50%;
  top: 0.095em;
  width: 0;
  height: 0;
}

.spec .label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  padding: 0.25em 0.6em;
  background: var(--bg);
  font-size: clamp(10px, 0.105em, 13px);
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.spec .tol,
.spec .dns {
  display: none;
}

.spec .rule {
  left: -0.1em;
  right: -0.08em;
  border-top: 1px dashed currentColor;
  opacity: 0;
  transition: opacity 0.2s;
}

.spec .rule.base { top: 0.914em; }
.spec .rule.xh { top: 0.383em; }
.spec .rule.cap { top: 0.211em; }
.spec .rule.desc { top: 1.133em; }

.spec .corner {
  width: 0.09em;
  height: 0.09em;
  border: 0 solid currentColor;
  opacity: 0;
  transition: opacity 0.2s;
}

.spec .corner.tl { left: -0.07em; top: 0.15em; border-left-width: 1px; border-top-width: 1px; }
.spec .corner.tr { right: -0.05em; top: 0.15em; border-right-width: 1px; border-top-width: 1px; }
.spec .corner.bl { left: -0.07em; top: 1.03em; border-left-width: 1px; border-bottom-width: 1px; }
.spec .corner.br { right: -0.05em; top: 1.03em; border-right-width: 1px; border-bottom-width: 1px; }

/* Each click adds a level of specification. */
.over:is([data-spec="2"], [data-spec="3"], [data-spec="4"]) .tol { display: inline; }
.over:is([data-spec="2"], [data-spec="3"], [data-spec="4"]) .rule:is(.base, .xh) { opacity: 1; }
.over:is([data-spec="3"], [data-spec="4"]) :is(.ruler i, .corner) { opacity: 1; }
.over[data-spec="4"] .rule:is(.cap, .desc) { opacity: 1; }
.over[data-spec="4"] .dns { display: inline; }

/* ---------- the rest of the sentence ---------- */

.tail {
  margin: 0;
  padding-top: clamp(10px, 1.8vh, 22px);
  max-width: 26em;
  font: 500 clamp(1.25rem, 0.3em, 3rem)/1.22 var(--text); /* em of the bench */
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Hard is the heaviest weight, soft the lightest, and "everything in between"
   steps through the weights in between, one letter at a time. */
.ramp b { font-weight: 900; }
.ramp .soft { font-weight: 200; }
.ramp .and { color: color-mix(in srgb, currentColor 62%, transparent); }
.ramp i { font-style: normal; }

.ramp i:nth-of-type(1) { font-weight: 860; }
.ramp i:nth-of-type(2) { font-weight: 826; }
.ramp i:nth-of-type(3) { font-weight: 791; }
.ramp i:nth-of-type(4) { font-weight: 757; }
.ramp i:nth-of-type(5) { font-weight: 722; }
.ramp i:nth-of-type(6) { font-weight: 688; }
.ramp i:nth-of-type(7) { font-weight: 653; }
.ramp i:nth-of-type(8) { font-weight: 619; }
.ramp i:nth-of-type(9) { font-weight: 584; }
.ramp i:nth-of-type(10) { font-weight: 550; }
.ramp i:nth-of-type(11) { font-weight: 516; }
.ramp i:nth-of-type(12) { font-weight: 481; }
.ramp i:nth-of-type(13) { font-weight: 447; }
.ramp i:nth-of-type(14) { font-weight: 412; }
.ramp i:nth-of-type(15) { font-weight: 378; }
.ramp i:nth-of-type(16) { font-weight: 343; }
.ramp i:nth-of-type(17) { font-weight: 309; }
.ramp i:nth-of-type(18) { font-weight: 274; }
.ramp i:nth-of-type(19) { font-weight: 240; }

/* ---------- the sticker and the leftover screws ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding-top: 18px;
  font: 400 16px/1.2 var(--text);
}

.sticker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-right: 6px;
  padding: 0 14px 0 12px;
  border-radius: 4px;
  background: var(--mint);
  color: #1b1d1e;
  font-weight: 600;
  transform: rotate(-1.5deg);
}

.sticker:disabled {
  color: #1b1d1e;
}

@media (hover: hover) {
  .sticker:enabled:hover {
    background: var(--mint-pressed);
  }
}

.sticker:enabled:active {
  background: var(--mint-pressed);
}

.sticker svg {
  width: 17px;
  height: 17px;
}

.screws {
  display: contents;
}

.screw {
  flex: none;
  width: 24px;
  height: 24px;
  color: color-mix(in srgb, currentColor 60%, transparent);
  transform: rotate(var(--turn, 24deg));
  animation: drop 0.26s cubic-bezier(0.3, 1.4, 0.5, 1) backwards;
}

.screw:first-child {
  animation: none;
}

@keyframes drop {
  from {
    opacity: 0;
    translate: 0 -10px;
    scale: 0.7;
  }
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 32px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(16px, 5vw, 28px);
}

.links a {
  display: inline-block;
  padding: 11px 0;
}

.mail {
  margin: 0;
  padding: 11px 0;
  color: color-mix(in srgb, currentColor 70%, transparent);
}

/* ---------- motion guards ---------- */

/* Sizes are in em of a fluid font size, so a window resize would animate everything. */
.resizing *,
.resizing *::before,
.resizing *::after {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
