/*
Theme Name: Lars van der Werf
Theme URI: https://larsvanderwerf.nl
Author: Lars van der Werf
Author URI: https://larsvanderwerf.nl
Description: Persoonlijk platform voor Lars van der Werf — Innovatie & Ontwikkeling. Editorial design met custom post types voor Werk, Inzichten en Experimenten.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Private
Text Domain: lvdw
*/

/* ===== VARIABLES ===== */
:root {
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --bg: #FAFAF8;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #2a4d3e;
  --accent-light: #e8f0ec;
  --border: #e5e3df;
  --warm: #f5f0ea;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
  overflow-x: hidden;
  line-height: 1.6;
}

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 0 max(24px, 4vw);
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(250,250,248,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav-logo {
  font-family: var(--serif); font-size: 20px; color: var(--fg);
  text-decoration: none; letter-spacing: -0.01em;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-link {
  font-family: var(--sans); font-size: 13px; font-weight: 400;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  padding: 4px 0; position: relative; transition: color 0.3s;
}
.nav-link:hover, .nav-link.active { color: var(--fg); }
.nav-link.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 100%; height: 1.5px; background: var(--accent);
}

/* Mobile menu */
.nav-hamburger {
  display: none; border: none; background: none; cursor: pointer;
  width: 32px; height: 32px; position: relative; z-index: 200;
}
.nav-hamburger span {
  display: block; width: 20px; height: 1.5px; background: var(--fg);
  position: absolute; left: 6px; transition: all 0.3s;
}
.nav-hamburger span:first-child { top: 11px; }
.nav-hamburger span:last-child { top: 19px; }
.nav-hamburger.open span:first-child { top: 15px; transform: rotate(45deg); }
.nav-hamburger.open span:last-child { top: 15px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; background: var(--bg);
  z-index: 100; display: none; flex-direction: column;
  justify-content: center; align-items: center; gap: 32px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--sans); font-size: 18px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); text-decoration: none;
  transition: color 0.3s;
}
.mobile-menu a:hover { color: var(--fg); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center;
  padding: 0 max(24px, 8vw);
  max-width: 1200px; margin: 0 auto;
  position: relative;
}
.hero-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 32px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.08; letter-spacing: -0.02em;
  margin-bottom: 32px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub {
  font-family: var(--sans); font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.7; color: var(--muted); max-width: 560px;
}
.hero-ctas { display: flex; gap: 16px; margin-top: 40px; flex-wrap: wrap; }

/* Hero animation */
.hero-line { overflow: hidden; }
.hero-anim {
  display: inline-block; opacity: 0; transform: translateY(100%);
  animation: slideUp 0.8s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }
.d1 { animation-delay: 0.2s; } .d2 { animation-delay: 0.35s; }
.d3 { animation-delay: 0.45s; } .d4 { animation-delay: 0.55s; }
.d5 { animation-delay: 0.7s; } .d6 { animation-delay: 0.85s; }

/* Scroll indicator */
.scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  opacity: 0.4; transition: opacity 0.5s;
}
.scroll-hint.hidden { opacity: 0; }
.scroll-line {
  width: 1px; height: 40px; background: var(--muted);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ===== BUTTONS ===== */
.btn-primary {
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  letter-spacing: 0.03em; padding: 14px 32px;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer; transition: all 0.3s;
  text-decoration: none; display: inline-block;
}
.btn-primary:hover { background: #1e3a2e; transform: translateY(-1px); }
.btn-outline {
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  letter-spacing: 0.03em; padding: 14px 32px;
  background: transparent; color: var(--fg);
  border: 1px solid var(--border); cursor: pointer; transition: all 0.3s;
  text-decoration: none; display: inline-block;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ===== TAGS & BADGES ===== */
.tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-light); padding: 4px 10px;
  border-radius: 2px; display: inline-block;
}
.stage {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 4px 12px; border-radius: 2px;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.stage.live { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ===== MARQUEE ===== */
.marquee {
  overflow: hidden; white-space: nowrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.marquee-inner {
  display: inline-block; animation: marquee 30s linear infinite;
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ===== SECTIONS ===== */
.section {
  padding: 120px max(24px, 8vw);
  max-width: 1200px; margin: 0 auto;
}
.section-full {
  padding: 120px max(24px, 8vw);
}
.section-full-inner { max-width: 1200px; margin: 0 auto; }
.section-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 16px;
}
.section-title {
  font-family: var(--serif); font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.15; font-weight: 400;
}
.section-title em { font-style: italic; color: var(--accent); }
.section-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 48px; flex-wrap: wrap; gap: 16px;
}
.section-header-sub {
  font-family: var(--sans); font-size: 14px; color: var(--muted);
}
.all-link {
  font-family: var(--sans); font-size: 14px; color: var(--accent);
  cursor: pointer; text-decoration: none;
}
.all-link:hover { text-decoration: underline; }

/* ===== FADE IN ===== */
.fade-in {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-d1 { transition-delay: 0.1s; }
.fade-d2 { transition-delay: 0.2s; }
.fade-d3 { transition-delay: 0.3s; }
.fade-d4 { transition-delay: 0.4s; }

/* ===== ABOUT ===== */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 64px; align-items: start;
}
.about-title {
  font-family: var(--serif); font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.15; font-weight: 400;
}
.about-title em { font-style: italic; color: var(--accent); }
.about-text {
  font-family: var(--sans); font-size: 15px; line-height: 1.8; color: var(--muted);
}
.about-text p { margin-bottom: 20px; }
.about-text p:last-child { margin-bottom: 0; }

.qualities {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px; background: var(--border); margin-top: 64px;
  border: 1px solid var(--border);
}
.quality { padding: 28px 24px; background: var(--bg); }
.quality-label { font-family: var(--serif); font-size: 20px; margin-bottom: 6px; }
.quality-desc { font-family: var(--sans); font-size: 13px; color: var(--muted); }

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.project-card {
  border: 1px solid var(--border); padding: 32px; background: #fff;
  transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
  cursor: pointer; position: relative; overflow: hidden;
}
.project-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 3px; height: 0; background: var(--accent);
  transition: height 0.4s cubic-bezier(0.22,1,0.36,1);
}
.project-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
.project-card:hover::before { height: 100%; }
.project-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.project-client {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.project-title {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  line-height: 1.3; margin-bottom: 12px;
}
.project-desc {
  font-family: var(--sans); font-size: 14px; line-height: 1.7;
  color: var(--muted); margin-bottom: 20px;
}
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== INSIGHTS ===== */
.substack-bar {
  background: var(--warm); padding: 20px 24px;
  margin-bottom: 40px; display: flex; align-items: center; gap: 16px;
  border-left: 3px solid var(--accent);
  font-family: var(--sans); font-size: 13px; color: var(--muted); line-height: 1.6;
}
.substack-bar strong { color: var(--fg); }
.insight-row {
  padding: 32px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: padding-left 0.3s;
  display: grid; grid-template-columns: 120px 1fr auto;
  gap: 32px; align-items: start;
}
.insight-row:hover { padding-left: 12px; }
.insight-date {
  font-family: var(--sans); font-size: 12px; color: var(--muted); margin-top: 8px;
}
.insight-title {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  line-height: 1.3; margin-bottom: 8px;
}
.insight-excerpt {
  font-family: var(--sans); font-size: 14px; line-height: 1.7; color: var(--muted);
}
.insight-time {
  font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap;
}

@media (max-width: 768px) {
  .insight-row { grid-template-columns: 1fr; gap: 8px; }
  .insight-time { display: none; }
}

/* ===== EXPERIMENTS ===== */
.experiment-item {
  padding: 24px 0; border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start;
}
.experiment-title {
  font-family: var(--serif); font-size: 20px; font-weight: 400;
  line-height: 1.3; margin-bottom: 6px;
}
.experiment-desc {
  font-family: var(--sans); font-size: 14px; line-height: 1.7; color: var(--muted);
}
.experiment-sub {
  font-family: var(--sans); font-size: 15px; line-height: 1.7;
  color: var(--muted); max-width: 560px; margin-bottom: 48px;
}

@media (max-width: 768px) {
  .experiment-item { grid-template-columns: 1fr; gap: 12px; }
}

/* ===== CONTACT ===== */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
}
.contact-text {
  font-family: var(--sans); font-size: 15px; line-height: 1.8;
  color: var(--muted); margin-bottom: 32px;
}
.contact-row {
  font-family: var(--sans); font-size: 14px; color: var(--muted);
  display: flex; gap: 12px; align-items: center; margin-bottom: 12px;
}
.contact-label {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  width: 48px; flex-shrink: 0;
}
.form-group { display: flex; flex-direction: column; gap: 16px; }
input[type="text"], input[type="email"], textarea {
  font-family: var(--sans); font-size: 15px; padding: 14px 16px;
  border: 1px solid var(--border); background: #fff; color: var(--fg);
  width: 100%; outline: none; transition: border-color 0.3s;
  border-radius: 0; -webkit-appearance: none;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; }
input::placeholder, textarea::placeholder { color: #b5b3af; }

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ===== FOOTER ===== */
.site-footer {
  padding: 48px max(24px, 4vw); border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 24px;
}
.footer-brand { font-family: var(--serif); font-size: 18px; }
.footer-copy {
  font-family: var(--sans); font-size: 12px; color: var(--muted); margin-left: 16px;
}
.footer-links { display: flex; gap: 24px; }
.footer-link {
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  text-decoration: none; transition: color 0.3s;
}
.footer-link:hover { color: var(--fg); }
.footer-univia {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  letter-spacing: 0.06em;
}

/* ===== SINGLE POST / PAGE ===== */
.single-content {
  max-width: 720px; margin: 0 auto;
  padding: 160px max(24px, 4vw) 80px;
}
.single-content .section-label { margin-bottom: 24px; }
.single-content h1 {
  font-family: var(--serif); font-size: clamp(28px, 4vw, 48px);
  font-weight: 400; line-height: 1.15; margin-bottom: 24px;
}
.single-meta {
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  margin-bottom: 48px; display: flex; gap: 20px; flex-wrap: wrap;
}
.single-body {
  font-family: var(--sans); font-size: 16px; line-height: 1.9; color: #333;
}
.single-body p { margin-bottom: 24px; }
.single-body h2 {
  font-family: var(--serif); font-size: 28px; font-weight: 400;
  margin: 48px 0 16px;
}
.single-body h3 {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
  margin: 36px 0 12px;
}
.single-body blockquote {
  border-left: 3px solid var(--accent); padding-left: 24px;
  margin: 32px 0; font-style: italic; color: var(--muted);
}
.single-body ul, .single-body ol { margin: 16px 0; padding-left: 24px; }
.single-body li { margin-bottom: 8px; }
.single-body code {
  font-family: var(--mono); font-size: 14px;
  background: var(--accent-light); padding: 2px 6px; border-radius: 2px;
}
.single-body pre {
  background: var(--fg); color: var(--bg); padding: 24px;
  overflow-x: auto; margin: 24px 0; font-size: 14px;
  font-family: var(--mono); line-height: 1.6;
}
.single-body img {
  margin: 32px 0; border: 1px solid var(--border);
}

/* Archive page */
.archive-header {
  padding: 160px max(24px, 8vw) 60px;
  max-width: 1200px; margin: 0 auto;
}

/* ===== WORDPRESS SPECIFIC ===== */
.wp-block-image { margin: 32px 0; }
.alignwide { max-width: 960px; margin-left: auto; margin-right: auto; }
.alignfull { max-width: 100vw; margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); }
.screen-reader-text {
  clip: rect(1px,1px,1px,1px); position: absolute; height: 1px;
  width: 1px; overflow: hidden;
}
