/* ===========================
   CSS Custom Properties
   =========================== */
:root {
  --color-bg: #fafafa;
  --color-bg-alt: #ffffff;
  --color-surface: #f5f5f5;
  --color-text: #1a1a1a;
  --color-text-secondary: #666666;
  --color-text-muted: #999999;
  --color-accent: #6c3ce0;
  --color-accent-light: #ede5fb;
  --color-border: #e8e8e8;
  --color-border-light: #f0f0f0;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --max-width: 1100px;
  --nav-height: 72px;

  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ===========================
   Dark Theme
   =========================== */
[data-theme="dark"] {
  --color-bg: #0f0f0f;
  --color-bg-alt: #1a1a1a;
  --color-surface: #252525;
  --color-text: #f0f0f0;
  --color-text-secondary: #a0a0a0;
  --color-text-muted: #666;
  --color-border: #2a2a2a;
  --color-border-light: #222;
  --color-accent-light: #1e1240;
}

[data-theme="dark"] .nav {
  background-color: rgba(15, 15, 15, 0.85);
}

[data-theme="dark"] .nav__cta {
  background-color: var(--color-accent);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

strong {
  font-weight: 600;
}

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

/* ===========================
   Navigation
   =========================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background-color: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.nav--scrolled {
  border-bottom-color: var(--color-border);
}

.nav__container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
  position: relative;
}

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

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background-color: var(--color-accent);
  transition: width 0.3s var(--ease-out);
}

.nav__links a:hover::after {
  width: 100%;
}

.nav__cta {
  background-color: var(--color-text);
  color: white !important;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  transition: background-color 0.2s ease, transform 0.2s ease !important;
}

.nav__cta::after {
  display: none !important;
}

.nav__cta:hover {
  background-color: var(--color-accent) !important;
  transform: translateY(-1px);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--color-accent);
}

.theme-toggle__sun {
  display: none;
}

[data-theme="dark"] .theme-toggle__sun {
  display: block;
}

[data-theme="dark"] .theme-toggle__moon {
  display: none;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
  border: none;
}

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

.btn--primary:hover {
  background-color: #5a2bc7;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 60, 224, 0.3);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

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

/* ===========================
   Hero Section
   =========================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: var(--nav-height);
}

.hero__container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  position: relative;
}

.hero__content {
  max-width: 680px;
}

.hero__greeting {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.hero__name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero__title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.hero__summary {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 540px;
  margin-bottom: 2.5rem;
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 3rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.hero__scroll span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  writing-mode: vertical-rl;
}

.hero__scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--color-accent), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ===========================
   Sections
   =========================== */
.section {
  padding: 7rem 0;
}

.section__container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section__header {
  margin-bottom: 3.5rem;
}

.section__label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 500;
  display: block;
  margin-bottom: 0.5rem;
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ===========================
   About Section
   =========================== */
.about__content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 4rem;
  align-items: start;
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about__text p {
  color: var(--color-text-secondary);
  font-size: 1.02rem;
  line-height: 1.8;
}

.about__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.about__detail {
  padding: 1.25rem;
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: 10px;
}

.about__detail-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.about__detail-value {
  font-weight: 600;
  font-size: 0.95rem;
}

/* ===========================
   Experience / Timeline
   =========================== */
.experience {
  background-color: var(--color-bg-alt);
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

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

.timeline__item {
  position: relative;
  padding-bottom: 3rem;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__marker {
  position: absolute;
  left: -2rem;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--color-accent);
  border: 2px solid var(--color-bg-alt);
  transform: translateX(-4px);
}

.timeline__content {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  padding: 2rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline__content:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 20px rgba(108, 60, 224, 0.06);
}

.timeline__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.timeline__role {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.timeline__company {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-top: 0.2rem;
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent);
  white-space: nowrap;
  font-weight: 500;
  flex-shrink: 0;
}

.timeline__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline__list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.timeline__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--color-border);
}

/* ===========================
   Projects Section
   =========================== */
.projects {
  background-color: var(--color-bg-alt);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.project-card__image {
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  transition: transform 0.5s var(--ease-out-expo);
}

.project-card:hover .project-card__image img {
  transform: scale(1.05);
}

.project-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: white;
  transition: transform 0.5s var(--ease-out-expo);
}

.project-card:hover .project-card__placeholder {
  transform: scale(1.05);
}

.project-card__placeholder--duft {
  background: linear-gradient(135deg, #6c3ce0 0%, #3b82f6 100%);
}

.project-card__placeholder--onsit3 {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
}

.project-card__placeholder--gcms {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
}

.project-card__body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.project-card__title {
  font-size: 1.15rem;
  font-weight: 600;
}

.project-card__arrow {
  color: var(--color-text-muted);
  transition: transform 0.3s ease, color 0.3s ease;
}

.project-card:hover .project-card__arrow {
  transform: translate(3px, -3px);
  color: var(--color-accent);
}

.project-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  flex: 1;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ===========================
   Skills Section
   =========================== */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.skill-card {
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  padding: 2rem;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.skill-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent-light);
  color: var(--color-accent);
  border-radius: 10px;
  margin-bottom: 1.25rem;
}

.skill-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

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

.tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background-color: var(--color-surface);
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.skill-card:hover .tag {
  background-color: var(--color-accent-light);
  color: var(--color-accent);
}

/* ===========================
   Open Source Section
   =========================== */
.open-source {
  background-color: var(--color-bg-alt);
}

.oss__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

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

.oss-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.oss-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
}

.oss-card__arrow {
  transition: transform 0.3s ease, color 0.3s ease;
}

.oss-card:hover .oss-card__arrow {
  transform: translate(3px, -3px);
  color: var(--color-accent);
}

.oss-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.oss-card__desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ===========================
   Education Section
   =========================== */
.edu-card {
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 550px;
}

.edu-card__degree {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.edu-card__school {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.edu-card__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 500;
  display: block;
  margin-bottom: 1rem;
}

.edu-card__badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-accent);
  background-color: var(--color-accent-light);
  border-radius: 20px;
}

/* ===========================
   Contact Section
   =========================== */
.contact {
  background-color: var(--color-bg-alt);
}

.contact__text {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 540px;
  margin-bottom: 2.5rem;
}

.contact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.75rem;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  color: var(--color-text-muted);
}

.contact-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.contact-card:hover svg {
  color: var(--color-accent);
}

.contact-card__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.contact-card__value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
}

/* ===========================
   Footer
   =========================== */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--color-border-light);
}

.footer__container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__text,
.footer__copyright {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ===========================
   Animations
   =========================== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s var(--ease-out-expo) forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }

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

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

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

/* ===========================
   Responsive
   =========================== */
@media (max-width: 900px) {
  .nav__toggle {
    display: flex;
    margin-left: auto;
  }

  .nav__links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    background-color: var(--color-bg-alt);
    flex-direction: column;
    padding: 6rem 2rem 2rem;
    gap: 1.5rem;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.08);
    transition: right 0.4s var(--ease-out-expo);
  }

  .nav__links.open {
    right: 0;
  }

  .nav__links a::after {
    display: none;
  }

  .nav__links a {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {

  .about__content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero__scroll {
    display: none;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline__header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .timeline__content {
    padding: 1.5rem;
  }

  .projects__grid,
  .skills__grid,
  .oss__grid {
    grid-template-columns: 1fr;
  }

  .contact__grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 4.5rem 0;
  }

  .footer__container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero__name {
    font-size: 2.25rem;
  }

  .hero__actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .about__details {
    grid-template-columns: 1fr;
  }
}
