/* ===========================================================
   WCGF Six-String Studio — shared dark theme
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@500;700;800&family=Sora:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  /* Surfaces */
  --ink-0: #07090d;
  --ink-1: #0d1117;
  --ink-2: #141a22;
  --ink-3: #1c2330;
  --ink-4: #2a3344;
  --line:  #2c3445;

  /* Text */
  --text-1: #f1efe7;
  --text-2: #c8cbd6;
  --text-3: #8a90a3;

  /* Brand: warm copper / amber – musical, vintage but modern */
  --copper:        #e8a154;
  --copper-bright: #ffc481;
  --copper-deep:   #b46a1d;
  --ember:         #ff6b3d;

  /* States */
  --green:  #5be39a;
  --yellow: #f6cc4a;
  --red:    #ff5e5e;

  /* Effects */
  --grain-opacity: 0.035;

  --font-display: "Unbounded", "Bricolage Grotesque", system-ui, sans-serif;
  --font-body:    "Sora", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--ink-0);
  color: var(--text-1);
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.005em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle film-grain layer used across the suite */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.78 0 0 0 0 0.50 0 0 0 0.7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 1000;
  mix-blend-mode: overlay;
}

a { color: var(--copper-bright); text-decoration: none; }
a:hover { color: var(--copper); }

button { font-family: inherit; }

/* ============================ Top bar ========================= */
.suite-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  background: linear-gradient(180deg, rgba(7,9,13,0.92), rgba(7,9,13,0.65));
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.suite-bar .brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text-1);
}
.suite-bar .brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 6px 18px rgba(232,161,84,.18), 0 0 0 1px rgba(232,161,84,.12);
}
.suite-bar .brand-mark img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}
.suite-bar .brand-text {
  display: flex; flex-direction: column; line-height: 1;
}
.suite-bar .brand-text b {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  letter-spacing: 0.02em;
}
.suite-bar .brand-text span {
  margin-top: 4px;
  font-size: 10px; color: var(--text-3); letter-spacing: 0.18em; text-transform: uppercase;
}
.suite-bar .nav-actions { display: flex; gap: 10px; align-items: center; }
.suite-user {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-2);
  padding: 8px 12px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 999px;
}
.suite-user em { color: var(--copper-bright); font-style: normal; }

.btn-ghost, .btn-pill, .btn-primary {
  border: 1px solid var(--line);
  background: var(--ink-2);
  color: var(--text-1);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .05s ease;
}
.btn-ghost:hover { background: var(--ink-3); border-color: #3a4358; }
.btn-ghost:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--copper-bright), var(--copper) 60%, var(--copper-deep));
  color: #1a1006;
  border-color: transparent;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(232,161,84,0.22), inset 0 -6px 14px rgba(0,0,0,.18);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }
.btn-pill { background: transparent; }

/* close-circle pattern used across the tool views */
.close-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2);
  padding: 8px 14px; border-radius: 999px;
  background: var(--ink-2); border: 1px solid var(--line);
}
.close-link:hover { color: var(--text-1); border-color: #3a4358; }

/* ============================ Page shell ========================= */
.suite-page {
  min-height: calc(100vh - 80px);
  padding: 36px 28px 80px;
  max-width: 1240px; margin: 0 auto;
}

.tool-shell {
  min-height: calc(100vh - 80px);
  padding: 28px 22px 80px;
  max-width: 760px;
  margin: 0 auto;
}

.tool-shell.wide { max-width: 920px; }

.tool-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4.6vw, 44px);
  letter-spacing: -0.01em;
  margin: 8px 0 6px;
}
.tool-sub {
  color: var(--text-3); font-size: 13px; letter-spacing: 0.16em;
  text-transform: uppercase; margin-bottom: 26px;
}

/* ============================ Cards ========================= */
.card {
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 14px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.03);
}

/* glass LCD common to tools */
.lcd {
  background: linear-gradient(180deg, #0a0e15, #060a10);
  border: 1px solid var(--copper-deep);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 0 0 1px rgba(232,161,84,.12), inset 0 0 30px rgba(232,161,84,.08), 0 18px 36px rgba(0,0,0,.55);
  color: var(--copper-bright);
}

/* shared rubber buttons (tool controls) */
.rubber {
  background: linear-gradient(180deg, #2a3344, #15192266);
  border: 1px solid #2f3a4f;
  border-bottom: 3px solid #0c1019;
  color: var(--text-1);
  padding: 10px 16px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: filter .15s ease, transform .04s ease, box-shadow .15s ease;
}
.rubber:hover { filter: brightness(1.08); box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.rubber:active { transform: translateY(1px); }
.rubber.copper {
  background: linear-gradient(180deg, var(--copper-bright), var(--copper) 60%, var(--copper-deep));
  color: #1b1106;
  border-color: transparent;
  border-bottom: 3px solid #6e3b08;
  font-weight: 700;
}
.rubber.copper:hover { filter: brightness(1.06); }

/* range slider styling */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--ink-4); border-radius: 999px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px;
  background: var(--copper-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(232,161,84,.18);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  background: var(--copper-bright);
  border-radius: 50%; border: none;
  box-shadow: 0 0 0 4px rgba(232,161,84,.18);
  cursor: pointer;
}

/* generic inputs */
.text-input, select.text-input {
  width: 100%;
  padding: 13px 14px;
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-1);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.text-input:focus { border-color: var(--copper); background: #11161e; }

/* fade-in helper */
@keyframes float-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.float-in { animation: float-in .5s ease both; }

/* hide for accessibility but visible to assistive tech */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================ Active timer chip ============================ */
.timer-chip {
  display: none;
  align-items: center; gap: 8px;
  padding: 7px 12px 7px 10px;
  background: linear-gradient(180deg, rgba(232,161,84,.18), rgba(232,161,84,.08));
  border: 1px solid rgba(232,161,84,.45);
  color: var(--copper-bright);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
  max-width: 220px; overflow: hidden;
}
.timer-chip:hover { background: rgba(232,161,84,.22); border-color: var(--copper); }
.timer-chip:active { transform: translateY(1px); }
.timer-chip.show { display: inline-flex; }
.timer-chip .tc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #5be39a; box-shadow: 0 0 6px #5be39a;
  animation: tc-pulse 1.4s ease-in-out infinite;
}
@keyframes tc-pulse { 0%,100%{opacity:.55;} 50%{opacity:1;} }
.timer-chip.warning { border-color: #ff6b6b; color: #ffb8b8; background: rgba(255,107,107,.12); }
.timer-chip.warning .tc-dot { background: #ff6b6b; box-shadow: 0 0 6px #ff6b6b; animation-duration: .65s; }
.timer-chip .tc-time { font-size: 13px; white-space: nowrap; }
.timer-chip .tc-label {
  font-family: var(--font-body); font-weight: 500;
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.12em;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis;
}

/* ============================ Toast ============================ */
.wcgf-toast-host {
  position: fixed; left: 0; right: 0; top: 86px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none; z-index: 1000;
}
.wcgf-toast {
  pointer-events: auto;
  background: linear-gradient(180deg, #1a2030, #10141d);
  border: 1px solid rgba(232,161,84,.5);
  color: var(--text-1);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(232,161,84,.18) inset;
  opacity: 0; transform: translateY(-12px);
  transition: opacity .25s ease, transform .25s ease;
}
.wcgf-toast.in { opacity: 1; transform: translateY(0); }

/* responsive shared */
@media (max-width: 720px) {
  .suite-bar { padding: 14px 16px; }
  .suite-page, .tool-shell { padding: 22px 14px 60px; }
  .suite-bar .brand-text span { display: none; }
  .timer-chip .tc-label { display: none; }
  /* On mobile the pulsing dot pushes the time off-centre. The chip itself
     is already glowing to indicate the timer is running, so we hide the dot
     and centre the MM:SS text inside the pill. */
  .timer-chip .tc-dot { display: none; }
  .timer-chip {
    max-width: none;
    padding: 7px 14px;
    gap: 0;
    justify-content: center;
  }
}
