/*
Theme Name: Zerth
Theme URI: https://zerth.net
Author: zerth.net
Author URI: https://zerth.net
Description: A self-contained, build-free classic WordPress theme for the streamer Zerth__. A mobile-first, single-screen link-in-bio with a calm "put-together woodland" aesthetic. No page builder, no jQuery, self-hosted assets, fully cacheable.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zerth
Tags: one-column, custom-menu, custom-colors, full-width-template
*/

/* ==========================================================================
   NOTE ON BUILD
   This file is the single source of truth AND what WordPress serves. The
   source is kept readable (comments + whitespace); minify on deploy if you
   want the last few bytes. The whole page is one viewport, so we load this as
   one small, render-blocking, same-origin file rather than splitting critical
   CSS — there is no meaningful "below the fold" to defer for a single screen.
   ========================================================================== */

/* ---- Self-hosted display font (variable, subset, swap) ------------------- */
/* Fraunces is bundled. The UI font (--font-ui) deliberately rides the system
   sans stack — zero bytes, instant. To self-host Inter instead, add an
   @font-face for "Inter" here pointing at a subset assets/fonts/inter-*.woff2;
   the token already lists "Inter" first so it'll take over automatically. */
@font-face {
  font-family: "Fraunces";
  src: url("assets/fonts/fraunces-variable.woff2") format("woff2");
  font-weight: 400 700;            /* variable wght axis; SOFT/WONK/opsz pinned at build time */
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens ------------------------------------------------------- */
:root {
  /* Palette (from the brief) */
  --pine:      #14342B; /* deepest green: display text */
  --forest:    #1F4D3A; /* button base */
  --moss:      #4A7C59; /* accents, hovers */
  --sage:      #A8C3A0; /* soft fills, borders, icon glyphs */
  --parchment: #F5F1E6; /* page background */
  --card:      #FBF9F2; /* card surface (warm off-white) */
  --bark:      #3A2E25; /* warm dark text */
  --sun:       #E0A94E; /* amber: focus ring, hover glow, flourishes */

  /* Derived */
  --btn-bg:       var(--forest);
  --btn-bg-hover: #235640;          /* gentle shift toward moss; keeps AA contrast on light ink */
  --btn-ink:      var(--parchment);
  --ring:         var(--sun);

  --maxw:   30rem;                   /* ~480px card */
  --radius: 1.25rem;
  --pill:   999px;

  --shadow-card:
    0 1px 2px rgba(20, 52, 43, .06),
    0 10px 26px -10px rgba(20, 52, 43, .20),
    0 30px 60px -30px rgba(20, 52, 43, .26);
  --shadow-btn: 0 1px 2px rgba(20, 52, 43, .20);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --t:    150ms;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui:      "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-ui);
  font-size: 100%;
  line-height: 1.5;
  color: var(--bark);
  background-color: var(--parchment);
  /* Soft sage glow up top melting into a warm parchment wash — never flat. */
  background-image:
    radial-gradient(120% 85% at 50% -15%, rgba(168, 195, 160, .55), rgba(168, 195, 160, 0) 60%),
    linear-gradient(180deg, var(--parchment) 0%, #EFE8D6 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1 { margin: 0; }

/* Visible, on-brand focus everywhere. */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 6px; }

/* ---- Quiet background depth: grain + topographic contour ----------------- */
/* Both are decorative, fixed, non-interactive, and sit behind everything. */
body::before { /* fine film grain */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.8'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after { /* faint topographic rings behind the card */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .05;
  background-position: center 42%;
  background-repeat: no-repeat;
  background-size: min(115vw, 48rem) auto;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20600%20600'%20fill='none'%20stroke='%231F4D3A'%20stroke-width='1.2'%3E%3Cellipse%20cx='298'%20cy='302'%20rx='78'%20ry='70'/%3E%3Cellipse%20cx='303'%20cy='298'%20rx='138'%20ry='124'/%3E%3Cellipse%20cx='296'%20cy='305'%20rx='202'%20ry='184'/%3E%3Cellipse%20cx='305'%20cy='296'%20rx='270'%20ry='248'/%3E%3C/svg%3E");
}

/* ---- Fireflies (JS-populated; absent for reduced-motion / no-JS) --------- */
.fireflies { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fireflies span {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--s, 3px); height: var(--s, 3px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 169, 78, .9), rgba(224, 169, 78, 0) 70%);
  opacity: 0;
  animation: drift var(--d, 8s) var(--delay, 0s) ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(.7);        opacity: 0; }
  20%  {                                                    opacity: .9; }
  50%  { transform: translate3d(12px, -18px, 0) scale(1); }
  80%  {                                                    opacity: .6; }
  100% { transform: translate3d(-10px, -32px, 0) scale(.8); opacity: 0; }
}

/* ---- Skip link + a11y util ---------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px; top: 0;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--pine);
  color: var(--parchment);
  border-radius: 0 0 .5rem 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Layout -------------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;   /* vertical centering; min-height (not height) means tall content just scrolls, no clipping */
  padding: clamp(1rem, 4vw, 2.5rem);
}

/* ---- Card ---------------------------------------------------------------- */
.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;       /* centre the capped-width card in the flex column */
  padding: clamp(1.5rem, 5vw, 2.5rem);
  text-align: center;
  background: var(--card);
  border: 1px solid rgba(20, 52, 43, .07);
  /* Slight organic asymmetry instead of a sterile rectangle. */
  border-radius: var(--radius);
  border-top-left-radius: 1.7rem;
  border-bottom-right-radius: 1.7rem;
  box-shadow: var(--shadow-card);
}

/* ---- Avatar -------------------------------------------------------------- */
.avatar {
  width: 124px;
  height: 124px;
  margin: 0 auto 1rem;
  border-radius: 50%;
}
.avatar img, .avatar > svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  /* Thin moss + sun ring, then a soft drop. */
  box-shadow:
    0 0 0 4px var(--card),
    0 0 0 6px var(--moss),
    0 0 0 9px rgba(224, 169, 78, .45),
    0 12px 26px -12px rgba(20, 52, 43, .45);
}

/* ---- Name + tagline ------------------------------------------------------ */
.name {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(2rem, 7vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -.01em;
  color: var(--pine);
  margin: .15rem 0 .2rem;
}
.tagline {
  margin: 0 0 1.4rem;
  color: var(--moss);
  font-weight: 500;
  font-size: 1rem;
}

/* ---- Link buttons -------------------------------------------------------- */
.links { display: flex; flex-direction: column; gap: .7rem; }
.links__item { margin: 0; }

.btn {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: 100%;
  padding: .95rem 1.1rem;
  font: 600 1.0625rem/1 var(--font-ui);
  text-decoration: none;
  color: var(--btn-ink);
  background: var(--btn-bg);
  border-radius: var(--pill);
  box-shadow: var(--shadow-btn);
  transition:
    transform var(--t) var(--ease),
    background-color var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}
.btn__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.1rem; height: 2.1rem;
  border-radius: 50%;
  color: var(--sage);
  background: rgba(168, 195, 160, .16);
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
.btn__icon svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.btn__label { flex: 1 1 auto; text-align: center; }
.btn__flourish { /* leaf that slides in on hover */
  flex: 0 0 auto;
  color: var(--sun);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.btn__flourish svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }

.btn:hover, .btn:focus-visible {
  background: var(--btn-bg-hover);
  transform: translateY(-2px);
  box-shadow:
    0 12px 26px -12px rgba(20, 52, 43, .5),
    0 0 0 1px rgba(224, 169, 78, .35),
    0 0 22px -6px rgba(224, 169, 78, .45);
}
.btn:hover .btn__icon, .btn:focus-visible .btn__icon { background: var(--moss); color: var(--parchment); }
.btn:hover .btn__flourish, .btn:focus-visible .btn__flourish { opacity: 1; transform: translateX(0); }
.btn:active { transform: translateY(0); }

/* ---- Social icon row (repeats the same links, icon-only) ----------------- */
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
  margin-top: 1.4rem;
}
.socials a {
  display: grid;
  place-items: center;
  width: 2.6rem; height: 2.6rem;
  border-radius: 50%;
  color: var(--sage);
  background: var(--forest);
  box-shadow: var(--shadow-btn);
  transition:
    transform var(--t) var(--ease),
    background-color var(--t) var(--ease),
    color var(--t) var(--ease),
    box-shadow var(--t) var(--ease);
}
.socials a svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.socials a:hover, .socials a:focus-visible {
  color: var(--parchment);
  background: var(--btn-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -8px rgba(20, 52, 43, .5), 0 0 18px -6px rgba(224, 169, 78, .5);
}

/* ---- Tiny footer note ---------------------------------------------------- */
.colophon {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: .8rem;
  color: var(--moss);
  opacity: .8;
}

/* ---- Motion & reduced-motion -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .fireflies { display: none; }
}
