@font-face {
  font-family: 'Breton';
  src: url('../assets/fonts/Breton.woff2') format('opentype');
  font-weight: normal; font-style: normal; font-display: block;
}
@font-face {
  font-family: 'other';
  src: url('../assets/fonts/Machine.otf') format('opentype');
  font-weight: normal; font-style: normal; font-display: block;
}
@font-face {
  font-family: 'Zirena';
  src: url('../assets/fonts/Zirena.woff2') format('woff2');
  font-weight: normal; font-style: normal; font-display: block;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { width: 100%; height: 100%; overflow: hidden; scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  width: 100%; height: 100vh; overflow: hidden;
  background: #0a0a0a; color: #f0f0f0;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

.cb-canvas {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
}
.cb-vignette {
  position: fixed; inset: 0;
  z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, rgba(10,10,10,0.25) 0%, rgba(10,10,10,0) 25%, rgba(10,10,10,0) 75%, rgba(10,10,10,0.35) 100%);
}
.intro-overlay {
  position: fixed; inset: 0;
  background: #0a0a0a;
  z-index: 9999;
  pointer-events: none;
}

.cb-layout {
  position: fixed; inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 300px 1fr;
  opacity: 0;
}

.cb-panel {
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  background: rgba(10,10,10,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.cb-panel::-webkit-scrollbar { display: none; }

.cb-panel-top {
  padding: 2rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.cb-iut-logo {
  width: 90px;
  height: auto;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  margin-bottom: 0.25rem;
}

.cb-profile {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.cb-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  max-height: 50vh;
  overflow: hidden;
  background: #111;
}
.cb-photo {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  -webkit-user-drag: none; user-select: none;
}
.frame-corner {
  position: absolute; width: 14px; height: 14px;
  z-index: 5; pointer-events: none;
}
.frame-corner::before, .frame-corner::after {
  content: ''; position: absolute; background: #fff;
}
.frame-corner::before { width: 1px; height: 100%; left: 50%; transform: translateX(-50%); }
.frame-corner::after  { height: 1px; width: 100%; top: 50%; transform: translateY(-50%); }
.frame-corner.tl { top: 8px; left: 8px; }
.frame-corner.tr { top: 8px; right: 8px; }
.frame-corner.bl { bottom: 8px; left: 8px; }
.frame-corner.br { bottom: 8px; right: 8px; }

.cb-profile-name {
  font-family: 'Breton', sans-serif;
  font-size: 1.2rem;
  color: #f0f0f0;
  line-height: 1.1;
}
.cb-profile-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-top: 0.1rem;
}

.cb-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.cb-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  text-align: left; text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cb-btn:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.22);
}
.cb-btn--active {
  background: rgba(255,255,255,0.07);
  color: #f0f0f0;
  border-color: rgba(255,255,255,0.28);
}
.cb-btn-icon { opacity: 0.55; font-size: 0.75rem; flex-shrink: 0; }

.cb-nav {
  margin-top: auto;
  padding: 0 1.5rem 2rem;
}
.cb-nav-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.56rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 0.15rem;
}
.cb-year-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  background: transparent; border: none;
  color: rgba(255,255,255,0.65);
  font-family: 'Breton', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color 0.2s;
}
.cb-year-btn:hover { color: #f0f0f0; }
.cb-year-item.open > .cb-year-btn {
  color: #f0f0f0;
  border-bottom-color: transparent;
}
.cb-chevron {
  font-size: 0.6rem;
  transition: transform 0.28s cubic-bezier(0.87,0,0.13,1);
  opacity: 0.4;
}
.cb-year-item.open .cb-chevron { transform: rotate(90deg); opacity: 1; }

.cb-comps-list {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.38s cubic-bezier(0.87, 0, 0.13, 1),
              opacity 0.28s ease;
  opacity: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 0.15rem;
}
.cb-comps-list-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  transition: padding-bottom 0.38s cubic-bezier(0.87, 0, 0.13, 1);
}
.cb-year-item.open .cb-comps-list {
  grid-template-rows: 1fr;
  opacity: 1;
}
.cb-year-item.open .cb-comps-list-inner {
  padding-bottom: 0.35rem;
}

.cb-comp-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.48rem 0.5rem 0.48rem 0.85rem;
  background: transparent; border: none;
  border-left: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  text-align: left; cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.cb-comp-btn:hover {
  color: rgba(255,255,255,0.82);
  border-left-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.03);
}
.cb-comp-btn.active {
  color: #f0f0f0;
  border-left-color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.05);
}

.grade-callout {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  margin-bottom: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.grade-callout-score {
  font-family: 'Zirena', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #f0f0f0;
  line-height: 1;
}
.grade-callout-max {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.1em;
}

.cb-content {
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.cb-content::-webkit-scrollbar { width: 4px; }
.cb-content::-webkit-scrollbar-track { background: transparent; }
.cb-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.cb-welcome {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: clamp(2rem, 6vw, 5rem) clamp(2rem, 7vw, 6rem);
}
.cb-welcome-inner {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}
.cb-welcome-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}
.cb-welcome-title {
  font-family: 'Breton', sans-serif;
  font-size: clamp(2.4rem, 4.5vw, 4.2rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: #f0f0f0;
}
.cb-welcome-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-top: -0.7rem;
}
.cb-welcome-desc {
  font-family: 'Breton', sans-serif;
  font-size: clamp(0.9rem, 1.05vw, 1.05rem);
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
}
.cb-welcome-desc em { font-style: italic; color: rgba(255,255,255,0.55); }
.cb-welcome-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem; line-height: 1.65;
  color: rgba(255,255,255,0.45);
}
.cb-notice-icon { opacity: 0.55; flex-shrink: 0; margin-top: 0.1rem; }
.cb-welcome-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.cb-link-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cb-link-btn:hover {
  background: rgba(255,255,255,0.07);
  color: #f0f0f0;
  border-color: rgba(255,255,255,0.38);
}

.cb-comp-view {
  display: none;
  padding: clamp(2.5rem, 5vh, 4rem) clamp(2rem, 7vw, 5rem) max(6rem, 30vh);
  max-width: 900px;
}
.cb-comp-meta {
  font-family: 'Machine', sans-serif;
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.22em; 
  color: rgba(255,255,255,0.35);
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cb-loading {
  padding: 3rem 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.25);
}

.cb-markdown {
  font-family: 'Breton', sans-serif;
  font-size: clamp(0.95rem, 1.05vw, 1.05rem);
  line-height: 1.78;
  color: rgba(255,255,255,0.82);
}
.cb-markdown h1 {
  font-family: 'Zirena', sans-serif;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  color: #f0f0f0;
  margin-bottom: 2.5rem;
}
.cb-markdown h2 {
  font-family: 'Zirena', sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-size: clamp(1.3rem, 2vw, 1.85rem);
  color: #f0f0f0;
  margin-top: 5rem;
  margin-bottom: 1.2rem;
}
.cb-markdown h2:first-child { margin-top: 0; }
.cb-markdown h3 {
  font-family: 'Zirena', sans-serif;
  font-weight: 800;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.45);
  margin-top: 2.2rem;
  margin-bottom: 0.75rem;
}
.cb-markdown p { margin-bottom: 1.1rem; }
.cb-markdown p:last-child { margin-bottom: 0; }
.cb-markdown strong {
  color: #f0f0f0;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  font-size: 0.88em;
}
.cb-markdown em { font-style: italic; color: rgba(255,255,255,0.6); }
.cb-markdown a {
  color: rgba(255,255,255,0.7);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.cb-markdown a:hover { color: #f0f0f0; }
.cb-markdown ul, .cb-markdown ol {
  padding-left: 1.5rem; margin-bottom: 1.1rem;
}
.cb-markdown li { margin-bottom: 0.4rem; }
.cb-markdown hr { display: none; }
.cb-markdown code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.83em;
  background: rgba(255,255,255,0.07);
  padding: 0.15em 0.45em;
  border-radius: 2px;
  color: rgba(255,255,255,0.8);
}
.cb-markdown pre {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 1.2rem 1.4rem;
  overflow-x: auto; margin-bottom: 1.5rem;
  border-radius: 1px;
}
.cb-markdown pre code { background: none; padding: 0; font-size: 0.88rem; }
.cb-markdown figure {
  margin: 2rem 0;
}
.cb-markdown figure img {
  max-width: 100%; display: block;
  border: 1px solid rgba(255,255,255,0.07);
}
.cb-markdown figure figcaption {
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  padding-top: 0.6rem;
}
.cb-markdown img {
  max-width: 100%; display: block;
  border: 1px solid rgba(255,255,255,0.07);
  margin: 1.5rem 0;
  border-radius: 8px;
}
.cb-markdown blockquote {
  border-left: 2px solid rgba(255,255,255,0.15);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  color: rgba(255,255,255,0.55);
  font-style: italic;
}

@media (max-width: 860px) {
  .cb-layout {
    position: relative;
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }
  .cb-panel {
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .cb-photo-wrap { max-height: 35vh; }
  .cb-nav { margin-top: 0; }
  .cb-content { height: auto; min-height: 50vh; overflow-y: visible; }
  .cb-welcome { min-height: 50vh; }
  .cb-comp-view { padding: 2rem 1.5rem 4rem; }
}

.md-img-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  align-items: start;
  margin: 1.5rem 0;
}
.md-img-row p {
  margin: 0;
}
.md-img-row p img,
.cb-markdown p.md-img-multi img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
  border: 1px solid rgba(255,255,255,0.07);
}
.cb-markdown p.md-img-multi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  align-items: start;
  margin: 1.5rem 0;
}

.cb-markdown img {
  cursor: zoom-in;
}

.cb-lightbox {
  position: fixed; inset: 0;
  z-index: 99999;
  background: rgba(10,10,10,0);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.35s ease, backdrop-filter 0.35s ease;
}
.cb-lightbox.open {
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cb-lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: min(90vw, 1200px);
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), opacity 0.3s ease;
  cursor: default;
}
.cb-lightbox.open .cb-lightbox-inner {
  transform: scale(1);
  opacity: 1;
}
.cb-lightbox-inner img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  cursor: default;
  border: 1px solid rgba(255,255,255,0.07);
}
.cb-lightbox-caption {
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  text-align: center;
}

.md-file-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.65) !important;
  text-decoration: none !important;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  vertical-align: middle;
}
.md-file-link::before {
  content: '↓';
  opacity: 0.6;
  font-size: 0.8em;
}
.md-file-link:hover {
  background: rgba(255,255,255,0.08);
  color: #f0f0f0 !important;
  border-color: rgba(255,255,255,0.28);
}
.md-file-link code {
  background: none;
  padding: 0;
  font-family: 'Courier New', monospace;
  font-size: 1em;
  color: inherit;
}

.github-card {
  display: block;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  text-decoration: none !important;
  color: inherit;
  transition: background 0.2s, border-color 0.2s;
  margin: 0.5rem 0 1rem;
}
.github-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.22);
}
.github-card-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.github-card-icon {
  opacity: 0.6;
  flex-shrink: 0;
  width: 14px; height: 14px;
}
.github-card-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem; font-weight: 700;
  color: #f0f0f0;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.github-card-arrow {
  font-size: 0.75rem;
  opacity: 0.4;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.github-card:hover .github-card-arrow { opacity: 0.8; }
.github-card-desc {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.5);
  margin: 0 0 0.65rem;
}
.github-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.github-card-lang,
.github-card-stars,
.github-card-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
}
.github-card-lang {
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(255,255,255,0.1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
