/*
  ══════════════════════════════════════════════════════════
  OYINLADE MOJOLA — PROFILE
  Wikipedia-Style Encyclopedia Layout
  Japanese Zen × Swiss Precision × Feminine Grace
  ══════════════════════════════════════════════════════════
*/

/* =====================
   DESIGN TOKENS
   ===================== */
:root {
  /* Colors - Warm Minimalist Feminine */
  --color-bg: #faf8f5;
  --color-surface: #ffffff;
  --color-text-primary: #2c2c2c;
  --color-text-secondary: #6b6b6b;
  --color-text-tertiary: #9a9a9a;
  --color-accent: #d4a5a5;
  --color-accent-dark: #b88888;
  --color-accent-muted: #e8d5d5;
  --color-accent-light: #f5ebe9;
  --color-border: #ebe7e3;
  --color-border-light: #f3f0ed;

  /* Typography */
  --font-display: 'Cormorant', Georgia, serif;
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;

  /* Layout */
  --sidebar-width: 240px;
  --content-max-width: 720px;
  --gap: 3rem;

  /* Animation */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] {
  --color-bg: #121010;
  --color-surface: #181615;
  --color-text-primary: #ece7e3;
  --color-text-secondary: #beb8b3;
  --color-text-tertiary: #938e88;
  --color-accent: #d4a5a5;
  --color-accent-dark: #c08e8e;
  --color-accent-muted: #3b2f2f;
  --color-accent-light: #241b1b;
  --color-border: #3a342f;
  --color-border-light: #2a2623;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  font-weight: 300;
  letter-spacing: 0.01em;
}

.page-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(to right, var(--color-accent), var(--color-accent-muted));
  z-index: 10000;
  box-shadow: var(--shadow-sm);
}

@keyframes progressGrow {
  from { width: 0; }
  to { width: 100%; }
}

.page-progress--animate { animation: progressGrow 1s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.page-progress--done { opacity: 0; transition: opacity var(--transition-base); }

.page-loader {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.page-loader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  opacity: 0;
  transform: translateY(10px);
  animation: loaderReveal var(--transition-slow) forwards;
}

.loader-line {
  width: 3px;
  height: 0;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-accent-muted));
  border-radius: 2px;
  animation: loaderBar 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.loader-initials {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-accent-dark);
  letter-spacing: 0.06em;
}

@keyframes loaderBar {
  from { height: 0; }
  to { height: 28px; }
}

@keyframes loaderReveal {
  to { opacity: 1; transform: translateY(0); }
}

::selection {
  background-color: var(--color-accent-muted);
  color: var(--color-text-primary);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* =====================
   TYPOGRAPHY
   ===================== */

/* --- Adaptive Typography System --- */

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-tertiary);
}

h4 {
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--color-text-primary);
}

p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
}

@media (max-width: 1024px) {
  h1 {
    font-size: clamp(2rem, 7vw, 3rem);
  }
  h2 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }
  h3 {
    font-size: 0.75rem;
  }
  h4 {
    font-size: 0.95rem;
  }
  p {
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: clamp(1.5rem, 8vw, 2.5rem);
  }
  h2 {
    font-size: clamp(1.25rem, 6vw, 1.5rem);
  }
  h3 {
    font-size: 0.7rem;
  }
  h4 {
    font-size: 0.9rem;
  }
  p {
    font-size: 0.9rem;
    line-height: 1.6;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.25rem;
  }
  h2 {
    font-size: 1rem;
  }
  h3 {
    font-size: 0.65rem;
  }
  h4 {
    font-size: 0.85rem;
  }
  p {
    font-size: 0.85rem;
    line-height: 1.5;
  }
}

/* --- End Adaptive Typography System --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: 1.3;
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-tertiary);
}

h4 {
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--color-text-primary);
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

/* =====================
   PAGE LAYOUT
   ===================== */
.page-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  gap: var(--gap);
  max-width: calc(var(--sidebar-width) * 2 + var(--content-max-width) + var(--gap) * 2);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  min-height: 100vh;
}

.page-container > * {
  min-width: 0;
}

.page-container img,
.page-container video,
.page-container canvas,
.page-container svg {
  max-width: 100%;
  height: auto;
}

.page-container pre {
  white-space: pre-wrap;
}

.page-container table {
  width: 100%;
  table-layout: fixed;
}

/* =====================
   LEFT SIDEBAR: TOC
   ===================== */
.sidebar-left {
  position: sticky;
  top: var(--space-lg);
  height: fit-content;
}

@media (max-width: 768px) {
  .sidebar-left {
    position: static;
    width: 100%;
    margin-bottom: var(--space-md);
  }
}

.toc {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: 2px;
  padding: var(--space-md);
}

.toc-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toc-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-tertiary);
}

.toc-header .theme-toggle-btn {
  width: 32px;
  height: 32px;
}

@media (max-width: 1024px) {
  .toc { display: none; }
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

@media (max-width: 768px) {
  .toc-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
  }
  .toc-link {
    padding: 0.5rem 0.5rem;
    font-size: 1rem;
  }
}

.toc-link {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  transition: all var(--transition-base);
  position: relative;
  padding-left: var(--space-sm);
}

.toc-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background-color: var(--color-accent);
  transition: height var(--transition-base);
  border-radius: 2px;
}

.toc-link:hover,
.toc-link.active {
  color: var(--color-text-primary);
}

.toc-link.active::before {
  height: 70%;
}

/* =====================
   MAIN CONTENT
   ===================== */
.main-content {
  max-width: var(--content-max-width);
  padding: 0 var(--space-md);
}

/* Profile Header */
.profile-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.profile-name {
  margin-bottom: var(--space-xs);
}

.profile-tagline {
  font-size: 1.125rem;
  color: var(--color-accent-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
}

.mobile-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-bg);
}

.nav-avatar { cursor: pointer; }

.mobile-nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
  touch-action: manipulation;
}

.theme-toggle-btn:hover {
  color: var(--color-accent-dark);
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.theme-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

/* Content Sections */
.content-section {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--color-border-light);
}

.content-section:last-of-type {
  border-bottom: none;
}

#overview.content-section {
  margin-bottom: 0;
  border-bottom: none;
}

/* Section Headers */
.section-header {
  margin-bottom: var(--space-xl);
  position: relative;
  padding-left: var(--space-md);
}

.section-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    var(--color-accent),
    var(--color-accent-muted)
  );
  border-radius: 2px;
}

.section-number {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-xs);
}

.section-title {
  margin-bottom: var(--space-xs);
}

.section-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-tertiary);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.03em;
}

/* Section Intro */
.section-intro {
  margin-bottom: var(--space-xl);
}

.lead-text {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.lead-text strong {
  color: var(--color-text-primary);
  font-weight: 500;
}

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

/* Subsections */
.subsection {
  margin-bottom: var(--space-xl);
}

.subsection:last-child {
  margin-bottom: 0;
}

.subsection-title {
  margin-bottom: var(--space-md);
}

/* Work Lists */
.work-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.work-item {
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.work-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.work-title {
  margin-bottom: 0.375rem;
  color: var(--color-text-primary);
  font-size: 1.0625rem;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.meta-tag {
  font-size: 0.875rem;
  color: var(--color-text-tertiary);
}

.meta-separator {
  color: var(--color-border);
  font-size: 0.75rem;
}

/* Body Text Blocks */
.body-text-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.body-text-block p {
  line-height: 1.8;
  color: var(--color-text-secondary);
}

/* Section Notes */
.section-note {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-light);
}

.section-note p {
  font-style: italic;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-year {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-accent-dark);
  line-height: 1;
}

.timeline-content {
  padding-top: 0.125rem;
}

.timeline-title {
  margin-bottom: 0.375rem;
  font-size: 1.0625rem;
  color: var(--color-text-primary);
}

.timeline-desc {
  font-size: 0.9375rem;
  color: var(--color-text-tertiary);
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-flow: dense;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  background-color: var(--color-surface);
  aspect-ratio: 3 / 4;
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.gallery-item:hover {
  box-shadow: var(--shadow-md);
}

.gallery-item--wide {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

.gallery-item--tall {
  grid-row: span 2;
  aspect-ratio: 3 / 5;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
  display: block;
  loading: lazy;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Footer */
.profile-footer {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-light);
  text-align: center;
}

.footer-text {
  font-size: 0.875rem;
  color: var(--color-text-tertiary);
}

/* =====================
   RIGHT SIDEBAR: PROFILE CARD
   ===================== */
.sidebar-right {
  position: sticky;
  top: var(--space-lg);
  height: fit-content;
}

@media (max-width: 768px) {
  .sidebar-right {
    position: static;
    width: 100%;
    margin-top: var(--space-md);
  }
}

.profile-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* Signature role/tagline */
.profile-signature {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}
.signature-role {
  font-family: var(--font-serif, var(--font-display, 'Cormorant'));
  font-size: 1rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.04em;
}

/* Status & Location */
.profile-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}
.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #2ecc71; /* success */
  animation: statusPulse 1.8s ease-in-out infinite;
}
.status-text {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-align: center;
}
@keyframes statusPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.9; }
  100% { transform: scale(1); opacity: 1; }
}
.location {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-text-secondary);
}
.location .icon {
  color: var(--color-text-tertiary);
}
.location-text {
  font-size: 0.875rem;
}

/* Stat Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}
.stat-card {
  border: 1px solid var(--color-border-light);
  border-radius: 2px;
  padding: 0.75rem;
  text-align: center;
  background: var(--color-bg);
}
.stat-value {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-text-primary);
}
.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
}

/* Hero Stats (main page striking presentation) */
.hero-stats {
  margin-top: var(--space-lg);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

#overview .hero-stats {
  border-bottom: none;
}

.hero-stats .stat-card--hero {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.hero-stats .stat-card--hero:not(:first-child) {
  border-left: 1px solid var(--color-border-light);
  padding-left: var(--space-md);
}

.hero-stats .stat-card--hero .stat-value {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
  line-height: 1;
}

.hero-stats .stat-card--hero .stat-value::after {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: var(--color-accent);
  margin-top: 0.4rem;
}

.hero-stats .stat-card--hero .stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stats .stat-card--hero:not(:first-child) {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--color-border-light);
    padding-top: var(--space-sm);
    margin-top: var(--space-sm);
  }
}

/* Facts with minimal icons */
.facts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
}
.fact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.fact-icon {
  width: 16px;
  height: 16px;
  color: var(--color-text-tertiary);
  display: inline-flex;
}
.fact-text {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  text-align: center;
}

/* Activity snippet */
.profile-activity {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}
.section-title-sm {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-sm);
}
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}
.activity-item .bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
}

/* Featured skills with dot meters */
.profile-featured-skills {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}
.featured-skill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0.25rem 0;
}
.skill-name {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}
.skill-meter, .lang-meter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background-color var(--transition-base), transform var(--transition-base);
}
.dot.filled {
  background: var(--color-text-primary);
  transform: scale(1.05);
}

/* Languages */
.profile-languages {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}
.language {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0.25rem 0;
}
.lang-name {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* Quote */
.profile-quote {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}
.quote-text {
  font-family: var(--font-serif, var(--font-display, 'Cormorant'));
  font-size: 1rem;
  color: var(--color-text-secondary);
}

/* Actions */
.profile-actions {
  padding: var(--space-md);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

@media (max-width: 768px) {
  .profile-actions {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: var(--space-sm);
  }
  .cv-btn {
    font-size: 1rem;
    padding: 1rem;
    width: 100%;
  }
}
.cv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}
.cv-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
  background-color: var(--color-accent-light);
}

/* Social Links */
.profile-social {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .profile-social {
    gap: 1.25rem;
    padding: var(--space-sm);
  }
  .social-link {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}

.social-link {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background-color: var(--color-bg);
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.social-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
  background-color: var(--color-accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Responsive tweaks for card */
@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .stat-cards { grid-template-columns: 1fr; }
}

/* Profile Image */
.profile-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--color-border-light);
  position: relative;
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  loading: lazy;
}

/* Availability pill overlay on image */
.availability-pill {
  position: absolute;
  left: 50%;
  bottom: 0.75rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
  z-index: 1;
  white-space: nowrap;
}

.availability-pill .status-text {
  font-weight: 500;
  color: var(--color-text-primary);
  font-size: 0.9375rem;
}

/* Profile Facts */
.profile-facts {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.facts-title {
  margin-bottom: var(--space-md);
}

.facts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.fact-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fact-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-tertiary);
}

.fact-value {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Profile Contact */
.profile-contact {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--color-surface);
  background-color: var(--color-text-primary);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.contact-btn:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.contact-btn svg {
  transition: transform var(--transition-base);
}

.contact-btn:hover svg {
  transform: translateX(3px);
}

.grid-toggle-btn {
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--color-text-primary);
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: var(--font-body);
}

.grid-toggle-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
  background-color: var(--color-accent-light);
}

/* Profile Skills */
.profile-skills {
  padding: var(--space-md);
}

.skills-title {
  margin-bottom: var(--space-md);
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.skill-tag:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
  background-color: var(--color-accent-light);
}

/* =====================
   GRID OVERLAY
   ===================== */
.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: 9999;
}

.grid-overlay.active {
  opacity: 1;
}

.grid-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    repeating-linear-gradient(
      to right,
      rgba(212, 165, 165, 0.12) 0px,
      rgba(212, 165, 165, 0.12) 1px,
      transparent 1px,
      transparent calc(100% / 12)
    );
}

/* =====================
   RESPONSIVE DESIGN
   ===================== */

/* --- Responsive Layout: Web, Tablet, Mobile --- */

/* Desktop (default) uses three columns for sidebars and main content */
.page-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
  gap: var(--gap);
  max-width: calc(var(--sidebar-width) * 2 + var(--content-max-width) + var(--gap) * 2);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  min-height: 100vh;
}

/* Large Tablets */
@media (max-width: 1200px) {
  .page-container {
    grid-template-columns: 200px 1fr 220px;
    gap: var(--space-lg);
  }
  .gallery-item--wide {
    grid-column: span 1;
  }
}

/* Tablets */
@media (max-width: 1024px) {
  .page-container {
    grid-template-columns: 1fr;
    padding: var(--space-md);
  }
  .sidebar-left {
    position: relative;
    top: 0;
    order: 1;
    margin-bottom: var(--space-lg);
  }
  .main-content {
    order: 2;
    padding: 0;
  }
  .sidebar-right {
    position: relative;
    top: 0;
    order: 3;
    margin-top: var(--space-lg);
  }
  .profile-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-md);
  }
  .profile-image {
    aspect-ratio: 1 / 1;
  }
  .profile-facts,
  .profile-contact,
  .profile-skills {
    border-bottom: none;
    border-right: 1px solid var(--color-border-light);
  }
  .profile-skills {
    border-right: none;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --space-xl: 2rem;
    --space-2xl: 3rem;
  }
  .page-container {
    padding: var(--space-sm);
  }
  .profile-header {
    margin-bottom: var(--space-xl);
  }
  .profile-name {
    font-size: 2.5rem;
  }
  .section-header {
    padding-left: var(--space-sm);
  }
  .timeline-item {
    grid-template-columns: 60px 1fr;
    gap: var(--space-sm);
  }
  .timeline-year {
    font-size: 1.25rem;
  }
  .gallery {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  .gallery-item--tall,
  .gallery-item--wide {
    grid-row: span 1;
    grid-column: span 1;
  }
  .profile-card {
    grid-template-columns: 1fr;
  }
  .profile-facts,
  .profile-contact,
  .profile-skills {
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
  }
  .profile-skills {
    border-bottom: none;
  }
  .gallery-item img {
    max-width: 100vw;
    height: auto;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
  .section-title {
    font-size: 1.5rem;
  }
  .toc {
    padding: var(--space-sm);
  }
  .work-item {
    padding-bottom: var(--space-sm);
  }
}

/* --- End Responsive Layout --- */

/* Large Tablets */
@media (max-width: 1200px) {
  .page-container {
    grid-template-columns: 200px 1fr 220px;
    gap: var(--space-lg);
  }

  .gallery-item--wide {
    grid-column: span 1;
  }
}

/* Tablets */
@media (max-width: 1024px) {
  .page-container {
    grid-template-columns: 1fr;
    padding: var(--space-md);
  }

  .sidebar-left {
    position: relative;
    top: 0;
    order: 1;
    margin-bottom: var(--space-lg);
  }

  .main-content {
    order: 2;
    padding: 0;
  }

  .sidebar-right {
    position: relative;
    top: 0;
    order: 3;
    margin-top: var(--space-lg);
  }

  .profile-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-md);
  }

  .profile-image {
    aspect-ratio: 1 / 1;
  }

  .profile-facts,
  .profile-contact,
  .profile-skills {
    border-bottom: none;
    border-right: 1px solid var(--color-border-light);
  }

  .profile-skills {
    border-right: none;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --space-xl: 2rem;
    --space-2xl: 3rem;
  }

  .page-container {
    padding: var(--space-sm);
  }

  .profile-header {
    margin-bottom: var(--space-xl);
  }

  .profile-name {
    font-size: 2.5rem;
  }

  .section-header {
    padding-left: var(--space-sm);
  }

  .timeline-item {
    grid-template-columns: 60px 1fr;
    gap: var(--space-sm);
  }

  .timeline-year {
    font-size: 1.25rem;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .gallery-item--tall,
  .gallery-item--wide {
    grid-row: span 1;
    grid-column: span 1;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .profile-facts,
  .profile-contact,
  .profile-skills {
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
  }

  .profile-skills {
    border-bottom: none;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .toc {
    padding: var(--space-sm);
  }

  .work-item {
    padding-bottom: var(--space-sm);
  }
}

/* =====================
   UTILITIES
   ===================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* Touch-friendly interactive elements */
button, .cv-btn, .contact-btn, .grid-toggle-btn {
  touch-action: manipulation;
  min-height: 44px;
}

/* Conditional resource loading for images (already using lazy loading) */
/* Notable Brands Marquee — Swiss minimal */
.brands-marquee {
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-md) 0;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-2xl);
}
.brands-marquee .marquee {
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}
.brands-marquee .marquee-track {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  white-space: nowrap;
  will-change: transform;
  animation: marquee-linear 24s linear infinite;
}
.brands-marquee .brand-name {
  font-family: var(--font-sans, "Inter", system-ui, -apple-system, sans-serif);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.brands-marquee .brand-sep {
  color: var(--color-border);
}

/* Edge fades to soften clipping */
.brands-marquee .marquee::before,
.brands-marquee .marquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 64px;
  pointer-events: none;
}
.brands-marquee .marquee::before {
  left: 0;
  background: linear-gradient(to right, var(--color-bg), rgba(250, 248, 245, 0));
}
.brands-marquee .marquee::after {
  right: 0;
  background: linear-gradient(to left, var(--color-bg), rgba(250, 248, 245, 0));
}

@keyframes marquee-linear {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Pause on hover for accessibility */
.brands-marquee .marquee:hover .marquee-track {
  animation-play-state: paused;
}

/* Reduced motion: no animation, allow manual horizontal scroll */
@media (prefers-reduced-motion: reduce) {
  .brands-marquee .marquee {
    overflow-x: auto;
  }
  .brands-marquee .marquee-track {
    animation: none;
  }
}

/* Section image marquee */
.section-media-marquee {
  margin: 0.75rem 0 1.5rem;
}

.media-marquee {
  position: relative;
  overflow: hidden;
}

.media-marquee::before,
.media-marquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 56px;
  pointer-events: none;
  z-index: 2;
}

.media-marquee::before {
  left: 0;
  background: linear-gradient(to right, var(--color-bg), transparent);
}

.media-marquee::after {
  right: 0;
  background: linear-gradient(to left, var(--color-bg), transparent);
}

.media-track {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  will-change: transform;
  animation: media-marquee-linear 28s linear infinite;
}

.media-marquee:hover .media-track {
  animation-play-state: paused;
}

/* Uniform image heights for seamless track */
.section-media-marquee .media-item {
  height: clamp(96px, 18vw, 144px);
  width: auto;
  display: block;
}

.media-item {
  height: 140px;
  width: auto;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: cover;
  background: #d9d9d9;
}

@keyframes media-marquee-linear {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Reduced-motion fallback: disable animation, allow manual scroll */
@media (prefers-reduced-motion: reduce) {
  .media-track {
    animation: none;
    transform: none;
  }
  .media-marquee {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .media-item {
    scroll-snap-align: start;
  }
}
/* Disable marquee fade overlays */
.media-marquee::before,
.media-marquee::after {
  content: none !important;
  background: none !important;
  width: 0 !important;
}
/* Subsections responsive grid container */
.subsections-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2vw, 1.25rem);
}

.subsections-grid .subsection {
  min-width: 0;
}

@media (min-width: 768px) {
  .subsections-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.subsections-grid--performance {
  align-items: start;
}

.subsections-grid .work-list {
  overflow-wrap: anywhere;
}
/* Image radius reset: ensure all images have square corners */
img,
.media-item,
.work-item img,
.section-media-marquee img,
.profile-image img {
  border-radius: 0 !important;
}
.mobile-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-md);
  width: min(92vw, 560px);
  margin: var(--space-sm) auto;
  border-radius: 2px;
}

.nav-avatar {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.avatar-image {
  width: 28px;
  height: 28px;
  object-fit: cover;
}

.avatar-initials {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--color-text-primary);
  font-weight: 500;
}

.hamburger-menu {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
  touch-action: manipulation;
}

.hamburger-menu:hover {
  color: var(--color-accent-dark);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.hamburger-menu.active .hamburger-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger-menu.active .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger-menu.active .hamburger-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.menu-overlay {
  position: fixed;
  top: calc(var(--mobile-nav-height, 48px) + var(--space-xs));
  left: 0;
  right: 0;
  background: transparent;
  display: none;
  align-items: stretch;
  justify-content: center;
  z-index: 60;
}

.menu-overlay.active {
  display: block;
  pointer-events: auto;
}

.menu-content {
  width: min(92vw, 560px);
  max-height: 80vh;
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  margin: var(--space-sm) auto 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.menu-overlay.active .menu-content {
  opacity: 1;
  transform: translateY(0);
}

.menu-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.menu-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-accent);
  font-size: 1.25rem;
  cursor: pointer;
}

.menu-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.menu-nav .menu-list {
  list-style: none;
  display: grid;
  gap: var(--space-xs);
}

.menu-link {
  display: inline-block;
  font-size: clamp(1rem, 3.5vw, 1.25rem);
  color: var(--color-text-primary);
  text-decoration: none;
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
  position: relative;
  padding-left: var(--space-sm);
}

.menu-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background-color: var(--color-accent);
  transition: height var(--transition-base);
  border-radius: 2px;
}

.menu-link.active::before {
  height: 70%;
}

.menu-link:hover,
.menu-link:focus-visible {
  color: var(--color-accent-dark);
}

.menu-social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.menu-content .cv-btn {
  width: 100%;
  margin-top: var(--space-md);
}

.menu-content .menu-social {
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-md);
  justify-content: center;
}

.menu-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background-color: var(--color-bg);
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  touch-action: manipulation;
}

.menu-social-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
  background-color: var(--color-accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
  .menu-social-link {
    width: 40px;
    height: 40px;
  }
}

.mobile-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  display: none;
  background: transparent;
  border-top: none;
}

.footer-actions {
  display: flex;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
}

.mobile-footer .contact-btn {
  width: 100%;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 var(--space-md);
  border-radius: 8px;
  border: 1px solid var(--color-accent);
  text-decoration: none;
  font-weight: 400;
  color: var(--color-surface);
  background: var(--color-accent);
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  touch-action: manipulation;
}

.footer-btn:hover,
.footer-btn:focus-visible {
  background: var(--color-accent-light);
  border-color: var(--color-accent-muted);
}

.footer-btn--primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

.footer-btn--primary:hover,
.footer-btn--primary:focus-visible {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
}

body.no-scroll {
  overflow: hidden;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0 var(--space-md) var(--space-sm);
}

@media (max-width: 1024px) {
  .mobile-nav {
    display: flex;
  }
}

@media (max-width: 768px) {
  .mobile-footer {
    display: block;
  }
}

@media (max-width: 1024px) {
  .profile-card {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }
  .profile-image {
    max-width: 320px;
    width: 100%;
    margin: 0 auto;
    aspect-ratio: auto;
  }
  .profile-image img {
    max-width: 100%;
    height: auto;
    display: block;
  }
  .profile-card > *:not(.profile-image):not(.profile-facts) { display: none; }
}

@media (max-width: 768px) {
  .profile-card {
    max-width: min(92vw, 420px);
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    gap: 0;
  }
  .profile-image {
    max-width: 92vw;
    width: 100%;
    margin: 0 auto;
    aspect-ratio: auto;
  }
  .profile-image img {
    max-width: 100%;
    height: auto;
    display: block;
  }
  .profile-card > *:not(.profile-image):not(.profile-facts) { display: none; }
}
