/* The Klaus Project — shared stylesheet */

:root {
  --bg: #0c0c0e;
  --bg-soft: #131317;
  --surface: #17171c;
  --border: #25252c;
  --border-strong: #34343d;
  --text: #ededed;
  --text-muted: #8a8a92;
  --text-dim: #5d5d65;
  --accent: #d4ff3f;
  --accent-dim: #aacc2f;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(212, 255, 63, 0.04), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* ================ NAV ================ */
nav {
  position: sticky;
  top: 0;
  background: rgba(12,12,14,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.logo {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-mark {
  color: var(--accent);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

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

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

.nav-cta {
  background: var(--accent);
  color: var(--bg) !important;
  padding: 9px 18px;
  border-radius: 4px;
  font-weight: 500;
  transition: background 0.2s;
}

.nav-cta:hover { background: #fff; }

@media (max-width: 820px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ================ BUTTONS ================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: #fff;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-arrow { transition: transform 0.2s; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ================ HERO ================ */
.hero {
  padding: 120px 0 100px;
  position: relative;
}

.hero-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 0.8s 0.1s forwards;
}

.hero-meta::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  max-width: 14ch;
  opacity: 0;
  animation: fadeUp 0.9s 0.2s forwards;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.cursor {
  display: inline-block;
  width: 0.55ch;
  height: 0.85em;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: -0.1em;
  animation: blink 1.1s infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero-sub {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 56ch;
  line-height: 1.55;
  margin: 0 0 48px;
  opacity: 0;
  animation: fadeUp 1s 0.35s forwards;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 1s 0.5s forwards;
}

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

/* ================ SECTION HEADERS ================ */
section { padding: 100px 0; position: relative; }

.section-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-label::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
  max-width: 20ch;
}

.section-intro {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 60ch;
  line-height: 1.55;
  margin: 0 0 64px;
}

/* ================ CARD GRID (services/labs) ================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.card {
  background: var(--bg);
  padding: 44px 36px;
  transition: background 0.3s;
  position: relative;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover { background: var(--bg-soft); }

.card-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-num::after {
  content: '';
  flex: 1;
  margin-left: 16px;
  border-top: 1px dashed var(--border-strong);
}

.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.card p {
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0 0 20px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.tag-accent {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.card-price {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}

@media (max-width: 760px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* ================ ARTICLE (long-form) ================ */
.article {
  padding: 80px 0 100px;
}

.article-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-meta::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.article h1 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

.article-byline {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 56px;
  letter-spacing: 0.02em;
}

.article-byline a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dashed var(--border-strong);
}

.article-byline a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-dim);
}

.article h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 56px 0 20px;
  color: var(--text);
}

.article h2 em {
  font-style: italic;
  color: var(--accent);
}

.article p {
  font-size: 18px;
  line-height: 1.7;
  margin: 0 0 22px;
  color: #d4d4d8;
}

.article p em { color: var(--text); font-style: italic; }
.article p strong { color: var(--text); }

.article a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
}

.article a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

.article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 56px 0;
}

.article blockquote {
  margin: 32px 0;
  padding: 20px 28px;
  border-left: 2px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}

.article-footer {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.article-footer em { font-style: italic; }
.article-footer a { color: var(--accent); text-decoration: none; }
.article-footer a:hover { color: #fff; }

/* ================ POST LIST (writing index) ================ */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

.post-item:first-child { border-top: 1px solid var(--border); }

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

.post-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.post-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--text);
  transition: color 0.2s;
  line-height: 1.2;
}

.post-item a:hover .post-title { color: var(--accent); }

.post-excerpt {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  max-width: 60ch;
}

/* ================ TEASER (small "latest" card on home) ================ */
.teaser {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.teaser-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 36px;
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  transition: border-color 0.2s, transform 0.2s;
  max-width: 760px;
}

.teaser-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.teaser-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: block;
}

.teaser-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 14px;
}

.teaser-snippet {
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0;
}

/* ================ FOOTER ================ */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.footer-meta a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 16px;
}

.footer-meta a:hover { color: var(--accent); }

/* ================ REVEAL ANIMATION ================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
