/* Haunted Scotland Audio Lab
   Visual companion to the current Haunted Scotland ITC Laboratory.
   Layout, interaction and audio processing remain in their existing files. */

:root {
  --bg: #090d0e;
  --panel: #101516;
  --panel-raised: #1a201f;
  --panel-deep: #0b1011;
  --line: #343128;
  --line-subtle: #302f27;
  --text: #f2eee3;
  --text-secondary: #ddd7c8;
  --muted: #b5b4aa;
  --amber: #d2ad68;
  --gold: #d2ad68;
  --gold-secondary: #bba478;
  --sage: #b5c1aa;
  --taupe: #a99777;
  --mint: #d2ad68;
  --mint-bright: #e0bf80;
  --mint-dim: rgba(210, 173, 104, .09);
  --radius: 4px;
  --font: 'DM Sans', 'Avenir Next', Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display-font: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

body {
  position: relative;
  isolation: isolate;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

/* The original ITC cover is shown unchanged, beneath a dark readability layer. */
body::before {
  content: '';
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: 0 0 auto;
  height: 440px;
  background:
    linear-gradient(180deg, rgba(9, 13, 14, .78) 0%, rgba(9, 13, 14, .82) 44%, #090d0e 100%),
    url('images/haunted-scotland-cover.jpg') center 25% / cover no-repeat;
}

.site-header {
  height: 96px;
  border-bottom-color: rgba(165, 138, 81, .4);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 25px;
  flex-shrink: 0;
}

/* The live Haunted Scotland wordmark: typography, without an invented symbol. */
.brand {
  display: block;
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: .2em;
  white-space: nowrap;
  text-shadow: 0 2px 10px #000;
}

.brand small {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font: 11px var(--font);
  text-align: center;
  letter-spacing: .36em;
}

.app-descriptor {
  padding: 8px 0 8px 23px;
  border-left: 1px solid #75603d;
  color: #e4cfaa;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .16em;
}

.header-actions { gap: 24px; }
.local-label { color: #d0c4ac; }
.live-dot { background: var(--gold); }

.companion-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: #e6ddc9;
  font-size: 13px;
  white-space: nowrap;
  text-decoration: none;
}

.companion-link span { color: var(--gold); }
.companion-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.help-button { color: #e6ddc9; }
.help-button svg { color: var(--gold-secondary); }

.page-heading { padding-top: 30px; padding-bottom: 27px; }
.eyebrow { color: var(--gold); letter-spacing: .18em; }
.page-heading .eyebrow { font-size: 11px; margin-bottom: 9px; }

h1 {
  color: var(--text);
  font-family: var(--display-font);
  font-size: 58px;
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: .01em;
  text-shadow: 0 2px 18px #000;
}

h1 > span { color: var(--text); }
.page-intro { margin-top: 11px; color: #d1c9b7; font-size: 14px; }
.page-intro strong { color: var(--text); font-weight: 500; }
.workspace-status { color: #cdc4b1; }
.workspace-status.error { color: var(--danger); }

.panel {
  background: var(--panel);
  border-color: #4b4231;
  border-radius: 4px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .14);
}

.analysis-panel { border-color: #6c5837; }
.cleanup-panel { background: linear-gradient(160deg, #171b18, #101516 65%); }
.section-label { color: #d4cab7; }
.section-label > span { color: var(--gold); }
.small-badge { color: #c6baa2; border-color: #625338; background: #1c1d17; border-radius: 3px; }
.panel-glyph { color: var(--gold-secondary); }

.cleanup-title,
.bottom-title,
.dialog-heading h2 {
  font-family: var(--display-font);
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--text);
}

.cleanup-title { font-size: 32px; line-height: 1.1; }
.bottom-title { font-size: 31px; line-height: 1.15; }
.dialog-heading h2 { font-size: 35px; line-height: 1.1; }
.cleanup-intro, .section-intro { color: var(--muted); }

.button { border-radius: 3px; }
.button-primary, .play-button {
  color: #121410;
  background: var(--gold);
  border-color: var(--gold);
}

.button-primary:not(:disabled):hover, .play-button:not(:disabled):hover {
  background: #e0bf80;
  border-color: #e0bf80;
  color: #121410;
}

.button-secondary {
  color: var(--text);
  background: #1a201f;
  border-color: #807052;
}

.button-secondary:not(:disabled):hover {
  color: var(--text);
  background: #292a23;
  border-color: #b3975e;
}

.button-quiet { color: #d8ceba; border-color: #74664c; }
.button-quiet:not(:disabled):hover { background: #252720; border-color: #ab925f; color: var(--text); }
.button-text { color: var(--muted); }
.button-text:not(:disabled):hover { color: var(--gold); }
.button-text, .compact-button, .skip-button, .help-button { border-color: transparent; }
.help-button:not(:disabled):hover { background: transparent; color: var(--gold); }

.drop-zone,
.loaded .drop-zone {
  border-color: #8e7447;
  border-radius: 4px;
  background: linear-gradient(110deg, rgba(210, 173, 104, .09), rgba(210, 173, 104, .015));
}

.drop-zone.is-dragging, .is-dragging .drop-zone {
  background: rgba(210, 173, 104, .15);
  border-color: var(--gold);
}

.file-icon, .loaded .file-icon { color: var(--gold); }
.file-copy h3 { color: var(--text); }
.file-copy > p { color: var(--muted); }
.file-copy > p.sample-note { color: #d8bd8c; }
.signal-label, .frequency-control { color: var(--muted); }
.signal-label output { color: #ddd2bd; }
.toolbar-divider { background: #6c5c3e; }
.spectral-dot { background: var(--gold); }

.visuals { background: #0c1112; border-color: #373329; }
.view-heading { color: #c8baa0; }
.view-heading > span:last-child { color: #b5b4aa; }
.spectrum-heading { border-color: #39372d; }
.canvas-frame {
  background: linear-gradient(transparent calc(50% - .5px), #343128 calc(50% - .5px), #343128 calc(50% + .5px), transparent calc(50% + .5px));
}

.canvas-frame canvas {
  background-image: linear-gradient(to right, rgba(166, 145, 107, .11) 1px, transparent 1px);
  border-right-color: #343128;
}

.loaded canvas { background-image: none; }
.spectrogram-frame {
  background: linear-gradient(to bottom, transparent calc(50% - .5px), rgba(166, 145, 107, .13) calc(50% - .5px), rgba(166, 145, 107, .13) calc(50% + .5px), transparent calc(50% + .5px));
}

.frequency-axis, .amplitude-axis { color: #b5b4aa; }
.spectrum-key { background: linear-gradient(90deg, #0b1219 0%, #5b2b4e 25%, #a8413a 50%, #e5803a 75%, #fff3d0 100%); }
.visual-empty {
  background: radial-gradient(ellipse, rgba(12, 17, 18, .98) 0%, rgba(12, 17, 18, .93) 28%, rgba(12, 17, 18, .12) 76%);
}

.empty-focus { color: var(--taupe); }
.visual-empty strong { color: #e3ddcf; font-family: var(--display-font); font-size: 28px; font-weight: 500; }
.visual-empty p, .empty-caption { color: var(--muted); }
.visuals-caption { background: #0d1213; border-color: #343128; color: var(--muted); }
.transport-options { border-color: #343128; }
.time-display > #time { color: var(--text); }
.time-display > #time-total { color: var(--muted); }

.source-switch { background: #0b1011; border-color: #66583d; border-radius: 3px; }
.source-switch button { color: #c9c0ac; border-radius: 2px; }
.source-switch button.active {
  color: #e8c787;
  background: #322b1d;
  border-color: #a48853;
}

.source-switch button:not(:disabled):hover { color: var(--text); }
.checkbox-label { color: #ddd7c8; }
.checkbox-label input[type=checkbox] { background: #0e1414; border-color: #a19070; }
.checkbox-label input[type=checkbox]::after { border-bottom-color: #18170f; border-left-color: #18170f; }
.checkbox-label input[type=checkbox]:checked { background: var(--gold); border-color: var(--gold); }

input[type=range] { accent-color: var(--gold); }
input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(90deg, #bc9857, #584b33); }
input[type=range]::-moz-range-track { background: #9f8452; }
input[type=range]::-webkit-slider-thumb {
  background: var(--gold);
  border-color: #e0bc7a;
  box-shadow: 0 0 0 4px rgba(210, 173, 104, .045);
}
input[type=range]::-moz-range-thumb { background: var(--gold); border-color: #e0bc7a; }
.volume-control svg { color: var(--gold-secondary); }

.selection-disclosure { background: #0e1414; border-color: #4c422f; }
.selection-disclosure > summary { color: var(--muted); }
.selection-disclosure > summary strong { color: var(--text-secondary); }
.selection-disclosure > summary > span > span { color: var(--muted); }
.noise-learning { border-color: #343128; }
.noise-learning strong { color: var(--text-secondary); }
.noise-learning p { color: var(--muted); }
.noise-learning .noise-profile { color: #d2bd93; }

.preset-option {
  color: var(--text-secondary);
  background: #0c1212;
  border-color: #6b5d43;
  border-radius: 4px;
}
.preset-option:hover { background: #28251e; border-color: #aa8f58; }
.preset-option.active {
  color: var(--text);
  background: linear-gradient(115deg, rgba(210, 173, 104, .15), rgba(210, 173, 104, .055));
  border-color: #b5975d;
}
.preset-icon { color: var(--gold-secondary); }
.preset-option.active .preset-icon { color: var(--gold); }
.preset-option small { color: var(--muted); }
.preset-radio { border-color: #a08a5f; }
.preset-option.active .preset-radio { border-color: var(--gold); }
.preset-option.active .preset-radio::after { background: var(--gold); }
.noise-control, .fine-tune { border-color: #383328; }
.switch-row, .select-setting { color: var(--text-secondary); }
.switch-row small, .select-setting small { color: var(--muted); }
.switch-input { background: #2a2a25; border-color: #9b8863; }
.switch-input::after { background: #c0b9a7; }
.switch-input:checked { background: #685631; border-color: #c09f60; }
.switch-input:checked::after { background: #ecd39f; }
.range-heading { color: var(--muted); }
.range-heading output { color: #e0bf80; }
.range-extents { color: var(--muted); }
.settings-status { color: var(--muted); }
.settings-status .live-dot { background: var(--gold); }
.process-summary { color: #dac69b; }
.processing-note { color: var(--muted); }
.listening-tip { border-color: #383328; }
.listening-tip > svg { color: var(--gold-secondary); }
.listening-tip p { color: var(--muted); }
.listening-tip strong { color: #d8c8a8; }
progress { background: #443a28; accent-color: var(--gold); }
progress::-webkit-progress-bar { background: #443a28; }
progress::-webkit-progress-value { background: var(--gold); }
progress::-moz-progress-bar { background: var(--gold); }
.is-busy .settings-status .live-dot { background: var(--gold); }

.count-badge { color: #e0c28a; background: #28241b; border-color: #8a7145; border-radius: 3px; }
.markers-list { scrollbar-color: #8d754c #101516; }
.marker-item { border-color: #343128; }
.marker-time { color: #e8c98a; background: #2a2519; border-color: #9b814f; border-radius: 3px; }
.marker-text { color: var(--text-secondary); }
.marker-remove { color: var(--muted); }
.marker-remove:hover { color: var(--danger); }
.marker-empty { color: var(--taupe); border-color: #67583c; border-radius: 4px; }
.marker-empty p { color: #d0c7b6; }
.marker-empty p > span { color: var(--muted); }
.observation-note { color: var(--muted); border-color: #343128; }
.observation-note > span { color: var(--gold-secondary); }

input[type=text], input[type=number], textarea, select {
  color: var(--text);
  background: #0c1212;
  border-color: #88785a;
  border-radius: 3px;
}
input[type=text]:hover, input[type=number]:hover, textarea:hover, select:hover { border-color: #b59962; }
input::placeholder, textarea::placeholder { color: #b5b1a4; }
.save-fields label { color: #ddd7c8; }
.optional { color: #bbb5a7; }
.export-options > label:first-child { color: var(--muted); }
.download-actions .button-quiet { border-color: #66583d; }
.export-explainer { color: var(--muted); }
.export-status { color: #e0c189; }
.session-save-status { margin-top: 12px; color: var(--text-secondary); font-size: 13px; line-height: 1.7; }
.session-save-status:empty { display: none; }
.save-confirmation { margin-top: 12px; padding: 14px; background: rgba(210, 173, 104, .055); border: 1px solid #8f774b; border-radius: 4px; }
.save-confirmation p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.save-confirmation .button { margin-top: 12px; min-height: 44px; font-size: 13px; }
.download-ready { color: #e2c68e; background: rgba(210, 173, 104, .09); border-color: #a78a50; border-radius: 3px; }
.cms-notice { color: #c4b58f; border-color: #343128; }
.loaded .mobile-cleanup-link { color: #e0c189; border-color: #a58a54; }

.site-footer { border-top: 1px solid #343128; margin-top: 28px; padding-top: 23px; }
.site-footer p { color: var(--gold-secondary); }
.version-badge { color: #c9b990; border-color: #79613b; border-radius: 3px; }

.help-dialog { background: #111718; border-color: #8b7449; border-radius: 4px; scrollbar-color: #8f764b #111718; }
.help-dialog::backdrop { background: rgba(4, 6, 6, .86); }
.help-lede, .help-steps p, .help-glossary p, .help-section p { color: var(--muted); }
.icon-button { color: #e2d8c1; background: #29261d; border-color: #a48a56; }
.icon-button:hover { color: var(--text); border-color: #ddba75; }
.help-steps li > span { color: #e0be7d; background: #29251b; border-color: #8f7547; border-radius: 3px; }
.help-steps strong, .help-glossary h3, .help-section h3 { color: var(--text); }
.help-glossary { background: #181b18; border-color: #5f5137; border-radius: 3px; }
.help-section { border-color: #343128; }
.help-section p strong { color: var(--text-secondary); }
.toast { background: #28291f; border-color: #a68a53; border-radius: 3px; }
.toast.error { background: #382721; border-color: #ad7d65; color: #f2d4c7; }

@media (max-width: 1100px) {
  .app-descriptor, .local-label { display: none; }
  .brand { font-size: 18px; }
  .header-actions { gap: 22px; }
}

@media (max-width: 900px) {
  h1 { font-size: 52px; }
  .page-heading { padding-top: 28px; }
}

@media (min-width: 901px) and (max-width: 1240px) {
  .frequency-control > span { display: inline; }
}

@media (max-width: 650px) {
  body::before {
    height: 345px;
    background-position: center 20%;
    background-size: auto 345px;
  }
  .site-header { height: 88px; gap: 12px; }
  .brand { font-size: 14px; letter-spacing: .14em; }
  .brand small { font-size: 10px; letter-spacing: .25em; margin-top: 7px; }
  .brand-lockup { gap: 0; }
  .companion-link { display: none; }
  .header-actions { gap: 0; }
  .help-button { font-size: 13px; }
  .page-heading { padding-top: 25px; padding-bottom: 24px; }
  .page-heading .eyebrow { font-size: 10px; letter-spacing: .13em; line-height: 1.6; }
  h1 { font-size: 46px; }
  .page-intro { font-size: 14px; max-width: 340px; line-height: 1.8; }
  .workspace-status { font-size: 13px; color: #cec4af; }
  .panel { border-radius: 4px; }
  .cleanup-title { font-size: 32px; }
  .bottom-title { font-size: 29px; }
  .dialog-heading h2 { font-size: 30px; }
  .visual-empty strong { font-size: 25px; }
  .visual-empty p { font-size: 13px; }
  .button, .source-switch button { min-height: 44px; }
  .apply-button, .download-actions .button-primary { min-height: 48px; }
  .save-confirmation .button { width: 100%; min-height: 48px; font-size: 14px; }
  input[type=text], input[type=number], textarea, select,
  .save-fields textarea, .marker-compose > input,
  .frequency-control select, .speed-control select,
  .select-setting select, .export-options select { font-size: 16px; }
  .site-footer { margin-top: 23px; }
}

@media (max-width: 380px) {
  .brand { font-size: 13px; letter-spacing: .105em; }
  .brand small { letter-spacing: .23em; }
  .page-heading .eyebrow { letter-spacing: .08em; }
  h1 { font-size: 43px; }
}
