/* ==========================================================================
   Almir Dzaferi — CV site
   Minimal editorial style: cream/black, Geist Sans, fixed 3-column desktop
   layout with cross-fading panels, scroll-snap on mobile.
   ========================================================================== */

@font-face{
  font-family: "GeistSans";
  src: url("../fonts/GeistVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root{
  color-scheme: light;

  --bg: #f5f4f1;
  --text-primary: #1a1a1a;
  --text-muted: #8a8a8a;
  --text-subtle: #cfcfcf;
  --text-desc: #555555;
  --frame: #0d0d0d;
  --border: rgba(0,0,0,0.08);

  --font: "GeistSans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

*, *::before, *::after{ box-sizing: border-box; }

html, body{
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 768px){
  html, body{ height: 100dvh; overflow: hidden; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

.skip-link{
  position: absolute; left: -9999px; top: 0;
  background: var(--frame); color: var(--bg); padding: 10px 16px; z-index: 999;
}
.skip-link:focus{ left: 0; }

/* ---------- Language switch ---------- */
.lang-switch{
  position: fixed; top: 20px; right: 24px; z-index: 50;
  display: flex; gap: 10px; align-items: center;
  font-size: 12px; letter-spacing: 0.04em;
}
.lang-btn{
  background: none; border: none; padding: 4px 2px; cursor: pointer;
  color: var(--text-subtle); border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.lang-btn:hover{ color: var(--text-primary); }
.lang-btn.active{ color: var(--text-primary); border-color: var(--text-primary); }

.journal-link{
  position: fixed; bottom: 22px; right: 24px; z-index: 50;
  font-size: 12px; letter-spacing: 0.04em; color: var(--text-muted);
  border-bottom: 1px solid var(--text-subtle);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.journal-link:hover{ color: var(--text-primary); border-color: var(--text-primary); }

/* ==========================================================================
   DESKTOP LAYOUT
   ========================================================================== */

.desktop-layout{ height: 100dvh; overflow: hidden; background: var(--bg); }

.desktop-grid{
  height: 100dvh;
  display: grid;
  grid-template-columns: 21% 40% 39%;
  padding: 52px 48px;
  gap: 0;
}

/* ---- Left column ---- */
.col-left{
  display: flex; flex-direction: column; justify-content: space-between;
  padding-right: 24px; min-width: 0;
}

.identity h1{
  font-size: 22px; font-weight: 600; line-height: 1.2;
  margin: 0 0 6px; letter-spacing: -0.01em;
}
.identity p{
  font-size: 13px; color: var(--text-muted); letter-spacing: 0.05em;
  margin: 0 0 22px;
}

.dots{ display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dot{
  width: 6px; height: 2px; background: var(--text-subtle); border: none; padding: 0;
  cursor: pointer; border-radius: 1px; transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.dot.active{ width: 20px; background: var(--text-primary); }

.title-stack{ flex: 1; position: relative; min-height: 0; }
.title-pane{
  position: absolute; top: 50%; left: 0; right: 0;
  transform: translateY(calc(-50% + 8px));
  opacity: 0; transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.title-pane.active{ opacity: 1; transform: translateY(-50%); pointer-events: auto; }
.title-pane p{
  font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em;
  margin: 0;
}
.title-pane .sub{ color: var(--text-subtle); }

/* ---- Center column ---- */
.col-center{
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  padding: 0 20px;
}
.photo-frame{
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 3 / 4;
  background: var(--frame);
  border-radius: 32px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 24px 48px -24px rgba(26,26,26,0.35);
}
.photo-frame-inner{
  position: relative; width: 100%; height: 100%;
  border-radius: 24px; overflow: hidden; background: #000;
}
.photo-frame-inner img{
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  opacity: 0; transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.photo-frame-inner img.active{ opacity: 1; }

/* ---- Right column ---- */
.col-right{
  display: flex; align-items: center; position: relative; overflow: hidden;
  padding-left: 40px; min-width: 0;
}
.panel-stack{ position: relative; width: 100%; height: 100%; }
.panel{
  position: absolute; inset: 0;
  display: flex; align-items: center;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.panel.active{ opacity: 1; transform: translateY(0); pointer-events: auto; }

.panel-scroll{
  max-height: 100%; overflow-y: auto; width: 100%;
  padding-right: 6px; scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: var(--text-subtle) transparent;
}
.panel-scroll::-webkit-scrollbar{ width: 5px; }
.panel-scroll::-webkit-scrollbar-thumb{ background: var(--text-subtle); border-radius: 3px; }

.panel-body{ display: flex; flex-direction: column; gap: 22px; max-width: 340px; }

.panel-lede p{
  font-size: 16px; font-weight: 700; line-height: 1.4; margin: 0 0 10px;
}
.panel-lede .muted{
  font-size: 14px; font-weight: 400; color: var(--text-muted); line-height: 1.6; margin: 0;
}

.panel-heading{ display: flex; flex-direction: column; gap: 4px; }
.panel-heading .role{ font-size: 16px; font-weight: 600; margin: 0; }
.panel-heading .meta{ font-size: 12px; color: var(--text-muted); letter-spacing: 0.03em; }

.field-label{
  font-size: 11px; color: var(--text-muted); letter-spacing: 0.08em;
  text-transform: uppercase; display: block; margin-bottom: 8px;
}
.field-block p, .field-block li{
  font-size: 14px; font-weight: 400; color: var(--text-desc); line-height: 1.55;
  margin: 0; max-width: 260px;
}
.field-block ul{ list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.field-block ul li::before{ content: "— "; color: var(--text-subtle); }

.tag-row{ display: flex; flex-wrap: wrap; gap: 6px 10px; }
.tag-row span{
  font-size: 12px; color: var(--text-desc); background: rgba(0,0,0,0.04);
  padding: 4px 10px; border-radius: 5px;
}

.lang-list{ display: flex; flex-direction: column; gap: 8px; }
.lang-list .row{ display: flex; justify-content: space-between; gap: 16px; font-size: 14px; max-width: 300px; }
.lang-list .row .name{ font-weight: 600; }
.lang-list .row .level{ color: var(--text-muted); font-size: 12px; text-align: right; }

.chip-row{ display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row span{ font-size: 12px; color: var(--text-muted); border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px; }

.skill-groups{ display: flex; flex-direction: column; gap: 16px; }
.skill-group .name{ font-size: 12px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-bottom: 6px; }
.skill-group .items{ font-size: 14px; color: var(--text-desc); line-height: 1.6; }

.cert-list{ display: flex; flex-direction: column; gap: 10px; }
.cert-row{
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 16px; border: 1px solid var(--border); border-radius: 10px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.cert-row:hover{ border-color: var(--text-primary); background: rgba(0,0,0,0.025); transform: translateY(-1px); }
.cert-row .title-line{ display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cert-row .title-line a{
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  display: inline-flex; align-items: center; gap: 6px;
}
.cert-row .title-line a::after{ content: "↗"; font-size: 11px; color: var(--text-muted); transition: transform 0.2s ease; }
.cert-row:hover .title-line a::after{ transform: translate(2px, -2px); }
.cert-row .title-line span{ font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.cert-row .issuer{ font-size: 12px; color: var(--text-muted); }

.edu-list{ display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.edu-item .title-line{ font-size: 14px; font-weight: 600; }
.edu-item .school-line{ font-size: 12px; color: var(--text-muted); }
.edu-item .note{ font-size: 12px; color: var(--text-primary); margin-top: 2px; }

.modules-toggle{
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  border: 1px solid var(--text-primary); background: transparent; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; margin-top: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}
.modules-toggle:hover{ background: var(--text-primary); color: var(--bg); }
.modules-toggle::after{ content: "▾"; font-size: 10px; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.modules-toggle[aria-expanded="true"]::after{ transform: rotate(180deg); }
.modules-grid{
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px;
  font-size: 12px; color: var(--text-muted); margin-top: 14px;
  padding: 16px; background: rgba(0,0,0,0.03); border: 1px solid var(--border); border-radius: 12px;
}
.modules-grid[hidden]{ display: none; }
.modules-grid .code{ color: var(--text-primary); font-weight: 600; margin-right: 4px; }

/* ---- Timeline (experience) ---- */
.timeline{ display: flex; flex-direction: column; gap: 30px; }
.tl-item{ position: relative; padding-left: 22px; }
.tl-item::before{
  content: ""; position: absolute; left: 4px; top: 6px; bottom: -30px; width: 1px;
  background: var(--border);
}
.tl-item:last-child::before{ display: none; }
.tl-dot{ position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--text-primary); }
.tl-head{ display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.tl-org{ font-size: 16px; font-weight: 700; border-bottom: 1px solid transparent; transition: border-color 0.2s ease; }
.tl-org:hover{ border-color: var(--text-primary); }
.tl-period{ font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.tl-role{ font-size: 13px; color: var(--text-muted); margin: 0 0 2px; }
.tl-location{ font-size: 11px; color: var(--text-subtle); letter-spacing: 0.03em; margin: 0 0 10px; }
.tl-org-desc{ font-size: 13px; color: var(--text-desc); line-height: 1.55; margin: 0 0 12px; max-width: 280px; }
.tl-content .field-block{ margin-bottom: 12px; }
.tl-content .field-block:last-child{ margin-bottom: 0; }
.tl-note{ font-size: 13px; color: var(--text-muted); font-style: italic; margin: 8px 0 0; }
.tl-journal-link{ font-style: normal; border-bottom: 1px solid var(--text-subtle); transition: border-color 0.2s ease, color 0.2s ease; }
.tl-journal-link:hover{ color: var(--text-primary); border-color: var(--text-primary); }

/* ---- Contact form ---- */
.contact-form{ display: flex; flex-direction: column; gap: 16px; max-width: 300px; }
.contact-form label{
  display: flex; flex-direction: column; gap: 7px; font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.contact-form input, .contact-form textarea{
  font-family: inherit; font-size: 14px; color: var(--text-primary); background: transparent;
  border: none; border-bottom: 1px solid var(--border); padding: 6px 2px 8px; resize: vertical;
  transition: border-color 0.2s ease;
}
.contact-form input:focus, .contact-form textarea:focus{ outline: none; border-color: var(--text-primary); }
.contact-form textarea{ min-height: 72px; font-family: inherit; }
.hp-field{ position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.btn-send{
  align-self: flex-start; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--bg); background: var(--text-primary); border: none; border-radius: 8px;
  padding: 11px 22px; cursor: pointer; margin-top: 2px;
  transition: opacity 0.2s ease, transform 0.15s ease;
}
.btn-send:hover:not(:disabled){ opacity: 0.82; }
.btn-send:disabled{ opacity: 0.5; cursor: default; }
.form-status{ font-size: 12px; margin: 0; min-height: 14px; }
.form-status.ok{ color: #3d7a4f; }
.form-status.err{ color: #b3402d; }

.contact-location{ font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 1px; }
.contact-location .label{ font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 400; }

.cv-links{ display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 4px; }
.cv-links a{
  font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--text-primary);
  padding-bottom: 1px; transition: opacity 0.2s ease;
}
.cv-links a:hover{ opacity: 0.6; }

/* ---- Medium desktop / tablet breathing room ---- */
@media (max-width: 1150px) and (min-width: 768px){
  .desktop-grid{ grid-template-columns: 25% 34% 41%; padding: 40px 32px; }
  .title-pane p{ font-size: 23px; }
  .panel-body{ max-width: 280px; }
  .col-right{ padding-left: 30px; }
}

/* ==========================================================================
   MOBILE LAYOUT
   ========================================================================== */

.mobile-layout{ display: none; }

@media (max-width: 767px){
  .desktop-layout{ display: none; }

  .mobile-layout{
    display: block;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    height: 100dvh;
    overflow-y: scroll;
  }

  .mobile-section{
    scroll-snap-align: start; scroll-snap-stop: always;
    min-height: 100dvh;
    padding: 78px 28px calc(env(safe-area-inset-bottom, 0px) + 56px);
    display: flex; flex-direction: column; justify-content: center;
    position: relative;
  }

  .mobile-section.intro{ justify-content: flex-start; }

  .mobile-photo{
    width: 84px; height: 84px; border-radius: 16px; overflow: hidden;
    margin-bottom: 20px; background: var(--frame);
  }
  .mobile-photo img{ width: 100%; height: 100%; object-fit: cover; object-position: top center; }

  .mobile-section h1{ font-size: 24px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
  .mobile-section .role-line{ font-size: 13px; color: var(--text-muted); letter-spacing: 0.04em; margin-bottom: 6px; }

  .mobile-section .panel-body{ max-width: none; gap: 18px; }

  .chevron{
    position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
    transform: translateX(-50%);
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    animation: chevronPulse 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  }
  @keyframes chevronPulse{
    0%, 100%{ transform: translateX(-50%) translateY(0); opacity: 0.5; }
    50%{ transform: translateX(-50%) translateY(5px); opacity: 1; }
  }

  .timeline{ gap: 26px; }
  .tl-item::before{ bottom: -26px; }
  .contact-form{ max-width: none; }
}

@media (max-width: 480px){
  .lang-switch{ top: 14px; right: 18px; }
  .journal-link{ bottom: 14px; right: 18px; font-size: 11px; }
}
