/* bluberribaby — link page. Blue gothic.
   Theme colours are injected as CSS custom properties by js/app.js from links.json.
   The values below are fallbacks only; edit links.json to change the palette. */

@font-face {
  font-family: 'Cormorant';
  src: url('../assets/fonts/cormorant-var.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cinzel';
  src: url('../assets/fonts/cinzel-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #05080e;
  --bg-glow: #16344a;
  --text: #e8f1f7;
  --muted: #7e9aab;
  --accent: #3f8fb5;
  --accent-soft: #a8dcf0;
  --card: rgba(168, 220, 240, 0.045);
  --card-hover: rgba(168, 220, 240, 0.10);
  --border: rgba(168, 220, 240, 0.16);
  --display: 'Cinzel', 'Cormorant', Georgia, serif;
  --serif: 'Cormorant', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Cold bloom above, deep vignette below — cathedral light. */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(70% 40% at 50% -5%, var(--bg-glow) 0%, transparent 68%),
    radial-gradient(45% 35% at 50% 105%, var(--accent) 0%, transparent 72%),
    radial-gradient(120% 80% at 50% 40%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0.72;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 52px 20px calc(44px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- profile ---------- */

.profile {
  text-align: center;
  margin-bottom: 30px;
  animation: rise 0.55s ease both;
}

/* Gothic arch frame — pointed at the top, squared at the base. */
.avatar-ring {
  position: relative;
  width: 126px;
  height: 150px;
  margin: 0 auto 20px;
  padding: 3px;
  border-radius: 63px 63px 5px 5px / 78px 78px 5px 5px;
  background: linear-gradient(170deg, var(--accent-soft), var(--accent) 45%, #0d1c28);
  box-shadow: 0 0 34px -10px var(--accent);
}

.avatar {
  width: 120px;
  height: 144px;
  display: block;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 60px 60px 3px 3px / 75px 75px 3px 3px;
  background: #0a121a;
  filter: saturate(0.92) contrast(1.06);
}

.name {
  margin: 0;
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  text-shadow: 0 0 26px rgba(168, 220, 240, 0.28);
}

.handle {
  margin: 4px 0 0;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-soft);
  opacity: 0.85;
}

/* Ornamental rule with a centred lozenge. */
.profile::after {
  content: '';
  display: block;
  width: 116px;
  height: 9px;
  margin: 18px auto 16px;
  background:
    linear-gradient(90deg, transparent, var(--border) 18%, var(--border) 38%, transparent 44%),
    linear-gradient(90deg, transparent 56%, var(--border) 62%, var(--border) 82%, transparent),
    conic-gradient(from 45deg at 50% 50%, var(--accent-soft) 0 25%, transparent 0 100%);
  background-size: 100% 1px, 100% 1px, 9px 9px;
  background-position: 0 4px, 0 4px, center;
  background-repeat: no-repeat;
  opacity: 0.75;
}

.bio {
  margin: 0 auto;
  max-width: 40ch;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--muted);
}

/* Each bio line balances independently. Balancing the whole bio as one run is
   what caused breaks mid-phrase ("creator here" / "to supply"). */
.bio-line {
  display: block;
  text-wrap: balance;
  text-wrap: pretty;
}

/* Opening line carries the introduction — give it a little more room. */
.bio-line:first-child { margin-bottom: 0.55em; }

/* Closing line is the hook: lift it out of the muted body colour. */
.bio-line:last-child {
  margin-top: 0.45em;
  color: var(--accent-soft);
  font-style: italic;
  opacity: 0.92;
}

.bio a { color: var(--accent-soft); }

/* ---------- link cards ---------- */

.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  min-height: 62px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease, background 0.2s ease,
              border-color 0.2s ease, box-shadow 0.2s ease;
  animation: rise 0.55s ease both;
}

/* Corner ticks — a spare nod to ironwork. */
.card::before,
.card::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  border-color: var(--accent-soft);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card::before {
  top: -1px; left: -1px;
  border-top: 1px solid; border-left: 1px solid;
}

.card::after {
  bottom: -1px; right: -1px;
  border-bottom: 1px solid; border-right: 1px solid;
}

.card:hover::before, .card:focus-visible::before,
.card:hover::after, .card:focus-visible::after { opacity: 1; }

.card:hover,
.card:focus-visible {
  background: var(--card-hover);
  border-color: rgba(168, 220, 240, 0.34);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -18px var(--accent);
}

.card:active { transform: translateY(0) scale(0.995); }

.card:focus-visible {
  outline: 1px solid var(--accent-soft);
  outline-offset: 3px;
}

.card-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  color: var(--accent-soft);
  opacity: 0.9;
}

.card-icon svg { width: 100%; height: 100%; display: block; }

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

.card-label {
  display: block;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-sub {
  display: block;
  margin-top: 1px;
  font-family: var(--serif);
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-arrow {
  flex: 0 0 auto;
  color: var(--accent-soft);
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.card:hover .card-arrow,
.card:focus-visible .card-arrow {
  opacity: 0.8;
  transform: translateX(0);
}

/* featured — taller, lit, gradient edge */
.card.featured {
  min-height: 78px;
  margin-bottom: 5px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(150deg, var(--accent-soft), var(--accent) 55%, #10202c) border-box;
  box-shadow: 0 14px 40px -20px var(--accent);
}

.card.featured .card-label { font-size: 1.05rem; letter-spacing: 0.14em; }
.card.featured .card-icon { flex-basis: 26px; width: 26px; height: 26px; opacity: 1; }

/* ---------- socials ---------- */

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 30px;
}

.social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 2px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  transition: color 0.2s ease, background 0.2s ease,
              transform 0.2s ease, border-color 0.2s ease;
}

.social:hover,
.social:focus-visible {
  color: var(--accent-soft);
  background: var(--card-hover);
  border-color: rgba(168, 220, 240, 0.34);
  transform: translateY(-2px);
}

.social svg { width: 19px; height: 19px; display: block; }

/* ---------- footer ---------- */

.footer {
  margin-top: 34px;
  text-align: center;
}

.share {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 20px;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.share:hover {
  color: var(--accent-soft);
  background: var(--card);
  border-color: rgba(168, 220, 240, 0.34);
}

.share-icon {
  width: 14px;
  height: 14px;
  display: block;
  background: currentColor;
  -webkit-mask: var(--share-mask) center / contain no-repeat;
  mask: var(--share-mask) center / contain no-repeat;
}

.footer-text {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--muted);
  opacity: 0.6;
}

/* ---------- motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 400px) {
  .wrap { padding-top: 40px; }
  .card { padding: 13px 15px; gap: 13px; }
  .name { font-size: 1.65rem; }
}

/* ---------- age gate ----------
   Content is hidden until verified. The gate markup and its handlers live
   inline in index.html so they work even if links.json or app.js fail. */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(90% 70% at 50% 45%, rgba(5,8,14,0.62), rgba(5,8,14,0.9));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: gate-in 0.35s ease both;
}

@keyframes gate-in { from { opacity: 0; } to { opacity: 1; } }

/* Verified: hide gate, restore page. Set by the inline head script. */
html.age-ok .gate { display: none; }

/* Unverified: page stays visible but is blurred out of legibility and made
   completely non-interactive. Links cannot be read, focused, or clicked. */
html:not(.age-ok) .wrap {
  filter: blur(16px) saturate(0.55) brightness(0.75);
  pointer-events: none;
  user-select: none;
  transform: scale(1.02);
}
html:not(.age-ok) body { overflow: hidden; }

/* Blurring alone would leave links tabbable, so hide them from a11y tree too. */
html:not(.age-ok) .wrap a,
html:not(.age-ok) .wrap button { visibility: hidden; }

.gate-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 390px;
  padding: 36px 28px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: linear-gradient(170deg, rgba(22,52,74,0.92), rgba(5,8,14,0.95));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 90px -25px rgba(0,0,0,0.9), 0 0 60px -30px var(--accent);
  animation: rise 0.45s ease both;
}

/* Arch badge, echoing the avatar frame. */
.gate-badge {
  width: 58px;
  height: 68px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 29px 29px 3px 3px / 36px 36px 3px 3px;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #06111a;
  background: linear-gradient(170deg, var(--accent-soft), var(--accent));
}

.gate-title {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gate-text {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--muted);
  text-wrap: balance;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gate-btn {
  width: 100%;
  min-height: 50px;
  padding: 13px 18px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease,
              border-color 0.2s ease, color 0.2s ease;
}

.gate-btn:active { transform: scale(0.985); }

.gate-btn:focus-visible {
  outline: 1px solid var(--accent-soft);
  outline-offset: 3px;
}

.gate-btn-yes {
  color: #06111a;
  border: 1px solid transparent;
  background: linear-gradient(150deg, var(--accent-soft), var(--accent));
}

.gate-btn-no {
  color: var(--muted);
  border: 1px solid var(--border);
  background: transparent;
}

.gate-btn-no:hover {
  color: var(--text);
  background: var(--card-hover);
  border-color: rgba(168, 220, 240, 0.30);
}

.gate-fine {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0.62;
}

@media (max-width: 380px) {
  .gate-card { padding: 28px 20px; }
}

/* ---------- image-based icons (brand logos) ---------- */

.card-icon-img img,
.social-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.card-icon-img { opacity: 1; }

/* Brand colours are loud against the palette. A slight desaturation settles
   them without losing recognisability. Remove this rule for full colour. */
.card-icon-img img,
.social-img img {
  filter: saturate(0.88) drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
  transition: filter 0.2s ease, transform 0.2s ease;
}

.card:hover .card-icon-img img,
.card:focus-visible .card-icon-img img {
  filter: saturate(1) drop-shadow(0 0 12px rgba(0, 0, 0, 0.55));
  transform: scale(1.06);
}

.social-img { padding: 10px; }
.social-img img { filter: saturate(0.8) opacity(0.85); }
.social-img:hover img { filter: saturate(1) opacity(1); }
