/* ==========================================================================
   Shisir Acharya Portfolio — Main Stylesheet
   Minimalist, Editorial, Swiss Graphic Design System
   ========================================================================== */

:root {
  /* Editorial Warm Linen / Off-White Theme (Default) */
  --bg-primary: #F7F5F0;
  --bg-secondary: #EFECE4;
  --bg-tertiary: #E5E0D5;
  --surface-card: #FFFFFF;
  --surface-elevated: #FAF8F4;

  --text-primary: #121211;
  --text-secondary: #524F48;
  --text-muted: #7E796F;
  --text-light: #A8A295;

  --border-subtle: #E8E4DA;
  --border-medium: #DCD6C9;
  --border-dark: #121211;

  --accent: #BD3A1B;           /* Deep vermilion / cinnabar accent */
  --accent-hover: #9E2F14;
  --accent-muted: rgba(189, 58, 27, 0.12);
  --accent-tint: #FDF3F0;

  --shadow-subtle: 0 4px 20px -2px rgba(18, 18, 17, 0.05);
  --shadow-medium: 0 12px 32px -4px rgba(18, 18, 17, 0.08);
  --shadow-high: 0 24px 48px -8px rgba(18, 18, 17, 0.14);

  /* Spacing Scale */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3.5rem;
  --space-2xl: 5.5rem;
  --space-3xl: 8.5rem;

  /* Layout */
  --container-max: 1340px;
  --container-padding: clamp(1.25rem, 3.5vw, 3rem);

  /* Transitions */
  --transition-fast: 160ms cubic-bezier(0.2, 0, 0, 1);
  --transition-normal: 260ms cubic-bezier(0.2, 0, 0, 1);
  --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Theme (Obsidian & Warm Charcoal) */
[data-theme="dark"] {
  --bg-primary: #10100F;
  --bg-secondary: #171715;
  --bg-tertiary: #20201D;
  --surface-card: #191917;
  --surface-elevated: #21211E;

  --text-primary: #F5F3EC;
  --text-secondary: #B8B3A8;
  --text-muted: #7E796F;
  --text-light: #524E46;

  --border-subtle: #242421;
  --border-medium: #33332D;
  --border-dark: #F5F3EC;

  --accent: #E04E2C;
  --accent-hover: #F06543;
  --accent-muted: rgba(224, 78, 44, 0.16);
  --accent-tint: #231613;

  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
  --shadow-medium: 0 12px 32px -4px rgba(0, 0, 0, 0.55);
  --shadow-high: 0 24px 48px -8px rgba(0, 0, 0, 0.7);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  color-scheme: light dark;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

ul, ol {
  list-style: none;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Section Spacing */
.section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  position: relative;
}

.section--hero {
  padding-top: clamp(7.5rem, 12vw, 10.5rem);
  padding-bottom: var(--space-2xl);
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Editorial Separator Line */
.editorial-rule {
  width: 100%;
  height: 1px;
  background-color: var(--border-subtle);
  border: none;
  margin: 0;
}

.editorial-rule--dark {
  background-color: var(--border-dark);
}

/* Section Header Structure */
.section-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.section-header__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border-subtle);
}

.section-header__index {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: var(--ls-mono);
  font-weight: 600;
}

.section-header__category {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: var(--ls-tag);
  text-transform: uppercase;
}

.section-header__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
}

.section-header__subtitle {
  font-size: var(--text-md);
  color: var(--text-secondary);
  max-width: 64ch;
  line-height: var(--lh-normal);
}

/* Buttons & Links */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.6rem;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 2px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
}

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

.btn--primary:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn--outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

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

.btn--editorial {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-subtle);
  background: transparent;
}

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

/* Text Links with Editorial Underlines */
.editorial-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1.5px solid var(--border-dark);
  padding-bottom: 2px;
}

.editorial-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.editorial-link svg {
  transition: transform var(--transition-fast);
}

.editorial-link:hover svg {
  transform: translateX(4px);
}

/* Custom Minimalist Cursor (Desktop only) */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
  mix-blend-mode: difference;
  display: none;
}

.custom-cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease-out, width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .custom-cursor,
  .custom-cursor-follower {
    display: block;
  }
}

.cursor-hover {
  width: 48px;
  height: 48px;
  background-color: rgba(189, 58, 27, 0.15);
  border-color: var(--accent);
}

/* Focus Indicators for Accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Reduced Motion Override */
@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;
  }
  .custom-cursor,
  .custom-cursor-follower {
    display: none !important;
  }
}
