/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base styling */
body {
  background-color: #eeece2;
  color: #333;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 1.1rem;
  line-height: 1.6;
  padding: 20px;
}

.small-text {
  font-size: 0.6em;
}



/* Header styling */
header {
  text-align: center;
  padding: 20px 0;
  margin-bottom: 30px;
}

header h1 {
  font-family: 'EB Garamond', serif;
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 10px;
  color: #333;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
}

nav ul li a {
  text-decoration: none;
  color: #333;
  padding: 8px 16px;
  border: 1px solid transparent;
  transition: border-color 0.3s, color 0.3s;
}

nav ul li a:hover,
nav ul li a.active {
  border-color: #333;
  color: #000;
}


/* Mobile fix for top navigation tabs */
@media (max-width: 900px) {
  header nav {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 0.6rem;
  }

  header nav::-webkit-scrollbar {
    display: none;
  }

  header nav ul {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.7rem;

    width: max-content;
    min-width: 100%;

    margin: 0;
    padding: 0 0.5rem;
    list-style: none;
  }

  header nav li {
    flex: 0 0 auto;
  }

  header nav a {
    display: inline-block;
    white-space: nowrap;
  }
}

/* Main content styling */
main {
  max-width: 900px;
  margin: 0 auto;
  background-color: #FFFFFF;
  padding: 30px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

main ul {
  padding-left: 2.1rem;   /* increase indentation */
}

section {
  margin-bottom: 40px;
}

section h2 {
  font-family: 'EB Garamond', serif;
  font-weight: 700;
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #333;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

p {
  margin-bottom: 15px;
  font-family: 'Zen Maru Gothic', sans-serif;
}

/* Work page subsections */
.subsection {
  margin-bottom: 30px;
}

.subsection h3 {
  font-family: 'EB Garamond', serif;
  font-weight: 500;
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: #333;
  border-left: 4px solid #333;
  padding-left: 10px;
}

.subsection ul {
  list-style: disc inside;
  margin-left: 20px;
}



/* Timeline list styling */
.year-event-list {
  list-style: circle;
  margin-top: 20px;
  padding-left: 30px;
}

.year-event-list li {
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 3px; /*solid #333;*/
}

/* Styling for the year portion */
.year-event-list .year {
  font-family: 'Zen Maru Gothic';/*'Crimson Pro', serif;*/
  font-weight: 700;
  font-size: 1.1rem;
  margin-right: 0.5rem;
  color: #333;
  /* Optional: adjust width if you want a fixed column effect */
  /* width: 80px; */
}

/* Styling for the event description */
/* (Assumes body text is already set to Zen Maru Gothic) */
.year-event-list .event {
  font-family: 'Zen Kaku Gothic New', sans-serif;
}




/* ──────────────────────────────────────────────────────────────────────
   Research List: EB Garamond for titles, Zen Maru Gothic for details
   ──────────────────────────────────────────────────────────────────────*/


/* Container for the research bullets */
.research-list {
  list-style: none;
  margin-left: 1.5em;
  padding: 0;
}

/* Each topic title (the “Quantum magnetism”, etc.) */
.research-list li {
  font-family: 'EB Garamond', serif;
  font-weight: 600;
  font-size: 1.2rem;       /* a bit smaller than your Research heading */
  margin-bottom: 0.5em;
}

/* The explanatory paragraph under each topic */
.research-list li p {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 0.8em;        /* as requested */
  font-weight: 300;
  line-height: 1.5;
  padding-left: 16px;
  padding-right: 16px;
  margin: 0.8em 0 0 0;     /* small gap above the paragraph */
}

.subtopic-list {
  list-style: disc inside;     /* a different bullet shape */
  margin: 0.5em 0 0 1.5em;      /* indent and small top margin */
  padding: 0;
}

.subtopic-list li {
  list-style: none;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 900;
  font-size: 0.9em;
}

.subtopic-list li p {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 0.9em;        /* as requested */
  font-weight: 300;
  line-height: 1.5;
  padding-left: 16px;
  padding-right: 16px;
  margin: 0.7em 0 0 0;     /* small gap above the paragraph */
}


/* Environment for personal interest topic lists */
.topic-list {
  font-size: 0.85em;    /* Smaller font size relative to your base text */
  line-height: 1.4;     /* Moderate line spacing */
  margin-left: 1.5em;   /* Indentation for list items */
  margin-bottom: 1em;   /* Space below the list */
  list-style-type: disc; /* You can change this to your preferred list style */
}

/* Optional: style links within these lists */
.topic-list a {
  text-decoration: none;
  color: inherit;       /* Inherit color from the parent, or set your desired color */
}

.topic-list a:hover {
  text-decoration: underline;
}


/* Footer styling */
footer {
  text-align: center;
  margin-top: 30px;
  padding: 20px 0;
  font-size: 0.9rem;
  color: #666;
  border-top: 1px solid #ddd;
}



.wordcloud-section {
  max-width: 1040px;
  margin: 60px auto;
  text-align: center;
}

.wordcloud-title {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

#wordcloud {
  width: 60%;
  max-width: 1100px;
  aspect-ratio: 1.5;
  border-radius: 18px;
  background: linear-gradient(180deg, #faf8f4 0%, #f3efe7 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: block;
  margin: 0 auto;
}





/* =========================================================
   Notes page only: tuned list environment
   ========================================================= */

/* Use body class="page-notes" on note.html to scope styles */
.page-notes .notes-list {
  list-style-type: circle;   /* open circles */
  list-style-position: outside;
  margin: 0.5rem 0 1.2rem 2.2rem;  /* more left indent */
  padding-left: 0.8rem;      /* additional indent for text alignment */
}

.page-notes .notes-list li {
  margin: 0.35rem 0;         /* moderate vertical spacing */
  line-height: 1.5;
}

/* Optional: slightly smaller list text, easy to tune */
.page-notes .notes-list,
.page-notes .notes-list li {
  font-size: 0.95em;
}

/* Optional: make links slightly calmer */
.page-notes .notes-list a {
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.25);
}

.page-notes .notes-list a:hover {
  border-bottom-color: rgba(0,0,0,0.55);
}






/* =========================================================
   Lianliankan mini-game (Metaphysics page)
   ========================================================= */

.lianliankan {
  margin-top: 1.2rem;
}

/* Outer panel, so the whole game looks like the other RMP applets */
.lianliankan .llk-panel {
  background: #f8f8f6;
  border: 1px solid #d8d8d2;
  border-radius: 16px;
  padding: 1rem 1rem 0.9rem 1rem;
  box-sizing: border-box;
  margin-top: 0.9rem;
}

/* Top control bar remains at the top */
.lianliankan .game-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  align-items: center;
  margin: 0 0 1rem 0;
  font-size: 0.95em;
}

.lianliankan .game-bar label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.lianliankan .game-bar button,
.lianliankan .game-bar select {
  font-family: inherit;
  font-size: 0.95em;
  padding: 0.32rem 0.55rem;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
}

.lianliankan .game-bar button:hover,
.lianliankan .game-bar select:hover {
  border-color: rgba(0, 0, 0, 0.5);
}

.lianliankan .status {
  opacity: 0.8;
}

/* Wrap: allow scroll if huge board; stage is zoomed */
.lianliankan .board-wrap {
  position: relative;
  width: min(1040px, 100%);
  margin: 0 auto;
  overflow: auto;
  border-radius: 14px;
  background: transparent;
}

/* Stage holds BOTH canvas+board so zoom keeps them aligned */
.lianliankan .llk-stage {
  position: relative;
  transform: scale(var(--llk-zoom, 1));
  transform-origin: top left;
}

/* canvas overlays board exactly */
.lianliankan canvas.path {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* Board */
.lianliankan .board {
  display: grid;
  gap: 1px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;

  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

/* Tiles */
.lianliankan .tile {
  aspect-ratio: 1 / 1;
  height: auto;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.lianliankan .tile:hover {
  border-color: rgba(0, 0, 0, 0.35);
}

.lianliankan .tile.selected {
  border-color: rgba(0, 0, 0, 0.75);
  outline: 2px solid rgba(0, 0, 0, 0.12);
}

.lianliankan .tile.empty {
  background: transparent;
  border: 1px dashed rgba(0, 0, 0, 0.10);
  cursor: default;
}

/* Symbol wrapper */
.lianliankan .tile .llk-symbol {
  width: 92%;
  height: 92%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: var(--llk-font-size, 18px);
  line-height: 1;
}

/* Twemoji SVG scales perfectly */
.lianliankan .tile .llk-symbol img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Color tile style */
.lianliankan .tile.color-tile {
  background: var(--llk-tile-color, #ffffff);
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.lianliankan .tile.color-tile.selected {
  outline: 3px solid rgba(0, 0, 0, 0.18);
  border-color: rgba(0, 0, 0, 0.40);
}

.lianliankan .hint {
  margin-top: 0.8rem;
  font-size: 0.9em;
  opacity: 0.8;
}

.lianliankan .hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

/* Small-screen behavior */
@media (max-width: 760px) {
  .lianliankan .llk-panel {
    padding: 0.85rem 0.8rem 0.8rem 0.8rem;
  }

  .lianliankan .game-bar {
    gap: 0.45rem 0.7rem;
  }

  .lianliankan .board-wrap {
    width: 100%;
  }
}




.llk-cn{
  font-family:
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans SC",
    "Source Han Sans SC",
    system-ui,
    sans-serif;

  font-weight: 600;
  letter-spacing: 0.02em;
}



/* ================================
   Random crystal corner game
   Add this block to the END of style.css
   ================================ */

#crystal-corner-game {
  margin: 1.5rem 0 2rem;
}

.crystal-corner-game {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(320px, 1fr);
  gap: 1.25rem;
  align-items: start;

  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(80, 80, 80, 0.14);
  border-radius: 18px;
  padding: 1rem 1rem 1rem 1rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(3px);
}

.crystal-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.crystal-controls label {
  display: block;
  font-size: 0.96rem;
  line-height: 1.45;
  color: #333;
}

.crystal-controls input[type="range"] {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  margin-bottom: 0.25rem;
}

.crystal-controls span {
  display: inline-block;
  min-width: 2.5rem;
  font-weight: 600;
  color: #555;
}

.crystal-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.2rem;
}

.crystal-button-row button {
  appearance: none;
  border: 1px solid rgba(70, 70, 70, 0.20);
  background: #f3f3f3;
  color: #333;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}

.crystal-button-row button:hover {
  background: #ebebeb;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.crystal-button-row button:active {
  transform: translateY(0);
  box-shadow: none;
}

.crystal-canvas-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
  border: 1px solid rgba(80, 80, 80, 0.10);
  padding: 0.5rem;
}

.crystal-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* Optional styling if you wrap this in a section with class="game-section" */
.game-section {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.game-section h3 {
  margin-bottom: 0.6rem;
}

.game-section p {
  margin-bottom: 1rem;
}

/* Responsive layout */
@media (max-width: 900px) {
  .crystal-corner-game {
    grid-template-columns: 1fr;
  }
}


.crystal-canvas-wrap {
  background: #efefef;
  border: 1px solid rgba(90, 90, 90, 0.10);
  padding: 0.35rem;
}

.crystal-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #f4f4f4;
}




/* ============================================================
   Radial KPZ / Eden Growth
   ============================================================ */

.rmp-block {
  margin: 2rem 0;
}

.rmp-block h3 {
  margin-bottom: 0.6rem;
}

.rmp-block p {
  margin-bottom: 1rem;
}

.kpz-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.kpz-sidebar {
  background: #f6f3ee;
  border: 1px solid #d8d1c7;
  border-radius: 16px;
  padding: 1rem 1rem 0.95rem 1rem;
  box-sizing: border-box;
}

.kpz-control {
  margin-bottom: 1rem;
}

.kpz-control label {
  display: block;
  font-size: 0.98rem;
  color: #3b3127;
  margin-bottom: 0.35rem;
}

.kpz-control input[type="number"],
.kpz-control select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid #b8afa3;
  border-radius: 8px;
  background: #fffdfa;
  box-sizing: border-box;
  font-size: 0.96rem;
}

.kpz-control input[type="range"] {
  width: 100%;
  margin-top: 0.15rem;
}

.kpz-value {
  margin-top: 0.3rem;
  font-size: 0.94rem;
  color: #4c4339;
}

.kpz-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.45rem;
}

.kpz-buttons button {
  padding: 0.5rem 0.95rem;
  border: 1px solid #8f8476;
  border-radius: 999px;
  background: #eee7dc;
  color: #2f2923;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.kpz-buttons button:hover {
  background: #e1d8cb;
}

.kpz-buttons button:active {
  transform: translateY(1px);
}

.kpz-info {
  margin-top: 0.9rem;
  font-size: 0.92rem;
  color: #4c4339;
  line-height: 1.45;
}

.kpz-stage {
  background: #f8f8f6;
  border: 1px solid #d8d8d2;
  border-radius: 16px;
  padding: 0.45rem;
  box-sizing: border-box;
  min-height: 0;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
}

#kpzCanvas {
  display: block;
  width: min(760px, 100%);
  height: auto;
  border: 1px solid #c8c8c0;
  background: #fafaf7;
  image-rendering: pixelated;
}

/* Slightly tighter spacing on smaller screens */
@media (max-width: 980px) {
  .kpz-layout {
    grid-template-columns: 1fr;
  }

  .kpz-stage {
    padding: 0.4rem;
  }

  #kpzCanvas {
    width: min(700px, 100%);
  }
}




/* ================================
   Conway Game of Life
   ================================ */

.gameoflife {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.gameoflife h3 {
  margin-bottom: 0.8rem;
}

.gameoflife .game-intro {
  max-width: 920px;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.gol-layout {
  display: grid;
  grid-template-columns: 240px auto;
  gap: 1rem;
  align-items: start;
  justify-content: center;
}

.gol-sidebar,
.gol-board-panel {
  background: rgba(255, 248, 235, 0.9);
  border: 1px solid rgba(120, 100, 70, 0.22);
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.gol-sidebar {
  width: 240px;
  padding: 0.95rem 0.95rem 1rem 0.95rem;
}

.gol-controls-block {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.gol-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.gol-toolbar button {
  appearance: none;
  border: 1px solid rgba(90, 80, 60, 0.25);
  background: #f7f1e3;
  color: #3d372f;
  padding: 0.42rem 0.82rem;
  border-radius: 11px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}

.gol-toolbar button:hover {
  background: #efe6d3;
  border-color: rgba(90, 80, 60, 0.4);
}

.gol-toolbar button:active {
  transform: translateY(1px);
}

.gol-toolbar-small {
  margin-top: -0.15rem;
}

#gol-zoom-in,
#gol-zoom-out {
  min-width: 2.4rem;
  padding-left: 0;
  padding-right: 0;
  font-weight: 600;
}

.gol-control-row {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.gol-control-row select {
  width: 100%;
  font: inherit;
  color: #3d372f;
  background: #faf8f2;
  border: 1px solid rgba(100, 90, 75, 0.28);
  border-radius: 10px;
  padding: 0.42rem 0.65rem;
  box-sizing: border-box;
}

.gol-control-row label {
  font-size: 0.95rem;
  color: #4a433b;
  margin: 0;
}

.gol-control-row input[type="range"] {
  width: 100%;
  margin: 0;
}

.gol-note {
  margin: 0.15rem 0 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #5b544b;
}

.gol-board-panel {
  padding: 0.5rem;
  width: fit-content;
  max-width: 100%;
}

.gol-canvas-wrap {
  width: 500px;
  height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: rgba(255, 251, 244, 0.85);
  border: 1px solid rgba(120, 100, 70, 0.18);
  border-radius: 16px;
  box-sizing: border-box;
}

#gol-canvas {
  display: block;
  width: 500px;
  height: 500px;
  max-width: none;
  border: 1px solid rgba(100, 90, 75, 0.22);
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
  background: #faf8f2;
  transform-origin: center center;
  transition: transform 0.12s ease;
  box-sizing: border-box;
}

@media (max-width: 980px) {
  .gol-layout {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .gol-sidebar,
  .gol-board-panel {
    width: 100%;
    max-width: 100%;
  }

  .gol-sidebar {
    padding: 0.95rem;
  }

  .gol-board-panel {
    padding: 0.5rem;
  }

  .gol-canvas-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
  }

  #gol-canvas {
    width: 100%;
    height: 100%;
  }
}










