:root {
  --bg:          #dcd7cb;  /* matched to video edge color */
  --text:        #1A1A1A;
  --secondary:   #3D3D3D;
  --muted:       #b8b2aa;
  --accent:      #D4916E;
  --card-bg:     #d8d2c7;
  --footer-bg:   #d3cdc2;
  --border:      #c4beb6;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }

/* Text selection */
::selection { background: var(--accent); color: #fff; }

/* Thin branded scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle paper-grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

.site {
  max-width: 1000px;
  margin: 0 auto;
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── Hero ── */
.hero {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 80px 120px;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 0 0 342px;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--card-bg);
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--border);
  transition: box-shadow 0.3s ease;
}

.avatar:hover {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.intro h1 {
  font-size: 40px;
  font-weight: 300;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 0 0 10px;
}


.intro .bio {
  font-size: 15px;
  line-height: 1.6;
  color: var(--secondary);
  margin: 0;
}

.hero-video { flex: 1; }
.hero-video video {
  width: 100%;
  display: block;
  border: none;
}

/* ── Sections ── */
.section {
  padding: 64px 120px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.two-col {
  flex-direction: row;
  align-items: flex-start;
  gap: 40px;
}

.section-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.side-video { flex: 0 0 220px; }
.side-video video {
  width: 100%;
  display: block;
  border: none;
}

/* ── Label ── */
.label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.label::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex-shrink: 0;
}

/* ── Projects ── */
.section h2 {
  font-size: 28px;
  font-weight: 300;
  margin: 0;
  line-height: 1.2;
}

.body-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--secondary);
  margin: 0;
}

.video-wide {
  position: relative;
  height: 200px;
  border-radius: 8px;
  background: var(--card-bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-wide video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.video-placeholder-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

/* ── Blog ── */
.posts {
  display: flex;
  gap: 20px;
}

.post-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  height: 180px;
  border-radius: 4px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  min-width: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.09);
  border-color: var(--accent);
}

.post-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

.read-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  display: inline-block;
  transition: transform 0.2s ease;
}

.post-card:hover .read-link {
  transform: translateX(5px);
}

/* ── Reading Tabs ── */
.reading-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  padding: 8px 20px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tab-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(212, 145, 110, 0.06);
}

.tab-btn:hover:not(.active) {
  color: var(--secondary);
  border-color: var(--secondary);
}

/* ── Book Carousel ── */
.carousel-viewport {
  overflow-x: auto;
  width: 100%;
  padding: 12px 0 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
}

.carousel-viewport::-webkit-scrollbar       { height: 4px; }
.carousel-viewport::-webkit-scrollbar-track { background: transparent; }
.carousel-viewport::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 10px; }
.carousel-viewport::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.carousel-track {
  display: flex;
  gap: 16px;
  width: max-content;
}

.carousel-track.hidden { display: none; }

.book-cover {
  flex-shrink: 0;
  width: 90px;
}

.book-cover img {
  width: 90px;
  height: 135px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-cover img:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
}

.cover-placeholder {
  width: 90px;
  height: 135px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.cover-placeholder .cover-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  color: var(--secondary);
  text-align: center;
  line-height: 1.5;
}

/* ── Footer ── */
.site-footer {
  background: var(--footer-bg);
  padding: 40px 120px;
}

.site-footer p {
  margin: 0;
  font-size: 12px;
  color: var(--secondary);
}

/* ── Password Gate ── */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.auth-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--accent);
}

#auth-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  color: var(--text);
  text-align: center;
  width: 220px;
  outline: none;
  letter-spacing: 3px;
  transition: border-color 0.2s ease;
}

#auth-input::placeholder {
  letter-spacing: 1px;
  color: var(--muted);
  font-size: 11px;
}

#auth-input:focus { border-bottom-color: var(--accent); }

#auth-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  padding: 8px 32px;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#auth-btn:hover {
  border-color: var(--accent);
  background: rgba(212, 145, 110, 0.06);
}

.auth-error {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  height: 14px;
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero,
  .section      { padding: 48px 24px; }
  .site-footer  { padding: 40px 24px; }
  .posts        { flex-direction: column; }
  .post-card    { height: auto; min-height: 120px; }

  /* Hide decorative videos on mobile */
  .hero-video   { display: none; }
  .side-video   { display: none; }
}
