@font-face {
  font-family: "sans";
  src: url('/assets/fonts/Inter-Variable.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: "sans Fallback";
  src: local(Arial);
  ascent-override: 89.79%;
  descent-override: 22.36%;
  line-gap-override: 0%;
  size-adjust: 107.89%;
}
@font-face {
  font-family: "serif";
  src: url('/assets/fonts/Lora-Italic-Variable.woff2') format('woff2');
  font-display: swap;
  font-style: italic;
}
@font-face {
  font-family: "serif Fallback";
  src: local(Arial);
  ascent-override: 98.68%;
  descent-override: 26.88%;
  line-gap-override: 0%;
  size-adjust: 101.95%;
}
@font-face {
  font-family: "mono";
  src: url('/assets/fonts/Iosevka-FixedCurly-Extended-Medium.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: "mono Fallback";
  src: local(Arial);
  ascent-override: 73.39%;
  descent-override: 16.35%;
  line-gap-override: 5.32%;
  size-adjust: 131.49%;
}

:root {
  --font-sans: "sans", "sans Fallback";
  --font-serif: "serif", "serif Fallback";
  --font-mono: "mono", "mono Fallback";
  
  --bg: #FBFBFB;
  --text: #4a515b;
  --muted: #6b7280;
  --divider: #e5e5e5;
  --link-hover: #000000;
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --text: #eeeeee;
  --muted: #9aa0a6;
  --divider: #333333;
  --link-hover: #ffffff;
}

:root[data-theme="cyber"] {
  --bg: #0b000f;
  --text: #f7f4ff;
  --muted: #cfc7ff;
  --divider: #3d2a4d;
  --link-hover: #ffe27a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-variation-settings: "wght" 440;
  line-height: 2.2;
  letter-spacing: 0.0085em;
  word-spacing: -0.04em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricprecision;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.site {
  display: grid;
  grid-template-columns: 64px 1px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 48px;
  width: 100%;
}

@media (max-width: 1024px) {
  .site {
    padding: 20px;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .site {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px;
  }
  
  .divider {
    display: none;
  }
}

@media (max-width: 480px) {
  .site {
    padding: 24px;
  }
}

.side {
  align-self: start;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-end;
}

.tab {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s ease;
  font-size: 1rem;
  font-variation-settings: "wght" 440;
  line-height: 2.2;
  letter-spacing: 0.0085em;
  word-spacing: -0.04em;
  display: block;
  text-align: right;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-current="page"] {
  color: #000000;
}

@media (max-width: 768px) {
  .side {
    position: static;
  }
  
  .side-nav {
    flex-direction: row;
    gap: 24px;
    align-items: center;
  }

  .tab {
    text-align: left;
    padding-right: 0;
  }
}

.divider {
  background: var(--divider);
  width: 1px;
  align-self: stretch;
}

.content {
  max-width: 680px;
  margin-top: -2px;
  transition: opacity 0.3s ease;
  opacity: 1;
  min-width: 0;
}

.content.fading-out {
  opacity: 0;
}

.content > *:first-child {
  margin-top: 0;
}

.content h1 {
  font-variation-settings: "wght" 600;
  font-size: 1.115rem;
  line-height: 2.2;
  letter-spacing: 0.0085em;
  word-spacing: -0.04em;
  margin: 0;
}

.content h1.article-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
}

.article-date {
  font-size: 1rem;
  font-variation-settings: "wght" 400;
  color: #b3b9c1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  margin-left: 1rem;
}

.content h2 {
  font-variation-settings: "wght" 440;
  font-size: 1rem;
  line-height: 2.2;
  letter-spacing: 0.0085em;
  word-spacing: -0.04em;
  margin: 0;
}

.content p {
  font-size: 1rem;
  font-variation-settings: "wght" 400;
  line-height: 2.2;
  letter-spacing: 0.0085em;
  word-spacing: -0.04em;
  margin: 0;
}

.content ul {
  margin: 0;
  padding-left: 1.2em;
}

.content li {
  font-size: 1rem;
  font-variation-settings: "wght" 400;
  line-height: 2.2;
  letter-spacing: 0.0085em;
  word-spacing: -0.04em;
  margin-bottom: 1.1em;
}

.content li:last-child {
  margin-bottom: 0;
}

.content a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color 0.18s ease;
  line-height: 2.2;
}

.content a:hover {
  color: #000000;
}

.social-label {
  color: var(--text);
}

.social-link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.18s ease;
}

.social-link:hover {
  color: #000000;
}

.thoughts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.thought-item {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 2.2;
}

.content a.thought-title {
  color: var(--text);
  text-decoration: none;
  transition: color 0.18s ease;
  flex-shrink: 0;
  line-height: 2.2;
}

.thought-dots {
  flex: 1 1 auto;
  text-align: end;
  word-wrap: break-word;
  letter-spacing: 6px;
  height: 1em;
  line-height: 1;
  overflow: hidden;
  color: #d8dbdf;
  margin: 0;
  min-width: 0;
}

.thought-dots::after {
  content: "······································································";
}

@media (max-width: 768px) {
  .thought-dots::after {
    content: "····························";
  }
}

@media (max-width: 480px) {
  .thought-dots::after {
    content: "··················";
  }
}

@media (max-width: 360px) {
  .thought-dots::after {
    content: "············";
  }
}

.thought-date {
  color: #b3b9c1;
  font-size: 1rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  line-height: 2.2;
}

.thought-item:hover .thought-title {
  color: #2b3035;
}

.thought-item:hover .thought-dots {
  color: var(--text);
}

.thought-item:hover .thought-date {
  color: var(--text);
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--divider);
  border-radius: 4px;
  padding: 4px 12px;
  gap: 12px;
  background: transparent;
}

.theme-arrow {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 0;
  transition: opacity 0.18s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 16px;
}

.theme-arrow svg {
  width: 16px;
  height: 16px;
  display: block;
  transition: fill 0.18s ease;
}

.theme-arrow svg path {
  fill: var(--text);
}

.theme-arrow:hover svg path {
  fill: var(--link-hover);
}

.theme-arrow-left svg {
  transform: rotate(180deg);
}

.theme-current {
  color: var(--text);
  font-size: 1rem;
  min-width: 60px;
  text-align: center;
}

#cursor-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  will-change: transform;
}

body.cursor-hidden {
  cursor: none;
}

@media (prefers-reduced-motion: reduce) {
  #cursor-canvas {
    display: none;
  }
  body {
    cursor: auto !important;
  }
}

@media (hover: none), (pointer: coarse) {
  #cursor-canvas {
    display: none !important;
  }
}

.copy-tooltip {
  position: fixed;
  background: var(--text);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10000;
  font-family: var(--font-sans);
  font-weight: 500;
}

.copy-tooltip.visible {
  opacity: 1;
}
