/* --- 1. VINTAGE PALETTE & VARIABLES --- */
:root {
  --bg-cream: #e6dcc3;
  --text-navy: #002535;
  --teal: #0d7c85;
  --mint: #7fb0a8;
  --mustard: #e59f26;
  --rust: #c15b08;
  --red: #8f201c;
  --white: #f9f7f1;
  --grey: #495057;

  /* Card Backgrounds (Bento Style) */
  --bento-green: #66ccaa;
  --bento-red: #e06c60;
  --bento-yellow: #f4d03f;
  --bento-blue: #5dade2;
}

/* --- 2. GLOBAL RESET --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Georgia", serif;
  background-color: var(--bg-cream);
  color: var(--text-navy);
  line-height: 1.6;
  overflow-x: hidden; /* Prevents horizontal scroll on small screens */
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}

/* Utility Class to replace inline HTML styles */
.page-header {
  margin-top: 30px; 
  border: none; 
  font-size: 40px;
}

/* --- 3. COLOR BAR --- */
.color-bar {
  display: flex;
  height: 12px;
  width: 100%;
  position: fixed;
  top: 0;
  z-index: 200;
}
.c1 { background-color: var(--text-navy); flex: 1; }
.c2 { background-color: var(--teal); flex: 1; }
.c3 { background-color: var(--mint); flex: 1; }
.c4 { background-color: var(--grey); flex: 1; }
.c5 { background-color: var(--mustard); flex: 1; }
.c6 { background-color: var(--rust); flex: 1; }
.c7 { background-color: var(--red); flex: 1; }

/* --- 4. HEADER --- */
header {
  background: var(--bg-cream);
  border-bottom: 3px solid var(--text-navy);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-top: 12px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.logo h1 {
  font-size: 30px;
  font-weight: 900;
  font-family: "Courier New", monospace;
  letter-spacing: -1px;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 24px;
}
nav a {
  font-weight: bold;
  font-size: 25px;
  text-transform: uppercase;
  font-family: "Courier New", monospace;
  position: relative;
}
nav a:hover {
  color: var(--rust);
}
nav a::after {
  content: "";
  display: block;
  width: 0;
  height: 2px;
  background: var(--rust);
  transition: width 0.3s;
}
nav a:hover::after {
  width: 100%;
}

/* --- 5. HERO SECTION --- */
.hero {
  padding: 100px 0;
  border-bottom: 2px dashed var(--text-navy);
  position: relative;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
}

.hero-text {
  flex: 0 1 auto;
  max-width: 800px;
}

/* Hero Text Styles */
.hero h1 {
  font-size: 64px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text-navy);
  letter-spacing: -2px;
}

/* Blinking Cursor Effect */
.cursor-blink {
  display: inline-block;
  width: 24px;
  height: 8px;
  background-color: var(--rust);
  margin-left: 8px;
  animation: blink 1s step-end infinite;
  vertical-align: baseline;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero h2 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
  color: var(--text-navy);
  font-family: "Georgia", serif;
  opacity: 0.9;
}

.hero p {
  font-size: 19px;
  color: #222;
  max-width: 700px;
  margin-bottom: 32px;
  font-weight: 500;
}

/* Highlight classes */
.txt-rust { color: var(--rust); font-weight: 800; }
.txt-teal { color: var(--teal); font-weight: 800; }
.txt-red { color: var(--red); font-weight: 800; }

.highlight-rust {
  color: var(--rust);
  border-bottom: 3px solid var(--mustard);
}
.highlight-teal {
  color: var(--teal);
  border-bottom: 3px solid var(--mint);
}

/* --- HERO BUTTONS --- */
.hero-buttons {
  display: flex;
  gap: 20px;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  font-family: "Courier New", monospace;
  font-weight: 900;
  font-size: 20px;
  text-transform: uppercase;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
  background-color: var(--text-navy);
  color: var(--white);
  border: 2px solid var(--text-navy);
  box-shadow: 4px 4px 0 var(--mustard);
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--mustard);
  background-color: var(--text-navy);
}

/* --- HERO IMAGE (FIXED) --- */
.hero-image-wrapper {
  flex-shrink: 0;
  position: relative;
}

.hero-img {
  width: 100%;            /* Allows shrinking on mobile */
  max-width: 350px;       /* Caps width for desktop */
  height: auto;           /* Maintains aspect ratio */
  object-fit: cover;
  border: 4px solid var(--text-navy);
  box-shadow: 16px 16px 0 var(--rust);
  background-color: var(--teal);
  border-radius: 4px;
}

/* --- 6. MAIN SPLIT LAYOUT --- */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 300px; /* Content | Sidebar */
  gap: 60px;
  padding: 60px 0;
}

/* --- 7. SKILLS --- */
.skills-section { margin-bottom: 60px; }

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.section-title {
  font-family: "Courier New", monospace;
  font-size: 28px;
  font-weight: bold;
  border-bottom: 4px solid var(--rust);
}

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

.skill-tag {
  color: var(--white);
  padding: 16px 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: "Courier New", monospace;
  font-size: 16px;
  font-weight: 1000;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  border: 2px solid var(--text-navy);
  cursor: pointer;
}
.skill-tag:hover { transform: translateY(-4px); }

.skill-tag:nth-of-type(5n + 1) { background-color: var(--text-navy); }
.skill-tag:nth-of-type(5n + 2) { background-color: var(--teal); }
.skill-tag:nth-of-type(5n + 3) { background-color: var(--rust); }
.skill-tag:nth-of-type(5n + 4) { background-color: var(--mustard); color: var(--text-navy); }
.skill-tag:nth-of-type(5n + 5) { background-color: var(--red); }

/* --- 8. PROJECTS --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

.project-card {
  padding: 32px;
  border-radius: 16px;
  color: var(--text-navy);
  border: 3px solid var(--text-navy);
  box-shadow: 8px 8px 0 var(--text-navy);
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 380px;
}
.project-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 12px 12px 0 var(--text-navy);
}

.bg-green { background-color: var(--bento-green); }
.bg-blue { background-color: var(--bento-blue); }
.bg-red { background-color: var(--bento-red); }
.bg-yellow { background-color: var(--bento-yellow); }

.card-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
  border: 2px solid var(--text-navy);
}

.project-card h3 {
  font-size: 22px;
  margin-bottom: 8px;
  font-weight: 800;
}
.project-card p {
  font-size: 16px;
  margin-bottom: 24px;
  font-weight: 500;
  line-height: 1.4;
}

.card-pills {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  background: var(--white);
  border: 2px solid var(--text-navy);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
  font-family: "Courier New", monospace;
  text-transform: uppercase;
}

.view-archive-link {
    display: inline-block;
    margin-top: 20px;
    font-family: "Courier New", monospace;
    font-weight: bold;
    font-size: 18px;
    color: var(--text-navy);
    border-bottom: 2px solid var(--rust);
}
.view-archive-link:hover {
    color: var(--rust);
    background-color: #fff8e1;
}

/* --- 9. WORK EXPERIENCE --- */
.experience-section { margin-top: 80px; }

.timeline-item {
  border-left: 4px solid var(--text-navy);
  padding-left: 24px;
  padding-bottom: 40px;
  position: relative;
}
.timeline-item:last-child { border-left: 4px solid transparent; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 0;
  width: 16px;
  height: 16px;
  background: var(--mustard);
  border: 3px solid var(--text-navy);
  border-radius: 50%;
}
.role { font-size: 25px; font-weight: bold; color: var(--text-navy); }
.company { color: var(--rust); font-weight: bold; font-family: "Courier New", monospace; font-size: 16px; }
.date { font-size: 14px; color: #666; margin-bottom: 8px; display: block; font-style: italic; }

/* --- 10. RIGHT SIDEBAR (Diary) --- */
.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  background: var(--white);
  border: 3px solid var(--text-navy);
  padding: 24px;
  box-shadow: 8px 8px 0 var(--mustard);
}

.sidebar-title {
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.diary-list li {
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--mint);
  padding-bottom: 16px;
}
.diary-list li:last-child { border: none; padding-bottom: 0; }

.diary-date {
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: var(--rust);
  display: block;
  margin-bottom: 4px;
}

.diary-link {
  font-weight: bold;
  font-size: 15px;
  color: var(--text-navy);
  display: block;
  margin-bottom: 4px;
  line-height: 1.3;
}
.diary-link:hover { text-decoration: underline; color: var(--teal); }

.diary-excerpt { font-size: 13px; color: #555; }

/* --- 11. FOOTER --- */
footer {
    background: var(--text-navy);
    color: var(--bg-cream);
    padding: 30px 0;
    text-align: center;
    font-size: 20px;
    font-family: 'Courier New', monospace;
    margin-top: 70px;
}

/* --- 12. RESPONSIVE MEDIA QUERIES (UPDATED) --- */
@media (max-width: 900px) {
  
  /* Global Container */
  .container {
    padding: 0 20px;
  }

  /* Header & Navigation */
  .header-content {
    flex-direction: column;
    gap: 15px;
  }
  
  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }
  
  nav a {
    font-size: 18px; /* Reduced to prevent wrapping issues */
  }

  /* Hero Section */
  .hero-content {
    flex-direction: column-reverse; /* Puts text below image */
    text-align: center;
    gap: 30px;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero h1 {
    font-size: 38px; /* Safe size for mobile */
    line-height: 1.1;
  }
  
  .hero h2 {
    font-size: 22px;
  }

  .hero-buttons {
    flex-direction: column; /* Stack buttons vertically */
    width: 100%;
    gap: 15px;
  }
  
  .hero-buttons .btn {
    width: 100%;
    display: block;
    text-align: center;
  }

  /* Layout Split (Main/Sidebar) */
  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: 0;
    margin-top: 40px;
    width: 100%;
  }

  /* Projects Grid */
  .projects-grid {
    grid-template-columns: 1fr; /* Force 1 column on mobile */
  }
  
  .project-card {
    min-height: auto; /* Allow height to adjust to content */
  }

  /* Dynamic Title Resizing */
  .page-header {
    font-size: 32px;
  }
  .section-title {
    font-size: 28px;
  }
}