/* ==========================================================================
   Patrik Rufino - Personal Portfolio Design System & Styles
   Style: Old Money / Minimalist Editorial Aesthetic
   Palette: Warm Parchment, Deep Espresso, Muted Bronze, Delicate Warm Stone
   Typography: Cormorant Garamond (Serif Heading) & Inter (Sans Body)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Variables & Design Tokens
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Editorial Neutral Color Palette */
  --bg-main: #faf8f5;           /* Warm Parchment / Alabaster */
  --bg-card: #ffffff;           /* Clean Cream White */
  --bg-card-hover: #f5f2eb;      /* Soft Warm Sand */
  --bg-tag: #f1ede5;            /* Subtle Muted Taupe */

  --border-color: #e5e0d6;      /* Fine Stone Line */
  --border-hover: #8c7355;      /* Warm Bronze Highlight */

  /* Primary Accent Colors */
  --accent-primary: #8c7355;     /* Warm Bronze / Cognac */
  --accent-primary-hover: #6e5a42;
  --accent-dark: #1a1917;        /* Deep Espresso */
  
  /* Text Colors */
  --text-main: #1a1917;         /* Deep Espresso */
  --text-muted: #5e5a53;        /* Muted Warm Charcoal */
  --text-dim: #8c867d;          /* Soft Beige Gray */

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing & Layout */
  --container-max: 1080px;
  --header-height: 90px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows & Refined Elevation */
  --shadow-subtle: 0 4px 20px rgba(26, 25, 23, 0.04);
  --shadow-hover: 0 12px 30px rgba(26, 25, 23, 0.08);

  /* Transitions */
  --transition-fast: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Editorial Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

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

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

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

.section {
  padding: 7rem 0;
}

.section-title-wrap {
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.section-title {
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  font-weight: 600;
  font-style: normal;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 0.75rem;
  max-width: 580px;
  font-weight: 300;
}

/* Buttons - Old Money Style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--accent-dark);
  color: #faf8f5;
}

.btn-primary:hover {
  background-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border-color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--text-main);
  color: var(--bg-main);
  transform: translateY(-2px);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   3. Header & Navigation
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.header.scrolled {
  border-bottom-color: var(--border-color);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

.brand-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  background: var(--bg-tag);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  list-style: none;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  font-weight: 500;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent-primary);
  transition: width var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* --------------------------------------------------------------------------
   4. Hero Section
   -------------------------------------------------------------------------- */
.hero {
  min-height: 90vh;
  padding-top: calc(var(--header-height) + 4rem);
  padding-bottom: 5rem;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-tag);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 2rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-primary);
  border-radius: 50%;
}

.hero-title {
  font-size: clamp(3rem, 5.5vw, 4.75rem);
  font-weight: 500;
  line-height: 1.08;
  margin-bottom: 1.25rem;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent-primary);
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  letter-spacing: 0.05em;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 540px;
  line-height: 1.8;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-socials {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
}

.hero-avatar-wrap {
  display: flex;
  justify-content: center;
  position: relative;
}

.hero-avatar-card {
  width: 310px;
  height: 360px;
  border-radius: var(--radius-md);
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
}

.hero-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-md) - 4px);
  filter: grayscale(20%) contrast(105%);
}

.hero-badge-float {
  position: absolute;
  bottom: -15px;
  right: -15px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hero-badge-icon {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--accent-primary);
  line-height: 1;
}

.hero-badge-text h4 {
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-serif);
}

.hero-badge-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   5. Stats Section
   -------------------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: -1rem;
  margin-bottom: 5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2rem 1.75rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

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

.stat-number {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   6. About Section
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

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

.about-card p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.about-card p:last-child {
  margin-bottom: 0;
}

.about-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.about-highlight-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--text-main);
}

.about-highlight-icon {
  color: var(--accent-primary);
  font-size: 1.1rem;
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   7. Skills Section
   -------------------------------------------------------------------------- */
.skills-categories {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.category-title {
  font-size: 1.35rem;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  font-family: var(--font-serif);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.category-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.25rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.25rem 1.15rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-fast);
}

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

.skill-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-tag);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  flex-shrink: 0;
}

.skill-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.skill-info h4 {
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 600;
}

.skill-info span {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   8. Projects Section
   -------------------------------------------------------------------------- */
.project-filters {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.5rem 1.35rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--text-main);
  border-color: var(--text-main);
  color: var(--bg-main);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.25rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-subtle);
  transition: all var(--transition-normal);
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.project-img-wrap {
  width: 100%;
  height: 200px;
  background: #f1ede5;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .project-img-wrap img {
  transform: scale(1.04);
}

.project-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  background: var(--bg-tag);
  color: var(--text-muted);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.project-title {
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
  font-family: var(--font-serif);
}

.project-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.65;
  font-weight: 300;
  flex: 1;
}

.project-links {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}

.project-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-color);
}

.project-link-btn:hover {
  background: var(--text-main);
  color: var(--bg-main);
  border-color: var(--text-main);
}

/* --------------------------------------------------------------------------
   9. Timeline / Education Section
   -------------------------------------------------------------------------- */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15px;
  width: 1px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-left: 50px;
  margin-bottom: 2.75rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 9px;
  top: 6px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 3px solid var(--bg-main);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.75rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--accent-primary);
  margin-bottom: 0.35rem;
  letter-spacing: 0.05em;
}

.timeline-title {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
  font-family: var(--font-serif);
}

.timeline-institution {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   10. Contact Section
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
}

.contact-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  box-shadow: var(--shadow-subtle);
}

.contact-info-card h3 {
  font-size: 1.5rem;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tag);
  border: 1px solid var(--border-color);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.contact-details h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-details p, .contact-details a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
}

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  box-shadow: var(--shadow-subtle);
}

.contact-form h3 {
  font-size: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-control {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(140, 115, 85, 0.12);
}

textarea.form-control {
  resize: vertical;
  min-height: 130px;
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0;
  background: var(--bg-main);
}

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

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

/* --------------------------------------------------------------------------
   12. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-subtitle, .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions, .hero-socials {
    justify-content: center;
  }

  .about-grid, .contact-grid {
    grid-template-columns: 1fr;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: calc(100vh - var(--header-height));
    background: var(--bg-main);
    border-left: 1px solid var(--border-color);
    flex-direction: column;
    padding: 2.5rem 1.5rem;
    align-items: flex-start;
    transition: right 0.3s ease;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-toggle {
    display: block;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 4.5rem 0;
  }

  .hero-avatar-card {
    width: 260px;
    height: 310px;
  }

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