/*
 * Copyright (c) 2026 Philipp Schönemann
 *
 * Code and structure are licensed under the MIT License.
 *
 * PERSONAL DATA, TEXTUAL CONTENT, AND PROPRIETARY MATERIALS
 * ARE EXCLUDED FROM THIS LICENSE AND ALL RIGHTS ARE RESERVED.
 */

/* ============================================================
 * style.css – Portfolio Philipp Schönemann
 *
 * 1. Fonts (@font-face, locally hosted – GDPR)
 * 2. Custom Properties
 * 3. Reset & Base
 * 4. Typography
 * 5. Navigation (including Burger/Mobile)
 * 6. Hero
 * 7. Sections
 * 8. Legal Texts & Blog Pages
 * 9. Footer
 * 10. Media Queries
 * ============================================================
 */

/* ============================================================
 * 1. Fonts
 * Locally hosted instead of Google Fonts API: no third-country
 * data transfer (GDPR, cf. LG Munich I, 3 O 17493/20).
 * ============================================================
 */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../assets/fonts/inter-v20-latin-300.woff2') format('woff2');
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/inter-v20-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/inter-v20-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../assets/fonts/inter-v20-latin-800.woff2') format('woff2');
}

@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/fira-code-v27-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/fira-code-v27-latin-500.woff2') format('woff2');
}

/* ============================================================
 * 2. Custom Properties
 * One accent color as the single source of truth; all alpha
 * variations are derived using color-mix() (Baseline 2023).
 * ============================================================
 */

:root {
  /* Areas */
  --bg-color: #0f1115;
  --bg-darker: #0a0b0e;
  --bg-card: #112240;
  --border-color: #233554;

  /* Text */
  --text-main: #a9adc1;
  --text-light: #ccd6f6;

  /* Accent + derived transparencies */
  --accent-color: #64ffda;
  --accent-glow-05: color-mix(in srgb, var(--accent-color) 5%, transparent);
  --accent-glow-10: color-mix(in srgb, var(--accent-color) 10%, transparent);
  --accent-glow-20: color-mix(in srgb, var(--accent-color) 20%, transparent);
  --accent-glow-30: color-mix(in srgb, var(--accent-color) 30%, transparent);
  --accent-glow-40: color-mix(in srgb, var(--accent-color) 40%, transparent);

  /* Effects */
  --shadow-card: 0 10px 30px -15px rgb(2 12 27 / 70%);

  /* Font */
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;
}

/* ============================================================
 * 3. Reset & Base
 * ============================================================
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Accessibility: respect user preference against animations (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .skip-link {
    transition: none;
  }
}

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

/* Accessibility: visible keyboard focus for all interactive elements */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0;
  left: 0.5rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-card);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: 0 0 4px 4px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
  transform: translateY(-110%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ============================================================
 * 4. Typography
 * ============================================================
 */

h1,
h2,
h3,
h4,
h5 {
  color: var(--text-light);
  font-weight: 600;
}

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

.mono-accent {
  font-family: var(--font-mono);
  color: var(--accent-color);
  font-size: 0.9rem;
}

/* ============================================================
 * 5. Navigation (including Burger/Mobile)
 * ============================================================
 */

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: color-mix(in srgb, var(--bg-color) 90%, transparent);
  backdrop-filter: blur(10px);
  z-index: 100;
  padding: 1.5rem 0;
}

.nav-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.logo {
  font-family: var(--font-mono);
  color: var(--accent-color);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 500;
}

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

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  transition: color 0.3s;
}

/* Burger button: visible only on mobile (see Media Query below) */
.nav-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.burger-bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--accent-color);
  margin: 5px 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

/* Burger → X, controlled via ARIA state (no extra state required) */
.nav-burger[aria-expanded='true'] .burger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-burger[aria-expanded='true'] .burger-bar:nth-child(2) {
  opacity: 0;
}

.nav-burger[aria-expanded='true'] .burger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-burger:not([hidden]) {
    display: block;
  }

  /* Mobile menu: panel below the navbar */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
  }

  /* Large touch targets (min. 44px, WCAG 2.5.8) */
  .nav-links a {
    display: block;
    padding: 1rem 2rem;
  }

  /* Hide only when JS is active (Progressive Enhancement:
     without JS the menu remains visible) */
  .js .nav-links:not(.nav-open) {
    display: none;
  }
}

/* ============================================================
 * 6. Hero
 * ============================================================
 */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin: 1rem 0 0.5rem;
}

.hero-tagline {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--text-main);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.hero-desc {
  max-width: 540px;
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

.btn-secondary {
  color: var(--text-light);
  border: 1px solid var(--border-color);
}

/* ============================================================
 * 7. Sections
 * ============================================================
 */

.section {
  padding: 100px 2rem;
}

.bg-darker {
  background-color: var(--bg-darker);
}

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

.section-title {
  font-size: 1.8rem;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
}

.section-title::after {
  content: '';
  display: block;
  height: 1px;
  width: 300px;
  background-color: var(--border-color);
  margin-left: 1.5rem;
}

/* --- About --- */
.about-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 3rem;
}

.about-text p {
  margin-bottom: 1rem;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stat-box {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
}

.stat-value {
  font-size: 2rem;
  color: var(--accent-color);
  font-weight: 600;
}

/* --- Skills --- */
.skills-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.skill-group-title {
  font-family: var(--font-mono);
  color: var(--accent-color);
  margin-bottom: 1rem;
  font-size: 1rem;
  opacity: 0.9;
}

.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.badge {
  background: var(--bg-card);
  color: var(--text-light);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    transform 0.2s ease,
    background 0.2s;
  cursor: default;
}

.main-badge {
  background: var(--accent-glow-10);
  color: var(--accent-color);
  border: 1px solid var(--accent-glow-30);
}

.badge-outline {
  border: 1px dashed var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* --- Projects (Featured Cards) --- */
.projects-grid-modern {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(320px, 1fr)
  ); /* auto-fit: 1 column on mobile, 2 on desktop – without Media Query */

  gap: 2rem;
  margin-top: 1rem;
}

.project-card-featured {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  border: 1px solid transparent;
}

.project-card-featured .mono-accent {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.project-card-featured .project-title {
  font-size: 1.4rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.project-description {
  /* flex-grow pushes tags/links to the bottom edge of the cards,
     so all cards in the grid align evenly */
  flex-grow: 1;
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.project-links a.text-link {
  font-family: var(--font-mono);
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s ease;
}

.project-links a.text-link .arrow {
  transition: transform 0.2s ease;
  display: inline-block;
}

/* --- Tech-Tag-Pills ---
 * One rule for both markup variants (span containers in the
 * timeline, ul/li in the project cards).
 */

.tech-tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

ul.tech-tags {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.tech-tags span,
ul.tech-tags li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--accent-glow-05);
  border: 1px solid var(--accent-glow-20);
  color: var(--accent-color);
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
}

/* --- Experience / Timeline --- */
.timeline {
  border-left: 2px solid var(--border-color);
  padding-left: 2rem;
  margin-left: 1rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -43px; /* 2rem Padding + 2px Border + Punkt-Offset */
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--bg-color);
  border: 2px solid var(--accent-color);
}

.timeline-date {
  font-family: var(--font-mono);
  color: var(--accent-color);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.timeline-content h3 {
  font-size: 1.3rem;
  color: var(--text-light);
}

.timeline-company {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  font-weight: 400;
}

.highlight-list {
  margin: 1rem 0 1rem 1rem;
  padding: 0;
  list-style: none;
}

.highlight-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.6;
}

.highlight-list li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

.highlight-list li strong {
  color: var(--text-light);
  font-weight: 600;
}

.project-role {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: -0.3rem;
  margin-bottom: 0.8rem;
  font-style: italic;
}

/* Project insertion within a timeline entry */
.project-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 6px;
  margin-top: 1rem;
  border-left: 2px solid var(--accent-color);
}

.project-title {
  font-size: 1.05rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-family: var(--font-sans);
}

.project-card p {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* --- Blog teaser (index.html) --- */
.div-btn-blog {
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.btn-solid-blog {
  display: inline-block;
  padding: 1rem 2rem;
  background-color: var(--bg-card);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
}

/* --- Contact --- */
.contact-container {
  text-align: center;
}

.contact-container p {
  max-width: 600px;
  margin: 0 auto 2rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: var(--font-mono);
}

.contact-link {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 1.2rem;
}

/* ============================================================
 * 8. Legal Texts, Blog & Error Pages
 * ============================================================
 */

/* Shared page layout for text pages (Imprint,
 * Privacy Policy, Articles, 404)
 */
.legal-content,
.four-zero-four-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 120px 2rem 60px;
}

.legal-content h1 {
  margin-bottom: 2rem;
}

.legal-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.legal-content p {
  margin-bottom: 1rem;
}

.legal-content ul {
  margin: 0 0 1rem 1.5rem;
  list-style-type: disc;
}

.legal-content a {
  color: var(--accent-color);
}

.four-zero-four-content {
  text-align: center;
}

.four-zero-four-content .button-p {
  margin-top: 2rem;
}

/* --- Blog overview --- */
.blog-header {
  padding: 150px 0 50px;
  text-align: left;
}

.blog-header p.blog-header-description {
  max-width: 600px;
  margin-top: 1rem;
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 800px;
}

.blog-post-card {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--accent-glow-10);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.blog-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.blog-title {
  font-size: 1.6rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  text-decoration: none;
  display: block;
}

.blog-excerpt {
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.read-more {
  font-family: var(--font-mono);
  color: var(--accent-color);
  text-decoration: none;
  font-size: 0.9rem;
}

/* ============================================================
 * 9. Footer
 * ============================================================
 */

footer {
  text-align: center;
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.footer-nav {
  margin-top: 10px;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.footer-nav a {
  color: var(--text-main);
  text-decoration: underline;
  font-size: 0.8rem;
}

/* ============================================================
 * 10. Media Queries (Layout/Typography)
 * Navigation-specific queries are located in Section 5 (cohesion).
 * ============================================================
 */

@media (max-width: 768px) {
  h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
  }

  h2 {
    font-size: 1.4rem;
    line-height: 1.3;
    overflow-wrap: break-word; /* Break long words instead of breaking the layout; hyphenation uses lang="de" in the HTML */
    hyphens: auto;
  }

  .section {
    padding: 60px 1.5rem;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
  }

  .section-title::after {
    width: 100px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .stat-value {
    font-size: 2rem;
    color: var(--accent-color);
    font-weight: 600;
  }

  .hero-actions {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* Very small displays */
@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.2rem;
  }
}

.social-links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin-top: 2rem;
  padding: 0;
}

.social-links a {
  display: inline-flex;
  padding: 0.5rem;
}

.icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  background-color: #fff;
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.icon-github {
  mask-image: url('../assets/icons/github.svg');
}

.icon-linkedin {
  mask-image: url('../assets/icons/linkedin.svg');
}

.social-links a:focus-visible .icon {
  transform: scale(150%);
}

.contact-profiles {
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 1.5rem;
  width: fit-content;
  margin: 2.5rem auto 0;
  padding: 0;
}

.contact-profiles a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-light);
  transition:
    color 0.3s ease,
    background-color 0.3s ease;
}

.contact-profiles .icon {
  width: 32px;
  height: 32px;
}

.contact-profiles .social-platform-name {
  font-size: 0.95rem;
  font-weight: 500;
}

.contact-profiles a:focus-visible {
  color: var(--accent-color);
  background-color: color-mix(in srgb, var(--accent-color) 8%, transparent);
}

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

  .btn-primary:hover {
    background-color: var(--accent-glow-10);
  }

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

  .badge:hover {
    transform: translateY(-2px);
    background: var(--border-color);
  }

  .project-card-featured:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card);
    border-color: var(--accent-glow-20);
  }

  .project-links a.text-link:hover {
    color: var(--accent-color);
  }

  .project-links a.text-link:hover .arrow {
    transform: translate(3px, -3px);
  }

  .btn-solid-blog:hover {
    background-color: var(--accent-color);
    color: var(--bg-darker);
    box-shadow: 0 4px 15px var(--accent-glow-30);
    transform: translateY(-2px);
  }

  .blog-post-card:hover {
    transform: translateX(10px);
    border-color: var(--accent-glow-40);
  }

  .social-links a:hover .icon {
    transform: scale(150%);
  }

  .contact-profiles a:hover {
    color: var(--accent-color);
    background-color: color-mix(in srgb, var(--accent-color) 8%, transparent);
  }
}
