/* Base reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}

body,
h1,
h2,
h3,
p,
ul,
li,
figure,
figcaption {
  margin: 0;
}
h1 {
  font-size: 3rem;
  font-weight: bold;
  line-height: 1.2;
}
img {
  max-width: 100%;
  display: block;
}
button {
  font: inherit;
}

p {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
/* Theme tokens */
:root {
  /* Base */
  --bg: #edf7f6;
  --bg-elev: #edf7f6;
  --text: #56351e;
  --text-muted: #c47335;
  --border: #f19953;
  --brand: #2660a4;
  --accent: #2660a4;
  --card-shadow: 0 1px 2px rgba(86, 53, 30, 0.1),
    0 8px 24px rgba(86, 53, 30, 0.1);

  /* Blueprint lines */
  --bp-line: #2a4f80;
  --bp-line-soft: #87a8d6;
  --bp-grid: rgba(38, 96, 164, 0.08);
  --bp-grid-strong: rgba(38, 96, 164, 0.12);

  /* Corner bracket color */
  --bracket-color: #7b8fb3;

  --ruler-overhang: 14px;
  --dim-gap: 16px;
  --dim-halo: 3px;
}

[data-theme="dark"] {
  --bg: #0b0c0f;
  --bg-elev: #12141a;
  --text: #f2f4f8;
  --text-muted: #a2a9b3;
  --border: #232733;
  --brand: #c9ccff;
  --accent: #2660a4;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 36px rgba(0, 0, 0, 0.45);

  --bp-line: #88aaff;
  --bp-line-soft: #c9d6ff;
  --bp-grid: rgba(136, 170, 255, 0.1);
  --bp-grid-strong: rgba(136, 170, 255, 0.18);

  --bracket-color: #9fb6ff;
}

html {
  color-scheme: light dark;
}
body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: repeating-linear-gradient(
      0deg,
      var(--bp-grid) 0 1px,
      transparent 1px 24px
    ),
    repeating-linear-gradient(90deg, var(--bp-grid) 0 1px, transparent 1px 24px),
    radial-gradient(1200px 800px at 20% -10%, var(--bg-elev), var(--bg));
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

body::after {
  content: "SCALE 1:1";
  position: fixed;
  bottom: 16px;
  left: 16px;
  font-size: 10px;
  font-family: ui-monospace, monospace;
  color: var(--bp-line);
  background: var(--bg);
  padding: 2px 6px;
  border: 1px solid var(--bp-line);
}

.vertical-banner {
  position: fixed; /* stays in place while scrolling */
  top: 0;
  left: 16px; /* hug the left edge */
  height: 100vh; /* span full viewport height */
  writing-mode: vertical-rl; /* vertical, right-to-left */
  text-orientation: upright; /* keep Mandarin characters upright */
  font-family: ui-monospace, monospace;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: var(--bp-line);
  padding: 16px 8px; /* some breathing room */
  z-index: 2000; /* above container */
  background: transparent;
}

.vertical-banner .translation {
  font-size: 14px;
  font-family: sans-serif;
  color: var(--text-muted);
  writing-mode: vertical-rl;
  text-orientation: mixed; /* allows English to read normally */
  letter-spacing: normal;
  font-family: ui-monospace, monospace;
}

@media (max-width: 1250px) {
  .vertical-banner {
    display: none;
  }
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  flex-grow: 1;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand h1 {
  font-size: clamp(18px, 2vw, 22px);
  letter-spacing: 0.2px;
}

/* Toggle */
.toggle {
  position: relative;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: transform 0.15s ease;
  box-shadow: var(--card-shadow);
}
.toggle:active {
  transform: scale(0.98);
}
.toggle[aria-pressed="true"] .sun {
  display: none;
}
.toggle[aria-pressed="false"] .moon {
  display: none;
}
.toggle .icon {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
}

/* Hero */
.hero {
  padding: 24px 0 16px;
  display: grid;
  gap: 12px;
  position: relative;
}
.hero h1 {
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--brand);
}
.hero p {
  font-size: 14px;
  color: var(--text-muted);
}

/* Sections */
section {
  margin: 28px 0;
  border-top: 1px dashed var(--bp-line);
}

section[aria-labelledby="projects-title"] {
  background: var(--bp-grid-strong);
  padding: 40px 24px;
  border-radius: 4px;
  border-top: 2px dashed var(--bp-line);
  border-bottom: 2px dashed var(--bp-line);
}

.section-title {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 14px;
}

.pill {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-top: 3.75rem;
}
.col-12 {
  grid-column: span 12;
}
@media (min-width: 720px) {
  .col-6 {
    grid-column: span 6;
  }
}
@media (min-width: 1024px) {
  .grid {
    column-gap: 60px;
  }
  .col-4 {
    grid-column: span 4;
  }
}

/* Card stack spacing */
.card-stack {
  gap: 40px;
}

/* Blueprint Card */
.card {
  position: relative;
  border: 1.5px solid var(--bp-line);
  border-radius: 0;
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
  display: flex;
  flex-direction: column;
  overflow: visible;
  isolation: isolate;
  margin-bottom: 60px;
}

.card.featured {
  border-width: 2.5px;
  border-color: var(--bp-line-soft);
  transform: translateY(-3px);
  border-width: 2.5px;
  border-color: var(--bp-line-soft);
  background: var(--bg-elev);
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--bp-line-soft), var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.featured:hover {
  transform: translateY(-4px); /* more lift on hover */
  border-color: var(--accent); /* brand highlight */
  box-shadow: 0 0 0 2px var(--accent), var(--card-shadow);
}

.card.featured .ruler,
.card.featured .dim,
.card.featured .corner {
  display: none;
}
d */ .card::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: repeating-linear-gradient(
      0deg,
      var(--bp-grid-strong) 0 1px,
      transparent 1px 16px
    ),
    repeating-linear-gradient(90deg, var(--bp-grid) 0 1px, transparent 1px 16px);
  pointer-events: none;
  z-index: 0;
}

/* Center guides */
.card::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: linear-gradient(
      0deg,
      transparent calc(50% - 0.5px),
      var(--bp-line-soft) calc(50% - 0.5px) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    ),
    linear-gradient(
      90deg,
      transparent calc(50% - 0.5px),
      var(--bp-line-soft) calc(50% - 0.5px) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    );
  mix-blend: normal;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

/* Rulers */
.card .ruler {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  opacity: 0.9;
  background: transparent;
}
.card .ruler {
  opacity: 0;
  transform: translateY(-4px);
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: 0.4s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ruler.top,
.ruler.bottom {
  left: 0;
  right: 0;
  height: 14px;
}
.ruler.left,
.ruler.right {
  top: 0;
  bottom: 0;
  width: 14px;
}
.ruler.top {
  top: -14px;
}
.ruler.bottom {
  bottom: -14px;
}
.ruler.left {
  left: -14px;
}
.ruler.right {
  right: -14px;
}

/* Tick pattern */
.ruler.top,
.ruler.bottom {
  background: repeating-linear-gradient(
    90deg,
    transparent 0 7px,
    var(--bp-line) 7px 8px,
    transparent 8px 15px,
    var(--bp-line) 15px 16px,
    transparent 16px 23px,
    var(--bp-line) 23px 24px,
    transparent 24px 31px,
    var(--bp-line) 31px 32px
  );
  border-top: 1px solid var(--bp-line);
  border-bottom: 1px solid var(--bp-line);
}
.ruler.left,
.ruler.right {
  background: repeating-linear-gradient(
    0deg,
    transparent 0 7px,
    var(--bp-line) 7px 8px,
    transparent 8px 15px,
    var(--bp-line) 15px 16px,
    transparent 16px 23px,
    var(--bp-line) 23px 24px,
    transparent 24px 31px,
    var(--bp-line) 31px 32px
  );
  border-left: 1px solid var(--bp-line);
  border-right: 1px solid var(--bp-line);
}

/* Dimension callouts */
.card .dim {
  position: absolute;
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  background: var(--bg);
  padding: 2px 6px;
  border: 0.5px solid var(--bp-line);
  color: var(--bp-line-soft);
  border-color: var(--bp-line-soft);
}
.dim::before,
.dim::after {
  content: "";
  position: absolute;
  background: var(--bp-line);
}

.card .dim::before,
.card .dim::after {
  background: var(--bp-line-soft);
}

/* Top dimension */
.dim.top {
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  margin-top: -4px;
}
.dim.top::before {
  width: 40px;
  height: 1px;
  right: 100%;
  top: 50%;
}
.dim.top::after {
  width: 40px;
  height: 1px;
  left: 100%;
  top: 50%;
}

/* Left dimension */
.dim.left {
  left: -60px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center center;
  margin-left: -4px;
}
.dim.left::before {
  width: 40px;
  height: 1px;
  right: 100%;
  top: 50%;
}
.dim.left::after {
  width: 40px;
  height: 1px;
  left: 100%;
  top: 50%;
}

/* Corner brackets */
.card .corner {
  position: absolute;
  width: 1px;
  height: 1px;
  background: transparent;
  z-index: 3;
}
.corner.top-left {
  top: 0;
  left: 0;
}
.corner.top-right {
  top: 0;
  right: 0;
}
.corner.bottom-left {
  bottom: 0;
  left: 0;
}
.corner.bottom-right {
  bottom: 0;
  right: 0;
}

.card .corner::before,
.card .corner::after {
  content: "";
  position: absolute;
  background-color: var(--bracket-color);
}
/* Horizontal */
.corner.top-left::before,
.corner.top-right::before,
.corner.bottom-left::before,
.corner.bottom-right::before {
  width: 26px;
  height: 2px;
}
.corner.top-left::before {
  left: -18px;
  top: -2px;
}
.corner.top-right::before {
  right: -18px;
  top: -2px;
}
.corner.bottom-left::before {
  left: -18px;
  bottom: -2px;
}
.corner.bottom-right::before {
  right: -18px;
  bottom: -2px;
}
/* Vertical */
.corner.top-left::after,
.corner.top-right::after,
.corner.bottom-left::after,
.corner.bottom-right::after {
  width: 2px;
  height: 26px;
}
.corner.top-left::after {
  left: -2px;
  top: -18px;
}
.corner.top-right::after {
  right: -2px;
  top: -18px;
}
.corner.bottom-left::after {
  left: -2px;
  bottom: -18px;
}
.corner.bottom-right::after {
  right: -2px;
  bottom: -18px;
}

/* Card text */

h3 {
  font-size: 16px;
  line-height: 1.35;
  z-index: 1;
}
.card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  z-index: 1;
}

/* Actions */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2rem;
  z-index: 1;
  font-size: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--brand);
  background: var(--bg);
  font-weight: 600;
}
.btn:hover {
  border-color: color-mix(in oklab, var(--border), var(--brand) 45%);
}

/* Footer */
footer {
  width: 100%;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 12px 24px 24px;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.footer-text-wrapper {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  flex-wrap: nowrap;
  gap: 10px;
}
.align-right {
  display: block;
  text-align: right;
}

/* Bot button */
#botbutton-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}
#botbutton-container:hover {
  transform: scale(1.05);
}
.helloworld-dark {
  display: none;
}
.helloworld,
.helloworld-dark {
  display: block;
  width: auto;
  height: 100px;
}

@media (max-width: 768px) {
  #botbutton-container {
    opacity: 0;
    pointer-events: none;
  }
  #botbutton-container.visible {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Custom column spans (desktop) */
@media (min-width: 1024px) {
  .yudu-learning {
    grid-column: span 6;
  }
  .stellar-ph {
    grid-column: span 9;
  }
  /* Hover lift + faint glow on blueprint lines */
  .card:hover {
    transform: translateY(-2px);
    border-color: var(--bp-line-soft);
    box-shadow: 0 0 0 1px var(--bp-line-soft), var(--card-shadow);
  }
}
