@font-face { font-family: "Instrument Serif"; src: url("/assets/fonts/instrument-serif.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/assets/fonts/instrument-serif-italic.ttf") format("truetype"); font-style: italic; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dm-sans.ttf") format("truetype"); font-weight: 100 1000; font-display: swap; }
:root { color-scheme: light; --pink:#fae8ea; --paper:#fffaf7; --ink:#1c2e44; --blue:#183f73; --muted:#526071; --hair:#d1c0c5; --serif:"Instrument Serif",Georgia,serif; --sans:"DM Sans",Arial,sans-serif; --mono:Consolas,"Courier New",monospace; }
* { box-sizing:border-box; }
body { margin:0; color:var(--ink); background:var(--pink); font:16px/1.55 var(--sans); }
button, input { font:inherit; }
button, a { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; color:inherit; }
button:disabled { cursor:wait; opacity:.55; }
button, input, a { touch-action:manipulation; }
button:focus-visible, input:focus-visible, a:focus-visible { outline:3px solid #2876b5; outline-offset:5px; }
a { color:inherit; text-underline-offset:4px; }
figure, h1, h2, p, dl, dd { margin:0; }
svg, img { display:block; }
[hidden] { display:none !important; }
.shell { width:min(1280px,calc(100% - 80px)); margin-inline:auto; }
.skip-link { position:fixed; z-index:10; top:-100px; left:20px; padding:12px 20px; color:white; background:var(--blue); }
.skip-link:focus { top:12px; }
.mast { display:flex; align-items:center; justify-content:space-between; gap:24px; min-height:83px; border-bottom:1px solid var(--hair); }
.brand { display:inline-flex; gap:9px; align-items:center; text-decoration:none; font:36px/1 var(--serif); letter-spacing:-.035em; }
.brand img { width:39px; height:42px; object-fit:contain; mix-blend-mode:multiply; }
.back-link { display:inline-flex; align-items:center; gap:9px; min-height:44px; font-size:13px; font-weight:550; text-decoration:none; }
.back-link:hover, footer a:hover { text-decoration:underline; }
.introduction { display:flex; align-items:flex-end; justify-content:space-between; gap:34px; padding:34px 0 31px; }
.eyebrow { font:600 10px/1.5 var(--mono); letter-spacing:.13em; text-transform:uppercase; color:var(--blue); }
.ruled { display:flex; align-items:center; gap:10px; }
.ruled::before { content:""; display:block; width:24px; height:2px; background:#a77a42; }
h1 { font:400 clamp(42px,4.7vw,66px)/1.04 var(--serif); letter-spacing:-.035em; margin-top:9px; }
h1 em { font-weight:400; color:var(--blue); }
.introduction>p { color:var(--muted); font-size:14px; line-height:1.7; padding-bottom:3px; }
.studio { display:grid; grid-template-columns:minmax(0,1fr) 334px; gap:27px; align-items:start; }
.drawing-column { min-width:0; }
.preview-panel { background:var(--paper); border:1px solid #aab6c3; }
.preview-heading { min-height:46px; display:flex; align-items:center; justify-content:space-between; padding:10px 20px; gap:12px; border-bottom:1px solid #dce2e6; }
.line-key { display:flex; gap:7px; align-items:center; white-space:nowrap; font-size:11px; color:var(--muted); }
.line-key i { display:block; width:18px; height:1px; background:var(--blue); }
.drawing { height:clamp(370px,36vw,496px); position:relative; overflow:hidden; background-color:#fcfaf6; background-image:linear-gradient(#4474970c 1px,transparent 1px),linear-gradient(90deg,#4474970c 1px,transparent 1px); background-size:25px 25px; background-position:center; }
.drawing::before,.drawing::after { content:""; position:absolute; background:#6184a41e; pointer-events:none; }
.drawing::before { left:0; right:0; height:1px; top:50%; }
.drawing::after { top:0; bottom:0; width:1px; left:50%; }
#curve-preview { width:100%; height:100%; position:relative; z-index:1; }
#curve-path { vector-effect:non-scaling-stroke; stroke-width:1.05px; }
.registration { width:12px; height:12px; position:absolute; color:#7692a9; }
.registration::before,.registration::after { content:""; position:absolute; background:currentColor; }
.registration::before { width:12px; height:1px; top:5px; }
.registration::after { width:1px; height:12px; left:5px; }
.top-left { top:13px; left:13px; } .top-right { top:13px; right:13px; } .bottom-left { bottom:13px; left:13px; } .bottom-right { bottom:13px; right:13px; }
figcaption { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:48px; padding:10px 20px; border-top:1px solid #dce2e6; }
figcaption strong { font-size:14px; font-weight:600; }
#status { color:var(--muted); font:11px/1.5 var(--mono); text-align:right; }
.presets-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:20px 0 10px; }
.presets-heading h2 { font-size:13px; font-weight:600; }
.presets-heading>span { font:italic 17px var(--serif); color:var(--muted); }
.presets { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
.preset { display:flex; align-items:center; gap:7px; min-width:0; min-height:80px; padding:10px 8px; border:1px solid #c8b9bf; border-radius:3px; background:transparent; text-align:left; color:var(--blue); }
.preset:hover { border-color:#607b9a; background:#fffaf780; }
.preset[aria-pressed="true"] { border-color:var(--blue); background:var(--paper); box-shadow:inset 0 -3px 0 var(--blue); }
.preset>svg { width:48px; height:48px; flex:0 0 48px; }
.preset>span { min-width:0; }
.preset strong { display:block; font-size:13px; font-weight:650; }
.preset small { display:block; color:var(--muted); font-size:10px; line-height:1.45; margin-top:2px; }
.controls { padding:23px 24px 21px; border:1px solid var(--hair); background:#fffaf77d; }
.controls-heading { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:23px; }
.controls h2 { font:400 28px/1.08 var(--serif); letter-spacing:-.012em; margin-top:6px; }
.reset-button { min-width:44px; min-height:44px; border:0; padding:0; background:transparent; text-decoration:underline; text-underline-offset:4px; font-size:12px; }
.parameter { margin-top:20px; }
.parameter-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.parameter label { font-size:14px; font-weight:650; }
.readout { display:inline-flex; align-items:baseline; gap:5px; }
.readout output { font:500 23px/1.2 var(--sans); font-variant-numeric:tabular-nums; letter-spacing:-.025em; }
.readout small { font-size:11px; color:var(--muted); }
input[type="range"] { display:block; width:100%; min-width:0; margin:5px 0 0; height:36px; padding:0; background:transparent; appearance:none; -webkit-appearance:none; cursor:pointer; accent-color:var(--blue); }
input[type="range"]::-webkit-slider-runnable-track { height:4px; border-radius:2px; background:linear-gradient(to right,var(--blue) 0%,var(--blue) var(--range-progress,40%),#c5cdd5 var(--range-progress,40%),#c5cdd5 100%); }
input[type="range"]::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:19px; height:19px; margin-top:-7.5px; border:3px solid var(--paper); border-radius:50%; background:var(--blue); box-shadow:0 0 0 1px var(--blue); }
input[type="range"]::-moz-range-track { height:4px; border-radius:2px; background:#c5cdd5; }
input[type="range"]::-moz-range-progress { height:4px; background:var(--blue); }
input[type="range"]::-moz-range-thumb { width:13px; height:13px; border:3px solid var(--paper); border-radius:50%; background:var(--blue); box-shadow:0 0 0 1px var(--blue); }
.range-ends { display:flex; justify-content:space-between; color:#596678; font:10px/1.2 var(--mono); margin-top:-2px; }
.pen-scale { position:relative; }
/* The 19px thumb travels within the input width. Align the 100/150 mark
   with its center at that value, rather than two thirds of the whole box. */
.pen-threshold { position:absolute; left:calc(66.666667% - 3.166667px); transform:translateX(-50%); color:var(--blue); }
.pen-threshold::before { content:""; position:absolute; left:50%; bottom:calc(100% + 4px); width:1px; height:8px; background:var(--blue); }
.parameter>p { font-size:11px; color:var(--muted); margin-top:7px; line-height:1.5; }
.curve-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-top:1px solid var(--hair); border-bottom:1px solid var(--hair); margin:23px 0 20px; padding:13px 0 12px; }
.curve-facts>div { text-align:center; border-right:1px solid var(--hair); }
.curve-facts>div:first-child { text-align:left; }
.curve-facts>div:last-child { border:0; text-align:right; }
.curve-facts dt { font:10px/1.5 var(--mono); color:var(--muted); }
.curve-facts dd { margin-top:3px; font-size:21px; font-weight:500; font-variant-numeric:tabular-nums; }
.download-button { width:100%; min-height:48px; display:flex; justify-content:space-between; align-items:center; gap:15px; border:1px solid var(--blue); border-radius:3px; padding:11px 17px; background:var(--blue); color:white; font-size:14px; font-weight:600; }
.download-button:hover:not(:disabled) { background:#285285; }
.download-button svg { width:20px; height:20px; }
.export-size { margin-top:11px; text-align:center; font-size:11px; font-weight:600; }
.export-note { margin-top:6px; text-align:center; font-size:11px; line-height:1.55; color:var(--muted); }
#download-status { font-size:11px; line-height:1.5; color:var(--blue); margin-top:7px; }
#download-status:empty { display:none; }
.about-study { display:grid; grid-template-columns:1fr 1.45fr; gap:60px; padding:37px 0 38px; margin-top:34px; border-top:1px solid var(--hair); }
.about-study h2 { max-width:300px; font:400 37px/1.08 var(--serif); letter-spacing:-.025em; }
.about-study p { font-size:13px; color:#435263; line-height:1.75; }
.about-study p+p { margin-top:9px; }
footer { display:flex; align-items:center; gap:24px; padding:23px 0 29px; border-top:1px solid var(--hair); color:var(--muted); }
footer>span { font:25px var(--serif); color:var(--ink); }
footer p { font-size:11px; flex:1; }
footer a { font-size:11px; text-decoration:none; }
.notice { background:var(--paper); border:1px solid var(--hair); padding:15px 20px; margin:0 0 20px; font-size:14px; }
@media (min-width:1500px) { .drawing { height:510px; } }
@media (max-width:1100px) {
  .shell { width:calc(100% - 48px); }
  .studio { grid-template-columns:minmax(0,1fr) 310px; gap:20px; }
  .controls { padding:21px 20px; }
  .introduction { align-items:flex-start; gap:20px; }
  .introduction>p { max-width:290px; margin-top:21px; font-size:13px; }
  .wide-only { display:none; }
  .presets { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .preset { min-height:70px; padding:8px 12px; }
  .preset>svg { width:43px; height:43px; flex-basis:43px; }
  .preview-heading { padding-inline:13px; }
  .line-key { font-size:10px; }
  figcaption { padding-inline:13px; }
  .about-study { gap:30px; }
}
@media (max-width:780px) {
  .shell { width:calc(100% - 36px); }
  .mast { min-height:73px; gap:15px; }
  .brand { font-size:30px; gap:5px; }
  .brand img { width:31px; height:35px; }
  .back-link { font-size:11px; }
  .introduction { display:block; padding:27px 0 24px; }
  h1 { font-size:clamp(43px,7.8vw,58px); }
  .introduction>p { margin-top:13px; max-width:480px; font-size:14px; }
  .studio { grid-template-columns:minmax(0,1fr); gap:24px; }
  .drawing { height:auto; aspect-ratio:1.2; min-height:300px; max-height:570px; }
  #curve-preview { position:absolute; inset:0; }
  .preview-heading { padding:11px 15px; }
  .presets { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .preset { display:block; padding:9px 10px 11px; }
  .preset>svg { width:55px; height:55px; margin:0 auto 5px; }
  .preset>span { display:block; text-align:center; }
  .controls { padding:23px; }
  .controls-heading { margin-bottom:18px; }
  .controls h2 br { display:none; }
  .parameter { margin-top:19px; }
  .parameter>p { font-size:12px; }
  .curve-facts { margin-top:25px; }
  .curve-facts>div:first-child,.curve-facts>div:last-child { text-align:center; }
  .export-note { max-width:340px; margin-inline:auto; }
  .about-study { grid-template-columns:1fr; gap:15px; margin-top:30px; padding:29px 0; }
  .about-study h2 { max-width:none; font-size:33px; }
  footer { flex-wrap:wrap; gap:10px 20px; }
  footer p { flex-basis:calc(100% - 190px); }
}
@media (max-width:440px) {
  .shell { width:calc(100% - 28px); }
  .brand { font-size:27px; }
  .back-link { width:79px; line-height:1.35; }
  .back-link>span { display:none; }
  .introduction { padding-top:23px; }
  h1 { font-size:44px; max-width:310px; }
  .introduction>p { font-size:13px; }
  .preview-heading { padding:10px 12px; }
  .preview-heading .eyebrow { font-size:9px; letter-spacing:.06em; }
  .line-key { font-size:9px; gap:4px; }
  .line-key i { width:11px; }
  .drawing { min-height:270px; aspect-ratio:1; }
  figcaption { flex-wrap:wrap; gap:3px; min-height:57px; padding:10px 12px; }
  #status { text-align:left; font-size:10px; }
  .presets { gap:6px; }
  .preset { padding:8px 4px 10px; }
  .preset>svg { width:47px; height:47px; }
  .preset strong { font-size:12px; }
  .preset small { font-size:9px; }
  .presets-heading>span { font-size:16px; }
  .controls { padding:20px; }
  .controls h2 { font-size:27px; }
  footer p { flex-basis:100%; }
}
/* Keep the curve in sight while a portrait-screen visitor adjusts its gears.
   Flatten only the visual wrapper so the figure's sticky boundary is the
   entire studio, including the controls. DOM and keyboard order are unchanged. */
@media (max-width:780px) and (min-height:600px) {
  .studio { gap:18px; }
  .drawing-column { display:contents; }
  .preview-panel { position:sticky; top:0; z-index:3; align-self:start; box-shadow:0 5px 0 var(--pink),0 9px 16px #1c2e4414; }
  .preview-heading { min-height:32px; padding:7px 12px; }
  .drawing { height:clamp(150px,25svh,205px); min-height:0; max-height:none; aspect-ratio:auto; }
  .preview-panel figcaption { min-height:38px; padding:7px 12px; gap:3px 10px; }
  .preview-panel figcaption strong { font-size:12px; }
  #status { font-size:9px; }
  .presets-heading { margin:0; }
  .presets { margin-top:-8px; }
  .preset,.reset-button,input[type="range"],.download-button { scroll-margin-top:calc(clamp(150px,25svh,205px) + 100px); }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior:auto !important; transition:none !important; animation:none !important; } }
