@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');
@import url(https://cdn.jsdelivr.net/gh/sunghyunzz/eulyoo1945/eulyoo1945.css);
@import url('https://cdn.jsdelivr.net/gh/leetaewook/gmarket-sans-dynamic-subset/GmarketSans.css');

:root{
  --bg:#d1cfda;
  --text:#2d2a3e;
  --hi:#7a73a0;

  --font-title: "Manrope", "Gmarket Sans", Roboto, Arial, sans-serif;
  --font-body: "Eulyoo1945", serif;

  --maxw: 780px;
  --radius: 5px;
  --shadow: 0 14px 50px rgba(45,42,62,0.18);
  --shadow-soft: 0 10px 30px rgba(45,42,62,0.12);

  --glass: rgba(250,250,255,0.5);
  --border: rgba(45,42,62,0.22);

  --paper: rgba(250,250,255,0.18);
  --gridline: rgba(45,42,62,0.26);
  --gridline-strong: rgba(45,42,62,0.42);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height:1.8;
  overflow-x:hidden;
}

a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:underline; text-underline-offset:3px; }

.page{ position:relative; z-index:1; min-height:100vh; display:flex; flex-direction:column; }

/* --- Ambient Background Rubik Wire Cube (CSS 3D) --- */
.bgStage{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  perspective: 900px;
  opacity: 0.58;
}

.cubeWrap{
  width: min(58vmin, 540px);
  height: min(58vmin, 540px);
  position: absolute;
  transform: translate(18vmin, -10vmin);
}

.cube{
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: spin 18s linear infinite;
}

@keyframes spin{
  0%   { transform: rotateX(18deg) rotateY(0deg) rotateZ(8deg); }
  100% { transform: rotateX(18deg) rotateY(360deg) rotateZ(8deg); }
}

/* edge line */
.edge{
  position:absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
  transform-origin: left center;
  height: 2px;
  background: rgba(122,115,160,0.38);
  box-shadow: 0 0 18px rgba(122,115,160,0.14);
  border-radius: 999px;
}

/* internal grid line on faces (Rubik subdivisions) */
.gridLine{
  position:absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
  transform-origin: left center;
  height: 2px;
  background: rgba(122,115,160,0.28);
  box-shadow: 0 0 14px rgba(122,115,160,0.10);
  border-radius: 999px;
}

.atom{
  position:absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  box-shadow: 0 0 18px rgba(255,255,255,0.12);
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
}

/* --- Header / Nav --- */
header{ padding:24px 16px 0; }
.header-inner{
  margin: 0 auto;
  justify-content:space-between;
  align-items:flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.brand{ display:flex; flex-direction:column; gap:6px; }
.brand .kicker{
  font-family: var(--font-title);
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 12px;
  opacity: .9;
  text-align: center;
}
.brand h1{
  margin:0;
  font-family: var(--font-title);
  font-weight: 500;
  letter-spacing: 0;
  font-size: 72px;
  line-height: 1;
  text-align: center;
  word-break: keep-all;
}

@media (max-width: 700px) {
 .brand h1 {
  font-size: 54px;
 }
}

.brand .sub {
  font-family: var(--font-title);
}
.logo {
  max-width: 150px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.brand .sub{ font-size:14px; text-align: center; margin-bottom: 20px;}

/* default nav chips (used on non-index pages) */
.nav{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:999px;
  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
}
.chip strong{ font-family: var(--font-title); font-weight:700; }

/* --- Single-column layout --- */
main{ flex:1; padding:18px 16px 46px; }
.container{
  max-width: var(--maxw);
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap: 16px;
}



/* --- Cards / UI --- */
.card{
  border-radius: var(--radius);
  background: var(--glass);
  /*border: 1px solid var(--border);*/
  box-shadow: var(--shadow);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  overflow:hidden;
}

.pad{ 
  padding-top: 80px;
  padding-left: 80px;
  padding-right: 80px;
  padding-bottom: 100px; }

.exempt {
  font-family: serif;
}
@media (max-width: 700px) {
  .main_art {
    padding-left: 5px;
    padding-right: 5px;
  }
  .pad {
    padding-left: 15px;
    padding-right: 15px;
  }
  .pad_art {
    padding-left: 0;
    padding-right: 0;
  }
  .workCP_art {
    padding-left: 30px;
    padding-right: 30px;
  }
}
.card h2{
  margin: 0 0 10px;
  font-family: var(--font-title);
  font-size: 18px;
}

.hr{ height:1px; background: rgba(45,42,62,0.18); margin: 14px 0; }

.btnRow{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

button, .btn{
  appearance:none;
  border: 1px solid rgba(45,42,62,0.28);
  background: rgba(250,250,255,0.30);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: .02em;
  cursor:pointer;
  transition: transform 160ms ease, background 160ms ease;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

button:hover, .btn:hover{ transform: translateY(-1px); background: rgba(250,250,255,0.38); }
button:active, .btn:active{ transform: translateY(0) scale(.99); }

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

.item{
  display:flex;
  flex-direction:column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(250,250,255,0.12);
  border: 1px solid rgba(45,42,62,0.18);
}

.item:hover {
  background: rgba(250,250,255,0.5);
}

.item .top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.item .title{
  font-family: var(--font-title);
  font-weight: 500;
  text-align: center;
  font-size: 18px;
}

.item .by{
  font-family: var(--font-title);
  font-weight: 800;      /* more prominent author */
  font-size: 14px;
  opacity: 0.8;
}

.item .excerpt{
  opacity: 0.88;
  font-size: 13px;
}

/* -------------------------
   Tags (quiet, archival)
   ------------------------- */
.tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:2px;
}

.tag{
  font-size:12px;
  letter-spacing:.04em;
  opacity:.68;
  padding:2px 6px 4px;
  border-radius:5px;
  border:1px solid rgba(45,42,62,0.22);
  background: rgba(250,250,255,0.18);
  font-family: var(--font-title);
}

/* Work page tags */
.workTags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top: 6px;
}

.workHeader {
  margin-bottom: 50px;
}
.workCP {
  font-family: var(--font-title);
  margin-bottom: 20px;
}
.workBody {
  margin-top: 50px;
}

.artwork {
  max-width: 100%;
}

#notesBody p {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 14px;
}
#notesBody a {
  text-decoration: underline;
}
#notesBody a:hover {
  background-color: var(--text);
  color: white;
}
#notesBody hr {
  margin-top: 30px;
  margin-bottom: 30px;
  border-top: 2px dotted;
}
.video-container {
  width: 100%; /* Ensures the container takes the full width of its parent */
  height: 100px;
}

.video-container iframe {
  width: 100%;
  height: 100%;

}

.credits {
  text-align: center;
  font-size: 14px;
  line-height: 1.2;
  margin-top: 50px;
}
/* Mini-index pages: make content more transparent */
body[data-page^="theme-"] .card{
  background: var(--glass);
  border-color: rgba(45,42,62,0.18);
}

/* --- Roman 9 motif --- */
.roman9{
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--hi);
  font-size: 24px;
}

/* --- Better 원고지 (double line top/bottom) --- */
.manuscript{
  background:
  linear-gradient(
    0deg,
    rgba(255,255,255,0.10),
    rgba(255,255,255,0.10)
  ),
  repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.035),
    rgba(255,255,255,0.035) 1px,
    transparent 1px,
    transparent 4px
  ),
  rgba(250,250,255,0.12);

  border-left: 1px solid rgba(45,42,62,0.30);
  border-right: 1px solid rgba(45,42,62,0.30);
  border-top: 3px double rgba(45,42,62,0.42);
  border-bottom: 3px double rgba(45,42,62,0.42);
  border-radius: 10px;
  padding: clamp(10px, 2vw, 14px);
  box-shadow: var(--shadow-soft);
}

.manuscriptHead{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.manuscriptHead .label{
  font-family: var(--font-title);
  font-weight: 760;
  letter-spacing: .04em;
  text-align: right;
}

.pt_link {
  text-align: right;
  margin-bottom: 20px;
}
.pt_link a {
  text-decoration: underline;
}

.grid9{
  display:grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  border: 1px solid rgba(45,42,62,0.30);
  background: rgba(250,250,255,0.08);
}

.cell{
  aspect-ratio: 1 / 1;
  display:grid;
  place-items:center;
  border-right: 1px solid rgba(45,42,62,0.26);
  border-bottom: 1px solid rgba(45,42,62,0.26);
  font-family: var(--font-title);
  font-weight: 760;
  font-size: clamp(16px, 3.3vw, 22px);
  line-height: 1;
}

.cell:nth-child(9n){ border-right: 0; }
.cellRowEnd{ border-bottom: 0; }
.cell.start{ background: rgba(122,115,160,0.12); }

/* --- 3D Die (prominent) --- */
.dieHero{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 16px;
  padding: 50px 0 6px;
}

.dieRow{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 16px;
  flex-wrap: wrap;
}

.die3d{
  /* Responsive cube depth: prevents faces “separating” on small screens */
  --die: min(30vmin, 160px);
  --depth: calc(var(--die) / 2);

  width: var(--die);
  height: var(--die);
  position: relative;
  perspective: 900px;
}

.die3d{
  cursor: pointer;
}

.dieCube{
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;

  /* Resting pose: slight tilt so it reads 3D on load */
  transform: rotateX(-26deg) rotateY(34deg);
  transition: transform 900ms cubic-bezier(.2,.8,.2,1);
}

/* Die feels clickable */
.die3d { cursor: pointer; }

/* Hover tilt (subtle) */
.die3d:hover .dieCube{
  transform: rotateX(-34deg) rotateY(46deg);
}

/* Press feedback */
.die3d:active .dieCube{
  transform: rotateX(-30deg) rotateY(40deg) scale(0.985);
}


.face{
  position:absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 22px;
  background: rgba(250,250,255,0.45);
  border: 1px solid rgba(45,42,62,0.25);
  box-shadow: var(--shadow-soft);
  display:grid;
  place-items:center;
}

.pips{
  width: 64%;
  height: 64%;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
}

.pip{
  width: clamp(10px, 2.1vmin, 14px);
  height: clamp(10px, 2.1vmin, 14px);
  border-radius: 50%;
  background: rgba(45,42,62,0.74);
  justify-self:center;
  align-self:center;
  opacity: 0;
}

.pip.on{ opacity: 1; }

/* Face positions (translateZ half depth) */
.face.f1{ transform: translateZ(var(--depth)); }
.face.f6{ transform: rotateY(180deg) translateZ(var(--depth)); }
.face.f2{ transform: rotateY(90deg) translateZ(var(--depth)); }
.face.f5{ transform: rotateY(-90deg) translateZ(var(--depth)); }
.face.f3{ transform: rotateX(90deg) translateZ(var(--depth)); }
.face.f4{ transform: rotateX(-90deg) translateZ(var(--depth)); }

.dieHint{
  text-align:center;
  font-size: 13px;
  opacity: 0.88;
}

/* Index page: minimal, centered layout */
body[data-page="home"] main{
  display:flex;
  align-items:center;
}
body[data-page="home"] .container{
  width:100%;
  align-items:center;
  gap: 14px;
}
body[data-page="home"] .card{
  width: min(720px, 100%);
}

/* Footer */
.footer{
  padding: 30px 16px 18px;
  opacity: .78;
  font-size: 12px;
}
.footer-inner{
  max-width: var(--maxw);
  margin:0 auto;
  display:flex;
  justify-content:center;
}

@media (prefers-reduced-motion: reduce){
  .cube{ animation: none; }
  .dieCube{ transition: none; }
}

/* ===============================
   Ritual: Manuscript Awakens
   =============================== */

/* Die clickable + hover tilt */
.die3d { cursor: pointer; }
.die3d:hover .dieCube{
  transform: rotateX(-34deg) rotateY(46deg);
}
.die3d:active .dieCube{
  transform: rotateX(-30deg) rotateY(40deg) scale(0.985);
}

/* While ritual runs, suppress hover tilt so it doesn’t fight the roll transform */
body.is-ritual .die3d:hover .dieCube{
  transform: rotateX(-26deg) rotateY(34deg);
}

/* Ritual layout under the die */
.ritual{
  width: min(520px, 100%);
  margin-top: 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
}

/* Softer paper texture (no images, file:// safe) */
.manuscript--soft{
  background:
    linear-gradient(0deg, rgba(255,255,255,0.10), rgba(255,255,255,0.10)),
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.035),
      rgba(255,255,255,0.035) 1px,
      transparent 1px,
      transparent 4px
    ),
    rgba(250,250,255,0.12);
}

/* Ghosted (pre-awakening) */
.manuscript--ghost{
  opacity: 0.80;
}

/* Ritual grid is 3 rows x 9 columns */
.grid9--ritual{
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

/* Make ritual cells feel like faint pencil until inked */
.grid9--ritual .cell{
  opacity: 0.05;
  transform: translateY(0);
  transition: opacity 380ms ease, transform 380ms ease, filter 380ms ease;
  filter: blur(0.2px);
}

/* Inked cell */
.grid9--ritual .cell.ink{
  opacity: 0.92;
  filter: blur(0px);
  transform: translateY(-0.2px);
}

/* Echo ink (lighter than the chosen line) */
.grid9--ritual .cell.echo{
  opacity: 0.55;
}

/* Chosen line gets a “seal” emphasis */
.grid9--ritual .cell.seal{
  background: rgba(122,115,160,0.10);
  box-shadow: inset 0 0 0 1px rgba(122,115,160,0.22);
}

/* Small ritual caption */
.ritualCaption{
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: 0.78;
  min-height: 16px;
}

