/* =======================================
   Astracel – Artifact View (Glass)
   Based on fauna.css, with purple accent.
   ======================================= */

/* ---------- Theme tokens ---------- */
:root {
  --bg: #0e1013;
  --panel: rgba(255,255,255,0.06);
  --panel-hover: rgba(255,255,255,0.09);
  --panel-border: rgba(255,255,255,0.12);
  --text: #eef2f6;
  --muted: #a9b1ba;
  --accent: #ff923a;        /* artifact accent */
  --accent-body: #f87a21;   /* tint used in hero gradient */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.03);
  --shadow-soft: 0 6px 18px rgba(0,0,0,0.28);
}

/* ---------- Base (fixed gradient coverage) ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 10% -10%, color-mix(in srgb, var(--accent-body) 35%, transparent), transparent 60%),
    radial-gradient(1000px 700px at 100% 0%, rgba(86,98,246,0.06), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed, fixed, scroll;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
*::-webkit-scrollbar { height: 8px; width: 8px; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 60%, transparent));
  border-radius: 20px;
}
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout ---------- */
.container {
  display: block;
  width: min(1280px, 92vw);
  margin: 28px auto;
}

.main-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  align-items: start;
}

.left-column { display: grid; gap: 22px; }
.left-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

/* Sticky info stack */
.right-column {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 18px;
}

/* ---------- Cards & Panels ---------- */
.fauna-image,
.text-box-1,
.text-box-2,
.info-box {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.fauna-image:hover,
.text-box-1:hover,
.text-box-2:hover,
.info-box:hover {
  background: var(--panel-hover);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

/* ---------- Image ---------- */
/* Image card container */
.fauna-image {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.fauna-image:hover {
  background: var(--panel-hover);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

/* Image itself */
.fauna-image img {
  width: 100%;
  height: auto;              /* natural height */
  max-height: 600px;         /* keep it from going *too* huge */
  object-fit: contain;       /* full image visible */
  object-position: center;
  border-radius: calc(var(--radius) - 6px);
  user-select: none;
}

/* ---------- Text content ---------- */
.text-box-1,
.text-box-2 {
  padding: 16px 18px;
  line-height: 1.45;
  color: var(--text);
}
.text-box-1 p,
.text-box-2 p,
.text-box-1 br,
.text-box-2 br {
  font-size: clamp(12px, 1.05vw, 16px);
  line-height: 1.35;
  margin: 0;
}

/* If you ever use the second box */
.text-box-2 { height: clamp(180px, 26vh, 320px); overflow: hidden; }

/* ---------- Info stack ---------- */
.info-box {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 14px;
  min-height: 58px;
  height: auto;
  overflow-wrap: anywhere;
  font-size: clamp(14px, 1.25vw, 20px);
  letter-spacing: .3px;
}
.info-box a,
.info-box a:visited,
.info-box a:active {
  color: #ffffff;
  text-decoration: none;
  border: none;
  outline: none;
  transition: color .2s ease, opacity .2s ease, text-shadow .2s ease;
  text-shadow: 0 0 0 transparent;
}
.info-box a:hover {
  color: var(--accent);
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Codex number box: smaller + grey */
.info-box.info-codex {
  font-size: clamp(12px, 1vw, 15px);
  color: var(--muted);
  letter-spacing: 0.4px;
}

/* Icon padding for shared super-styles icons */
.info-box.info-audio,
.info-box.info-tag,
.info-box.info-waypoint {
  padding-left: 42px;
}

/* Elevate first three info chips */
.right-column .info-box:nth-child(-n+3) {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03)),
    var(--panel);
  border: 1px solid rgba(255,255,255,0.18);
}

/* Last chip acts as full-width button surface */
.right-column .info-box:last-child { padding: 0; }
.right-column .info-box:last-child a {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 12px 14px;
  background: none !important; border: 0 !important; border-radius: inherit;
  box-shadow: none !important; outline: none; font-weight: inherit; color: inherit;
}
.right-column .info-box:last-child a:hover {
  background: none !important;
  color: var(--accent);
  text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* ---------- Links in text ---------- */
.text-box-1 a,
.text-box-2 a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.text-box-1 a:hover,
.text-box-2 a:hover {
  color: var(--accent);
  text-decoration-color: #ffffff;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .main-content { grid-template-columns: 1.6fr 1fr; }
}
@media (max-width: 980px) {
  .main-content { grid-template-columns: 1fr; }
  .right-column { position: static; grid-template-columns: repeat(2, 1fr); }
  .right-column .info-box { min-height: 56px; }
}
@media (max-width: 680px) {
  .left-top { grid-template-columns: 1fr; }
  .fauna-image img { height: clamp(220px, 32vh, 420px); }
  .right-column { grid-template-columns: 1fr; }
}

/* ---------- Focus ring ---------- */
a:focus-visible,
.info-box:focus-within {
  outline: 2px solid transparent;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent),
    0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent),
    var(--shadow-soft);
  border-color: rgba(255,255,255,0.24);
}

/* ---------- Micro-underline anim ---------- */
@media (prefers-reduced-motion: no-preference) {
  .info-box a,
  .text-box-1 a,
  .text-box-2 a { position: relative; }
  .info-box a::after,
  .text-box-1 a::after,
  .text-box-2 a::after {
    content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px;
    background: currentColor; transform-origin: left; transform: scaleX(0);
    transition: transform .22s ease;
  }
  .info-box a:hover::after,
  .text-box-1 a:hover::after,
  .text-box-2 a:hover::after { transform: scaleX(1); }
}

/* Make Name/Scientific (or any .info-box.clickable) draw ONLY the animated line under the text */

/* 1) Remove any inherited underline */
.info-box.clickable,
.info-box.clickable:hover,
.info-box.clickable:focus,
.info-box.clickable * {
  text-decoration: none !important;
}

/* 2) Keep the same hover “lift” + accent color as link boxes */
.info-box.clickable {
  cursor: pointer;
  color: inherit;
  position: relative;
}
.info-box.clickable:hover,
.info-box.clickable:focus {
  outline: none;
  background: var(--panel-hover);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  color: var(--accent);
  text-shadow: 0 0 18px rgba(66,167,162,0.35);
}

/* 3) Put the animated underline ONLY under the text wrapper */
.info-box.clickable .info-label {
  position: relative;
  display: inline-block;
}
.info-box.clickable .info-label::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .22s ease;
}
.info-box.clickable:hover .info-label::after,
.info-box.clickable:focus .info-label::after {
  transform: scaleX(1);
}
