/* Shared shell — matches home.html (styles.css) for inner pages */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --shell-header-offset: 5.35rem;
  --shell-footer-offset: 3.25rem;
  --void: #050506;
  --ink: #0c0c0e;
  --panel: #101014;
  --line: rgba(250, 248, 240, 0.12);
  --muted: rgba(250, 248, 240, 0.55);
  --cream: #f6f3ea;
  --paper: #ebe6dc;
  --accent: #c4a574;
  --vinyl: #121214;
  --vinyl-groove: #2a2a2e;
  --shadow: rgba(0, 0, 0, 0.45);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-x: env(safe-area-inset-left, 0px);
  --safe-x-right: env(safe-area-inset-right, 0px);
  --safe-y-top: env(safe-area-inset-top, 0px);
  --safe-y-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-roboto);
  color: var(--cream);
  background: var(--void);
  /* Gold-accent scrollbar (Firefox + others) */
  scrollbar-color: var(--accent) rgba(12, 12, 14, 0.55);
  scrollbar-width: thin;
}

/* Subtle retro arrow cursor — gold (accent-colored) pointer with a
   black outline reminiscent of classic 90s OS cursors. Hot-spot at
   the tip (1,1). !important needed to beat the many local
   `cursor: pointer` declarations scattered across this project. */
html,
body,
* {
  cursor:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path d='M2 1 L2 16 L6 12 L9 18 L11.5 16.7 L8.5 11 L13.5 11 Z' fill='%23c4a574' stroke='%23070707' stroke-width='1.2' stroke-linejoin='round'/></svg>")
      1 1,
    default !important;
}

/* Hovering an interactive target (link, button, input, etc.) swaps
   the cursor to a cream-filled version of the same retro arrow so
   clickable areas read distinctly. */
a,
a *,
button,
button *,
[role="button"],
[role="button"] *,
[onclick],
[onclick] *,
.icon-btn,
.icon-btn *,
input[type="submit"],
input[type="button"],
input[type="checkbox"],
input[type="radio"],
input[type="file"],
.header-compose-btn,
.profile-new-song,
.profile-new-album,
label,
label *,
select,
summary {
  cursor:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path d='M2 1 L2 16 L6 12 L9 18 L11.5 16.7 L8.5 11 L13.5 11 Z' fill='%23faf5e8' stroke='%23070707' stroke-width='1.2' stroke-linejoin='round'/></svg>")
      1 1,
    pointer !important;
}

/* Gold-accent scrollbar (WebKit / Blink: Safari, Chrome, Edge). */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: rgba(12, 12, 14, 0.55);
}
*::-webkit-scrollbar-thumb {
  background-color: var(--accent);
  border-radius: 999px;
  border: 2px solid rgba(12, 12, 14, 0.55);
}
*::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in oklab, var(--accent) 80%, white 20%);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-roboto);
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 1rem;
  padding:
    max(1.1rem, var(--safe-y-top)) max(1.25rem, var(--safe-x-right)) 0.85rem max(1.25rem, var(--safe-x));
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.94) 0%, rgba(8, 8, 10, 0.72) 100%);
  backdrop-filter: blur(10px);
}

.header-brand {
  min-width: 0;
  justify-self: start;
}

.logo {
  margin: 0;
  font-family: var(--font-logo);
  font-size: clamp(1.45rem, 2.7vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

@media (min-width: 701px) {
  .header-brand,
  .header-actions {
    transform: translateY(-3px);
  }
}

.logo a,
.logo a:visited {
  color: #ffffff;
  text-decoration: none;
}

.logo a:hover,
.logo a:focus-visible {
  color: var(--accent);
}

/* No hover underline on anchors; components use color / chips instead */
a:hover {
  text-decoration: none;
}

.header-tagline {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  justify-self: end;
}

.header-compose-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  justify-self: center;
  padding: 0.16rem;
  border-radius: 999px;
  border: 2px solid rgba(196, 165, 116, 0.62);
  background:
    repeating-linear-gradient(
      -12deg,
      rgba(255, 246, 230, 0.045) 0 2px,
      rgba(12, 12, 15, 0.08) 2px 4px
    ),
    linear-gradient(180deg, rgba(28, 24, 20, 0.94) 0%, rgba(12, 12, 16, 0.95) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 224, 0.2),
    0 0 0 1px rgba(58, 44, 24, 0.7);
}

.header-compose-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2rem;
  min-width: clamp(6.25rem, 11vw, 7.75rem);
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  font-family: var(--font-rajdhani);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid rgba(40, 30, 20, 0.45);
}

.header-compose-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -20deg,
    rgba(255, 255, 255, 0.08) 0 1px,
    rgba(255, 255, 255, 0) 1px 3px
  );
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.header-compose-btn.profile-new-song {
  color: #1f1710;
  text-shadow: 0 1px 0 rgba(255, 246, 226, 0.5);
  background: linear-gradient(180deg, #dbc79e 0%, #c8ad7a 52%, #b59462 100%);
  border-color: rgba(106, 74, 34, 0.62);
}

.header-compose-btn.profile-new-album {
  color: rgba(250, 248, 240, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  background: linear-gradient(180deg, rgba(34, 35, 48, 0.98) 0%, rgba(18, 20, 32, 0.98) 100%);
  border-color: rgba(165, 140, 100, 0.55);
}

.header-compose-btn:hover {
  filter: brightness(1.06);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.icon-btn:hover {
  background: rgba(250, 248, 240, 0.06);
  border-color: var(--line);
}

.icon-btn[aria-expanded="true"],
.icon-btn[aria-current="page"] {
  background: rgba(196, 165, 116, 0.15);
  border-color: rgba(196, 165, 116, 0.35);
  color: var(--accent);
}

/* Decorative toolbar glyphs (match home chrome without implying a control) */
.icon-btn--quiet {
  pointer-events: none;
  opacity: 0.72;
}

.page-main {
  position: relative;
  flex: 1;
  min-height: 0;
  padding-top: var(--shell-header-offset);
  padding-bottom: var(--shell-footer-offset);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-back,
.main-book,
.main-fore {
  position: absolute;
  inset: -8%;
  pointer-events: none;
  will-change: transform;
}

/* Same wood stack as home (styles.css .main-back) — profile, song post, user, reader */
.main-back {
  background: url("assets/homepage-wood-bg.jpg") center / cover no-repeat, var(--ink);
  opacity: 0.18;
  transition: transform 0.35s ease-out;
}

.main-book {
  background: none;
  mix-blend-mode: normal;
  opacity: 0;
  transition: transform 0.45s ease-out;
}

.main-fore {
  background: transparent;
  transition: transform 0.55s ease-out;
}

/* Scrollable page content above the depth layers */
.subpage-inner {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.page-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 0.95rem max(1.25rem, var(--safe-x-right)) max(1.35rem, calc(0.7rem + var(--safe-y-bottom))) max(
    1.25rem,
    var(--safe-x)
  );
  border-top: 1px solid var(--line);
  background: linear-gradient(0deg, rgba(5, 5, 6, 0.98) 0%, rgba(5, 5, 6, 0.88) 100%);
}

.footer-sns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.sns-chip {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 0.12rem 0;
  border-bottom: 1px solid transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.sns-chip:hover {
  color: var(--accent, #c4a574);
  text-decoration: none;
  border-bottom-color: transparent;
}

@media (hover: none) and (pointer: coarse) {
  .icon-btn {
    width: 2.75rem;
    height: 2.75rem;
  }
}

@media (max-width: 700px) {
  :root {
    --shell-header-offset: 7.3rem;
  }

  /* Two-row layout on mobile:
       Row 1: title (left)  ·  icons (right)   ← inline together
       Row 2: NEW SONG / NEW ALBUM toggle (full width) */
  .page-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "brand   actions"
      "toggle  toggle" !important;
    align-items: center !important;
    row-gap: 0.6rem;
  }

  .header-brand {
    grid-area: brand !important;
    justify-self: start !important;
  }

  .header-actions {
    grid-area: actions !important;
    align-self: center !important;
    justify-self: end !important;
    margin-top: 0 !important;
  }

  .header-compose-toggle {
    grid-area: toggle !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-self: stretch !important;
  }

  .header-compose-btn {
    min-width: 0;
    width: 50%;
  }

  /* Center the streaming-app chips in the footer on mobile so they
     read as a centered row rather than left-aligned text. */
  .footer-sns {
    justify-content: center;
    text-align: center;
  }
}
