:root{
    --panel:#0f1417;
    --muted:#97a0ad;
    --accent:#60a5fa;
    --node-bg:#0f1720;
    --node-border:#24303a;
    --line:#445b6a;
    --arrow:#60a5fa;
    --bg:#0f1417;
    --text: #e6eef6;
    --window-bg: var(--panel);
    --window-border: rgba(0,0,0,0.08);
    --window-shadow: 0 12px 32px rgba(0,0,0,0.25);

    --titlebar-bg: rgba(255,255,255,0.7);
    --titlebar-border: rgba(0,0,0,0.1);

    --title-bg: rgba(0,0,0,0.04);
    --title-text: var(--muted);

    --content-text: var(--text);
    --content-muted: rgba(20, 24, 28, 0.9);
    --link: var(--accent);

}

body.light{
    --bg:#f6f8fb;
    --panel:#ffffff;
    --text:#101010;
    --muted:#6b7280;
    --accent:#0077ff;
    --node-bg:#ffffff;
    --node-border:#ddd;
    --line:#cbd5e1;
    --arrow:#0077ff;
}

body {
    font-family: system-ui, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    background:var(--bg);
    color:var(--text);
}

#menu_toggle {
    position:fixed;
    left:12px;
    top:12px;
    z-index:10000;
    width:40px;
    height:40px;
    border-radius:8px;
    border:1px solid rgba(255,255,255,0.06);
    background:var(--panel);
    box-shadow:0 4px 12px rgba(2,6,23,0.6);
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    color:var(--text)
}
#site_menu {
    position:fixed;
    left:12px;
    top:64px;
    width:220px;
    max-width:calc(100% - 32px);
    background:var(--panel);
    border:1px solid rgba(255,255,255,0.03);
    box-shadow:0 10px 30px rgba(2,6,23,0.6);
    border-radius:8px;
    padding:12px;
    z-index:10000;
    transform:translateY(-8px);
    transition:opacity .18s ease, transform .18s ease;
    opacity:0;
    pointer-events:none;
}

#site_menu.open {
    opacity:1;
    transform:translateY(0);
    pointer-events:auto;
}

#site_menu ul {
    list-style:none;
    padding:0;
    margin:0;
    display:flex;
    flex-direction:column;
    gap:8px;
}

#site_menu a {
    display:block;
    border-radius:6px;
    padding:8px;
    color:var(--text);
    text-decoration:none;
    font-weight: 600;
}

#site_menu a:hover {
    background: rgba(96,165,250,0.06);
    color:var(--accent);
}

#site_menu .menu_footer {
    margin-top:12px;
    font-size:12px;
    color:var(--muted);
    border-top:1px solid rgba(255,255,255,0.03);
    padding-top:8px;
    display:flex;
    align-items:center;
    justify-content:space-between;
}

#theme_toggle {
    background:transparent;
    border:1px solid rgba(255,255,255,0.04);
    padding:6px 8px;
    border-radius:6px;
    color:var(--text);
    cursor:pointer;
}

#main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  padding: 0 20px;
  box-sizing: border-box;
}

#logo {
  font-size: 6em;
  margin: 0;
}

.typewriter {
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;

  width: 7ch;
  border-right: 0.15em solid var(--text);

  animation:
    typing 2s steps(7, end) forwards,
    caret-blink 1s step-end 2s 5 forwards;
}

@keyframes typing {
  from { width: 0 }
  to   { width: 7ch }
}

@keyframes caret-blink {
  0%, 100% { border-color: transparent }
  50%      { border-color: var(--text) }
}


@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--text); }
}

#macos-window {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  width: 410px;
  height: 190px;
  border-radius: 12px;
  margin-top: 20px;
  background: var(--title-bg);
  box-shadow: var(--window-shadow);
  border: 1px solid var(--window-border);
  overflow: hidden;
  transition: width 0.35s ease, height 0.35s ease;
}

#macos-window.expanded {
  width: 640px;
  height: 260px;
}

.window-title-bar {
  position: relative;
  height: 34px;
  background: var(--titlebar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--titlebar-border);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.window-dots {
  position: absolute;
  left: 15px;
}

.window-dot {
  width: 10px;
  height: 10px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 50%;
}

.window-dot.red    { background: #ff5f56; }
.window-dot.yellow { background: #ffbd2e; }
.window-dot.green  { background: #27c93f; cursor: pointer; }

.window-title {
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--title-bg);
  color: var(--title-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.window-content {
  padding: 18px 22px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: var(--content-text);

  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

#macos-window.expanded .window-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.window-content ul {
  list-style-type: none;
  padding-left: 18px;
  margin: 0;
}
.window-content li {
  margin-bottom: 10px;
}
.window-content strong {
  font-weight: 600;
}
.window-content em {
  font-style: normal;
  color: var(--content-muted);
}
.window-content a {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}

.window-content a:hover {
  text-decoration: underline;
}

.window-dot.green:hover {
  box-shadow: 0 0 6px rgba(39,201,63,0.8);
}

body.dark #macos-window {
  background: rgba(20,24,28,0.9);
  border: 1px solid #24303a;
  box-shadow: 0 18px 40px rgba(0,0,0,0.6);
  color: #e6eef6;
}
body.dark #macos-window .window-title-bar {
  background: rgba(32, 35, 37, 0.9);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
body.dark #macos-window .window-title {
  background: rgba(255,255,255,0.06);
  color: #97a0ad;
}
body.dark #macos-window .window-content {
  color: #e6eef6;
  --link: #60a5fa;
  --content-muted: #97a0ad;
}

body.light #macos-window {  
    background: linear-gradient(
    180deg,
    rgba(252,253,255,0.98),
    rgba(246,248,250,0.98)
  );
  border: 1px solid rgba(15,20,25,0.035);
  border-radius: 12px;
  box-shadow:
    0 18px 40px rgba(2,6,23,0.10),
    0 1px 0 rgba(255,255,255,0.6) inset;
  color: #111827;
}
body.light #macos-window .window-title-bar {
  background: rgba(248, 250, 252, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15,20,25,0.04);
}
body.light #macos-window .window-title {
  background: rgba(240,243,246,0.65);
  color: #6b7280;
  font-weight: 500;
}
body.light #macos-window .window-content {
  color: #111827;
  --content-muted: #6b7280;
  --link: #2563eb;
}