/* ==========================================================================
   Mehida Salihovic — salihovic.ch
   ==========================================================================
   Design-Konzept: "Verbindungen schaffen" — eine durchgehende dünne Linie
   mit Knotenpunkten (thread-nav) zieht sich als einziges Leitmotiv durch
   die Seite und macht das Kernthema (Menschen, Teams, Organisationen
   verbinden) sichtbar, statt es dekorativ zu behaupten.

   Farben: warmes, dunkles Anthrazit-Braun statt neutralem Schwarz;
   gedämpftes Messing/Kupfer als einziger Akzent.
   Typografie: Roboto Condensed (Display/Struktur) + Roboto (Lesetext).
   ========================================================================== */

:root {
  --bg: #14110e;
  --bg-raised: #1b1610;
  --bg-card: #1e1811;
  --line: #302823;
  --text: #f3ede4;
  --text-muted: #ab9d8c;
  --text-faint: #8f8271;
  --accent: #c08a4e;
  --accent-contrast: #14110e;
  --font-cond: "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-body: "Roboto", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1180px;
  --content-inset: clamp(1.25rem, 4vw, 3.5rem);
  --rail-w: 64px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

h1, h2, h3 {
  font-family: var(--font-cond);
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.01em;
}

p { margin: 0; }

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

ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.03;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem var(--content-inset) 1.5rem calc(var(--content-inset) + var(--rail-w));
  z-index: 100;
  background: linear-gradient(to bottom, rgba(20,17,14,0.9), rgba(20,17,14,0));
}

.logo {
  font-family: var(--font-cond);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.primary-nav {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2.2rem);
}

.primary-nav a {
  position: relative;
  font-family: var(--font-cond);
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 0.4rem 0;
  transition: color 0.25s var(--ease);
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}

.primary-nav a:hover,
.primary-nav a.active {
  color: var(--text);
}

.primary-nav a:hover::after,
.primary-nav a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 101;
}

.nav-toggle span {
  display: block;
  height: 1px;
  width: 22px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ==========================================================================
   Thread nav — das durchgehende Leitmotiv der Seite
   ========================================================================== */

.thread-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.1rem;
  z-index: 90;
}

.thread-nav::before {
  content: "";
  position: absolute;
  top: 8%;
  bottom: 8%;
  left: 50%;
  width: 1px;
  background: var(--line);
  transform: translateX(-50%);
}

.thread-nav a {
  position: relative;
  width: 44px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thread-nav a::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  border: 1px solid var(--bg);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.thread-nav a:hover::before,
.thread-nav a.active::before {
  background: var(--accent);
  transform: scale(1.3);
}

.thread-nav a span {
  position: absolute;
  left: 100%;
  margin-left: 0.9rem;
  white-space: nowrap;
  font-family: var(--font-cond);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 0.3rem 0.7rem;
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.thread-nav a:hover span,
.thread-nav a:focus-visible span {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 900px) {
  .thread-nav { display: none; }
  :root { --rail-w: 0px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 var(--content-inset) 0 calc(var(--content-inset) + var(--rail-w));
}

.hero-inner {
  max-width: 780px;
}

.hero-name {
  display: flex;
  flex-direction: column;
  line-height: 0.96;
}

.hero-first {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 300;
  color: var(--text-muted);
}

.hero-last {
  font-size: clamp(3rem, 10vw, 6.8rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-role {
  margin-top: 1.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem 1.4rem;
}

.hero-role span {
  position: relative;
  font-family: var(--font-cond);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--text-muted);
  padding-left: 1.4rem;
}

.hero-role span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 0.8rem;
  height: 1px;
  background: var(--accent);
}

.hero-cta {
  display: inline-block;
  margin-top: 3rem;
  font-family: var(--font-cond);
  font-size: 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.hero-cta:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* one orchestrated entrance — the page's single deliberate motion moment */
.hero-first,
.hero-last,
.hero-role,
.hero-cta {
  opacity: 0;
  animation: rise 0.9s var(--ease) forwards;
}

.hero-first { animation-delay: 0.05s; }
.hero-last { animation-delay: 0.16s; }
.hero-role { animation-delay: 0.32s; }
.hero-cta { animation-delay: 0.48s; }

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

@media (prefers-reduced-motion: reduce) {
  .hero-first, .hero-last, .hero-role, .hero-cta {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Sections (shared)
   ========================================================================== */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4.5rem, 9vw, 8rem) var(--content-inset) clamp(4.5rem, 9vw, 8rem) calc(var(--content-inset) + var(--rail-w));
}

.career, .engagement {
  max-width: none;
  background: var(--bg-raised);
}

.career > *, .engagement > * {
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}

.section h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  margin-bottom: clamp(2.2rem, 5vw, 3.5rem);
}

/* ==========================================================================
   About
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.about-text {
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  font-weight: 300;
  line-height: 1.75;
  max-width: 58ch;
}

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

.about-facts li {
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.about-facts li:last-child { border-bottom: none; padding-bottom: 0; }

.about-facts h3 {
  font-size: 1.05rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.about-facts p {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 32ch;
}

/* ==========================================================================
   Career / Timeline
   ========================================================================== */

.timeline-item {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 2rem;
  padding: 2.1rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item:first-child { padding-top: 0; }
.timeline-item:last-child { border-bottom: none; padding-bottom: 0; }

.timeline-year {
  font-family: var(--font-cond);
  color: var(--text);
  font-size: 1.05rem;
}

.timeline-current {
  margin-top: 0.4rem;
  font-family: var(--font-cond);
  font-size: 0.85rem;
  color: var(--accent);
}

.timeline-content h3 {
  font-size: 1.25rem;
}

.timeline-org {
  color: var(--accent);
  font-family: var(--font-cond);
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

.timeline-desc {
  margin-top: 0.7rem;
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 60ch;
}

/* ==========================================================================
   Skills
   ========================================================================== */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.skill-card {
  background: var(--bg);
  padding: 2rem 1.8rem;
}

.skill-card h3 {
  font-size: 1.05rem;
  margin-bottom: 1.1rem;
}

.skill-card ul li {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
}

.skill-card ul li:first-child { border-top: none; padding-top: 0; }

.interests {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
}

.interests-label {
  font-family: var(--font-cond);
  font-size: 0.95rem;
  color: var(--text-faint);
}

.tag-cloud {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.tag-cloud li {
  font-family: var(--font-cond);
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 1px solid var(--line);
  padding: 0.4em 0.9em;
  border-radius: 999px;
}

/* ==========================================================================
   Engagement
   ========================================================================== */

.engagement-content > p {
  max-width: 65ch;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2.6rem;
}

.engagement-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.engagement-card {
  background: var(--bg-raised);
  padding: 1.8rem;
}

.engagement-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.contact-intro {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.7;
  max-width: 42ch;
}

.contact-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
}

.contact-item:last-child { border-bottom: none; }

.contact-item dt {
  font-family: var(--font-cond);
  font-size: 0.95rem;
  color: var(--text-faint);
}

.contact-item dd {
  font-family: var(--font-cond);
  font-size: 1.05rem;
  color: var(--text);
  text-align: right;
}

.placeholder-text {
  color: var(--text-faint);
  font-style: italic;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.4rem var(--content-inset) 3.2rem calc(var(--content-inset) + var(--rail-w));
  border-top: 1px solid var(--line);
}

.site-footer p {
  font-family: var(--font-cond);
  font-size: 0.9rem;
  color: var(--text-faint);
}

.back-top {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 1rem;
  color: var(--text-muted);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.back-top:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .contact-item dd { text-align: left; }

  .nav-toggle { display: flex; }

  .primary-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--bg-raised);
    border-left: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    padding: 2rem clamp(1.5rem, 6vw, 2.5rem);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    z-index: 100;
  }

  .primary-nav.is-open { transform: translateX(0); }
  .primary-nav a { font-size: 1.05rem; }
}
