/* ==========================================================================
   Portfolio CSS — Full-Bleed Responsive Design System
   ========================================================================== */

:root {
  --accent: #7F77DD;
  --accent-dark: #534AB7;
  --accent-light: #9B94EA;
  --accent-tint: #F1EFFC;
  
  --page-bg: #F4F4F8;
  --section-bg: #FFFFFF;
  --alt-section-bg: #F8F7FC;
  --card-bg: #FFFFFF;
  --card-hover-bg: #FDFDFF;
  
  --border-color: #E6E4F0;
  --text-main: #1C1B29;
  --text-secondary: #6B6980;
  --text-muted: #9694A8;
  
  --shadow: 0 10px 30px rgba(28, 27, 41, 0.05);
  --shadow-hover: 0 16px 36px rgba(127, 119, 221, 0.12);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  
  --container-width: 1536px;
}

[data-theme="dark"] {
  --page-bg: #0E0D14;
  --section-bg: #14121E;
  --alt-section-bg: #181624;
  --card-bg: #1C1A29;
  --card-hover-bg: #221F33;
  --accent-tint: #26233B;
  
  --border-color: #2A273D;
  --text-main: #EFEEF7;
  --text-secondary: #A8A6BC;
  --text-muted: #7A7893;
  
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 16px 36px rgba(127, 119, 221, 0.18);
}

/* Base resets & typography */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--page-bg);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
  width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-dark);
}

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

/* Full-bleed Section & Centered Inner Container */
.section {
  width: 100%;
  padding: 4.5rem 0;
  position: relative;
  background-color: var(--section-bg);
}

.page-section {
  min-height: 75vh;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 3.5rem;
  padding-right: 3.5rem;
}

/* Header & Navigation */
.site-header {
  width: 100%;
  background-color: var(--section-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.site-header .container {
  max-width: 1536px;
  padding-left: 3.5rem;
  padding-right: 3.5rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
  gap: 1.5rem;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
  white-space: nowrap;
}

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

#site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

#site-nav a {
  color: inherit;
  font-weight: 400;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

#site-nav a:hover,
#site-nav a[aria-current="page"] {
  color: var(--text-main);
  font-weight: 600;
}

.header-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 2.375rem;
  height: 2.375rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  border: 1px solid transparent;
  background: transparent;
  padding: 0;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background-color: var(--accent-tint);
  color: var(--accent);
}

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

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  width: 2.5rem;
  height: 2.375rem;
  font-size: 1.125rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Messages & Flash alerts */
.messages-bar {
  width: 100%;
  background-color: var(--section-bg);
  padding: 1rem 0 0;
}
.messages { display: grid; gap: 0.5rem; }
.flash {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background-color: var(--accent-tint);
}
.flash-success { color: var(--accent-dark); }
[data-theme="dark"] .flash-success { color: var(--accent-light); }
.flash-error { color: #b42318; }
[data-theme="dark"] .flash-error { color: #ff8a80; }

/* Hero Section 2-Column Grid Layout */
.hero-section {
  padding: 4rem 0 3rem;
  background-color: var(--section-bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.hero-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.hero-name {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
  color: var(--text-main);
  line-height: 1.15;
}

.hero-tagline {
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 1.25rem;
}

.hero-intro {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 1.5rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.hero-tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background-color: var(--accent-tint);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.hero-main .btn-row {
  justify-content: flex-start;
}

/* Button Component System */
.btn-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  border: none;
  padding: 0.75rem 1.375rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  outline: none;
  box-sizing: border-box;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(127, 119, 221, 0.35);
  border: 1px solid transparent;
}

.btn-primary:hover {
  background-color: var(--accent-dark);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(127, 119, 221, 0.45);
}

.btn-secondary {
  background-color: var(--card-bg);
  color: var(--text-main) !important;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
  background-color: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-dark) !important;
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-secondary:hover {
  color: var(--accent-light) !important;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

button.btn {
  font-family: inherit;
  line-height: normal;
}

.contact-form button[type="submit"] {
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

/* Hero Right Sidebar Cards */
.hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #c084fc);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-details {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.profile-role {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0.15rem 0 0;
}

.profile-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}

.hero-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.mini-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 1.25rem;
}

.mini-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.mini-stat {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin: 0.2rem 0;
}

.mini-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.stack-card {
  padding: 1.25rem;
}

.stack-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.stack-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.stack-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--page-bg);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
}

/* Stats Section Below Hero */
.stats-section {
  background-color: var(--alt-section-bg);
  padding: 2rem 0;
}

.stats-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: var(--shadow);
}

.stat-box {
  text-align: center;
  flex: 1;
}

.stat-box .num {
  font-size: 1.875rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.stat-box .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background-color: var(--border-color);
}

@media (max-width: 600px) {
  .stats-card {
    flex-direction: column;
    gap: 1.5rem;
  }
  .stat-divider {
    width: 80%;
    height: 1px;
  }
}

/* Projects Section & Cards */
.projects-section {
  background-color: var(--section-bg);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.projects-grid-wide {
  margin-top: 1.5rem;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.25s ease;
}

.card:hover {
  border-color: var(--accent);
  background-color: var(--card-hover-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card .dot {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background-color: var(--accent-tint);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.875rem;
}

.card-thumb {
  width: 100%;
  height: 10rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.875rem;
}

.cover {
  width: 100%;
  max-height: 20rem;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: 0.75rem 0 1.5rem;
}

.cover-sm {
  height: 8rem;
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.375rem;
  color: var(--text-main);
}

.card p {
  font-size: 0.84375rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.view-all-wrap {
  text-align: center;
  margin-top: 2rem;
}

.view-all {
  display: inline-flex;
  align-items: center;
  font-size: 0.9375rem;
  color: var(--accent);
  font-weight: 600;
}

.view-all:hover {
  color: var(--accent-dark);
}

/* Skills Section */
.skills-section {
  background-color: var(--alt-section-bg);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

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

.tag {
  background-color: var(--accent-tint);
  color: var(--accent-dark);
  font-size: 0.84375rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}

[data-theme="dark"] .tag {
  background-color: var(--accent-tint);
  color: var(--text-main);
}

.tag:hover {
  background-color: var(--accent);
  color: #ffffff;
}

/* Newsletter Section */
.newsletter-section {
  background-color: var(--section-bg);
}

.newsletter {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.75rem;
  text-align: center;
  max-width: 42rem;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

.newsletter h3 {
  font-size: 1.25rem;
  margin: 0 0 0.375rem;
  font-weight: 700;
  color: var(--text-main);
}

.newsletter p {
  font-size: 0.90625rem;
  color: var(--text-secondary);
  margin: 0 0 1.25rem;
}

.sub-row {
  display: flex;
  gap: 0.625rem;
  max-width: 32rem;
  margin: 0 auto;
  align-items: stretch;
}

.input-with-icon {
  position: relative;
  flex: 1;
  min-width: 0;
}

.input-with-icon svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}

.sub-row input, .contact-form input, .contact-form textarea {
  flex: 1;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--section-bg);
  color: var(--text-main);
  font-size: 0.875rem;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-icon input {
  padding-left: 2.75rem !important;
}

.sub-row input:focus, .contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.sub-row button {
  padding: 0 1.375rem;
  white-space: nowrap;
}

/* Footer */
.site-footer {
  width: 100%;
  background-color: var(--page-bg);
  border-top: 1px solid var(--border-color);
  padding: 1.75rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer .copy {
  font-size: 0.84375rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Generic Page Styles & Timeline */
.page {
  padding: 1rem 0 2.5rem;
}

.lede {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  margin: 0 0 1.5rem;
}

.body-copy {
  font-size: 1rem;
  color: var(--text-main) !important;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.page p {
  color: var(--text-main);
  line-height: 1.7;
}

.muted { color: var(--text-muted); }
.small { font-size: 0.8125rem; }
.crumb { font-size: 0.875rem; color: var(--text-secondary); margin: 0 0 1rem; }

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline li {
  padding: 0 0 1.5rem;
  border-left: 2px solid var(--border-color);
  padding-left: 1.25rem;
  margin-left: 0.25rem;
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -0.375rem;
  top: 0.35rem;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: var(--accent);
}

.plain-list {
  padding-left: 1.25rem;
}

.post-list {
  display: grid;
  gap: 1.25rem;
}

.post-card p {
  font-size: 0.875rem;
}

.email-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
  margin: 0 0 1.5rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
  max-width: 32rem;
}

.contact-form label {
  display: grid;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.pdf-frame {
  width: 100%;
  height: 45rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--alt-section-bg);
}

.empty-404 {
  text-align: center;
  padding: 3rem 0;
}


/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* 1. Ultra-Wide Monitors (1600px and up) */
@media (min-width: 1600px) {
  .container, .site-header .container {
    max-width: 1480px;
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

/* 2. Standard Monitors / Large Displays (1366px – 1599px) */
@media (min-width: 1366px) and (max-width: 1599px) {
  .container, .site-header .container {
    max-width: 1320px;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

/* 3. Standard Laptops (1200px – 1365px) */
@media (min-width: 1200px) and (max-width: 1365px) {
  .container, .site-header .container {
    max-width: 1180px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* 4. Small Laptops / Tablets Landscape (992px – 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .container, .site-header .container {
    max-width: 980px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .section {
    padding: 3.5rem 0;
  }
  .hero-section h1 {
    font-size: 2rem;
  }
}

/* 5. Tablet: 768px – 991px */
@media (max-width: 991px) {
  .container, .site-header .container {
    max-width: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .section {
    padding: 3.25rem 0;
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats .num {
    font-size: 1.5rem;
  }
  .stats .label {
    font-size: 0.8125rem;
  }
  
  /* Mobile / Tablet Nav Drawer */
  .nav-toggle {
    display: inline-flex;
  }
  .site-header {
    position: relative;
  }
  .header-inner {
    position: relative;
  }
  #site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--section-bg);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    gap: 1rem;
    box-shadow: var(--shadow);
    z-index: 99;
  }
  #site-nav.is-open {
    display: flex;
  }
}

/* 4. Mobile: below 768px — Single column throughout, stacked buttons, wrapped footer */
@media (max-width: 767px) {
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .section {
    padding: 2.75rem 0;
  }
  .hero-section h1 {
    font-size: 1.625rem;
  }
  .hero-section p {
    font-size: 0.9375rem;
  }
  .btn-row {
    flex-direction: column;
    width: 100%;
  }
  .btn-row .btn {
    width: 100%;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  .stats .num {
    font-size: 1.25rem;
  }
  .stats .label {
    font-size: 0.75rem;
  }
  .sub-row {
    flex-direction: column;
    width: 100%;
  }
  .sub-row button {
    width: 100%;
    padding: 0.75rem;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
  .pdf-frame {
    height: 30rem;
  }
}

/* 5. Small Mobile: 480px and below */
@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .stats > div {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
  }
  .stats > div:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}
