:root {
  --paper: #E8E1D4;
  --paper-hi: #F1ECE2;
  --char: #26231F;
  --char-2: #3A3631;
  --graphite: #5E5850;
  --dust: #8E877C;
  --blue: #2F5D8C;
  --blue-deep: #244A71;

  --f-display: "Vollkorn", Georgia, serif;
  --f-text: "Onest", "Segoe UI", sans-serif;

  --s1: .5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2.5rem;
  --s5: 4rem;
  --s6: 6rem;
  --gutter: clamp(1rem, 3.5vw, 3rem);
  --wide: 1360px;
  --rail: 320px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow-x: clip;
  color: var(--char);
  background:
    radial-gradient(120% 60% at 10% 0%, rgba(38, 35, 31, .06), transparent 60%),
    linear-gradient(180deg, var(--paper-hi), var(--paper) 40%);
  background-color: var(--paper);
  font: 400 1rem/1.62 var(--f-text);
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, p { margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.skip { position: absolute; left: var(--s2); top: -4rem; background: var(--char); color: var(--paper-hi); padding: .6rem 1rem; z-index: 20; }
.skip:focus { top: var(--s2); }

.top {
  --edge: max(var(--gutter), calc((100% - var(--wide)) / 2 + var(--gutter)));
  width: 100%;
  margin: 0;
  padding: 1.15rem var(--edge) 1.05rem var(--edge);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem 2rem;
  position: relative;
  border-bottom: 1px solid rgba(38, 35, 31, .16);
}
.top::before {
  content: "";
  position: absolute;
  left: calc(var(--edge) - .85rem);
  top: .55rem; bottom: .7rem;
  width: 2px; border-radius: 1px;
  background: var(--blue);
}
.brand {
  display: grid; justify-items: start; gap: .15rem;
  min-height: var(--tap); text-decoration: none;
  position: relative; z-index: 1;
}
.brand-name {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(1.65rem, 3.1vw, 2.45rem);
  line-height: .95; letter-spacing: -.02em;
}
.brand-name em { font-style: italic; font-weight: 500; color: var(--blue); }
.brand-stroke { width: min(11.5rem, 52vw); height: 12px; color: var(--blue); }
@media (prefers-reduced-motion: no-preference) {
  .brand-stroke path {
    stroke-dasharray: 240; stroke-dashoffset: 240;
    animation: ink-in .9s var(--ease) .05s forwards;
  }
}
@keyframes ink-in { to { stroke-dashoffset: 0; } }
.top-note {
  margin: 0; position: relative; z-index: 1;
  font-family: var(--f-display); font-style: italic; font-weight: 500;
  font-size: 1.05rem; line-height: 1.25; text-align: right;
  color: var(--graphite); max-width: 14ch;
}

/* hero: two sketches from the notebook sit above the title */
.hero {
  max-width: var(--wide); margin: 0 auto;
  padding: var(--s4) var(--gutter) var(--s4);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(16rem, .85fr);
  grid-template-areas: "study lede" "title lede";
  column-gap: var(--s5); row-gap: var(--s2);
  align-items: end;
}
.study {
  grid-area: study; margin: 0;
  display: flex; align-items: flex-end; gap: clamp(1rem, 3vw, 2.5rem);
  min-width: 0; max-width: 28rem;
}
.study-main { width: min(200px, 46%); height: auto; }
.study-side { width: min(92px, 24%); height: auto; margin-bottom: 1.6rem; }
.hero h1 {
  grid-area: title;
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(2.5rem, 5.4vw, 5rem); line-height: .98; letter-spacing: -.02em;
}
.hero h1 em { font-style: italic; font-weight: 500; color: var(--blue); }
.lede { grid-area: lede; align-self: center; color: var(--graphite); max-width: 42ch; padding-bottom: .4rem; }

/* horizontal scene */
.scene {
  max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) var(--rail);
  align-items: stretch;
}
.stage {
  position: relative; display: grid; place-items: center;
  min-width: 0; min-height: clamp(400px, 40vw, 640px);
  color: var(--paper-hi);
  background:
    radial-gradient(60% 50% at 30% 40%, rgba(255, 255, 255, .05), transparent 70%),
    radial-gradient(40% 40% at 80% 75%, rgba(0, 0, 0, .25), transparent 70%),
    var(--char);
  overflow: hidden;
}
.stage canvas {
  display: none; width: auto; height: auto;
  max-width: 100%; max-height: 74vh;
  touch-action: none; cursor: grab;
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .7);
}
.stage canvas:active { cursor: grabbing; }
.stage.has-photo { aspect-ratio: auto; min-height: 0; padding: var(--s2); }
.stage.has-photo canvas { display: block; animation: rise .55s var(--ease); }
.stage.has-photo .stage-empty { display: none; }
.stage-empty {
  position: absolute; inset: 0; cursor: pointer;
  display: grid; place-content: center; justify-items: center; gap: .6rem;
  text-align: center; padding: var(--s4);
}
.stage-empty svg { width: 120px; color: var(--dust); animation: dust 3.8s ease-in-out infinite; }
@keyframes dust { 50% { transform: translateY(10px); opacity: .45; } }
.stage-empty strong { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.5rem, 2.8vw, 2.25rem); }
.stage-empty small { color: #BDB5A8; max-width: 34ch; font-size: .9375rem; }
.stage-empty:hover strong { text-decoration: underline; text-decoration-color: var(--blue); text-underline-offset: 6px; }
.ghost {
  position: absolute; width: 26%; right: 12%; top: 18%;
  opacity: .5; filter: invert(1); pointer-events: none;
}
.ghost[hidden] { display: none; }
.ghost.is-flip { transform: scaleX(-1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.rail {
  background: var(--paper-hi);
  border: 1px solid rgba(38, 35, 31, .18); border-left: 0;
  padding: var(--s3);
  display: flex; flex-direction: column; gap: var(--s2);
}
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); }
.status { min-height: 3.2em; font-size: .9rem; color: var(--graphite); border-left: 2px solid var(--blue); padding-left: .75rem; }

.dial { display: grid; }
.dial-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s1); }
.dial label { font-family: var(--f-display); font-weight: 500; font-size: 1.1rem; }
.dial span { font-size: .875rem; color: var(--blue); font-variant-numeric: tabular-nums; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: var(--tap); background: transparent; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--char-2) 0 6px, transparent 6px 9px);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -10px;
  border-radius: 50%; background: var(--paper-hi); border: 2px solid var(--blue);
}
input[type="range"]::-moz-range-track { height: 3px; background: repeating-linear-gradient(90deg, var(--char-2) 0 6px, transparent 6px 9px); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--paper-hi); border: 2px solid var(--blue); }

.pair { display: grid; grid-template-columns: 1fr; gap: var(--s1); margin-top: auto; }

.btn {
  position: relative; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: var(--tap); padding: .55rem 1rem;
  border: 1.5px solid var(--char); border-radius: 3px;
  background: transparent; color: var(--char);
  font: 500 .9375rem/1.2 var(--f-text); cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.btn:hover { background: rgba(38, 35, 31, .06); }
.btn:focus-within { outline: 2px solid var(--blue); outline-offset: 3px; }
.btn.is-on { background: var(--char); color: var(--paper-hi); }
.btn-blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-wide { width: 100%; min-height: 52px; font-size: 1rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-link {
  appearance: none; background: none; border: 0; min-height: var(--tap); padding: 0;
  color: var(--graphite); font: inherit; font-size: .875rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.btn-link[hidden] { display: none; }

input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* sketchbook strip */
.strip {
  max-width: var(--wide); margin: 0 auto;
  padding: var(--s3) var(--gutter) 0;
  display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s3); align-items: center;
}
.strip h2 { font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: 1.5rem; color: var(--graphite); }
.strip-row {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid rgba(38, 35, 31, .35); border-bottom: 1px solid rgba(38, 35, 31, .35);
}
.motif, .own {
  appearance: none; background: none; border: 0; border-right: 1px solid rgba(38, 35, 31, .18);
  color: var(--char); font: inherit; cursor: pointer;
  display: grid; justify-items: center; align-content: center; gap: .35rem;
  padding: var(--s2) var(--s1); min-height: var(--tap);
}
.motif img { width: 92px; height: 92px; transition: transform .4s var(--ease); }
.motif span { font-family: var(--f-display); font-size: 1.05rem; }
.motif:hover img { transform: rotate(-4deg) scale(1.04); }
.motif.is-on img {
  border-radius: 48% 52% 46% 54% / 55% 45% 55% 45%;
  box-shadow: 0 0 0 2px var(--blue);
}
.motif.is-on span { color: var(--blue); }
.own { position: relative; border-right: 0; text-align: center; font-size: .95rem; }
.own > span { font-family: var(--f-display); font-size: 2rem; line-height: 1; color: var(--blue); }
.own small { font-size: .75rem; color: var(--dust); max-width: 14ch; }
.own:focus-within { outline: 2px solid var(--blue); outline-offset: -4px; }
.own:hover { background: rgba(47, 93, 140, .06); }
.line {
  max-width: var(--wide); margin: var(--s3) auto 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 11rem minmax(0, 1fr) auto; gap: .6rem var(--s2); align-items: end;
}
.line label { font-family: var(--f-display); font-style: italic; font-size: 1.35rem; color: var(--graphite); padding-bottom: .35rem; }
.line input {
  min-height: var(--tap); width: 100%;
  background-color: transparent; color: var(--char); font: inherit;
  border: 0; border-bottom: 1px solid rgba(38, 35, 31, .35); border-radius: 0;
  background-image: repeating-linear-gradient(180deg, transparent 0 1.45rem, rgba(47, 93, 140, .22) 1.45rem 1.5rem);
  padding: 0 .35rem .15rem;
}
.line button {
  min-height: var(--tap); padding: 0 1.1rem;
  background: var(--blue); color: #fff; border: 0; font: inherit; cursor: pointer;
}
.line button:hover { background: var(--blue-deep); }
.line input:focus-visible, .line button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.line button:disabled { opacity: .55; cursor: wait; }
.line-note { grid-column: 2 / -1; margin: 0; color: var(--dust); font-size: .875rem; }
@media (max-width: 640px) {
  .line { grid-template-columns: 1fr; }
  .line-note { grid-column: 1; }
}

/* notes with pencil margin */
.notes {
  max-width: var(--wide); margin: 0 auto;
  padding: var(--s6) var(--gutter) var(--s5);
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s5);
}
.notes-main { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.3rem, 2.1vw, 1.75rem); line-height: 1.4; max-width: 34ch; }
.notes-side { list-style: none; margin: 0; padding: 0 0 0 var(--s3); border-left: 1.5px solid var(--blue); display: grid; gap: var(--s2); }
.notes-side li { color: var(--graphite); font-size: .9375rem; }

.foot {
  max-width: var(--wide); margin: 0 auto; padding: var(--s3) var(--gutter) var(--s4);
  border-top: 1px solid rgba(38, 35, 31, .3);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3);
  font-size: .875rem; color: var(--graphite);
}
.foot address { flex: 1 1 100%; font-style: normal; line-height: 1.5; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 var(--s2); }
.foot a { display: inline-flex; align-items: center; min-height: var(--tap); text-underline-offset: 3px; }
.foot .yr { margin-left: auto; }

.note {
  position: relative; left: auto; right: auto; bottom: auto; top: auto; z-index: 1;
  max-width: 36rem; margin: 0 auto var(--s4); padding: var(--s3);
  background: var(--char); color: var(--paper-hi); border-radius: 4px;
  display: grid; gap: var(--s2); font-size: .9375rem;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .6);
}
.note[hidden] { display: none; }
.note .btn { justify-self: start; }

.legal-page { max-width: 68ch; margin: 0 auto; padding: var(--s5) var(--gutter); }
.legal-page h1 { font-family: var(--f-display); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; margin-bottom: var(--s3); }
.legal-page h2 { font-family: var(--f-display); font-size: 1.35rem; margin: var(--s4) 0 var(--s1); }
.legal-page p, .legal-page li { color: var(--graphite); }
.legal-page p + p { margin-top: var(--s2); }

@media (max-width: 1000px) {
  .scene { grid-template-columns: 1fr; padding: 0; }
  .rail { border: 0; border-bottom: 1px solid rgba(38, 35, 31, .18); padding: var(--s3) var(--gutter); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s3); }
  .rail .picks, .rail .status, .rail .btn-wide, .rail .btn-link { grid-column: 1 / -1; }
  .pair { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; margin-top: 0; }
  .strip { grid-template-columns: 1fr; gap: var(--s1); }
}

@media (max-width: 860px) {
  .top { align-items: flex-start; padding-top: 1rem; }
  .top-note { text-align: left; font-size: .98rem; }
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "study" "lede";
    align-items: start;
    row-gap: var(--s3);
    padding-top: var(--s3);
  }
  .study { max-width: none; }
  .study-main { width: 128px; }
  .study-side { width: 64px; margin-bottom: .8rem; }
  .lede { align-self: start; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; row-gap: .35rem; }
  .top-note { flex: 1 0 100%; max-width: none; }
  .hero { padding-top: var(--s3); gap: var(--s2); }
  .stage { aspect-ratio: 4 / 5; min-height: 0; }
  .stage.has-photo { aspect-ratio: auto; }
  .stage.has-photo { padding: 0; }
  .stage canvas { width: 100%; max-height: none; box-shadow: none; }
  .rail { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr; }
  .strip { padding-inline: 0; }
  .strip h2 { padding: 0 var(--gutter); }
  .strip-row {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; padding: 0 var(--gutter);
  }
  .strip-row::-webkit-scrollbar { display: none; }
  .motif, .own { flex: 0 0 34%; scroll-snap-align: start; }
  .motif img { width: 72px; height: 72px; }
  .notes { grid-template-columns: 1fr; gap: var(--s4); padding-top: var(--s5); }
  .foot .yr { margin-left: 0; }
  .note { left: var(--s1); right: var(--s1); max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.reg {
  position: absolute;
  z-index: 4;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  display: none;
  pointer-events: none;
  color: currentColor;
}
.stage.has-photo .reg { display: block; }
.reg::before,
.reg::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.reg::before { left: 50%; top: -6px; width: 1px; height: calc(100% + 12px); }
.reg::after { top: 50%; left: -6px; height: 1px; width: calc(100% + 12px); }
