/* Shared styles for every nekoacoustic page */

:root {
  --bg: #F7F4E6;
  --ink: #B32C61;
  --ink-soft: rgba(179, 44, 97, 0.35);
  --ink-faint: rgba(179, 44, 97, 0.12);
  --gutter: clamp(16px, 4vw, 48px);
  --nav-size: clamp(14px, 1.1vw + 10px, 16px);
  /* hand-drawn wavy line, used for dividers and the player timeline */
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8' viewBox='0 0 24 8'%3E%3Cpath d='M0 4 Q6 0.5 12 4 T24 4' fill='none' stroke='%23B32C61' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E");
  /* the area under that wave, filled with the page cream */
  --wave-fill: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8' viewBox='0 0 24 8'%3E%3Cpath d='M0 4 Q6 0.5 12 4 T24 4 V8 H0 Z' fill='%23F7F4E6'/%3E%3C/svg%3E");
}

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

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- Header / nav ---------- */
.site-header {
  padding: max(env(safe-area-inset-top), 20px) var(--gutter) 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* comfortable tap target */
  font-size: var(--nav-size);
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: lowercase;
}

/* subtle underline on hover / current page */
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }

/* arrow after links that leave the site */
.ext-icon {
  width: 0.9em;
  height: 0.9em;
  margin-left: 2px;
  transform: translateY(-0.02em);  /* bottom of the arrow sits on the text baseline */
}

.nav a.is-external::after { right: calc(0.9em + 2px); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Header logo (inner pages only — home has the big logo) ---------- */
.site-header--sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.home-link {
  display: block;
  line-height: 0;
  transition: opacity 0.2s ease;
}

.home-link:hover { opacity: 0.7; }

.home-link img {
  display: block;
  height: var(--logo-h);
  width: auto;
}

/* Sized relative to the nav text: 2.43× the nav size makes the wordmark's strokes match the
   nav weight (Hanken stems are 0.085em, the logo's 10.08 of 288 units); it's shown 1.375× that */
.site-header--sub { --logo-h: calc(var(--nav-size) * 2.43 * 1.375); }

/* PC: logo left, nav right */
@media (min-width: 768px) {
  .site-header--sub {
    flex-direction: row;
    justify-content: space-between;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
  }

  .home-link {
    /* the logo file has empty space before the lettering (63 of 288 units) */
    margin-left: calc(var(--logo-h) * -0.221);
    /* centre the logo on the 44px nav without making the header taller,
       so the nav sits at exactly the same height as on the home page */
    margin-block: calc((44px - var(--logo-h)) / 2);
  }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 0 var(--gutter) max(env(safe-area-inset-bottom), 24px);
  text-align: center;
}

.site-footer small {
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
