/* ============================================================
   Sebastian Bosman Portfolio — Design System
   Aesthetic reference: cursor.com
   ============================================================ */


/* ============================================================
   1. CSS Custom Properties
   ============================================================ */

:root {
  /* Colour tokens */
  --bg:             #0a0a0a;
  --surface:        #111111;
  --surface-hover:  #1a1a1a;
  --border:         #1e1e1e;
  --border-hover:   #333333;
  --text-primary:   #f0f0f0;
  --text-secondary: #888888;
  --text-muted:     #444444;
  --accent:         #ffffff;

  /* Typography */
  --font-main: 'Inter', sans-serif;
  --font-mono: 'Courier New', monospace;

  --text-label:  clamp(11px, 0.8vw, 13px);
  --text-base:   13px;
  --text-body:   clamp(15px, 1.1vw, 18px);
  --text-hero:   64px;

  /* Layout */
  --max-width:    900px;
  --radius:       8px;
  --radius-btn:   6px;

  /* Motion */
  --transition:   150ms ease;
  --fade:         400ms ease;
}


/* ============================================================
   2. Reset & Base
   ============================================================ */

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

.no-scroll {
  overflow: hidden;
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button {
  font-family: var(--font-main);
  cursor: pointer;
  background: none;
  border: none;
}

img {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}


/* ============================================================
   3. Layout Utilities
   ============================================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}


/* ============================================================
   4. Typography
   ============================================================ */

.text-hero {
  font-size: var(--text-hero);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.text-role {
  font-size: var(--text-label);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

.text-body {
  font-size: var(--text-body);
  line-height: 1.7;
  color: var(--text-secondary);
}

.text-label {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}


/* ============================================================
   5. Nav
   ============================================================ */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text-primary);
  transition: color var(--transition);
}

.nav-brand:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: var(--text-base);
  color: var(--text-secondary);
  transition: color var(--transition);
}

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


/* ============================================================
   6. Section Label
   ============================================================ */

.section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.section-label span {
  font-size: var(--text-label);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.section-rule {
  flex: 1;
  height: 1px;
  background-color: var(--border);
}


/* ============================================================
   7. Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: var(--text-base);
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font-main);
  line-height: 1;
}

.btn-pill {
  border-radius: 999px;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-outline:hover {
  border-color: var(--text-primary);
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Welcome screen CTA */
.btn-welcome-cta {
  width: 160px;
  display: block;
  margin: 0 auto;
}


/* ============================================================
   8. Cards
   ============================================================ */

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
  text-decoration: none;
  color: inherit;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--surface-hover);
}

.card-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.card-icon {
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
}

.card-title {
  font-size: clamp(13px, 1vw, 16px);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Projects grid — 2 columns */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Work grid — 2 columns (matches projects grid) */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}


/* ============================================================
   9. Image / Figma Placeholders
   ============================================================ */

.placeholder-image,
.placeholder-figma {
  width: 100%;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.placeholder-image span,
.placeholder-figma span {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-main);
}

.placeholder-image.wide,
.placeholder-figma.wide {
  min-height: 320px;
}


/* ============================================================
   10. BIOS Boot Sequence (Phase 1)
   ============================================================ */

#terminal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity var(--fade);
}

#terminal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 1;
}

#terminal.fade-out {
  opacity: 0;
  pointer-events: none;
}

.terminal-block {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.8;
  text-align: left;
  position: relative;
  z-index: 2;
  width: min(640px, 90vw);
}

.bios-line {
  display: block;
  color: #f0f0f0;
  white-space: pre;
}

.bios-ok {
  color: #f0f0f0;
}

.bios-cursor {
  display: inline-block;
  width: 9px;
  height: 15px;
  background: #f0f0f0;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.bios-progress-wrap {
  margin-top: 12px;
}

.bios-progress-label {
  display: block;
  color: #f0f0f0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  margin-bottom: 4px;
}

.bios-progress-bar {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #f0f0f0;
  white-space: pre;
}


/* ============================================================
   11. Welcome Modal (Phase 3)
   ============================================================ */

#welcome {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--fade);
}

#welcome.visible {
  pointer-events: auto;
}

#welcome::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 1;
}

#welcome.visible {
  opacity: 1;
}

#welcome.fade-out {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  position: relative;
  z-index: 2;
  background: #0d0d0d;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  padding: 48px;
  width: fit-content;
  min-width: 360px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-heading {
  font-family: var(--font-main);
  font-size: 28px;
  font-weight: 300;
  color: #f0f0f0;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.modal-subline {
  font-family: var(--font-main);
  font-size: 11px;
  color: #f0f0f0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-divider {
  width: 100%;
  height: 1px;
  background: #1e1e1e;
  margin: 24px 0;
}

.modal-props {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
  width: 100%;
  text-align: left;
}

.modal-props p {
  font-family: var(--font-main);
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-cta {
  display: block;
  width: 100%;
  background: #f0f0f0;
  color: #0a0a0a;
  font-family: var(--font-main);
  font-size: var(--text-base);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  border-radius: 2px;
  padding: 14px;
  cursor: pointer;
}


/* ============================================================
   12. Toast Notification
   ============================================================ */

.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999;
  background: #111111;
  border: 1px solid #333333;
  border-radius: 6px;
  padding: 12px 20px;
  font-family: var(--font-main);
  font-size: var(--text-base);
  color: #f0f0f0;
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
}

.toast-visible {
  opacity: 1;
  transition: opacity 150ms ease;
}

.toast:not(.toast-visible) {
  transition: opacity 300ms ease;
}


/* ============================================================
   13. Portfolio Page
   ============================================================ */

#portfolio {
  opacity: 0;
  transition: opacity var(--fade);
  padding-top: 52px; /* nav height offset */
}

#portfolio.visible {
  opacity: 1;
}

/* Portfolio header */
.portfolio-header {
  padding: 80px 0 64px;
  margin-bottom: 0;
}

.portfolio-header .header-role {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: center;
}

.portfolio-header .header-name {
  font-size: clamp(48px, 6vw, 96px);
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  line-height: 1.05;
  text-align: center;
}

.portfolio-header .header-props {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.portfolio-header .header-props-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: fit-content;
}

.portfolio-header .header-props p {
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: left;
}

.portfolio-header .btn-group {
  justify-content: center;
}

/* About section */
.about-section {
  padding: 64px 0;
  margin-bottom: 64px;
}

.about-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 64px;
  align-items: start;
}

.about-bio {
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.8;
  color: var(--text-secondary);
  font-style: italic;
}

.about-competencies-label {
  font-size: var(--text-base);
  color: var(--text-primary);
  margin-bottom: 16px;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 12px;
  color: var(--text-primary);
  background: #1a1a1a;
  border: 1px solid #333333;
  border-radius: 999px;
  padding: 6px 14px;
  line-height: 1;
}

/* Portfolio sections */
.portfolio-section {
  padding-bottom: 72px;
}

.portfolio-section + .portfolio-section {
  padding-top: 0;
}


/* ============================================================
   13. Project Pages
   ============================================================ */

.project-page {
  padding-top: 52px; /* nav height offset */
}

.project-hero {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.project-title {
  font-size: clamp(32px, 4vw, 64px);
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 24px;
}

.project-description {
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.project-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 32px;
  margin-right: 32px;
  border-right: 1px solid var(--border);
}

.project-meta-item:last-child {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}

.project-meta-label {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.project-meta-value {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* Project section */
.project-section {
  padding-bottom: 64px;
}

.project-section-content {
  padding-top: 8px;
}

.project-section-content p {
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.project-section-content p:last-child {
  margin-bottom: 0;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: 48px;
  margin-bottom: 80px;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--text-primary);
}

.back-link::before {
  content: '←';
}


/* ============================================================
   14. Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-text {
  font-size: var(--text-base);
  color: var(--text-muted);
}


/* ============================================================
   15. Utility Classes
   ============================================================ */

.opacity-0   { opacity: 0; }
.opacity-1   { opacity: 1; }
.hidden      { display: none !important; }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }
.gap-24      { gap: 24px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mt-32       { margin-top: 32px; }
.mt-48       { margin-top: 48px; }
.mt-64       { margin-top: 64px; }
.mb-8        { margin-bottom: 8px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.mb-32       { margin-bottom: 32px; }
.mb-48       { margin-bottom: 48px; }
.mb-64       { margin-bottom: 64px; }


/* ============================================================
   16. Responsive Breakpoints
   ============================================================ */

/* Large screens: 1440px+ */
@media (min-width: 1440px) {
  :root {
    --max-width: 1200px;
  }

  .work-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* Extra large screens: 1920px+ */
@media (min-width: 1920px) {
  :root {
    --max-width: 1400px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 560px));
    justify-content: center;
  }
}

/* Tablet: 768–1024px */
@media (max-width: 1024px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: <768px */
@media (max-width: 767px) {
  :root {
    --text-hero: 44px;
  }

  .portfolio-header .header-name {
    font-size: clamp(36px, 10vw, 48px);
    text-align: left;
  }

  .portfolio-header .header-role {
    text-align: left;
  }

  .nav-links {
    display: none;
  }

  .projects-grid,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

  .project-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .project-meta-item {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
  }

  .btn-group {
    flex-direction: column;
    align-items: flex-start;
  }


  .site-footer .container {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
