/* ============================================================
   PORTFOLIO.CSS — Tede Mehrtens
   ============================================================ */

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

/* === CSS VARIABLES === */
:root {
  --bg:              #ffffff;
  --bg-secondary:    #f6f8fa;
  --text:            #24292f;
  --text-muted:      #57606a;
  --accent:          #0969da;
  --accent-hover:    #0550ae;
  --border:          #d0d7de;
  --card-bg:         #f6f8fa;
  --nav-bg:          rgba(255, 255, 255, 0.88);
  --spotlight-r:     9;
  --spotlight-g:     105;
  --spotlight-b:     218;
  --spotlight-o:     0.04;
  --font:            'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', 'Fira Mono', monospace;
  --radius:          8px;
  --nav-height:      60px;
  --max-width:       860px;
  --transition:      0.2s ease;
}

[data-theme="dark"] {
  --bg:              #0d1117;
  --bg-secondary:    #161b22;
  --text:            #e6edf3;
  --text-muted:      #8b949e;
  --accent:          #58a6ff;
  --accent-hover:    #79c0ff;
  --border:          #30363d;
  --card-bg:         #161b22;
  --nav-bg:          rgba(13, 17, 23, 0.88);
  --spotlight-r:     88;
  --spotlight-g:     166;
  --spotlight-b:     255;
  --spotlight-o:     0.07;
}

/* === BASE === */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Mouse spotlight — subtle glow that follows cursor */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
    rgba(var(--spotlight-r), var(--spotlight-g), var(--spotlight-b), var(--spotlight-o)),
    transparent 80%
  );
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* === LAYOUT === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* === NAVBAR === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-brand {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  margin-right: auto;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}

.nav-icon:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

/* Theme toggle: show correct icon based on current theme */
.icon-sun  { display: none; }
.icon-moon { display: none; }

[data-theme="dark"]  .icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: block; }

/* Fallback for no JS / system auto */
:root:not([data-theme]) .icon-sun { display: block; }

/* Mobile nav */
.nav-toggle { display: none; }

@media (max-width: 600px) {
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    z-index: 99;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
    margin-right: auto;
  }
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  font-family: var(--font);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

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

.btn-secondary:hover {
  background: var(--bg-secondary);
  transform: translateY(-1px);
}

/* Secondary button inside hero always on dark background */
.hero .btn-secondary {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
}

.hero .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* === HERO === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
  background-image: url('/assets/img/IMG_1249.jpeg');
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
}

/* Gradient: transparent on left (face visible), dark on right (text readable) */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.2)  35%,
    rgba(0, 0, 0, 0.72) 58%,
    rgba(0, 0, 0, 0.82) 100%
  );
  z-index: 0;
}

.hero .container {
  display: flex;
  justify-content: flex-end;
}

.hero-inner {
  padding: 4rem 0;
  width: 54%;
  position: relative;
  z-index: 1;
}

/* Hero text is always light — it sits on a dark photo */
.hero-eyebrow {
  font-size: 0.875rem;
  font-weight: 500;
  color: #7eb8ff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-name {
  font-size: clamp(2.5rem, 8vw, 4.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: #fff;
}

.hero-title {
  font-size: clamp(1rem, 3vw, 1.3rem);
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 2.5rem;
  line-height: 1.4;
}

.hero-title a {
  color: #7eb8ff;
  text-decoration: none;
  font-weight: 500;
}

.hero-title a:hover {
  text-decoration: underline;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 5rem;
}

/* On mobile: text anchored to bottom so it doesn't cover the face */
@media (max-width: 640px) {
  .hero {
    align-items: flex-end;
  }

  .hero::after {
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.85) 0%,
      rgba(0, 0, 0, 0.4)  50%,
      rgba(0, 0, 0, 0.05) 100%
    );
  }

  .hero .container {
    justify-content: flex-start;
    padding-bottom: 3rem;
  }

  .hero-inner {
    width: 100%;
    padding: 0;
  }

  .hero-actions {
    margin-bottom: 2rem;
  }
}

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
  animation: nudge 2.5s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}

/* === SECTIONS === */
.section {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  color: var(--text);
}

/* === TIMELINE === */
.timeline {
  position: relative;
  padding-left: 1.25rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 1.75rem;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}

.timeline-role {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.6rem;
}

.timeline-company {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.timeline-company:hover {
  text-decoration: underline;
}

.timeline-sep {
  color: var(--border);
  font-size: 0.75rem;
}

.timeline-period {
  color: var(--text-muted);
  font-size: 0.825rem;
}

.timeline-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

/* === SKILLS === */
.skills-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.skill-category-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.825rem;
  color: var(--text);
  transition: all 0.2s ease;
  cursor: default;
  user-select: none;
}

.skill-tag:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* === BLOG CARDS === */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.post-card {
  display: block;
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}

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

.post-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.post-card-date {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.post-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* === FOOTER === */
.footer {
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}

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

.footer-copy {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-size: 0.825rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* === PAGE LAYOUT (Impressum, Datenschutz, About) === */
.page-wrap {
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 5rem;
}

.page-wrap h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

.page-wrap h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.page-wrap h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.page-wrap p {
  margin-bottom: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.page-wrap a {
  color: var(--accent);
  text-decoration: none;
}

.page-wrap a:hover {
  text-decoration: underline;
}

.page-wrap ul,
.page-wrap ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.page-wrap li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.page-wrap strong {
  color: var(--text);
  font-weight: 600;
}

/* === POST PAGE === */
.post-page {
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 5rem;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 500;
  margin-bottom: 2.5rem;
  transition: color var(--transition);
}

.post-back:hover {
  color: var(--text);
}

.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

/* Hashtag tags above title */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.post-tag {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--accent);
  cursor: default;
  user-select: none;
}

.post-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--text);
}

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 0.4rem 0.6rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.meta-sep {
  color: var(--border);
}

/* Post prose typography */
.post-body {
  font-size: 1.0625rem;
  line-height: 1.85;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.post-body h2 { font-size: 1.375rem; }
.post-body h3 { font-size: 1.125rem; }
.post-body h4 { font-size: 1rem; }

.post-body p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.post-body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.post-body :not(pre) > code {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
}

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

.post-body li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
  color: var(--text-muted);
}

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

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

.post-body img {
  border-radius: var(--radius);
  margin: 2rem 0;
}

.post-footer {
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
}

/* === RELATED POSTS === */
.post-related {
  padding-top: 3rem;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
}

.post-related-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.post-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.post-related-card {
  display: block;
  padding: 1.1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), transform var(--transition);
}

.post-related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.post-related-tags {
  margin-bottom: 0.5rem;
}

.post-related-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.post-related-date {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* === POSTS LIST PAGE === */
.posts-page {
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 5rem;
}

.posts-page h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

.posts-list-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: color var(--transition);
}

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

.post-item-date {
  font-size: 0.825rem;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 95px;
  padding-top: 0.15rem;
}

.post-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.post-item-title {
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

.post-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.posts-pagination {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* === UTILITIES === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
