:root{
  --blue:#087cff;--cyan:#00d5f5;--teal:#00e7c3;--green:#39f36d;
  --white:#f8fbff;--muted:#a9b8c9;--bg:#03070d;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg)}
body{
  min-height:100vh;color:var(--white);font-family:"DM Sans",Arial,sans-serif;
  background:
    radial-gradient(ellipse at 50% 45%,rgba(0,94,145,.17),transparent 43%),
    radial-gradient(ellipse at 50% 0%,rgba(0,46,85,.13),transparent 42%),
    #03070d;
  overflow-x:hidden;
}
main{
  width:min(1500px,100%);min-height:100vh;margin:auto;padding:22px 36px 36px;
  display:flex;flex-direction:column;align-items:center;
}
.brand{
  display:block;height:auto;margin:8px 0 22px;padding:0;
  text-align:center;text-decoration:none;white-space:nowrap;line-height:.8;
}
.brand .brand-script{font-family:Georgia,serif;font-style:italic;
  font-size:37px;font-weight:400;letter-spacing:normal;color:#f5efe3}
.brand .brand-guitar{font-family:Georgia,serif;font-style:italic;font-size:32px;
  font-weight:400;letter-spacing:normal;color:#f5a623}
.brand small{display:block;position:static;transform:none;margin-top:8px;
  font:400 8px/1 "DM Sans",Arial,sans-serif;letter-spacing:4px;color:#8e9aa5}
.tuner{
  width:100%;display:flex;flex-direction:column;align-items:center;
  flex:1;justify-content:center;padding-bottom:18px;
}
.display{
  width:min(100%,1380px);height:clamp(470px,57vh,590px);position:relative;
  display:flex;align-items:center;justify-content:center;
}
.wave{display:none!important}
.gauge{
  position:relative;width:min(540px,54vw);height:min(540px,54vw);
  max-height:540px;max-width:540px;min-width:340px;min-height:340px;
  display:grid;place-items:center;z-index:2;margin-top:-5px;
}
.gauge svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.arc-track{fill:none;stroke:rgba(21,70,101,.25);stroke-width:8;stroke-linecap:round}
.arc{fill:none;stroke:url(#arc);stroke-width:9;stroke-linecap:round;filter:url(#softGlow)}
.tick{stroke:#0786a8;stroke-width:3;stroke-linecap:round;opacity:.66}
.needle-wrap{position:absolute;inset:0;transform:rotate(0deg);transition:transform .1s ease-out}
.needle{
  position:absolute;top:5.7%;left:50%;width:8px;height:13%;
  transform:translateX(-50%);border-radius:8px;background:#f4ffff;
  box-shadow:0 0 8px #fff,0 0 17px #00eaff,0 0 30px #00aaff;
}
.readout{
  position:relative;text-align:center;margin-top:39px;min-width:250px;
  text-shadow:0 0 20px rgba(0,180,255,.08)
}
.note{
  font-size:clamp(100px,12vw,150px);font-weight:600;letter-spacing:-8px;
  line-height:.92;color:#fff;
}
.note small{font-size:.43em;letter-spacing:-2px;margin-left:5px}
.cents{font-size:clamp(27px,3vw,38px);font-weight:500;color:#dce7f2;margin-top:16px}
.freq{font-size:12px;letter-spacing:1.5px;color:#7f9bb2;margin-top:10px;min-height:17px}
.status{
  display:inline-flex;align-items:center;justify-content:center;gap:13px;
  min-width:280px;padding:14px 28px;margin-top:27px;border:2px solid #18d95b;
  border-radius:60px;color:#43ef72;background:rgba(0,190,73,.07);
  font-size:25px;font-weight:700;box-shadow:0 0 19px rgba(0,255,96,.12),inset 0 0 16px rgba(0,255,96,.04);
  white-space:nowrap;
}
.status .check{
  width:34px;height:34px;border-radius:50%;background:#35ed68;color:#052014;
  display:inline-grid;place-items:center;font-size:23px;font-weight:900;text-shadow:none;
}
.display[data-state="close"] .status{color:#ffd36b;border-color:#e6a83c;background:rgba(255,180,45,.06);box-shadow:none}
.display[data-state="close"] .check{background:#e6a83c;color:#241500}
.display[data-state="off"] .status,.display[data-state="idle"] .status{color:#b7c8d9;border-color:#31516a;background:rgba(21,64,91,.12);box-shadow:none}
.display[data-state="off"] .check,.display[data-state="idle"] .check{background:#68869c;color:#07121d}
.display[data-state="error"] .status{color:#ff8497;border-color:#b94359}
.controls{
  display:flex;align-items:center;justify-content:center;gap:28px;
  width:min(100%,720px);margin-top:0;
}
.select-wrap{position:relative;width:310px}
select,.start{height:76px;border-radius:50px;font:600 22px "DM Sans",Arial,sans-serif}
select{
  appearance:none;width:100%;padding:0 60px 0 34px;color:#edf6ff;
  background:rgba(5,13,24,.84);border:2px solid #14283c;outline:none;cursor:pointer;
  box-shadow:inset 0 0 20px rgba(0,80,140,.04);
}
select option{background:#071321;color:#fff}
.select-wrap:after{
  content:"";position:absolute;right:31px;top:29px;width:12px;height:12px;
  border-right:3px solid #c7d5e2;border-bottom:3px solid #c7d5e2;
  transform:rotate(45deg);pointer-events:none;
}
.start{
  min-width:360px;padding:0 42px;color:#fff;cursor:pointer;
  border:3px solid #08baff;background:rgba(0,102,180,.12);
  box-shadow:0 0 13px rgba(0,177,255,.48),inset 0 0 18px rgba(0,130,255,.11);
  transition:box-shadow .18s,background .18s,transform .18s;
}
.start:hover{transform:translateY(-1px);box-shadow:0 0 25px rgba(0,177,255,.65),inset 0 0 20px rgba(0,130,255,.16)}
.start.running{border-color:#ff6c83;background:rgba(180,30,65,.14);box-shadow:0 0 18px rgba(255,65,100,.2)}
.mic{font-size:27px;margin-right:14px;vertical-align:-2px}
.help{height:22px;margin:17px 0 0;color:#6f899f;font-size:12px;text-align:center}
.help.error{color:#ff8497}
.level{display:none!important}
.level span{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--blue),var(--green));transition:width .08s}
@media(max-width:700px){
  main{padding:12px 15px 28px}
  .brand{margin:8px 0 22px}
  .brand .brand-script{font-size:30px}
  .brand .brand-guitar{font-size:25px}
  .brand small{font-size:8px;letter-spacing:4px}
  .display{height:440px}
  .gauge{width:min(430px,94vw);height:min(430px,94vw);min-width:300px;min-height:300px}
  .wave{height:145px;opacity:.65}
  .note{font-size:108px}
  .status{font-size:19px;min-width:225px;padding:11px 20px;margin-top:21px}
  .status .check{width:28px;height:28px;font-size:19px}
  .controls{flex-direction:column;gap:12px;margin-top:0}
  .select-wrap,.start{width:min(100%,390px);min-width:0}
  select,.start{height:62px;font-size:17px}
  .select-wrap:after{top:22px}
  .mic{font-size:21px}
  .help{font-size:11px;margin-top:13px}
}
@media(max-width:390px){
  .display{height:390px}.gauge{min-width:285px;min-height:285px}
  .note{font-size:94px}.cents{font-size:26px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important}}


/* Responsive viewport fit: layout only; tuner/audio JavaScript is unchanged. */
html, body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
main {
  width: min(1500px, 100%);
  height: 100vh;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(8px, 1.5vh, 18px) clamp(12px, 3vw, 36px);
  overflow: hidden;
}
@supports (height: 100dvh) {
  main { height: 100dvh; }
}
.brand {
  flex: 0 0 auto;
  margin: 4px 0 clamp(5px, 1vh, 14px);
}
.tuner {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding-bottom: 0;
  justify-content: space-evenly;
  gap: clamp(4px, 1vh, 12px);
}
.display {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: auto;
  max-height: 100%;
  overflow: hidden;
}
.gauge {
  width: min(540px, 54vw, calc(100vh - 205px));
  height: auto;
  aspect-ratio: 1 / 1;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  margin-top: 0;
}
.readout {
  margin-top: clamp(12px, 4vh, 39px);
  min-width: 0;
}
.note {
  font-size: clamp(76px, 12vw, 150px);
}
.cents {
  margin-top: clamp(7px, 1.8vh, 16px);
  font-size: clamp(23px, 3vw, 38px);
}
.status {
  min-width: 0;
  max-width: calc(100vw - 40px);
  margin-top: clamp(10px, 2.5vh, 27px);
  padding: clamp(8px, 1.5vh, 14px) clamp(16px, 2vw, 28px);
  font-size: clamp(16px, 2vw, 25px);
}
.controls {
  flex: 0 0 auto;
  margin-top: 0;
  gap: clamp(10px, 2vw, 28px);
}
select, .start {
  height: clamp(50px, 8vh, 76px);
  font-size: clamp(16px, 1.8vw, 22px);
}
.select-wrap { width: min(310px, 42vw); }
.start { min-width: min(360px, 48vw); }
.help {
  flex: 0 0 auto;
  height: auto;
  min-height: 16px;
  margin: clamp(4px, .8vh, 10px) 0 0;
  font-size: clamp(10px, 1.1vw, 12px);
}

@media (max-width: 700px) {
  main {
    padding: max(6px, env(safe-area-inset-top)) 12px max(6px, env(safe-area-inset-bottom));
  }
  .brand { margin: 2px 0 5px; }
  .brand .brand-script { font-size: clamp(25px, 7vw, 30px); }
  .brand .brand-guitar { font-size: clamp(21px, 6vw, 25px); }
  .brand small { margin-top: 5px; font-size: 7px; }
  .tuner { gap: 4px; }
  .display { flex: 1 1 0; }
  .gauge {
    width: min(94vw, 430px, calc(100vh - 185px));
    max-width: 100%;
    max-height: 100%;
  }
  @supports (height: 100dvh) {
    .gauge { width: min(94vw, 430px, calc(100dvh - 185px)); }
  }
  .readout { margin-top: clamp(8px, 2vh, 18px); }
  .note { font-size: clamp(76px, 23vw, 108px); letter-spacing: -5px; }
  .cents { margin-top: 7px; font-size: clamp(23px, 6vw, 29px); }
  .freq { margin-top: 5px; }
  .status {
    min-width: 0;
    margin-top: 10px;
    padding: 8px 15px;
    font-size: clamp(15px, 4.5vw, 19px);
    gap: 9px;
  }
  .status .check { width: 25px; height: 25px; font-size: 17px; }
  .controls { flex-direction: column; width: 100%; gap: 8px; }
  .select-wrap, .start { width: min(100%, 390px); min-width: 0; }
  select, .start { height: clamp(46px, 7.5vh, 62px); font-size: 16px; }
  .select-wrap:after { top: 17px; }
  .mic { font-size: 20px; margin-right: 9px; }
  .help { margin-top: 4px; font-size: 10px; }
}

/* Short landscape phones and other low-height viewports. */
@media (max-height: 520px) {
  main { padding-top: 4px; padding-bottom: 4px; }
  .brand { margin: 0 0 2px; }
  .brand .brand-script { font-size: 24px; }
  .brand .brand-guitar { font-size: 21px; }
  .brand small { margin-top: 3px; font-size: 6px; }
  .tuner { gap: 2px; }
  .gauge { width: min( min(540px, 54vw), calc(100vh - 125px) ); }
  .readout { margin-top: 5px; }
  .note { font-size: clamp(54px, 13vh, 90px); }
  .cents { margin-top: 3px; font-size: 20px; }
  .freq { margin-top: 2px; min-height: 12px; font-size: 10px; }
  .status { margin-top: 4px; padding: 5px 12px; font-size: 14px; }
  .status .check { width: 20px; height: 20px; font-size: 14px; }
  .controls { flex-direction: row; gap: 8px; }
  .select-wrap { width: min(240px, 34vw); }
  select, .start { height: 42px; font-size: 14px; }
  .start { min-width: min(220px, 38vw); padding: 0 14px; }
  .select-wrap:after { top: 14px; right: 18px; }
  .mic { font-size: 17px; margin-right: 6px; }
  .help { margin-top: 2px; font-size: 9px; }
}
@media (max-width: 700px) and (max-height: 520px) {
  .gauge { width: min(68vw, calc(100vh - 125px)); }
  .controls { flex-direction: row; }
  .select-wrap { width: min(42vw, 240px); }
  .start { width: min(48vw, 260px); min-width: 0; }
}

/* Homepage-style navigation header */
.site-header {
  height: 82px; min-height: 82px; width: 100%; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 clamp(18px, 4vw, 56px);
  background: rgba(8,18,27,.96); border-bottom: 1px solid #263747; backdrop-filter: blur(12px);
}
.site-header .brand {
  display: flex; align-items: baseline; gap: 5px; height: auto; margin: 0;
  line-height: 1; text-align: left; text-decoration: none;
}
.site-header .brand-script {
  color: #f5efe3; font-family: "Instrument Serif", Georgia, serif; font-size: 34px; font-style: italic;
}
.site-header .brand-guitar {
  color: #f5a623; font-family: "Instrument Serif", Georgia, serif; font-size: 30px; font-style: italic;
}
.site-header .brand small { display: none; }
.site-header nav {
  display: flex; align-items: center; justify-content: flex-end; gap: clamp(12px, 2.2vw, 30px);
}
.site-header nav a {
  color: #aab7c4; text-decoration: none; font-size: 14px; font-weight: 600;
  white-space: nowrap; transition: color .18s ease;
}
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: #f5a623; }

/* Preserve the tuner layout beneath the added header. */
html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
main { height: calc(100vh - 82px); min-height: 560px; overflow: hidden; }
@supports (height: 100dvh) { main { height: calc(100dvh - 82px); } }

/* Tool links sit below the tuner and do not interfere with its controls. */
.tool-promos {
  width: min(1100px, calc(100% - 36px)); margin: 10px auto 34px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}
.tool-promo {
  display: block; padding: 17px 20px; border: 1px solid #17354b; border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,102,180,.13), rgba(0,231,195,.045));
  color: #f8fbff; text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.tool-promo:hover {
  border-color: #087cff; transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(0,102,180,.2), rgba(0,231,195,.07));
}
.tool-promo strong { display: block; margin-bottom: 5px; color: #f5efe3; font-size: 16px; }
.tool-promo span { color: #a9b8c9; font-size: 13px; line-height: 1.5; }

@media (max-width: 700px) {
  .site-header { height: auto; min-height: 68px; padding: 10px 14px; gap: 12px; }
  .site-header .brand-script { font-size: 28px; }
  .site-header .brand-guitar { font-size: 25px; }
  .site-header nav { gap: 12px; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { font-size: 11px; }
  main { height: calc(100vh - 68px); min-height: 520px; }
  @supports (height: 100dvh) { main { height: calc(100dvh - 68px); } }
  .tool-promos { grid-template-columns: 1fr; gap: 10px; margin-top: 8px; }
  .tool-promo { padding: 14px 16px; }
}
@media (max-width: 390px) {
  .site-header { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .site-header nav { gap: 9px; }
  .site-header nav a { font-size: 10px; }
}


/* Prominent tool cards: visible beside the tuner without adding page scroll. */
main { position: relative; }
.tool-promos {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  display: block;
  pointer-events: none;
  z-index: 3;
}
.tool-promo {
  position: absolute;
  top: 42%;
  width: clamp(210px, 18vw, 270px);
  min-height: 112px;
  padding: 22px 20px;
  pointer-events: auto;
  border: 1px solid rgba(0, 213, 245, .48);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(4, 25, 39, .96), rgba(3, 12, 21, .96));
  box-shadow: 0 0 24px rgba(0, 150, 220, .13), inset 0 0 20px rgba(0, 150, 220, .05);
}
.tool-promo:first-child { left: clamp(14px, 3vw, 48px); }
.tool-promo:last-child { right: clamp(14px, 3vw, 48px); }
.tool-promo strong { font-size: 18px; margin-bottom: 9px; }
.tool-promo span { display: block; font-size: 14px; line-height: 1.55; }
.tool-promo:hover {
  border-color: #00d5f5;
  box-shadow: 0 0 28px rgba(0, 190, 255, .24), inset 0 0 22px rgba(0, 150, 220, .08);
}

@media (max-width: 900px) {
  .tool-promo { width: clamp(175px, 22vw, 220px); padding: 16px 14px; }
  .tool-promo strong { font-size: 15px; }
  .tool-promo span { font-size: 12px; }
}

@media (max-width: 700px) {
  /* On phones, place both links in a clear strip under the site header. */
  main {
    padding-top: 66px;
    height: calc(100vh - 68px);
  }
  @supports (height: 100dvh) {
    main { height: calc(100dvh - 68px); }
  }
  .tool-promos {
    top: 5px;
    left: 12px;
    right: 12px;
    width: auto;
    height: 54px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .tool-promo {
    position: static;
    width: auto;
    min-height: 0;
    height: 54px;
    padding: 8px 10px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .tool-promo strong { font-size: 12px; margin: 0 0 3px; }
  .tool-promo span {
    font-size: 9px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}


/* Match the homepage's animated gold navigation indicator exactly. */
.site-header nav {
  display: flex;
  gap: 32px;
  align-items: center;
  position: relative;
  height: 100%;
}
.site-header nav a {
  color: #d5dde4;
  font-size: 14px;
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 2px 0 0;
  white-space: nowrap;
  transition: color .2s ease;
}
.site-header nav a:hover,
.site-header nav a.active { color: #fff; }
.nav-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: #f5a623;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.2,.75,.25,1), width .28s cubic-bezier(.2,.75,.25,1);
  will-change: transform, width;
}
@media (max-width: 900px) {
  .site-header nav { display: none; }
}


/* Match the homepage hamburger visibility. */
.site-header .menu-btn {
  display: none;
  background: none;
  border: 0;
  color: white;
  font-size: 25px;
  cursor: pointer;
}
@media (max-width: 900px) {
  .site-header .menu-btn { display: block; }
}


/* Mobile navigation: same compact brand header, with an expandable dropdown. */
.site-header { position: sticky; }
.site-header .brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  line-height: .8;
  flex: 0 0 auto;
}
.site-header .brand-name { display: flex; align-items: baseline; gap: 5px; }
.site-header .brand small {
  display: block;
  margin-top: 7px;
  color: #8e9aa5;
  font-family: "DM Sans", sans-serif;
  font-size: 8px;
  letter-spacing: 4px;
  line-height: 1;
  white-space: nowrap;
}
.site-header .menu-btn {
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
  font-family: "DM Sans", sans-serif;
  line-height: 1;
}
.site-header .menu-btn:focus-visible {
  outline: 2px solid #f5a623;
  outline-offset: 3px;
}
@media (max-width: 900px) {
  .site-header {
    position: sticky;
    z-index: 50;
    min-height: 76px;
    height: 76px;
    padding: 8px 5%;
  }
  .site-header .brand-script { font-size: 30px; }
  .site-header .brand-guitar { font-size: 25px; }
  .site-header .brand small { font-size: 7px; margin-top: 6px; }
  .site-header .menu-btn { display: flex; }
  .site-header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: auto;
    padding: 8px 5% 14px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    overflow: visible;
    background: rgba(8,18,27,.985);
    border-bottom: 1px solid #263747;
    box-shadow: 0 14px 24px rgba(0,0,0,.28);
  }
  .site-header.menu-open nav { display: flex; }
  .site-header nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 4px;
    font-size: 14px;
    border-bottom: 1px solid rgba(38,55,71,.65);
  }
  .site-header nav a:last-of-type { border-bottom: 0; }
  .site-header nav a.active,
  .site-header nav a[aria-current="page"] { color: #f5a623; }
  .site-header .nav-indicator { display: none; }
}
@media (max-width: 620px) {
  .site-header { padding-left: 5%; padding-right: 5%; }
}

.language-switch{width:100%;padding:8px 0 2px;text-align:center;color:#71869a;font-size:11px;letter-spacing:.2px}
.language-switch a{color:#a9b8c9;text-decoration:none;margin:0 4px;white-space:nowrap}
.language-switch a:hover,.language-switch a[aria-current="page"]{color:#f5a623}
@media(max-width:700px){.language-switch{line-height:2.1;padding-top:12px}}
