/* ================================================
   THOUGHT CABINET — Portfolio Stylesheet
   Inspired by Disco Elysium's Thought Cabinet UI

   HOW TO RETHEME:
   - Change colors in the ":root" block below.
   - Change fonts in the ":root" block below.
   - Section headings (e.g. "CARD GRID") mark each
     component so you can find and edit it quickly.
   ================================================ */


/* ================================================
   CSS CUSTOM PROPERTIES
   Edit this block to retheme the entire site.
   ================================================ */
:root {
  /* Background and text */
  --color-bg:           #222222;
  --color-surface:      #1a1a1a;
  --color-border:       #393734;
  --color-text:         #cfd5bf;
  --color-text-muted:   #9c9686;

  /* Disco Elysium skill-attribute colors */
  --color-intellect:    #5cc1d7;   /* blue-teal  — Skills, Education  */
  --color-psyche:       #7556cf;   /* purple     — About, Certs        */
  --color-physique:     #cb476a;   /* red-pink   — Experience          */
  --color-motorics:     #e3b734;   /* amber      — Projects            */
  --color-grey:         #9c9686;   /* neutral    — Contact             */

  /* Typography */
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;

  /* Layout */
  --panel-width:  640px;
  --grid-gap:     0.75rem;
  --page-padding: 2.5rem;

  /* Global text scale — increase to make all text larger.
     1 = 16px base, 1.1 = 17.6px base, 1.2 = 19.2px base etc.
     All rem values in the file scale with this automatically. */
  --scale: 1.2;
}


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

html {
  font-size: calc(16px * var(--scale));
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
}

ul {
  list-style: none;
}


/* ================================================
   CABINET SCREEN (page wrapper)
   Applies the ruled-paper background from disco.css.
   Center-constrained; padding keeps content clear
   of the vertical margin lines.
   ================================================ */
.cabinet-screen {
  /*
    Ruled-paper background: creates subtle vertical
    margin lines on left and right edges.
    Source: disco.css (#workskin background).
  */
  background-image:
    repeating-linear-gradient(180deg, #939593 0, #939593 1.25em, transparent 0, transparent 1.75cm),
    repeating-linear-gradient(180deg, #5d6163 0, #545758 2px,    transparent 0, transparent .5cm),
    linear-gradient(90deg,  #616364 0, #616364 .75em, transparent .75em),
    linear-gradient(270deg, #616364 0, #616364 .75em, transparent .75em),
    repeating-linear-gradient(180deg, #393734 0, #393734 2px, transparent 0, transparent 2.5cm),
    repeating-linear-gradient(180deg, #393734 0, #393734 2px, transparent 0, transparent .5cm);
  background-position: 100% 0, 0 20px, 0 0, 0 0, 0 10px, 0 10px;
  background-size:     .2em 100%, .3em 100%, 100% 100%, 100% 100%, 2.25em 100%, 1.2em 100%;
  background-repeat:   no-repeat;

  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem var(--page-padding) 5rem;
}


/* ================================================
   CABINET HEADER
   ================================================ */
.cabinet-header {
  text-align: center;
  padding: 2rem 0 1.75rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.header-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.header-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  line-height: 1.1;
}

.header-sub {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--color-text);
  margin-top: 0.5rem;
  letter-spacing: 0.04em;
}

.header-contacts {
  margin-top: 0.85rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.header-contacts a {
  color: var(--color-text-muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

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


/* ================================================
   FILTER TABS
   ================================================ */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}

.filter-tab {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.filter-tab:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

/* Active tab fills with the category color */
.filter-tab.active {
  background:   var(--tab-color, var(--color-text-muted));
  border-color: var(--tab-color, var(--color-text-muted));
  color: var(--color-bg);
}

/* Map each category to its accent color */
.filter-tab[data-category="about"].active          { --tab-color: var(--color-psyche);    }
.filter-tab[data-category="skills"].active         { --tab-color: var(--color-intellect); }
.filter-tab[data-category="projects"].active       { --tab-color: var(--color-motorics);  }
.filter-tab[data-category="experience"].active     { --tab-color: var(--color-physique);  }
.filter-tab[data-category="education"].active      { --tab-color: var(--color-intellect); }
.filter-tab[data-category="certifications"].active { --tab-color: var(--color-intellect);    }
.filter-tab[data-category="contact"].active        { --tab-color: var(--color-grey);      }


/* ================================================
   CARD GRID
   .thought-grid is a vertical stack of .thought-section rows.
   Each section has a heading and its own .thought-section-cards
   sub-grid. Cards from different sections never mix in one row.
   ================================================ */
.thought-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.thought-section.hidden {
  display: none;
}

/* Section heading row */
.thought-section-header {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--section-color, var(--color-text-muted));
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--section-color, var(--color-border));
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.thought-section-header::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--section-color, var(--color-text-muted));
  flex-shrink: 0;
}

/* Cards sub-grid — only cards within one section */
.thought-section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--grid-gap);
}


/* ================================================
   THOUGHT CARD

   Category accent color is set per-card via the
   --card-color CSS variable (see category rules below).
   ================================================ */
.thought-card {
  background: rgba(26, 26, 26, 0.9);
  border: 1px solid var(--color-border);
  border-bottom: 2px solid var(--card-color, var(--color-border));
  padding: 0.9rem 1rem 2rem;  /* extra bottom padding for status badge */
  cursor: pointer;
  position: relative;
  user-select: none;

  /* Suppress the default grey tap flash — replaced with our own :active style */
  -webkit-tap-highlight-color: transparent;

  /* Entrance animation — JS adds .visible to trigger */
  opacity: 0;
  transform: translateY(6px);
}

.thought-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    border-color 0.15s,
    box-shadow 0.15s;
}

.thought-card:hover,
.thought-card:active {
  border-color: var(--card-color, var(--color-text-muted));
  box-shadow: 0 0 12px -3px var(--card-color, transparent);
  transform: translateY(-2px);
}

/* Category accent colors */
.thought-card[data-category="about"]          { --card-color: var(--color-psyche);    }
.thought-card[data-category="skills"]         { --card-color: var(--color-intellect); }
.thought-card[data-category="projects"]       { --card-color: var(--color-motorics);  }
.thought-card[data-category="experience"]     { --card-color: var(--color-physique);  }
.thought-card[data-category="education"]      { --card-color: var(--color-intellect); }
.thought-card[data-category="certifications"] { --card-color: var(--color-intellect);    }
.thought-card[data-category="contact"]        { --card-color: var(--color-psyche);      }

/* Hidden state (filter) */
.thought-card.hidden {
  display: none;
}

/* ---- Card internals ---- */

.card-category-badge {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--card-color, var(--color-text-muted));
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Colored dot before the badge label */
.card-category-badge::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--card-color, var(--color-text-muted));
  flex-shrink: 0;
}

.card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.card-subtitle {
  font-size: 0.74rem;
  color: var(--color-text-muted);
  line-height: 1.35;
}

.card-status {
  position: absolute;
  bottom: 0.7rem;
  right: 0.85rem;
  font-family: var(--font-display);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--card-color, var(--color-text-muted));
  opacity: 0.65;
}


/* ================================================
   DETAIL PANEL OVERLAY
   Fixed full-viewport overlay. Click outside the
   panel (on the dim layer) to close.
   ================================================ */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 200;
  pointer-events: none;
  transition: background 0.25s;
}

.detail-overlay.open {
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

/* ---- Sliding panel ---- */
.detail-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--panel-width);
  max-width: 100vw;
  height: 100%;
  background: var(--color-surface);
  border-left: 2px solid var(--panel-accent, var(--color-border));
  padding: 2rem 1.5rem 2.5rem;
  overflow-y: auto;

  /* Slide in/out */
  transform: translateX(100%);
  transition: transform 0.3s ease, border-color 0.2s;
}

.detail-overlay.open .detail-panel {
  transform: translateX(0);
}

/* ---- Close button ---- */
.detail-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 2px solid var(--color-text);
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
  width: 2.2rem;
  height: 2.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.detail-close:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ---- Panel content ---- */

.detail-category {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--panel-accent, var(--color-text-muted));
  margin-bottom: 0.4rem;
  margin-top: 0.25rem;
}

.detail-status {
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--panel-accent, var(--color-border));
  color: var(--panel-accent, var(--color-text-muted));
  margin-bottom: 1rem;
}

.detail-name {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
  line-height: 1.15;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--panel-accent, var(--color-border));
  margin-bottom: 0.5rem;
}

.detail-subtitle {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0.6rem 0 1rem;
  line-height: 1.4;
}

.detail-body {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.detail-bullets {
  margin-bottom: 1rem;
}

.detail-bullets li {
  font-size: 0.85rem;
  color: var(--color-text);
  padding: 0.3rem 0 0.3rem 1.4rem;
  position: relative;
  line-height: 1.5;
  border-bottom: 1px solid #2a2a2a;
}

.detail-bullets li:last-child {
  border-bottom: none;
}

/* Sub-bullet: slightly indented with a smaller dash */
.detail-bullets li.sub {
  padding-left: 2.6rem;
  color: var(--color-text);
  font-size: 0.81rem;
}

.detail-bullets li.sub::before {
  content: '·';
  left: 1.4rem;
}

.detail-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--panel-accent, var(--color-text-muted));
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.detail-links a {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--panel-accent, var(--color-text-muted));
  text-decoration: none;
  border: 1px solid var(--panel-accent, var(--color-border));
  padding: 0.35rem 0.8rem;
  transition: background 0.15s, color 0.15s;
}

.detail-links a:hover {
  background: var(--panel-accent, var(--color-border));
  color: var(--color-bg);
}


/* ================================================
   FOOTER / CREDITS
   Static block below the card grid.
   Edit links directly in index.html.
   ================================================ */
.cabinet-footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cabinet-footer p {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.cabinet-footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

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


/* ================================================
   ACCESSIBILITY — focus rings
   ================================================ */
.thought-card:focus-visible,
.filter-tab:focus-visible,
.detail-close:focus-visible,
.detail-links a:focus-visible {
  outline: 2px solid var(--color-intellect);
  outline-offset: 2px;
}


/* ================================================
   RESPONSIVE BREAKPOINTS
   ================================================ */

/* Medium screens — narrower panel */
@media (max-width: 900px) {
  .cabinet-screen {
    --page-padding: 1.5rem;
  }

  .detail-panel {
    width: 360px;
  }
}

/* Small screens — single column grid, full-width panel */
@media (max-width: 600px) {
  .cabinet-screen {
    --page-padding: 0.85rem;
  }

  .thought-section-cards {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    width: 100vw;
    border-left: none;
    border-top: 2px solid var(--panel-accent, var(--color-border));
  }

  .header-contacts {
    flex-direction: column;
    gap: 0.4rem;
  }
}
