/* the gnostic book of changes — design language of b0y.eu */

/* ===== reset ===== */
*, ::before, ::after { box-sizing: border-box; border: 0 solid currentColor; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
a { color: inherit; text-decoration: inherit; }
img { display: block; max-width: 100%; height: auto; }
input { margin: 0; }

/* ===== theme (b0y.eu) ===== */
[data-theme="black"] { --bg: #000; --fg: #fff; --sec: #e5e5e5; }
[data-theme="lofi"]  { --bg: #fff; --fg: #000; --sec: #1a1a1a; }
body {
  background-color: var(--bg); color: var(--fg);
  font-family: system-ui, sans-serif;
  max-width: 48rem; width: 95vw; margin: 0 auto;
  padding: 1.5rem 0 2rem; line-height: 1.6;
}

/* ===== chrome ===== */
header { text-align: center; padding-bottom: 1rem; }
header a {
  font-weight: 800; letter-spacing: -0.025em; text-transform: uppercase;
  font-size: 0.875rem; color: var(--sec);
}
header a:hover { text-decoration: underline; }
footer { text-align: center; padding: 2rem 0 1rem; }
footer p { font-weight: 300; font-size: 0.875rem; color: var(--sec); }
footer a:hover { text-decoration: underline; }

.theme-corner {
  position: absolute; top: 1rem; right: 1rem; z-index: 10;
  display: flex; align-items: center; gap: 0.25rem;
}
svg.icon { display: inline-block; vertical-align: middle; fill: currentColor;
  flex-shrink: 0; width: 1rem; height: 1rem; }
.toggle {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  width: 2rem; height: 1.25rem;
  border-radius: 9999px; border: 1px solid var(--sec);
  background-color: var(--sec);
  --tglbg: var(--bg); --handleoffset: 0.75rem;
  box-shadow: calc(var(--handleoffset) * -1) 0 0 2px var(--tglbg) inset,
              0 0 0 2px var(--tglbg) inset;
  transition: box-shadow 0.2s; flex-shrink: 0;
}
.toggle:checked {
  box-shadow: var(--handleoffset) 0 0 2px var(--tglbg) inset,
              0 0 0 2px var(--tglbg) inset;
}

/* ===== components (b0y.eu) ===== */
.card {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--sec); border-radius: 1rem; overflow: hidden;
  padding: 1rem; margin: 1rem 0;
  transition: box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 1.9rem; border: 1px solid currentColor;
  padding: 0 0.563rem; height: 1.25rem; width: fit-content;
  font-size: 0.875rem; line-height: 1.25rem; background-color: transparent;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
a.badge:hover { background-color: var(--fg); color: var(--bg); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; height: 3rem; min-height: 3rem; padding: 0 1rem;
  border: 1px solid currentColor; border-radius: 0.5rem;
  background: none; color: inherit; cursor: pointer;
  font: inherit; font-size: 0.875rem; font-weight: 600;
  text-align: center; user-select: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background-color: var(--fg); color: var(--bg); border-color: var(--fg); }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.text-secondary { color: var(--sec); }

/* ===== typography ===== */
h1 { font-size: 1.875rem; line-height: 2.25rem; font-weight: 800;
     letter-spacing: -0.025em; }
h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.025em;
     margin-top: 2.5rem; border-top: 1px solid var(--sec); padding-top: 1.5rem; }
h3 { font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
     letter-spacing: 0.1em; color: var(--sec); opacity: 0.8; margin-top: 2rem; }
p { margin: 0.75em 0; }
main a { text-decoration: underline; }
main a:hover { text-decoration: none; }
.sub { color: var(--sec); opacity: 0.85; margin: 0.25em 0; }
.other { color: var(--sec); opacity: 0.75; font-size: 0.9em; }
.dates { color: var(--sec); opacity: 0.6; font-size: 0.8em; margin-top: 3em; }
blockquote {
  margin: 1em 0 1em 1rem; padding-left: 1rem;
  border-left: 2px solid var(--sec); opacity: 0.8;
}

/* ===== navigation ===== */
nav { display: flex; justify-content: space-between; margin: 1rem 0; }
nav a { text-decoration: none !important; font-size: 0.875rem; font-weight: 600;
        color: var(--sec); min-width: 6rem; }
nav a:hover { text-decoration: underline !important; }
nav a:nth-child(2) { text-align: center; }
nav a:last-child, nav span:last-child { text-align: right; }
.actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
           justify-content: center; margin: 1.5rem 0; }
.actions a { text-decoration: none; }
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
          justify-content: center; margin: 1rem 0; }
.badges a { text-decoration: none; }

/* ===== hexagram pieces ===== */
.hexhead { flex-direction: row; align-items: center; gap: 1.25rem; }
.bigglyph { font-size: 4em; line-height: 1; }
.hexhead .badge { margin-top: 0.5rem; }
.grid8 {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 0.4rem; margin: 2rem 0; text-align: center;
}
.grid8 a { text-decoration: none; padding: 0.4rem 0; border-radius: 0.5rem;
           transition: background-color 0.2s, color 0.2s; }
.grid8 a:hover { background-color: var(--fg); color: var(--bg); }
.grid8 .g { display: block; font-size: 1.9em; line-height: 1.2; }
.grid8 .n { display: block; font-size: 0.75em; opacity: 0.6; }
.toc { columns: 2; font-size: 0.9em; padding-left: 3rem; }
.toc li { margin: 0.15em 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
table { border-collapse: separate; border-spacing: 0; margin: 2rem auto;
        text-align: center; border: 1px solid var(--sec); border-radius: 1rem; }
th, td { border-right: 1px solid var(--sec); border-bottom: 1px solid var(--sec);
         padding: 0.4rem 0.7rem; }
tr > :last-child { border-right: 0; }
tr:last-child > * { border-bottom: 0; }
th { color: var(--sec); opacity: 0.8; font-weight: 400; font-size: 0.8em; }
td a { text-decoration: none; display: block; }
td a:hover { background-color: var(--fg); color: var(--bg); }

/* ===== cast page ===== */
#result pre { font-size: 1.1em; line-height: 1.5; margin: 0.5rem 0; }
#primary a, #transformed a { text-decoration: none; font-size: 1.15em; font-weight: 600; }
#primary a:hover, #transformed a:hover { text-decoration: underline; }
#moving { color: var(--sec); opacity: 0.8; }

@media (max-width: 40rem) {
  .toc { columns: 1; }
  .bigglyph { font-size: 3em; }
  body { font-size: 0.9rem; }
}
