/* verb */

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

:root {
  --bg: #101017;
  --text: #a0a0b4;
  --text-bright: #d8d8e4;
  --text-muted: #4e4e62;
  --accent: #c9a84c;
  --max-w: 640px;
  --bg-surface-hover: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.05);
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 300;
  line-height: 1.9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* background — dot grid (digital/AI) */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 100%);
}

/* background — organic glows (life) */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(120px);
}

.bg-glow--1 {
  width: 700px;
  height: 700px;
  top: -10%;
  right: -5%;
  background: rgba(201, 168, 76, 0.07);
  animation: drift1 25s ease-in-out infinite alternate;
}

.bg-glow--2 {
  width: 600px;
  height: 600px;
  bottom: -5%;
  left: -8%;
  background: rgba(80, 80, 160, 0.10);
  animation: drift2 30s ease-in-out infinite alternate;
}

@keyframes drift1 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-50px, 40px); }
}

@keyframes drift2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(40px, -50px); }
}

/* content above bg */
header, main, footer {
  position: relative;
  z-index: 1;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* header */
header {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 4rem 1.5rem 0;
}

.logo {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.4s ease;
}

.logo:hover {
  opacity: 1;
}

/* main */
main {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
  flex: 1;
  animation: enter 0.6s ease both;
}

@keyframes enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* homepage */
.post-list {
  display: flex;
  flex-direction: column;
}

.post-item {
  border-bottom: 1px solid var(--border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-item a {
  display: block;
  padding: 1.5rem 0;
  text-decoration: none;
  color: inherit;
}

.post-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
}

.post-item h2 {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-bright);
  letter-spacing: -0.01em;
  position: relative;
  transition: color 0.4s ease;
}

.post-item h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.post-item a:hover h2 {
  color: #fff;
}

.post-item a:hover h2::after {
  width: 100%;
}

.post-item time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.post-item-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* post */
.post-header {
  margin-bottom: 3.5rem;
}

.post-header h1 {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.3;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.post-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: "Inter", system-ui, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-sep {
  opacity: 0.4;
}

.post-body p {
  margin-bottom: 1.6rem;
}

.post-body h2 {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: #fff;
  margin-top: 3.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.post-body h3 {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-bright);
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
}

.post-body hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 3rem auto;
  max-width: 80px;
}

.post-body strong {
  font-weight: 400;
  color: var(--text-bright);
}

.post-body em {
  font-style: italic;
}

.post-body blockquote {
  border-left: 1px solid var(--accent);
  padding-left: 1.3rem;
  margin: 2rem 0;
  color: var(--text);
  font-style: italic;
}

.post-body ul,
.post-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.3rem;
}

.post-body li {
  margin-bottom: 0.4rem;
}

.post-body li::marker {
  color: var(--text-muted);
}

.post-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.post-body a:hover {
  border-bottom-color: var(--accent);
}

/* nav */
.post-nav {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-nav a {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.post-nav a:hover {
  color: var(--text-bright);
}

/* empty */
.empty {
  padding: 6rem 0;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

/* footer */
footer {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* post number */
.post-number {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.post-item-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.post-header .post-number {
  display: block;
  margin-bottom: 0.6rem;
}

/* reading progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.15s linear;
}

/* keyboard nav */
.post-item.kb-active {
  background: var(--bg-surface-hover);
  border-radius: 6px;
  margin: 0 -0.8rem;
  padding: 0 0.8rem;
}

.post-item.kb-active h2 {
  color: #fff;
}

/* view transitions */
::view-transition-old(root) {
  animation: fade-out 0.2s ease-in;
}

::view-transition-new(root) {
  animation: fade-in-vt 0.3s ease-out;
}

@keyframes fade-out {
  to { opacity: 0; }
}

@keyframes fade-in-vt {
  from { opacity: 0; }
}

/* scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 2px; }

/* responsive */
@media (max-width: 480px) {
  html { font-size: 15px; }
  header { padding: 2.5rem 1.2rem 0; }
  main { padding: 2.5rem 1.2rem; }
  .post-header h1 { font-size: 1.45rem; }
  .post-item-top { flex-direction: column; gap: 0.3rem; }
}

/* print */
@media print {
  :root {
    --bg: #fff;
    --text: #1a1a1a;
    --text-bright: #000;
    --text-muted: #666;
  }

  body {
    background: #fff;
    color: #1a1a1a;
    font-size: 12pt;
    line-height: 1.6;
  }

  .bg-grid,
  .bg-glow,
  .progress-bar,
  .post-nav,
  .logo,
  footer {
    display: none !important;
  }

  header {
    padding: 0;
    margin-bottom: 1cm;
  }

  main {
    padding: 0;
    max-width: 100%;
  }

  .post-header h1 {
    color: #000;
    font-size: 18pt;
  }

  .post-body h2 {
    color: #000;
    font-size: 14pt;
    margin-top: 1.5cm;
  }

  .post-body hr {
    background: #ccc;
  }

  .post-body a {
    color: #1a1a1a;
    border-bottom: none;
  }

  .post-body a::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }
}
