/* =====================================================================
   Martijn Jonker - stylesheet
   1. Theme        2. Base          3. Background & sky   4. Layout & tabs
   5. Page header  6. Home links    7. Content boxes      8. Photos & videos
   9. Friends     10. Footer       11. Responsive
   ===================================================================== */


/* ---------- 1. Theme ---------- */
:root {
  --ink: #111111;
  --paper: #f6f4ee;
  --paper-dim: #ece9df;
  --accent: #6b6252;
  --card-bg: rgba(255,255,255,0.55);
  --card-bg-hover: rgba(255,255,255,0.85);
  --card-border: rgba(0,0,0,0.19);
  --card-border-hi: #111111;
  --overlay: #111111;
  --text: #8a6f1f;
}

[data-theme="dark"] {
  --ink: #f2f0ea;
  --paper: #121110;
  --paper-dim: #1b1917;
  --accent: #b9ac8d;
  --card-bg: rgba(255,255,255,0.06);
  --card-bg-hover: rgba(255,255,255,0.12);
  --card-border: rgba(150, 200, 162, 0.34);      /* soft green line around buttons, boxes and notes */
  --card-border-hi: rgba(180, 226, 192, 0.85);   /* the same green, brighter, for hover */
  --overlay: #f2f0ea;
  --text: #c4a756;
}


/* ---------- 2. Base ---------- */
* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

/* Big screens (1440p, 4K...): everything on the site is sized in rem, so growing the root font size
   scales the WHOLE page - text, column width, buttons, icons - together. Nothing changes up to 1600px wide;
   from there it grows smoothly to 2x at 3840px (a 4K screen at 100% zoom). */
html { font-size: clamp(1rem, 0.7143vw + 0.2857rem, 2rem); }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: 'EB Garamond', Georgia, serif;
}

/* Only ONE of html/body may clip sideways overflow. Both together turn <body> into its own scroll
   container, which makes the first scroll on phones stutter and leaves a stray line. "clip" does not. */
body { overflow-x: hidden; }
@supports (overflow: clip) { body { overflow-x: clip; } }

/* inline SVG icons (see assets/img/icons.svg) */
.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex-shrink: 0;
  vertical-align: -0.125em;
}


/* ---------- 3. Background & twinkling sky ---------- */
/* Soft, see-through runes, alien and egyptian glyphs that drift slowly upwards.
   - the layer uses the LARGE viewport height (lvh), so it never resizes when a phone's address bar slides away
   - only a transform is animated (cheap, runs on the GPU), the tile loops seamlessly
   - to calm it down, raise --drift (seconds per loop); to stop it, set the animation to none */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
  --tile: 900px;    /* css size of one tile: smaller = smaller glyphs */
  --drift: 170s;    /* time for one tile to scroll past: bigger = slower */
}

.backdrop::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% + var(--tile));
  background: url('../img/runes-s.webp') 0 0 / var(--tile) var(--tile) repeat;
  animation: runes-drift var(--drift) steps(1800) infinite;   /* ~10 updates a second is plenty for a drift this slow */
  will-change: transform;
}

/* paused by script.js while the tab is hidden or a video plays */
.bg-paused .backdrop::before { animation-play-state: paused; will-change: auto; }

@keyframes runes-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(0, calc(var(--tile) * -1), 0); }
}

/* edges melt into the page colour, so glyphs fade in/out instead of popping at the screen edge */
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, #121110 0, rgba(18, 17, 16, 0) 13%, rgba(18, 17, 16, 0) 84%, #121110 100%),
    radial-gradient(ellipse at 50% 45%, rgba(18, 17, 16, 0) 42%, rgba(18, 17, 16, 0.5) 100%);
}

/* big screens: keep the glyphs visible at the sides, calmer behind the text column */
@media (min-width: 900px) {
  .backdrop::after {
    background:
      linear-gradient(to bottom, #121110 0, rgba(18, 17, 16, 0) 13%, rgba(18, 17, 16, 0) 84%, #121110 100%),
      linear-gradient(to right, rgba(18, 17, 16, 0) 14%, rgba(18, 17, 16, 0.62) 34%, rgba(18, 17, 16, 0.62) 66%, rgba(18, 17, 16, 0) 86%),
      radial-gradient(ellipse at 50% 45%, rgba(18, 17, 16, 0) 42%, rgba(18, 17, 16, 0.5) 100%);
  }
}

@media (min-width: 900px) {
  .backdrop { --tile: 1800px; --drift: 340s; }
  .backdrop::before { animation-timing-function: steps(3600); }
  .backdrop::before { background-image: url('../img/runes-l.webp'); }
}

.sky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;      /* stable on phones, see .backdrop */
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: layout paint;
}

.sky-star {
  position: absolute;
  color: var(--text);
  line-height: 1;
  opacity: 0;
  text-shadow: 0 0 0.375rem rgba(196, 167, 86, 0.6);
  animation: star-pop var(--dur, 3.5s) ease-in-out forwards;
}

@keyframes star-pop {
  0%   { opacity: 0;    transform: scale(0.2) rotate(-35deg); }
  20%  { opacity: 0.95; transform: scale(1)   rotate(0deg); }
  65%  { opacity: 0.7;  transform: scale(0.9) rotate(8deg); }
  100% { opacity: 0;    transform: scale(0.5) rotate(25deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sky { display: none; }
  .backdrop::before { animation: none; }
  .expandable .more:not([hidden]) { animation: none; }
  .caption, .expand-btn .icon { transition: none; }
  .track.loading .track-play { animation: none; }
}


/* ---------- 4. Layout & tabs ---------- */
main {
  position: relative;
  z-index: 1;
  max-width: 38.75rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
  text-align: center;
}

/* Tabs never get cut off: they wrap onto a second row if there is ever not enough room. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
  margin: 0 0 2.25rem;
  padding: 0.25rem 0.125rem;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5625rem 1rem;
  background: var(--card-bg);
  border: 0.0625rem solid var(--card-border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.tab:hover {
  transform: translateY(-0.0625rem);
  background: var(--card-bg-hover);
  border-color: var(--card-border-hi);
}

.tab.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}


/* ---------- 5. Page header (eyebrow, title, symbol row) ---------- */
.eyebrow {
  letter-spacing: 0.35em;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.75rem;
  color: var(--text);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

h1 {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  margin: 0 0 0.6rem;
}

#site-title {
  cursor: default;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

/* The drawn symbols that replace the a's and x's of the name (see /config.js) */
html:not(.site-ready) [data-site] {
  visibility: hidden;                                  /* no flash of the plain name before script.js runs */
  animation: site-reveal 0s linear 1.2s forwards;      /* safety net: if script.js ever fails, show the plain name after 1.2s */
}

@keyframes site-reveal { to { visibility: visible; } }

.site-sym {
  display: inline-block;
  vertical-align: baseline;
  overflow: visible;
  margin: 0 0.07em 0 0.02em;
}

.site-sym.tri {
  width: 0.74em;
  height: 0.62em;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.6;
  stroke-linejoin: miter;
}

.site-sym.cross {
  width: 0.56em;
  height: 0.96em;
  vertical-align: -0.1em;
  fill: currentColor;
}

/* The row of symbols under the title. script.js fills it in and slides it between tabs. */
.tagline {
  font-style: italic;
  font-family: 'EB Garamond', 'Segoe UI Symbol', 'Microsoft Himalaya', 'Noto Serif Tibetan', 'Noto Sans Syriac', 'Noto Sans Symbols', 'Noto Sans Symbols 2', 'Noto Sans Math', 'Cambria Math', 'Apple Symbols', serif;
  font-size: clamp(2.3rem, 8vw, 2.9rem);
  line-height: 1.3;
  color: var(--text);
  width: 7.2em; /* 7 character slots + 1 fading slot each side, 0.8em each */
  margin: 0 auto 2.6rem;
  overflow: hidden;
  white-space: nowrap;
  visibility: hidden; /* shown once script.js has drawn the right symbols (no flicker) */
  -webkit-mask-image: linear-gradient(90deg, transparent 11.1%, #000 15%, #000 85%, transparent 88.9%);
  mask-image: linear-gradient(90deg, transparent 11.1%, #000 15%, #000 85%, transparent 88.9%);
}

.tagline.ready { visibility: visible; }

.stars-strip {
  display: flex;
  width: max-content;
  will-change: transform;
}

.star-cell {
  flex: 0 0 0.8em;
  width: 0.8em;
  text-align: center;
}


/* ---------- 6. Home: social link pills ---------- */
.links {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.link-pill {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.25rem;
  background: var(--card-bg);
  border: 0.0625rem solid var(--card-border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.link-pill:hover {
  transform: translateY(-0.125rem) scale(1.015);
  background: var(--card-bg-hover);
  border-color: var(--card-border-hi);
}

.link-pill.inactive {
  cursor: not-allowed;
  opacity: 0.6;
}

.link-pill.inactive:hover {
  transform: none;
  background: var(--card-bg);
  border-color: var(--card-border);
}

.link-pill .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.link-pill .handle {
  margin-left: auto;
  font-family: 'EB Garamond', Georgia, serif;
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
  color: var(--text);
  font-size: 0.9rem;
}

/* the red strike is drawn as a line (not text-decoration) so it also runs through the a / x symbols */
.link-pill .handle.struck {
  position: relative;
}

.link-pill .handle.struck::after {
  content: "";
  position: absolute;
  left: -0.125rem;
  right: -0.125rem;
  top: 56%;
  height: 0.125rem;
  background: #c0392b;
  transform: translateY(-50%);
}

/* phones: the handle is hidden to save space, so a small "unavailable" icon takes its place */
.link-pill .na-icon { display: none; }


/* ---------- 7. Content boxes (About me, My projects, Photos) ---------- */
.content-box {
  background: var(--card-bg);
  border: 0.0625rem solid var(--card-border);
  border-radius: 1.5rem;
  padding: 2.2rem 1.9rem;
  text-align: left;
}

.content-box + .content-box {
  margin-top: 1.5rem;
}

.content-box h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 1.15rem;
  margin: 0 0 1.1rem;
}

.content-box p {
  line-height: 1.75;
  margin: 0 0 1.1rem;
}

.content-box ul {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
  line-height: 1.75;
}

.content-box p:last-child,
.content-box ul:last-child {
  margin-bottom: 0;
}


/* ---------- 7b. Expandable boxes (My projects) ---------- */
.content-box.expandable {
  position: relative;
  padding-bottom: 3.6rem; /* room for the round button in the bottom-right corner */
}

.expandable .more:not([hidden]) { animation: expand-in 0.35s ease; }

@keyframes expand-in {
  from { opacity: 0; transform: translateY(-0.375rem); }
  to   { opacity: 1; transform: none; }
}

.expand-btn {
  position: absolute;
  right: 1.1rem;
  bottom: 1rem;
  width: 2.125rem;
  height: 2.125rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-dim);
  border: 0.0625rem solid var(--card-border);
  border-radius: 50%;
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.expand-btn .icon { transform: rotate(90deg); transition: transform 0.3s ease; } /* points down */
.expand-btn[aria-expanded="true"] .icon { transform: rotate(-90deg); }          /* points up */

.expand-btn:hover {
  transform: scale(1.1);
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.expand-btn:focus-visible { outline: 0.125rem solid var(--text); outline-offset: 0.125rem; }


/* ---------- 8. Photos & videos ---------- */
.photo-box {
  position: relative;
}

/* "1/2" counter in the top-right corner of the box */
.photo-count {
  position: absolute;
  top: 1.15rem;
  right: 1.3rem;
  padding: 0.1875rem 0.6875rem;
  border: 0.0625rem solid var(--card-border);
  border-radius: 999px;
  background: var(--card-bg);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--text);
}

/* round arrows sitting on the left and right edge of the box */
.photo-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.375rem;
  height: 2.375rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-dim);
  border: 0.0625rem solid var(--card-border);
  border-radius: 50%;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.photo-arrow.prev { left: -1.1875rem; }
.photo-arrow.next { right: -1.1875rem; }

.photo-arrow:hover {
  transform: translateY(-50%) scale(1.1);
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.photo-arrow:focus-visible {
  outline: 0.125rem solid var(--text);
  outline-offset: 0.125rem;
}

/* 2 photos across, 3 rows = 6 photos per set */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem;
  transition: opacity 0.22s ease;
}

.photo-grid[hidden] { display: none; }
.photo-grid.fading  { opacity: 0; }

/* The <img> ignores the mouse, so right-click / long-press / drag never offers "save image". */
.photo {
  position: relative;
  margin: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 1rem;
  border: 0.0625rem solid var(--card-border);
  background: var(--card-bg);
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}


/* Photos | Videos | Art edits | Mixtapes switch at the top-left of the box */
.media-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.3rem;
  padding-right: 3rem; /* keeps clear of the 1/2 counter */
}

.media-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.5rem 0.8125rem;
  background: var(--card-bg);
  border: 0.0625rem solid var(--card-border);
  border-radius: 999px;
  color: var(--text);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.media-tab:hover { transform: translateY(-0.0625rem); background: var(--card-bg-hover); border-color: var(--card-border-hi); }
.media-tab.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.media-tab:focus-visible { outline: 0.125rem solid var(--text); outline-offset: 0.125rem; }

.media-panel[hidden] { display: none; }

/* videos: 16:9 cards, the main one spans both columns (as wide as two photos) */
.video {
  grid-column: 1 / -1; /* every video is full width, stacked one under the other */
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1rem;
  border: 0.0625rem solid var(--card-border);
  background: var(--card-bg);
}

.video-real { background: #000; }
.video-placeholder video { background: #1b1917 url('../img/video-placeholder.svg') center / cover no-repeat; }
.video video.video-missing { pointer-events: none; }

.video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}


/* Hover caption: a square, slightly see-through box with a title + description.
   Photos show it at the bottom; videos at the top so the player controls stay free. */
.caption {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.625rem 0.875rem 0.6875rem;
  border-radius: 0.5rem;
  border: 0.0625rem solid var(--card-border);
  background: rgba(18, 17, 16, 0.78);
  color: var(--text);
  text-align: left;
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 1.5rem);   /* never taller than the picture */
  pointer-events: none;            /* invisible = never in the way of the photo / video */
  opacity: 0;
  transform: translateY(0.375rem);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.caption strong {
  display: block;
  flex: none;
  margin-bottom: 0.1875rem;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* the description scrolls when it is longer than the box (mouse wheel, touch drag or scrollbar) */
.caption span {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.375rem;
  overflow-wrap: break-word;
  font-size: 0.92rem;
  line-height: 1.4;
  font-style: italic;
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 167, 86, 0.6) transparent;
}

.caption span::-webkit-scrollbar { width: 0.3125rem; }
.caption span::-webkit-scrollbar-track { background: transparent; }
.caption span::-webkit-scrollbar-thumb { background: rgba(196, 167, 86, 0.6); border-radius: 0.1875rem; }

/* on videos the box hangs from the top and leaves the bottom strip free for the player controls */
.video .caption { top: 0.75rem; bottom: auto; max-height: calc(100% - 4.75rem); transform: translateY(-0.375rem); }

.photo:hover .caption,
.video:hover .caption,
.photo:focus-visible .caption,
.video:focus-visible .caption { opacity: 1; transform: none; pointer-events: auto; }

/* touch screens have no hover: tapping a photo/video shows its caption instead */
@media (hover: none) {
  .photo:focus .caption,
  .video:focus .caption { opacity: 1; transform: none; pointer-events: auto; }
}

.photo:focus, .video:focus { outline: none; }
.photo:focus-visible, .video:focus-visible { outline: 0.125rem solid var(--text); outline-offset: 0.125rem; }


/* single-page tabs (Mixtapes) have nothing to flip through: hide the arrows + counter */
.photo-box.single .photo-arrow,
.photo-box.single .photo-count { display: none; }

/* ---------- 8b. Mixtapes player ---------- */
.photo-grid.tracks:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.track {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  border: 0.0625rem solid var(--card-border);
  border-radius: 1rem;
  background: var(--card-bg);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.track:hover { border-color: var(--card-border-hi); }
.track.playing { border-color: var(--text); background: var(--card-bg-hover); }

.track-play {
  flex: 0 0 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-dim);
  border: 0.0625rem solid var(--card-border);
  border-radius: 50%;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.track-play:hover:not(:disabled) {
  transform: scale(1.08);
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.track-play:focus-visible,
.track-bar:focus-visible { outline: 0.125rem solid var(--text); outline-offset: 0.1875rem; }

.track-play .i-pause { display: none; }
.track.playing .i-play { display: none; }
.track.playing .i-pause { display: block; }
.track.loading .track-play { animation: track-pulse 1s ease-in-out infinite; }

@keyframes track-pulse { 50% { opacity: 0.45; } }

.track-body { flex: 1; min-width: 0; }

.track-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.625rem;
}

.track-title {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.track-time {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
  white-space: nowrap;
}

.track-desc {
  margin: 0.125rem 0 0.5625rem;
  font-size: 0.92rem;
  font-style: italic;
  opacity: 0.85;
  line-height: 1.4;
  max-height: 5.6em;               /* about 4 lines, then it scrolls */
  overflow-y: auto;
  padding-right: 0.375rem;
  overflow-wrap: break-word;
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 167, 86, 0.6) transparent;
}

.track-desc::-webkit-scrollbar { width: 0.3125rem; }
.track-desc::-webkit-scrollbar-track { background: transparent; }
.track-desc::-webkit-scrollbar-thumb { background: rgba(196, 167, 86, 0.6); border-radius: 0.1875rem; }

/* the seek bar: thin line, with a taller invisible touch area around it */
.track-bar {
  position: relative;
  height: 0.375rem;
  border-radius: 0.1875rem;
  background: rgba(196, 167, 86, 0.22);
  cursor: pointer;
  touch-action: pan-y;
}

.track-bar::before { content: ""; position: absolute; inset: -0.625rem 0; }

.track-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  border-radius: 0.1875rem;
  background: var(--text);
}

.track.error .track-time { opacity: 0.6; }

/* empty slots */
.track-ph { opacity: 0.5; }
.track-ph:hover { border-color: var(--card-border); }
.track-ph .track-play { cursor: not-allowed; }
.track-ph .track-bar { cursor: default; }


/* ---------- 9. Friends ---------- */
.friends {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  text-align: left;
}

/* each friend gets its own tint through --tint (r,g,b) */
.friend {
  --tint: 196, 167, 86;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  border-radius: 1.375rem;
  border: 0.0625rem solid rgba(var(--tint), 0.45);
  background:
    linear-gradient(135deg, rgba(var(--tint), 0.24), rgba(var(--tint), 0.06) 75%),
    var(--card-bg);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.friend.tint-gold   { --tint: 196, 167, 86; }
.friend.tint-violet { --tint: 150, 118, 190; }
.friend.tint-ash    { --tint: 140, 140, 150; }
.friend.tint-crimson { --tint: 178, 84, 90; }

.friend:hover {
  transform: translateY(-0.125rem);
  border-color: rgba(var(--tint), 0.8);
}

.friend.away {
  border-style: dashed;
  opacity: 0.7;
}

.friend.away:hover {
  transform: none;
  border-color: rgba(var(--tint), 0.45);
}

.friend-avatar {
  flex: 0 0 2.875rem;
  width: 2.875rem;
  height: 2.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--tint), 0.22);
  border: 0.0625rem solid rgba(var(--tint), 0.6);
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.friend-main {
  flex: 1;
  min-width: 0;
}

.friend-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
}

.friend-name {
  margin: 0;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.friend-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  flex-shrink: 0;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.friend-status .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: rgb(var(--tint));
  box-shadow: 0 0 0.5rem rgba(var(--tint), 0.95);
  animation: friend-glow 2.6s ease-in-out infinite;
}

.friend.away .friend-status .dot {
  background: transparent;
  border: 0.0625rem solid rgba(var(--tint), 0.9);
  box-shadow: none;
  animation: none;
}

@keyframes friend-glow {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .friend-status .dot { animation: none; }
}

.friend-site {
  display: inline-block;
  margin-top: 0.1875rem;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(var(--tint), 0.7);
  text-underline-offset: 0.1875rem;
  overflow-wrap: anywhere;
}

a.friend-site:hover { text-decoration-color: var(--text); }

.friend.away .friend-site {
  text-decoration: none;
  cursor: default;
}

.friend-info {
  margin: 0.375rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  opacity: 0.85;
}


/* ---------- 10. Footer ---------- */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
}

.footer-quote {
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
  max-width: 20rem;
  margin: 0 auto;
}

.scroll-spacer {
  height: 300vh;
  position: relative;
  z-index: 1;
}

.secret-footer {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3.5rem;
  text-align: center;
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.secret-footer.visible {
  opacity: 1;
  transform: translateY(0);
}

.secret-footer .spell {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text);
  max-width: 30rem;
  margin: 0 auto 1rem;
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
}

.secret-footer .visitor-info {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.7;
  word-break: break-word;
  font-family: 'EB Garamond', Georgia, serif;
}


/* ---------- 11. Responsive ---------- */

/* Wide screens: let the tabs use a little more room than the text column. */
@media (min-width: 720px) {
  .tabs { margin-left: -2.75rem; margin-right: -2.75rem; }
}

/* Below that the tabs become icon-only so they always fit. */
@media (max-width: 719px) {
  .tab { padding: 0.625rem 0.875rem; }
  .tab .tab-label { display: none; }
  .tab .icon { font-size: 1.05rem; }
}

@media (max-width: 480px) {
  .tabs { gap: 0.5rem; }
  .tab { padding: 0.625rem 0.8125rem; }
  .link-pill { font-size: 0.72rem; padding: 0.75rem 1rem; }
  .link-pill .handle { display: none; }
  .link-pill .na-icon {
    display: inline-block;
    margin-left: auto;
    width: 1.125rem;
    height: 1.125rem;
    color: #c0392b;
    opacity: 0.9;
  }
  .friend { padding: 0.875rem 0.9375rem; gap: 0.75rem; }
  .friend-avatar { flex-basis: 2.5rem; width: 2.5rem; height: 2.5rem; font-size: 0.95rem; }
  .photo-count { right: 1rem; }
  .media-tabs { gap: 0.375rem; padding-right: 2.9rem; }
  .media-tab { padding: 0.4375rem 0.6875rem; gap: 0.375rem; font-size: 0.62rem; letter-spacing: 0.08em; }
}

@media (max-width: 340px) {
  .tabs { gap: 0.375rem; }
  .tab { padding: 0.625rem 0.6875rem; }
}

/* very small phones: keep the four media tabs to two rows */
@media (max-width: 360px) {
  .media-tabs { gap: 0.3125rem; padding-right: 0; } /* the counter only sits beside the first row (2 pills) */
  .media-tab { padding: 0.375rem 0.5625rem; gap: 0.3125rem; font-size: 0.56rem; letter-spacing: 0.05em; }
}

/* phones: photos are small, so give the caption box more room for text */
@media (max-width: 480px) {
  .caption { left: 0.5rem; right: 0.5rem; bottom: 0.5rem; padding: 0.5rem 0.625rem 0.5625rem; max-height: calc(100% - 1rem); }
  .caption span { font-size: 0.82rem; }
  .video .caption { top: 0.5rem; max-height: calc(100% - 4.25rem); }
}

/* ---------- Content-warning cover (add class "has-cover" to a .photo + a .cover button) ---------- */
.photo.has-cover img { transition: filter 0.35s ease, transform 0.35s ease; }

.photo.has-cover:not(.revealed) img {
  filter: blur(1.875rem) brightness(0.6);
  transform: scale(1.2);               /* hides the soft edges the blur leaves */
}

.photo.has-cover:not(.revealed) .caption { display: none; }  /* don't give the picture away */
.photo.revealed .cover { display: none; }

.cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(18, 17, 16, 0.55);
  border: 0;
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.cover .icon { font-size: 2.4rem; transition: transform 0.18s ease; }
.cover:hover .icon { transform: scale(1.12); }
.cover:focus-visible { outline: 0.125rem solid var(--text); outline-offset: -0.375rem; }

.cover strong {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cover span { font-size: 0.85rem; font-style: italic; opacity: 0.85; }

/* ---------- The skull (nav) ---------- */
.kill-button {
  position: relative;
  color: #9fd0ac;                       /* soft green skull */
}

.kill-button .icon { transition: filter 0.25s ease, transform 0.25s ease; }

.kill-button:hover { border-color: rgba(159, 208, 172, 0.55); }

.kill-button:hover .icon,
.kill-button:focus-visible .icon {
  filter: drop-shadow(0 0 0.3125rem rgba(159, 208, 172, 0.65));
  transform: scale(1.1);
}

.kill-button:focus-visible { outline: 0.125rem solid #9fd0ac; outline-offset: 0.1875rem; }

/* the little note under it - same look as the photo description box */
.kill-tip,
.tab-tip {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5625rem;
  padding: 0.625rem 0.875rem 0.6875rem;
  border-radius: 0.5rem;
  border: 0.0625rem solid var(--card-border);
  background: rgba(18, 17, 16, 0.9);
  color: var(--text);
  white-space: nowrap;
  text-align: left;
  cursor: default;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-0.375rem);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.kill-text {   /* (also used by the other tabs' notes) */
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kill-tip .sym,
.tab-tip .sym { width: 1.25em; height: 1.25em; flex: none; color: #9fd0ac; fill: currentColor; opacity: 0.9; }
.kill-tip .sym-sm,
.tab-tip .sym-sm { width: 0.8em; height: 0.8em; color: var(--text); }
.kill-tip .flip,
.tab-tip .flip { transform: scaleX(-1); }

.kill-button:hover .kill-tip,
.kill-button:focus-visible .kill-tip,
.tab:hover .tab-tip,
.tab:focus-visible .tab-tip { opacity: 1; transform: none; }

@media (hover: none) { .kill-tip, .tab-tip { display: none; } }   /* touch screens: a tap just opens the link */


/* very small phones: six nav icons (with the skull) still fit on one row */
@media (max-width: 360px) {
  .tabs { gap: 0.375rem; }
  .tab { padding: 0.5625rem 0.625rem; }
  .tab .icon { font-size: 1rem; }
}

/* desktop: make the lone skull icon bigger (phones already use a larger icon) */
@media (min-width: 720px) {
  .kill-button .icon {
    font-size: 1.2rem;     /* icon size: 1.1rem = a bit smaller, 1.4rem = bigger */
    margin: -0.4rem 0;     /* stops the bigger icon from making the nav pills taller */
  }
}

/* ---------- Hover notes on the other nav buttons (same look as the skull's) ---------- */
.tab { position: relative; }

.tab-tip { right: auto; left: 50%; translate: -50% 0; }                 /* centred under the button */
.tabs .tab:first-child .tab-tip { left: 0; translate: none; }           /* the first one lines up with its left edge */
.tab-tip .sym { color: var(--text); }                                   /* gold runes (the skull's stay green) */

@media (max-width: 559px) { .tab-tip { display: none; } }               /* narrow windows: no room for the notes */

/* ---------- The star at the very bottom (appears after a few seconds, see script.js section 6) ---------- */
.end-star {
  display: flex;
  justify-content: center;
  margin: 0 auto 2.2rem;      /* sits above the ward text */
  opacity: 0;
}

.end-star-svg { width: clamp(6rem, 18vw, 8.75rem); height: auto; overflow: visible; }

/* out of thin air: it fades in from a blurry, tiny glow */
.end-star.on { animation: star-appear 2.8s cubic-bezier(0.22, 0.7, 0.2, 1) forwards; }

@keyframes star-appear {
  0%   { opacity: 0;    transform: scale(0.35); filter: blur(1rem); }
  40%  { opacity: 0.75;                         filter: blur(0.375rem); }
  100% { opacity: 1;    transform: scale(1);    filter: none; }
}

.es-ring { stroke-dasharray: 100; }
.end-star.idle .es-ring, .end-star.idle .es-hand, .end-star.idle .es-core, .end-star.idle .es-halo { animation-play-state: paused; }
.es-hand, .es-core, .es-halo { transform-box: view-box; transform-origin: 100px 100px; }
.end-star.on .es-ring { animation: es-draw 12s linear infinite; }
.end-star.on .es-hand { animation: es-sweep 12s linear infinite; }
.end-star.on .es-core,
.end-star.on .es-halo { animation: es-pulse 2.8s ease-in-out infinite; }

@keyframes es-draw  { 0% { stroke-dashoffset: 100; opacity: 1; } 92% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes es-sweep { to { transform: rotate(360deg); } }
@keyframes es-pulse { 0%, 100% { transform: scale(0.86); opacity: 0.8; } 50% { transform: scale(1.14); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .end-star.on { animation: star-fade 1.4s ease forwards; }
  @keyframes star-fade { from { opacity: 0; } to { opacity: 1; } }
  .end-star.on .es-ring, .end-star.on .es-hand, .end-star.on .es-core, .end-star.on .es-halo { animation: none; }
}

/* ---------- nav with seven buttons: keep it on one row ---------- */
@media (min-width: 720px) {
  .tabs { margin-left: -4.375rem; margin-right: -4.375rem; gap: 0.5rem; }
  .tab { padding: 0.5625rem 0.8125rem; }
}
@media (max-width: 480px) {
  .tabs { gap: 0.375rem; }
  .tab { padding: 0.625rem 0.625rem; }
}
@media (max-width: 360px) {
  .tabs { gap: 0.3125rem; }
  .tab { padding: 0.5625rem 0.5rem; }
  .tab .icon { font-size: 1rem; }
}

/* ---------- After the skull: click the star to put the page back together ---------- */
.end-star.rebuild { cursor: pointer; }
.end-star.rebuild:not(.on) { pointer-events: none; }   /* invisible = not clickable */
.end-star.rebuild .end-star-svg { transition: filter 0.3s ease, transform 0.3s ease; }
.end-star.rebuild:hover .end-star-svg,
.end-star.rebuild:focus-visible .end-star-svg { filter: drop-shadow(0 0 0.875rem rgba(255, 216, 107, 0.75)); transform: scale(1.06); }
.end-star.rebuild:focus-visible { outline: none; }

.rebuild-hint {
  margin: -1.2rem 0 1.8rem;
  font-style: italic;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  opacity: 0;
  transition: opacity 1.2s ease 0.8s;
}
.rebuild-hint.on { opacity: 0.85; }

/* while the page is lying in pieces: a soft dark halo keeps the ward text readable over the heap */
html.fallen .spell,
html.fallen .visitor-info,
html.fallen .rebuild-hint { text-shadow: 0 0 0.3125rem #121110, 0 0 0.625rem #121110, 0 0 1.125rem #121110; }
html.fallen .tab-tip,
html.fallen .kill-tip { display: none; }      /* the hover notes hang below the tabs: they would stretch the page once the tabs have fallen */


/* Occult passage: quotation styling with a soft green glow, retaining the existing box. */
.occult-quote blockquote {
  margin: 1.2rem 0 0;
  padding: 0.6rem 0.2rem;
  color: #b9edc0;
  font-size: 1.15rem;
  line-height: 1.8;
  font-style: italic;
  text-shadow: 0 0 0.3125rem rgba(126, 255, 153, 0.45), 0 0 0.875rem rgba(126, 255, 153, 0.28), 0 0 1.75rem rgba(126, 255, 153, 0.16);
}


/* ---------- SmolTube project ---------- */
.smoltube-box h3 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  margin: 1.4rem 0 0.65rem;
}
.smoltube-box h3 a { color: var(--text); text-decoration-color: var(--card-border-hi); text-underline-offset: 0.2em; }
.smoltube-box h3 a:hover { text-decoration-color: var(--text); }
.smoltube-lead { font-style: italic; font-size: 1.15rem; }
.smoltube-download + .smoltube-download,
.smoltube-previews { border-top: 1px solid var(--card-border); margin-top: 1.5rem; padding-top: 0.5rem; }
.smoltube-code-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.smoltube-copy {
  flex-shrink: 0; border: 1px solid var(--card-border); border-radius: 999px;
  padding: 0.45rem 0.85rem; background: var(--paper-dim); color: var(--text);
  font: inherit; font-size: 0.8rem; cursor: pointer;
}
.smoltube-copy:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.smoltube-code {
  overflow-x: auto; padding: 1rem 1.1rem; border: 1px solid var(--card-border);
  border-radius: 0.85rem; background: var(--paper-dim); font-size: 0.82rem;
  line-height: 1.7; white-space: pre; user-select: text; -webkit-user-select: text;
}
.smoltube-code code { user-select: text; -webkit-user-select: text; }
.smoltube-port { margin-top: 1.25rem; padding-left: 1rem; border-left: 2px solid var(--card-border-hi); }
.smoltube-port blockquote { margin: 0 0 1.1rem; padding-left: 1rem; border-left: 2px solid var(--card-border); font-style: italic; line-height: 1.75; }
.smoltube-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.smoltube-gallery a { display: block; overflow: visible; border: 1px solid var(--card-border); border-radius: 0.8rem; }
.smoltube-gallery img { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 0.25s ease; }
.smoltube-gallery a:hover img { transform: scale(1.035); }
@media (max-width: 600px) {
  .smoltube-gallery { grid-template-columns: 1fr; }
  .smoltube-gallery img { aspect-ratio: 16 / 9; }
  .smoltube-code { font-size: 0.75rem; }
}


/* Desktop hover preview: enlarge screenshots in a centered lightbox without leaving the page. */
.smoltube-preview-overlay {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  padding: 3vh 3vw; background: rgba(10, 10, 12, 0.82); pointer-events: none;
}
.smoltube-preview-overlay img {
  display: block; max-width: 94vw; max-height: 94vh; width: auto; height: auto; object-fit: contain;
  border: 1px solid var(--card-border-hi); border-radius: 0.7rem; box-shadow: 0 1rem 4rem rgba(0,0,0,.5);
}
@media (hover: hover) and (pointer: fine) and (min-width: 601px) {
  .smoltube-gallery a { cursor: zoom-in; }
}


/* small helper text under the SmolTube install code */
.smoltube-note { font-size: 0.95em; opacity: 0.85; }
.smoltube-note code { white-space: normal; word-break: break-all; }
.smoltube-code { overflow-x: auto; }
