/* ===================================
   Reset & Base Styles
   =================================== */

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

:root {
  --color-bg: #fafbfc;
  --color-surface: #ffffff;
  --color-primary: #0f1419;
  --color-secondary: #3a4149;
  --color-tertiary: #6b7280;
  --color-border: #d1d5db;
  --color-border-light: #e5e7eb;
  --color-accent: #4b5563;

  --font-serif: "Georgia", "Times New Roman", serif;
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "SF Mono", "Monaco", "Courier New", monospace;

  --spacing-unit: 8px;
  --max-width: 800px;
  --nav-width: 180px;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ===================================
   Layout Structure
   =================================== */

.page-container {
  display: flex;
  min-height: 100vh;
}

/* ===================================
   Margin Navigation (Sidebar)
   =================================== */

.margin-nav {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--nav-width);
  height: 100vh;
  padding: calc(var(--spacing-unit) * 8) calc(var(--spacing-unit) * 3);
  border-right: 1px solid var(--color-border-light);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.logo svg {
  width: 100%;
  height: 100%;
}

.nav-items {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 4);
}

.nav-item {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 0.5);
  text-decoration: none;
  color: var(--color-tertiary);
  transition: color 0.2s ease;
  position: relative;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--color-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-item.active::before {
  opacity: 1;
}

.nav-item:hover {
  color: var(--color-secondary);
}

.nav-item.active {
  color: var(--color-primary);
}

.nav-number {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.margin-decoration {
  padding-top: calc(var(--spacing-unit) * 3);
  border-top: 1px solid var(--color-border-light);
}

.current-page {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-tertiary);
}

/* ===================================
   Main Content Area
   =================================== */

.content {
  margin-left: var(--nav-width);
  width: calc(100% - var(--nav-width));
  padding: calc(var(--spacing-unit) * 8) calc(var(--spacing-unit) * 6);
}

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  opacity: 0;
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   Section Headers
   =================================== */

.section-header {
  margin-bottom: calc(var(--spacing-unit) * 6);
  padding-bottom: calc(var(--spacing-unit) * 3);
  border-bottom: 1px solid var(--color-border-light);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: calc(var(--spacing-unit) * 1);
  color: var(--color-primary);
}

.section-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===================================
   Typography
   =================================== */

.section-content p {
  margin-bottom: calc(var(--spacing-unit) * 3);
  color: var(--color-secondary);
}

.section-content p.lead {
  font-size: 20px;
  line-height: 1.6;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 4);
  font-weight: 400;
}

h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--color-primary);
  margin-bottom: calc(var(--spacing-unit) * 1);
}

/* ===================================
   About Image
   =================================== */

.about-image {
  margin: calc(var(--spacing-unit) * 6) 0;
  border: 1px solid var(--color-border-light);
  padding: calc(var(--spacing-unit) * 2);
  background: var(--color-surface);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.about-image img {
  width: 100%;
  display: block;
}

/* ===================================
   Credentials (Education Section)
   =================================== */

.credentials {
  margin-top: calc(var(--spacing-unit) * 6);
  padding: calc(var(--spacing-unit) * 3) 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.credentials-header {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-tertiary);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.credentials-list {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 1.5);
}

.credential-item {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 0.5);
}

.credential-degree {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.credential-institution {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-tertiary);
  letter-spacing: -0.01em;
}

/* ===================================
   Note Boxes
   =================================== */

.note-box {
  margin-top: calc(var(--spacing-unit) * 6);
  padding: calc(var(--spacing-unit) * 3);
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 23px,
    var(--color-border-light) 23px,
    var(--color-border-light) 24px
  );
  border-left: 2px solid var(--color-border);
  position: relative;
}

.note-label {
  position: absolute;
  top: -10px;
  left: calc(var(--spacing-unit) * 2);
  background: var(--color-bg);
  padding: 0 calc(var(--spacing-unit) * 1);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-tertiary);
}

.note-box p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 0;
}

/* ===================================
   Timeline (Experience Section)
   =================================== */

.timeline {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 6);
}

.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: calc(var(--spacing-unit) * 4);
  padding-bottom: calc(var(--spacing-unit) * 6);
  border-bottom: 1px dotted var(--color-border-light);
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-tertiary);
  padding-top: 2px;
  letter-spacing: -0.01em;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 1.5);
}

.timeline-location {
  font-size: 14px;
  color: var(--color-tertiary);
  font-style: italic;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 1);
  list-style: none;
  margin-top: calc(var(--spacing-unit) * 1);
}

.timeline-tags li {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 2px;
  color: var(--color-secondary);
  letter-spacing: 0.02em;
}

/* ===================================
   Projects Grid
   =================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: calc(var(--spacing-unit) * 4);
  margin-bottom: calc(var(--spacing-unit) * 6);
}

.project-card {
  padding: calc(var(--spacing-unit) * 3);
  border: 1px solid var(--color-border-light);
  background: var(--color-surface);
  transition: all 0.2s ease;
  position: relative;
}

.project-card:hover {
  border-color: var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: calc(var(--spacing-unit) * 2);
  gap: calc(var(--spacing-unit) * 2);
}

.project-header h3 {
  margin-bottom: 0;
  flex: 1;
}

.project-year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-tertiary);
  white-space: nowrap;
  padding-top: 4px;
}

.project-card .project-description {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-secondary);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.project-link {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: border-color 0.2s ease;
  white-space: nowrap;
}

.project-link:hover {
  border-bottom-color: var(--color-primary);
}

.project-meta {
  display: flex;
  gap: calc(var(--spacing-unit) * 2);
  padding-top: calc(var(--spacing-unit) * 2);
  border-top: 1px dotted var(--color-border-light);
}

.project-status,
.project-type {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-tertiary);
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1024px) {
  :root {
    --nav-width: 140px;
  }

  .margin-nav {
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 2);
  }

  .nav-item::before {
    left: -16px;
  }
}

@media (max-width: 768px) {
  .page-container {
    flex-direction: column;
  }

  .margin-nav {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 3);
    flex-direction: row;
    align-items: center;
    gap: calc(var(--spacing-unit) * 4);
  }

  .nav-items {
    flex-direction: row;
    gap: calc(var(--spacing-unit) * 3);
  }

  .nav-item::before {
    display: none;
  }

  .margin-decoration {
    display: none;
  }

  .content {
    margin-left: 0;
    width: 100%;
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 3);
  }

  .section-title {
    font-size: 32px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 2);
  }

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

/* ===================================
   Notebook Content Styles
   =================================== */

.notebook-content {
  max-width: none;
  padding-top: calc(var(--spacing-unit) * 4);
}
