@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&display=swap');

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Custom Cursor ── */
html, body {
  cursor: url("arrowhead.svg") 3 1, auto;
}

html.dark, body.dark {
  cursor: url("arrowhead-rounded-outline.svg") 5 3, auto;
}

a, button, [role="button"], input[type="submit"], input[type="button"], label {
  cursor: url("hand-pointer.svg") 8 1, pointer !important;
}

/* ── Base (light mode) ── */
body {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 18px;
  line-height: 1.6;
  color: #333;
  background: #fff;
  transition: background 0.3s, color 0.3s;
}

::selection {
  background: rgba(0, 230, 118, 0.4);
  color: #000;
}

body.dark ::selection {
  background: rgba(255, 105, 135, 0.5);
  color: #fff;
}

/* ── Dark mode ── */
body.dark {
  color: #d4d4d4;
  background: #1a1a1a;
}

body.dark a {
  color: #6db3f2;
}

body.dark hr {
  border-color: #444;
}

body.dark #theme-toggle {
  color: #d4d4d4;
}

/* ── Container (centered like Karpathy) ── */
.container {
  max-width: 850px;
  margin: 0 auto;
  padding: 60px 20px 80px;
  position: relative;
}

/* ── Subtle decorative vertical dashed line ── */
.container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40px;
  width: 1px;
  border-left: 1px dashed rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

body.dark .container::before {
  border-left-color: rgba(255, 255, 255, 0.08);
}

/* ── Resizer Handle ── */
.resizer-handle {
  position: absolute;
  right: 0;
  top: 0;
  width: 12px;
  height: 100%;
  cursor: col-resize;
  z-index: 100;
  border-right: 1px dashed rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.resizer-handle:hover,
.resizer-handle.dragging {
  border-right: 2px dashed #999;
  background-color: rgba(0, 0, 0, 0.02);
}

body.dark .resizer-handle {
  border-right-color: rgba(255, 255, 255, 0.08);
}

body.dark .resizer-handle:hover,
body.dark .resizer-handle.dragging {
  border-right: 2px dashed #555;
  background-color: rgba(255, 255, 255, 0.02);
}

body.dragging-width {
  user-select: none;
  cursor: col-resize;
}


/* ── Header ── */
header {
  text-align: center;
  margin-bottom: 10px;
}

h1 {
  font-size: 2.4em;
  font-weight: 700;
  margin-bottom: 4px;
}

.tagline {
  font-size: 1.1em;
  font-style: italic;
  color: #666;
  margin-bottom: 14px;
}

body.dark .tagline {
  color: #999;
}

/* ── Nav links ── */
nav {
  font-size: 1em;
}

nav a {
  text-decoration: none;
  color: #1a0dab;
}

nav a:hover {
  text-decoration: underline;
}

.sep {
  margin: 0 6px;
  color: #999;
}

/* ── Horizontal rule ── */
hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 30px 0;
}

/* ── About section ── */
#about h2 {
  font-size: 1.3em;
  margin-bottom: 10px;
}

#about p {
  margin-bottom: 14px;
}

/* ── Sections ── */
section {
  margin-bottom: 10px;
}

section h2 {
  font-size: 1.3em;
  margin-bottom: 10px;
}

section p {
  margin-bottom: 10px;
}

section ul {
  margin-left: 20px;
  margin-bottom: 10px;
}

section ul li {
  margin-bottom: 6px;
}

/* ── Links ── */
a {
  color: #1a0dab;
}

a:hover {
  text-decoration: underline;
}

/* ── Theme toggle button ── */
#theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  z-index: 10;
  transition: color 0.3s ease;
}

#theme-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 4px;
}

#theme-toggle svg {
  width: 24px;
  height: 24px;
  display: block;
  transition: transform 0.3s ease;
}

#theme-toggle:hover svg {
  transform: rotate(30deg) scale(1.15);
}

#theme-toggle:active svg {
  transform: scale(0.9);
}

body:not(.dark) #theme-toggle .moon-icon {
  display: none;
}

body.dark #theme-toggle .sun-icon {
  display: none;
}

/* ── Blog list ── */
.blog-list {
  list-style: none;
  margin-left: 0;
}

.blog-list li {
  margin-bottom: 8px;
}

.blog-date {
  color: #888;
  font-size: 0.9em;
}

/* ── Blog post page ── */
.back {
  margin-bottom: 30px;
}

.post-title {
  font-size: 1.8em;
  margin-bottom: 4px;
}

.post-date {
  color: #888;
  font-size: 0.95em;
  font-style: italic;
  margin-bottom: 24px;
}

article p {
  margin-bottom: 14px;
}

/* ── Email Reveal Container ── */
.email-trigger:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 4px;
}

.email-reveal-container {
  margin-top: 12px;
  font-size: 0.9em;
  gap: 10px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.email-reveal-container.show {
  opacity: 1;
  transform: translateY(0);
}

header .email-reveal-container {
  justify-content: center;
}

#about .email-reveal-container {
  justify-content: flex-start;
}

.email-address {
  font-weight: bold;
  color: #333;
}

body.dark .email-address {
  color: #d4d4d4;
}

.email-copy-btn {
  font-family: inherit;
  font-size: 0.85em;
  padding: 3px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #f7f7f7;
  color: #333;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.email-copy-btn:hover {
  background-color: #eee;
  border-color: #bbb;
}

body.dark .email-copy-btn {
  background-color: #2b2b2b;
  border-color: #444;
  color: #d4d4d4;
}

body.dark .email-copy-btn:hover {
  background-color: #3b3b3b;
  border-color: #555;
}

.email-copy-success {
  color: #2e7d32;
  font-weight: bold;
  font-size: 0.85em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.email-copy-success.show {
  opacity: 1;
}

body.dark .email-copy-success {
  color: #81c784;
}

/* ── Handwritten Annotation ── */
.handwritten-annotation {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-family: 'Caveat', cursive;
  font-size: 1.6em;
  color: #d35400;
  transform: rotate(-3deg);
  margin-bottom: -10px;
  gap: 6px;
  flex-direction: row;
}

body.dark .handwritten-annotation {
  color: #ff7675;
}

.annotation-arrow {
  animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}


/* ── Comments Section ── */
.comments-section {
  margin-top: 40px;
}

.comments-section h2 {
  font-size: 1.4em;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

body.dark .comments-section h2 {
  border-bottom-color: #444;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.no-comments {
  text-align: center;
  color: #888;
  font-style: italic;
}
body.dark .no-comments {
  color: #666;
}

@keyframes commentFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comment-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background-color: #f9f9f9;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  animation: commentFadeIn 0.3s ease-out forwards;
}

body.dark .comment-card {
  background-color: #222;
  border-color: #333;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1em;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
  user-select: none;
}

.comment-content {
  flex-grow: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.comment-author {
  font-weight: bold;
  font-size: 0.95em;
  color: #222;
}

body.dark .comment-author {
  color: #eee;
}

.comment-date {
  font-size: 0.8em;
  color: #777;
}

body.dark .comment-date {
  color: #999;
}

.comment-body {
  font-size: 0.95em;
  line-height: 1.5;
  color: #444;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-word;
}

body.dark .comment-body {
  color: #ccc;
}

.comment-form {
  border-top: 1px solid #ddd;
  padding-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.dark .comment-form {
  border-top-color: #444;
}

.comment-form h3 {
  font-size: 1.2em;
  margin-bottom: 4px;
}

.comment-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-form input[type="text"],
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  color: #333;
  font-family: inherit;
  font-size: 0.95em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form textarea {
  resize: vertical;
  min-height: 110px;
}

.comment-form input[type="text"]::placeholder,
.comment-form textarea::placeholder {
  color: #999;
}

.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: #1a0dab;
  box-shadow: 0 0 0 3px rgba(26, 13, 171, 0.15);
}

body.dark .comment-form input[type="text"],
body.dark .comment-form textarea {
  background-color: #2b2b2b;
  border-color: #444;
  color: #d4d4d4;
}

body.dark .comment-form input[type="text"]::placeholder,
body.dark .comment-form textarea::placeholder {
  color: #777;
}

body.dark .comment-form input[type="text"]:focus,
body.dark .comment-form textarea:focus {
  border-color: #6db3f2;
  box-shadow: 0 0 0 3px rgba(109, 179, 242, 0.2);
}

.comment-form button[type="submit"] {
  align-self: flex-start;
  font-family: inherit;
  font-size: 0.95em;
  font-weight: bold;
  padding: 10px 20px;
  border: 1px solid #333;
  border-radius: 6px;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.comment-form button[type="submit"]:hover {
  background-color: #f0f0f0;
}

body.dark .comment-form button[type="submit"] {
  background-color: #1a1a1a;
  border-color: #d4d4d4;
  color: #d4d4d4;
}

body.dark .comment-form button[type="submit"]:hover {
  background-color: #2b2b2b;
}



