/* violin.css — ManyHand Online Violin: a dark, warm console (a violin case) on the cream site page. */

:root{
  --cream:#faf5ec; --paper:#fffdf8; --ink:#221a12; --inksoft:#6f6152;
  --brand:#0e386d; --brand2:#0b7d74; --line:#e8ddc9;

  --bg:#140b0d; --panel:#1d1215; --panel2:#26181b; --panel3:#321f22;
  --edge:#3a272a; --edge2:#4d3438; --edge3:#6a4a4e;
  --text:#f3e9dc; --dim:#bba796; --faint:#8a7666;
  --gold:#e3b25e; --gold2:#f4d08f; --rose:#e98b7a;
  --r:14px;
}

*{ box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
html,body{ height:100%; }
body{ font-family:"Hanken Grotesk",system-ui,-apple-system,sans-serif; background:var(--cream); color:var(--ink);
  line-height:1.5; display:flex; flex-direction:column; min-height:100%; }
button,select,input{ font:inherit; color:inherit; }
button{ cursor:pointer; }
svg{ display:block; }

header.site{ display:flex; align-items:center; justify-content:space-between; padding:12px 18px;
  border-bottom:1.5px solid var(--line); background:var(--paper); }
header.site .brand{ font-family:"Fraunces",Georgia,serif; font-weight:900; font-size:20px; letter-spacing:-.02em;
  color:var(--brand); text-decoration:none; display:flex; align-items:center; gap:8px; }
header.site .brand img{ width:24px; height:24px; }
header.site .brand span{ color:var(--brand2); }
header.site .back{ font-size:13px; font-weight:700; color:var(--brand); text-decoration:none; }

main{ width:100%; max-width:1240px; margin:0 auto; padding:16px 14px calc(36px + env(safe-area-inset-bottom)); }
h1.title{ font-family:"Fraunces",Georgia,serif; font-weight:900; font-size:30px; letter-spacing:-.02em; text-align:center; margin:2px 0 0; }
.sub{ text-align:center; color:var(--inksoft); font-size:15px; margin:2px auto 14px; max-width:660px; }

/* ===================================================================== */
/* The console                                                            */
/* ===================================================================== */
.console{ position:relative; background:var(--bg); color:var(--text); border-radius:22px; padding:10px;
  box-shadow:0 30px 60px -36px rgba(30,8,12,.8), 0 0 0 1px #000 inset; isolation:isolate; }
.console .lbl{ font-size:10.5px; font-weight:800; letter-spacing:.13em; text-transform:uppercase; color:var(--faint); }
.console .sp{ flex:1 1 auto; }
.console select{ appearance:none; -webkit-appearance:none; background:var(--panel2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23bba796' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border:1px solid var(--edge2); border-radius:10px; padding:7px 28px 7px 11px; font-size:13.5px; font-weight:700; color:var(--text); cursor:pointer; width:100%; }
.console select option{ background:#26181b; color:var(--text); }
.console select:focus-visible, .console button:focus-visible, .console input:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }

.topbar{ display:flex; align-items:center; gap:8px 10px; padding:2px 2px 10px; flex-wrap:wrap; }
.seg{ display:inline-flex; background:var(--panel); border:1px solid var(--edge); border-radius:11px; padding:3px; gap:2px; }
.seg button{ border:0; background:transparent; color:var(--dim); font-size:13.5px; font-weight:800; padding:6px 13px; border-radius:8px; white-space:nowrap; }
.seg button[aria-pressed="true"]{ background:var(--panel3); color:var(--gold2); box-shadow:0 1px 0 rgba(255,255,255,.06) inset, 0 2px 6px -2px #000; }
.seg.sm button{ padding:5px 10px; font-size:12.5px; }
.tbtn{ display:inline-flex; align-items:center; gap:7px; border:1px solid var(--edge2); background:var(--panel2); border-radius:11px;
  padding:7px 12px; font-size:13.5px; font-weight:800; color:var(--text); }
.tbtn svg{ width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.tbtn:hover{ border-color:var(--edge3); background:var(--panel3); }
.tbtn[aria-expanded="true"]{ border-color:var(--gold); color:var(--gold2); }
.tbtn.icon span{ display:none; }
@media (min-width:900px){ .tbtn.icon span{ display:inline; } }

.dyn{ display:inline-flex; align-items:center; gap:8px; background:var(--panel); border:1px solid var(--edge); border-radius:11px; padding:5px 10px; }
.dyn output{ font:italic 800 15px/1 "Fraunces",Georgia,serif; color:var(--gold2); min-width:24px; text-align:center; }
input[type=range]{ -webkit-appearance:none; appearance:none; background:transparent; width:120px; height:22px; cursor:pointer; }
input[type=range]::-webkit-slider-runnable-track{ height:4px; border-radius:2px; background:linear-gradient(90deg, #4d3438, var(--gold)); }
input[type=range]::-moz-range-track{ height:4px; border-radius:2px; background:linear-gradient(90deg, #4d3438, var(--gold)); }
input[type=range]::-webkit-slider-thumb{ -webkit-appearance:none; width:16px; height:16px; border-radius:50%; background:var(--gold2); margin-top:-6px; border:2px solid #2a1a1c; box-shadow:0 1px 4px #000; }
input[type=range]::-moz-range-thumb{ width:14px; height:14px; border-radius:50%; background:var(--gold2); border:2px solid #2a1a1c; }

/* settings */
.sheet{ position:relative; background:var(--panel); border:1px solid var(--edge); border-radius:14px; padding:14px 44px 14px 14px; margin:0 0 10px; }
.sheet[hidden]{ display:none; }
.sheet-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:12px 16px; }
.sheet-grid label{ display:flex; flex-direction:column; gap:5px; font-size:12px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--faint); }
.sheet-grid label input[type=range]{ width:100%; }
.sheet-grid label.check{ flex-direction:row; align-items:center; gap:8px; text-transform:none; letter-spacing:0; font-size:13.5px; font-weight:700; color:var(--dim); }
.sheet-grid label.check input{ width:17px; height:17px; accent-color:var(--gold); }
.sheet .x{ position:absolute; right:8px; top:8px; width:30px; height:30px; border-radius:9px; border:1px solid var(--edge2); background:var(--panel2); color:var(--dim); font-size:13px; }

/* the stage */
.stage{ position:relative; border-radius:16px; overflow:hidden; background:#12060a; border:1px solid var(--edge);
  height:clamp(280px, 52vh, 540px); touch-action:none; user-select:none; -webkit-user-select:none; }
.stage canvas{ position:absolute; inset:0; width:100%; height:100%; display:block; touch-action:none; }
.now{ position:absolute; left:12px; top:10px; display:flex; align-items:baseline; gap:8px; padding:6px 12px; border-radius:12px;
  background:rgba(18,6,9,.62); border:1px solid rgba(243,233,220,.12); pointer-events:none; opacity:0; transform:translateY(-4px);
  transition:opacity .25s, transform .25s; backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px); }
.now.on{ opacity:1; transform:none; }
.now b{ font:900 22px/1 "Fraunces",Georgia,serif; color:var(--gold2); letter-spacing:-.01em; }
.now span{ font-size:12px; font-weight:700; color:var(--dim); }
.stage-hint{ position:absolute; left:50%; bottom:12px; transform:translateX(-50%); font-size:12.5px; font-weight:700; color:rgba(255,240,225,.8);
  background:rgba(18,6,9,.6); padding:6px 12px; border-radius:20px; pointer-events:none; transition:opacity .6s; white-space:nowrap; max-width:calc(100% - 24px); overflow:hidden; text-overflow:ellipsis; }
.stage-hint.gone{ opacity:0; }

/* the computer-keyboard strip (only where there is a keyboard) */
.keys{ display:none; padding:10px 4px 2px; gap:4px; flex-direction:column; align-items:center; }
@media (hover:hover) and (pointer:fine){ .keys{ display:flex; } }
.krow{ display:flex; gap:4px; align-items:center; }
.keys[data-layout="piano"] .krow.blk{ margin-left:22px; }
.keys[data-layout="piano"] .krow:nth-child(3){ margin-left:30px; }
.keys[data-layout="piano"] .krow:nth-child(4){ margin-left:8px; }
.kname{ width:20px; font:800 12px/1 "Fraunces",Georgia,serif; color:var(--gold); text-align:right; margin-right:4px; }
.kgap{ width:38px; }
.keys kbd{ position:relative; display:inline-flex; flex-direction:column; align-items:center; justify-content:center; width:38px; height:34px;
  border-radius:7px; background:var(--panel2); border:1px solid var(--edge2); border-bottom-width:3px; color:var(--text);
  font:700 12px/1 "JetBrains Mono",ui-monospace,monospace; transition:transform .05s, background .1s; }
.keys kbd i{ font:700 9.5px/1 "Hanken Grotesk",system-ui,sans-serif; font-style:normal; color:var(--faint); margin-top:3px; }
.keys .krow.blk kbd{ background:#0f0809; }
.keys kbd.down{ background:var(--gold); color:#2a1306; border-color:var(--gold2); transform:translateY(2px); border-bottom-width:1px; }
.keys kbd.down i{ color:#5a3412; }

/* full screen */
html.violin-full, html.violin-full body{ overflow:hidden; }
.console.full{ position:fixed; inset:0; z-index:50; border-radius:0; padding:calc(6px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
  display:flex; flex-direction:column; }
.console.full .stage{ flex:1 1 auto; height:auto; min-height:0; }
.console.full .keys{ display:none; }
.console.full .topbar{ padding-bottom:6px; }

/* phones held upright: the board stands up and grows tall */
@media (max-width:640px) and (orientation:portrait){
  .stage{ height:min(72vh, 640px); }
  .topbar{ gap:6px; }
  .seg.sm button{ padding:5px 7px; }
  input[type=range]{ width:90px; }
  h1.title{ font-size:26px; }
}

/* ===================================================================== */
/* The guide                                                              */
/* ===================================================================== */
.guide{ max-width:860px; margin:30px auto 0; padding:0 4px; }
.guide h2{ font-family:"Fraunces",Georgia,serif; font-weight:800; font-size:22px; letter-spacing:-.01em; margin:26px 0 8px; }
.guide h3{ font-size:15px; font-weight:800; margin:4px 0 6px; color:var(--ink); }
.guide p{ color:#43382c; font-size:15px; margin:0 0 10px; }
.guide .cols{ display:grid; grid-template-columns:1fr 1fr; gap:6px 28px; }
@media (max-width:720px){ .guide .cols{ grid-template-columns:1fr; } }
.guide details{ border-top:1.5px solid var(--line); padding:11px 0; }
.guide details:last-child{ border-bottom:1.5px solid var(--line); }
.guide summary{ cursor:pointer; font-weight:700; font-size:14.5px; }
.guide details p{ margin:8px 0 0; color:var(--inksoft); font-size:14.5px; }

footer{ text-align:center; font-size:13px; color:var(--inksoft); padding:22px 14px calc(22px + env(safe-area-inset-bottom)); border-top:1.5px solid var(--line); margin-top:auto; }
footer a{ color:var(--brand); font-weight:700; text-decoration:none; }
