@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500&display=swap');

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

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --mid:   #888;
  --rule:  #e8e8e8;
}

/* ── Base ────────────────────────────────────────────────── */
html { font-size: 17px; }
html.page-post { font-size: 18px; }

body {
  background: var(--white);
  color: var(--black);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Nav – shared base ───────────────────────────────────── */
nav {
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}

nav.nav--index {
  position: sticky;
  top: 0;
  padding: 1.5rem 3rem;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(14px);
}

nav.nav--post {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 1.6rem 3rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
}

.nav-logo {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--black);
}

.nav-logo--serif {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-tagline {
  font-size: 0.8rem;
  color: var(--mid);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav.nav--post .nav-links { gap: 2.5rem; }

.nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--mid);
  transition: color 0.2s;
}

nav.nav--post .nav-links a { letter-spacing: 0.12em; }

.nav-links a:hover,
.nav-links a.active { color: var(--black); }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--rule);
  margin-top: 2rem;
  padding: 2.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-logo {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--black);
  text-decoration: none;
}

.footer-logo--serif {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-copy {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--mid);
}

.footer-links {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--mid);
  text-decoration: none;
}

.footer-links a:hover { color: var(--black); }

/* ── Index: page header ──────────────────────────────────── */
.page-header {
  padding: 5rem 3rem 3.5rem;
  border-bottom: 1px solid var(--rule);
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.1s;
}

.page-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
}

.page-header h1 em { font-style: italic; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.2rem;
}

.header-count {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
}

/* ── Index: grid ─────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0 3rem;
}

/* ── Post card ───────────────────────────────────────────── */
.post-card {
  position: relative;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
  transition: background 0.2s;
}

.post-card:nth-child(3n+1) { padding: 3rem 2rem 3rem 0; }
.post-card:nth-child(3n+2) { padding: 3rem 2rem; }
.post-card:nth-child(3n)   { padding: 3rem 0 3rem 2rem; border-right: none; }

.post-card:nth-child(1) { animation-delay: 0.2s; }
.post-card:nth-child(2) { animation-delay: 0.3s; }
.post-card:nth-child(3) { animation-delay: 0.4s; }
.post-card:nth-child(4) { animation-delay: 0.5s; }
.post-card:nth-child(5) { animation-delay: 0.6s; }
.post-card:nth-child(6) { animation-delay: 0.7s; }

.card-image-link { display: block; }

.card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  margin-bottom: 1.6rem;
  transition: opacity 0.3s;
}

.post-card:hover .card-image { opacity: 0.88; }

.card-tag {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.6rem;
}

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.card-link {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.post-card:hover .card-title { opacity: 0.7; }

.card-date {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--mid);
  margin-bottom: 1rem;
}

.card-excerpt {
  font-size: 0.88rem;
  line-height: 1.75;
  color: #555;
}

/* ── Post: hero ──────────────────────────────────────────── */
.hero {
  padding-top: 80px;
  position: relative;
  height: 88vh;
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 1.2s ease forwards 0.2s;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.82);
}

.hero-caption {
  position: absolute;
  bottom: 3.5rem;
  left: 3rem;
}

.hero-tag {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.8rem;
}

.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  color: var(--white);
  max-width: 700px;
}

.hero-title em { font-style: italic; }

.hero-credit {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.4);
}

.hero-credit a { color: inherit; text-decoration: none; }
.hero-credit a:hover { opacity: 0.8; }

/* No-hero fallback header */
.post-header-text {
  padding: 5rem 3rem 3rem;
  border-bottom: 1px solid var(--rule);
  margin-top: 80px;
}

.post-header-text .hero-tag { color: var(--mid); margin-bottom: 1rem; }
.post-header-text .hero-title { color: var(--black); }

/* ── Post: article ───────────────────────────────────────── */
article {
  max-width: 680px;
  margin: 0 auto;
  padding: 5rem 2rem 8rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.5s;
}

.meta-date,
.meta-read {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
}

.meta-dot {
  width: 3px; height: 3px;
  background: var(--rule);
  border-radius: 50%;
}

.lead {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem;
  font-weight: 300;
  line-height: 1.55;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.7s;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* ── Post: content ───────────────────────────────────────── */
.post-content p {
  font-size: 1rem;
  line-height: 1.85;
  color: #2a2a2a;
  margin-bottom: 1.6rem;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 0.9s;
}

.post-content p + p           { animation-delay: 1.0s; }
.post-content p + p + p       { animation-delay: 1.1s; }
.post-content p + p + p + p   { animation-delay: 1.2s; }
.post-content p + p + p + p + p { animation-delay: 1.3s; }

.post-content blockquote {
  border-left: 2px solid var(--black);
  margin: 2.5rem 0;
  padding: 0.5rem 0 0.5rem 2rem;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 1.2s;
}

.post-content blockquote p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 300;
  line-height: 1.5;
  color: var(--black);
  margin-bottom: 0.6rem;
  animation: none;
  opacity: 1;
}

.post-content blockquote cite {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  font-style: normal;
}

.post-content h2,
.post-content h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  margin: 2.5rem 0 1rem;
  line-height: 1.2;
}
.post-content code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: #f3f4f6;
  padding: 0.15em 0.35em;
  border-radius: 3px;
}
.post-content pre {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.25rem 0;
}
.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  border-radius: 0;
  white-space: pre;
}

.post-content h2 { font-size: 2rem; }
.post-content h3 { font-size: 1.6rem; }

.post-content a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  margin: 3rem 0 0.75rem;
  opacity: 0;
  animation: fadeUp 0.9s ease forwards 1.3s;
}

.post-content figcaption {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--mid);
  text-align: center;
  margin-bottom: 3rem;
}

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

.post-content li {
  font-size: 1rem;
  line-height: 1.85;
  color: #2a2a2a;
  margin-bottom: 0.4rem;
}

.post-content code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: #f3f4f6;
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.post-content pre {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.6rem;
}

.post-content pre code { background: none; padding: 0; font-size: 0.875rem; }

/* ── Shared content pages (about, impressum, privacy) ────── */
.main { padding: 4rem 3rem 6rem; }

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

.article-narrow { max-width: 680px; margin: 0 auto; }

.article-narrow h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: 2rem;
}

.article-narrow p {
  font-size: 1rem;
  line-height: 1.85;
  color: #2a2a2a;
  margin-bottom: 1.4rem;
}

.article-narrow a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.nav-home {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--mid);
}
.nav-home:hover { color: var(--black); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  nav.nav--index { padding: 1.2rem 2rem; }
  .nav-tagline { display: none; }
  .page-header { padding: 3rem 2rem 2.5rem; }
  .grid { grid-template-columns: repeat(2, 1fr); padding: 0 2rem; }

  /* Reset 3-col, apply 2-col */
  .post-card:nth-child(3n+1),
  .post-card:nth-child(3n+2),
  .post-card:nth-child(3n) {
    padding: 3rem 2rem 3rem 0;
    border-right: 1px solid var(--rule);
  }
  .post-card:nth-child(2n) { padding: 3rem 0 3rem 2rem; border-right: none; }

  .main { padding: 3rem 2rem 5rem; }
  footer { padding: 2rem 2rem; }
}

@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; padding: 0 1.5rem; }
  .post-card:nth-child(n) { padding: 2.5rem 0 !important; border-right: none !important; }
  nav.nav--index,
  nav.nav--post { padding: 1rem 1.5rem; }
  .hero-caption { left: 1.5rem; bottom: 2rem; }
  footer { padding: 2rem 1.5rem; flex-direction: column; align-items: flex-start; }
  .main { padding: 2rem 1.5rem 4rem; }
}
