/* ══════════════════════════════════════════════
   BAUHAUS DESIGN SYSTEM — Dario Toman
   ══════════════════════════════════════════════ */

/* ── Sequel Rounded @font-face ── */
@font-face {
  font-family: 'Sequel Rounded';
  src: url('/fonts/ogj-type-design-sequel-rounded-extended.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Sequel Rounded';
  src: url('/fonts/ogj-type-design-sequel-rounded-ex-text.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Bauhaus Primaries */
  --color-black:     #1A1A1A;
  --color-red:       #BE1E2D;
  --color-blue:      #1B3F8B;
  --color-yellow:    #F2C12E;
  --color-bg:        #F7F5F1;
  --color-white:     #FFFFFF;

  /* Neutrals */
  --color-gray:      #A0998C;
  --color-steel:     #4A4A4A;
  --color-parchment: #EDE8DF;

  /* Typography */
  --font-display: 'Sequel Rounded', 'Jost', system-ui, -apple-system, sans-serif;
  --font-sans:    'Jost', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Menlo', monospace;

  /* Spacing */
  --border-thick: 4px;
  --transition:   200ms ease-in-out;
}

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

/* ── Base ── */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-black);
  line-height: 1.7;
}

/* ── Accent Bar ── */
.accent-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 100vh;
  background: var(--color-red);
  z-index: 1000;
}

/* ── Container ── */
.site-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 40px 0 54px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════ */

.site-header {
  padding-top: 40px;
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 100;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
}

.site-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--color-black);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-square {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--color-red);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--color-steel);
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
  transition: color var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--color-red);
  transition: width var(--transition);
}

.nav-link:hover {
  color: var(--color-black);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: var(--color-black);
  font-weight: 700;
}

.nav-link.active::after {
  width: 100%;
}

.nav-rule {
  height: 3px;
  background: var(--color-black);
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-black);
  transition: var(--transition);
}

/* ══════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════ */

.site-main {
  flex: 1;
  padding: 48px 0;
}

/* ── Page Content ── */
.page-content {
  max-width: 700px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 32px;
}

.page-content h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-top: 24px;
  border-top: none;
  position: relative;
}

.page-content h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 12px;
  height: 3px;
  background: var(--color-black);
}

.page-content h2::after {
  content: '';
  position: absolute;
  top: -3px;
  right: 0;
  width: 9px;
  height: 9px;
  background: var(--color-red);
}

.page-content h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
}

.page-content h2:first-of-type::before,
.page-content h2:first-of-type::after {
  display: none;
}

.page-content h3 {
  font-size: 16px;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 12px;
}

.page-content p {
  margin-bottom: 16px;
}

.page-content a {
  color: var(--color-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
}

.page-content a:hover {
  color: var(--color-yellow);
  border-bottom-color: var(--color-yellow);
}

/* ── Code blocks ── */
.page-content pre {
  background: var(--color-white);
  color: var(--color-black);
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 20px;
  border-left: 3px solid var(--color-red);
  font-size: 13px;
  line-height: 1.6;
}

.page-content img {
  max-width: 100%;
  height: auto;
}

.page-content pre code {
  background: none;
  padding: 0;
  color: var(--color-black);
  font-family: 'JetBrains Mono', monospace;
  font-size: inherit;
}

.page-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: #E8E4DD;
  padding: 2px 6px;
}

/* ── Lists ── */
.page-content ul {
  list-style: none;
  margin-bottom: 16px;
}

.page-content ul li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}

.page-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  background: var(--color-blue);
}

/* Nested lists (teaching duties) */
.page-content ul ul {
  margin-top: 4px;
  margin-bottom: 0;
}

.page-content ul ul li::before {
  width: 5px;
  height: 5px;
  background: var(--color-gray);
}

/* ── Details / Abstracts ── */
.page-content details {
  margin: 12px 0 20px;
}

.page-content summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-steel);
  transition: color var(--transition);
  padding: 4px 0;
}

.page-content summary:hover {
  color: var(--color-black);
}

.page-content details[open] summary {
  margin-bottom: 12px;
}

.page-content details > p,
.page-content details > div {
  border-left: var(--border-thick) solid var(--color-yellow);
  padding: 12px 20px;
  font-size: 14px;
  color: var(--color-steel);
  line-height: 1.7;
  background: #FDFBF6;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 2px solid var(--color-black);
  background: transparent;
  color: var(--color-black);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn:hover {
  background: var(--color-black);
  color: var(--color-bg);
  border-bottom-color: var(--color-black);
}

.page-content .btn {
  border: 2px solid var(--color-black);
}

.page-content .btn:hover {
  border-bottom-color: var(--color-black);
}

/* ── PDF links (inline) ── */
.page-content .pdf-link {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-blue);
  border-bottom: 2px solid var(--color-blue);
  padding-bottom: 2px;
}

.page-content .pdf-link:hover {
  color: var(--color-yellow);
  border-bottom-color: var(--color-yellow);
}

/* ══════════════════════════════════════════════
   HOMEPAGE / PROFILE
   ══════════════════════════════════════════════ */

.profile-section {
  max-width: 700px;
}

.profile-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.profile-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 3;
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  margin-top: -40px;
}

.profile-avatar-wrap::before {
  content: '';
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 180px;
  background: var(--color-blue);
  border-radius: 50%;
  z-index: 0;
}

.profile-avatar-wrap::after {
  content: '';
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 999px var(--color-bg);
  z-index: 2;
  clip-path: inset(50% -999px -999px -999px);
}

.profile-avatar {
  position: relative;
  z-index: 1;
  width: 200px;
  height: auto;
  border-radius: 0;
  object-fit: cover;
  display: block;
  margin-left: -15px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.profile-role {
  font-size: 14px;
  color: var(--color-steel);
  margin-top: 4px;
}

.profile-contact {
  margin-top: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-contact a {
  color: var(--color-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
}

.profile-contact a:hover {
  border-bottom-color: var(--color-blue);
}

.profile-contact-sep {
  color: var(--color-gray);
}

.profile-divider {
  height: 3px;
  background: var(--color-black);
  margin-bottom: 24px;
}

.profile-bio {
  margin-bottom: 28px;
}

.profile-bio p {
  margin-bottom: 16px;
  max-width: 680px;
}

.profile-bio strong {
  font-weight: 700;
}

.profile-actions {
  margin-top: 8px;
}

/* ══════════════════════════════════════════════
   RESEARCH PAGE — Paper Cards
   ══════════════════════════════════════════════ */

.paper-card {
  margin-bottom: 28px;
}

.paper-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.page-content .paper-title a {
  color: var(--color-blue);
  text-decoration: none;
  border-bottom: none;
  transition: color var(--transition);
}

.page-content .paper-title a:hover {
  color: var(--color-yellow);
  border-bottom: none;
}

.paper-authors,
.paper-status,
.paper-card details {
  padding-left: 20px;
}

.paper-authors {
  font-size: 14px;
  color: #4A4A4A;
  margin-bottom: 4px;
}

.paper-status {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-red);
  margin-bottom: 8px;
}

.paper-card details {
  margin-top: 8px;
}

/* ══════════════════════════════════════════════
   CV PAGE
   ══════════════════════════════════════════════ */

.cv-embed {
  width: 100%;
  height: 1100px;
  border: none;
  margin-top: 16px;
  background: var(--color-white);
}

/* Native CV content */
.cv-native {
  margin-top: 32px;
}

.cv-subheading {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--color-steel);
}

.cv-list {
  list-style: none;
  margin-bottom: 12px;
}

.cv-list li {
  padding: 5px 0;
  padding-left: 0;
  position: relative;
}

.cv-list li::before {
  display: none;
}

.cv-list li ul {
  margin-top: 2px;
  margin-bottom: 0;
}

.cv-list li ul li {
  padding: 1px 0;
  padding-left: 16px;
  font-size: 14px;
  color: var(--color-steel);
}

.cv-list li ul li::before {
  display: none;
}

.cv-list--indent {
  padding-left: 20px;
}

.cv-list--compact li {
  padding: 2px 0;
}

.cv-list code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: none;
  padding: 0;
  color: var(--color-blue);
  font-weight: 500;
}

.cv-highlight {
  color: var(--color-blue);
  font-weight: 700;
}

.cv-paper {
  color: var(--color-blue);
  font-weight: 700;
}

.cv-status {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-red);
}

.cv-references {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 8px;
}

.cv-ref {
  font-size: 14px;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════
   TEACHING PAGE
   ══════════════════════════════════════════════ */

.page-content .course-list {
  list-style: none;
}

.page-content .course-list > li {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-parchment);
}

.page-content .course-list > li::before {
  display: none;
}

/* ══════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════ */

.site-footer {
  padding-bottom: 40px;
  margin-top: auto;
}

.footer-rule {
  height: 2px;
  background: var(--color-gray);
  margin-bottom: 16px;
}

.footer-content {
  font-size: 13px;
  color: var(--color-gray);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-content a {
  color: var(--color-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
}

.footer-content a:hover {
  border-bottom-color: var(--color-blue);
}

.footer-sep {
  color: var(--color-parchment);
}

/* ══════════════════════════════════════════════
   404 PAGE
   ══════════════════════════════════════════════ */

.error-page {
  text-align: left;
  padding: 80px 0;
}

.error-code {
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-red);
  line-height: 1;
  margin-bottom: 16px;
}

.error-subtitle {
  font-size: 17px;
  color: var(--color-gray);
  font-style: italic;
  margin-bottom: 24px;
}

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

@media (max-width: 640px) {
  .accent-bar {
    position: fixed;
    width: 100%;
    height: 4px;
    top: 0;
    left: 0;
  }

  .site-container {
    padding: 0 20px 0 20px;
  }

  .site-header {
    padding-top: 24px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 3px solid var(--color-black);
    z-index: 100;
  }

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

  .site-nav {
    position: relative;
  }

  .profile-layout {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .profile-avatar {
    width: 120px;
    height: auto;
  }

  .profile-avatar-wrap::before {
    width: 110px;
    height: 110px;
  }

  .profile-avatar-wrap::after {
    width: 110px;
    height: 110px;
  }

  .profile-avatar-wrap {
    margin-top: -20px;
  }

  .profile-name {
    font-size: 26px;
  }

  .page-title {
    font-size: 22px;
  }

  .cv-embed {
    height: 600px;
  }
}

/* ══════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════ */

@media print {
  .accent-bar,
  .site-header,
  .site-footer,
  .nav-toggle {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .site-container {
    max-width: none;
    padding: 0;
  }
}
