:root {
  color-scheme: dark;
  /* Warm amber palette inspired by Flipper Zero */
  --bg: #0b0906; /* near-black with warm tint */
  --bg-card: rgba(22, 14, 9, 0.88);
  --bg-pill: rgba(255, 179, 0, 0.16);
  --accent: #ffb300; /* amber */
  --accent-soft: rgba(255, 179, 0, 0.14);
  --text-main: #fff7e6; /* warm off-white */
  --text-muted: #cbbda3; /* desaturated warm */
  --border: rgba(255, 179, 0, 0.22);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  font-family: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 18% 18%, rgba(255, 179, 0, 0.09), transparent 46%),
              radial-gradient(circle at 82% -8%, rgba(255, 128, 0, 0.16), transparent 56%),
              linear-gradient(135deg, #0b0906, #16100a 52%, #21160d);
  color: var(--text-main);
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 3rem);
  max-width: 1200px;
  margin: 0 auto;
  padding-left: calc(env(safe-area-inset-left) + clamp(1rem, 5vw, 3rem));
  padding-right: calc(env(safe-area-inset-right) + clamp(1rem, 5vw, 3rem));
}

.site-branding {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  width: clamp(160px, 22vw, 220px);
  display: block;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a,
.site-nav summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 12, 6, 0.78);
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav summary:hover,
.site-nav summary:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(255, 179, 0, 0.25);
  outline: none;
}

.site-nav .active {
  border-color: var(--accent);
}

.nav-drop {
  position: relative;
}

.nav-drop summary {
  list-style: none;
}

.nav-drop summary::-webkit-details-marker {
  display: none;
}

.nav-drop[open] summary {
  border-color: var(--accent);
}

.nav-drop[open] .nav-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-panel {
  position: absolute;
  top: calc(100% + 0.8rem);
  right: 0;
  width: clamp(240px, 28vw, 320px);
  padding: 1.4rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(16, 10, 6, 0.95);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  z-index: 20;
}

.nav-panel h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Bitcoin icon badge */
.btc-icon {
  display: inline-grid;
  place-items: center;
  width: 1.25em;
  height: 1.25em;
  margin-right: 0.4rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 179, 0, 0.35);
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.28), rgba(255, 128, 0, 0.22));
  color: #1a1209;
  font-weight: 700;
}

.nav-panel p,
.nav-panel span {
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.nav-panel .nav-link-card {
  display: block;
  padding: 0.8rem 1rem;
  margin: 0 0 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 12, 6, 0.78);
  color: var(--text-main);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-panel .nav-link-card:last-of-type {
  margin-bottom: 0;
}

.nav-panel .nav-link-card:hover,
.nav-panel .nav-link-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 12px 24px rgba(255, 179, 0, 0.25);
  transform: translateY(-2px);
  outline: none;
}

.nav-link-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-link-desc {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.wallet {
  font-family: "JetBrains Mono", "SFMono-Regular", "Menlo", monospace;
  background: rgba(18, 12, 6, 0.88);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.wallet button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #1a1209;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wallet button:hover,
.wallet button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(255, 179, 0, 0.35);
  outline: none;
}

.wallet button[disabled] {
  cursor: wait;
  opacity: 0.7;
}

.qr-card {
  margin-top: 1rem;
}

.qr-card h3 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.qr-wrapper {
  border-radius: 16px;
  border: 1px solid rgba(255, 179, 0, 0.18);
  background: rgba(16, 10, 6, 0.7);
  padding: 12px;
  display: grid;
  place-items: center;
}

.qr-wrapper img {
  width: 100%;
  border-radius: 12px;
}

.site-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 6vw, 3.5rem) clamp(4rem, 8vw, 6rem);
}

.post-card,
.post-article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: clamp(1.8rem, 4vw, 2.6rem);
}

.subscribe-callout {
  margin-top: clamp(2.4rem, 5vw, 4rem);
}

.subscribe-card {
  background: rgba(18, 12, 6, 0.88);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: clamp(1.8rem, 4vw, 2.4rem);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.subscribe-card h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.subscribe-card p {
  margin: 0 0 1.6rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.subscribe-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 179, 0, 0.35);
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.20), rgba(255, 128, 0, 0.18));
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.subscribe-button:hover,
.subscribe-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(255, 179, 0, 0.35);
  text-decoration: none;
  outline: none;
}

.post-card + .post-card {
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
}

.post-card h2 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
}

.post-card time {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.post-card p {
  margin-top: 1rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.post-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.2rem;
  font-weight: 600;
}

.post-article h1 {
  margin-top: 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.audio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: clamp(1.8rem, 4vw, 2.6rem);
  display: grid;
  gap: 1.4rem;
}

.audio-header h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-header p {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.audio-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.8rem);
}

.audio-play {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(255, 179, 0, 0.28);
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.28), rgba(255, 128, 0, 0.22));
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  color: inherit;
}

.audio-play:hover,
.audio-play:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(255, 179, 0, 0.28);
  border-color: var(--accent);
  outline: none;
}

.audio-play .play-icon {
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #041018;
  margin-left: 3px;
}

.audio-play.is-playing .play-icon {
  position: relative;
  width: 16px;
  height: 16px;
  border: none;
  display: grid;
  grid-template-columns: repeat(2, 6px);
  gap: 4px;
}

.audio-play.is-playing .play-icon::before,
.audio-play.is-playing .play-icon::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: #041018;
  border-radius: 2px;
}

.audio-progress {
  display: grid;
  gap: 0.6rem;
}

.audio-seek,
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 179, 0, 0.18);
  overflow: hidden;
  cursor: pointer;
}

.audio-seek::-webkit-slider-thumb,
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 179, 0, 0.22);
  border: none;
}

.audio-seek::-moz-range-thumb,
.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
}

.audio-seek::-moz-range-track,
.volume-slider::-moz-range-track {
  height: 6px;
  background: rgba(255, 179, 0, 0.18);
  border-radius: 999px;
}

.audio-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.audio-volume {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 120px;
}

.volume-icon {
  width: 18px;
  height: 14px;
  position: relative;
}

.volume-icon::before,
.volume-icon::after {
  content: "";
  position: absolute;
  background: var(--accent);
  border-radius: 2px;
}

.volume-icon::before {
  width: 10px;
  height: 10px;
  left: 0;
  top: 2px;
  clip-path: polygon(0 30%, 55% 30%, 100% 0, 100% 100%, 55% 70%, 0 70%);
}

.volume-icon::after {
  width: 6px;
  height: 6px;
  right: -10px;
  top: 4px;
  border-radius: 50% 50% 50% 0;
}

.audio-card audio {
  width: 100%;
  margin-top: 1rem;
  border-radius: 16px;
  background: rgba(16, 10, 6, 0.85);
  border: 1px solid rgba(255, 179, 0, 0.18);
}

.resource-article {
  display: grid;
  gap: clamp(1.8rem, 4vw, 2.6rem);
}

.resource-header h1 {
  margin-top: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.resource-header p {
  margin: clamp(0.6rem, 1.5vw, 1rem) 0 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.resource-list {
  display: grid;
  gap: clamp(1.2rem, 2.8vw, 1.8rem);
  padding-left: clamp(1.4rem, 3vw, 2rem);
  margin: 0;
}

.resource-list li {
  list-style: disc;
  padding-inline-start: clamp(0.4rem, 1vw, 0.8rem);
}

.resource-card {
  display: grid;
  gap: 0.4rem;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  border-radius: 22px;
  border: 1px solid rgba(255, 179, 0, 0.2);
  background: rgba(7, 12, 24, 0.82);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.resource-card:hover,
.resource-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 18px 32px rgba(255, 179, 0, 0.25);
  text-decoration: none;
  outline: none;
}

.resource-label {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-main);
}

.resource-description {
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.tag {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 179, 0, 0.1);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.post-article p,
.post-article li {
  line-height: 1.7;
  color: var(--text-muted);
}

.post-article pre {
  background: rgba(5, 12, 24, 0.85);
  padding: 1rem;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid rgba(255, 179, 0, 0.12);
}

.post-article code {
  color: #ffd37a;
}

.site-footer {
  border-top: 1px solid rgba(255, 179, 0, 0.12);
  padding: calc(2rem + env(safe-area-inset-top))
           calc(1.5rem + env(safe-area-inset-right))
           calc(3rem + env(safe-area-inset-bottom))
           calc(1.5rem + env(safe-area-inset-left));
  text-align: center;
  color: var(--text-muted);
  background: rgba(5, 10, 18, 0.75);
}

.site-footer a {
  color: var(--accent);
}

@media (max-width: 840px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-branding {
    width: 100%;
    justify-content: space-between;
  }

  .site-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .nav-drop {
    width: 100%;
  }

  .nav-drop summary {
    width: 100%;
    justify-content: space-between;
  }

  .nav-panel {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    width: 100%;
    margin-top: 0.8rem;
  }

  .audio-controls {
    grid-template-columns: 1fr;
  }

  .audio-volume {
    width: 100%;
  }

  .resource-card {
    padding: 1.2rem;
  }
}

/* --- Global mobile-friendly tweaks (2025-10-31) --- */
img, video {
  max-width: 100%;
  height: auto;
}

.site-nav a,
.site-nav summary {
  min-height: 44px; /* comfortable tap target */
}

.subscribe-button {
  min-height: 44px;
}

@media (max-width: 480px) {
  .site-main {
    padding: 0 1rem 3rem;
  }
  .post-card,
  .post-article,
  .audio-card {
    padding: 1.2rem;
    border-radius: 20px;
  }
  .audio-time {
    font-size: 0.95rem;
  }
  .logo-img {
    width: clamp(140px, 40vw, 200px);
  }
}
/* --- end mobile-friendly tweaks --- */

/* --- Audio player visibility & mobile enhancements (2025-10-31) --- */
.audio-play {
  width: 64px;
  height: 64px;
  position: relative;
  border-width: 2px;
  -webkit-tap-highlight-color: transparent;
}
.audio-play::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 999px;
  background: rgba(4, 16, 24, 0.88);
  box-shadow: 0 0 0 2px rgba(255, 179, 0, 0.12) inset;
}
.audio-play .play-icon {
  position: relative;
  z-index: 1;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--text-main);
  margin-left: 4px;
}
.audio-play.is-playing .play-icon {
  width: 18px;
  height: 18px;
  gap: 5px;
}
.audio-play.is-playing .play-icon::before,
.audio-play.is-playing .play-icon::after {
  background: var(--text-main);
}
.audio-play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 480px) {
  .audio-play { width: 72px; height: 72px; }
  .audio-seek, .volume-slider { height: 8px; }
}
/* --- end enhancements --- */
