/* === tokens === */
:root {
  --pink:       #f2d7d9;
  --pink-light: #f9eced;
  --dark:       #1a1a2e;
  --dark-mid:   #232340;
  --accent:     #e8a0bf;
  --text-light: #f0e6e8;
  --text-dark:  #2a2a3e;
  --mono:       'JetBrains Mono', monospace;
  --script:     'Caveat', cursive;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--mono);
  font-weight: 300;
  line-height: 1.7;
  background: var(--pink-light);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* === layout === */
.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout-fixed {
  height: 100vh;
  overflow: hidden;
}

.section-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === dark blocks === */
.dark-block {
  background: var(--dark);
  color: var(--text-light);
}

/* === hero === */
.hero {
  padding: 6rem 1.5rem 4rem;
  text-align: center;
}

.name {
  font-family: var(--script);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1rem;
  color: var(--text-dark);
  opacity: 0.7;
  margin-bottom: 2rem;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--dark);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.nav-links a:hover {
  border-color: var(--accent);
}

/* === section headings === */
h2 {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.accent {
  color: var(--accent);
}

/* === about === */
.about {
  padding: 3.5rem 1.5rem;
}

.about p {
  font-size: 0.95rem;
  line-height: 1.8;
  opacity: 0.85;
}

/* === section header row (title + link) === */
.section-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section-header-row h2 {
  margin-bottom: 0;
}

/* === projects section (home page) === */
.projects {
  padding: 3.5rem 0;
}

.projects .section-inner {
  padding-bottom: 1.25rem;
}

/* === carousel (block grid) === */
.carousel {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2.5rem;
}

.carousel-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 600px) {
  .carousel-track {
    grid-template-columns: 1fr;
  }
}

.carousel-track .project-card[hidden] {
  display: none;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--dark);
  color: var(--text-light);
  border: none;
  font-size: 1.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}

.carousel-btn:hover {
  background: var(--dark-mid);
}

.carousel-prev { left: 0.25rem; }
.carousel-next { right: 0.25rem; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dark);
  opacity: 0.2;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s;
}

.carousel-dot.active {
  opacity: 0.7;
}

/* === project card === */
.project-card {
  display: block;
  padding: 1.5rem;
  border-radius: 6px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(26, 26, 46, 0.25);
}

.project-card h3 {
  font-family: var(--script);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--pink);
}

.project-card p {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* === tags === */
.tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--dark-mid);
  color: var(--accent);
  padding: 0.2em 0.6em;
  border-radius: 3px;
  margin-right: 0.4rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* === writing === */
.writing {
  padding: 3.5rem 1.5rem;
}

.writing p {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 1.25rem;
}

.cta {
  display: inline-block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: opacity 0.2s;
}

.cta:hover {
  opacity: 0.7;
}

/* === contact === */
.contact {
  padding: 3.5rem 1.5rem;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dark);
  font-size: 0.85rem;
  font-weight: 400;
  padding: 0.5rem 1rem;
  border: 1px solid var(--dark);
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.social-link:hover {
  background: var(--dark);
  color: var(--text-light);
}

/* === footer === */
.footer {
  margin-top: auto;
  padding: 1.5rem;
  text-align: center;
}

.layout-fixed .footer {
  margin-top: 0;
  flex-shrink: 0;
}

.footer p {
  font-size: 0.75rem;
  opacity: 0.5;
}

/* === cursor blink on name === */
.name::after {
  content: '_';
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* === page header (subpages) === */
.page-header {
  padding: 2rem 1.5rem 2.5rem;
  flex-shrink: 0;
}

.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.page-nav .nav-links {
  gap: 1.5rem;
}

.page-nav .nav-links a {
  color: var(--text-light);
}

.back-link {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 400;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(232, 160, 191, 0.4);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.back-link:hover {
  background: var(--accent);
  color: var(--dark);
  border-color: var(--accent);
}

.page-title {
  font-family: var(--script);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* === project catalog page === */
.catalog {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.catalog::-webkit-scrollbar {
  width: 6px;
}

.catalog::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.catalog-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 540px) {
  .catalog-inner {
    grid-template-columns: 1fr 1fr;
  }
}

/* === blog search === */
.blog-search {
  margin-bottom: 1.5rem;
}

.blog-search input {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 300;
  padding: 0.75rem 1rem;
  background: var(--dark);
  color: var(--text-light);
  border: 1px solid var(--dark-mid);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.blog-search input::placeholder {
  color: var(--text-light);
  opacity: 0.4;
}

.blog-search input:focus {
  border-color: var(--accent);
}

/* === blog list === */
.blog-list {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.blog-list::-webkit-scrollbar {
  width: 6px;
}

.blog-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.blog-entry {
  display: block;
  background: var(--dark);
  color: var(--text-light);
  padding: 1.5rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.blog-entry:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(26, 26, 46, 0.25);
}

.blog-date {
  display: block;
  font-size: 0.75rem;
  opacity: 0.5;
  margin-bottom: 0.25rem;
}

.blog-entry-title {
  font-family: var(--script);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  line-height: 1.3;
  color: var(--pink);
}

.blog-excerpt {
  font-size: 0.85rem;
  opacity: 0.7;
  line-height: 1.6;
}

.blog-no-results {
  text-align: center;
  opacity: 0.5;
  font-size: 0.85rem;
  padding: 2rem 0;
  display: none;
}

/* === blog post === */
.blog-post {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.5rem 3.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.blog-post::-webkit-scrollbar {
  width: 6px;
}

.blog-post::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.post-header {
  margin-bottom: 2.5rem;
}

.post-title {
  font-family: var(--script);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0.5rem;
  color: var(--dark);
}

.post-body p {
  font-size: 0.9rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

.post-body h2 {
  font-size: 1rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-body ul, .post-body ol {
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  line-height: 1.85;
}

.post-body code {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: rgba(26, 26, 46, 0.07);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-body pre {
  background: var(--dark);
  color: var(--text-light);
  padding: 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.7;
}
