/* ==========================================================================
   MAIN CORE STYLES & LAYOUT
   Oshan Nethsara Subhasinghe — Personal Portfolio (oshan.me)
   Typography: Poppins
   Default: Bright / Light Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  /* Theme transition handled by animations.css */
}



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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

.mono {
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
}

/* Top Reading Progress Bar */
.top-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #f59e0b, #10b981);
  z-index: 100;
  transition: width 0.05s linear;
}

/* Floating Premium Top Navigation */
.topnav-wrapper {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  pointer-events: none;
}

.topnav {
  pointer-events: auto;
  width: 100%;
  max-width: var(--content-max);
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 0 24px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

/* Brand / Logo */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-transform: lowercase;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.brand:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.brand-dot {
  color: var(--accent-amber-bright);
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--surface-hover);
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.theme-toggle-btn:hover {
  border-color: var(--line-strong);
  transform: scale(1.05);
}

.theme-toggle-btn svg {
  width: 17px;
  height: 17px;
  transition: transform var(--transition-normal);
}

.theme-icon-dark {
  display: block;
}
.theme-icon-light {
  display: none;
}

[data-theme="dark"] .theme-icon-dark {
  display: none;
}
[data-theme="dark"] .theme-icon-light {
  display: block;
}

/* Nav CTA Button */
.nav-cta {
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--text-primary);
  color: var(--bg);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.nav-cta:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
}

/* Main Shell Container */
.shell {
  width: 100%;
  position: relative;
}

/* Sections */
section {
  padding: 110px 24px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.sec-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 6px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.sec-tag .num {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-amber-bright);
}

.sec-title {
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.lede {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 720px;
  margin-bottom: 48px;
  font-weight: 400;
}

/* Buttons */
.btn {
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 0.92;
}

.btn-outline {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.btn-outline:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

/* Footer */
.footer {
  padding: 60px 24px;
  max-width: var(--content-max);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
}

.back-to-top:hover {
  color: var(--text-primary);
  border-color: var(--line-strong);
}

/* Responsive Navigation */
@media (max-width: 960px) {
  .nav-links {
    display: none;
  }
  .mobile-nav-toggle {
    display: inline-flex;
  }
  .topnav-wrapper {
    top: 12px;
    padding: 0 16px;
  }
  .topnav {
    height: 58px;
    padding: 0 16px;
  }
  section {
    padding: 72px 18px;
  }
  .shell {
    /* no padding-top needed */
  }
}
