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

:root {
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-tertiary: #999;
  --border: #e8e8e8;
  --bg: #fff;
  --bg-hover: #fafafa;
  --max-width: 900px;
  --header-width: 260px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ——— Typography ——— */
h1 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
p:last-child {
  margin-bottom: 0;
}

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

/* ——— Layout ——— */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 768px) {
  body {
    flex-direction: row;
  }
}

/* ——— Header / Sidebar ——— */
.header {
  padding: 3rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .header {
    position: sticky;
    top: 0;
    width: var(--header-width);
    min-width: var(--header-width);
    height: 100vh;
    padding: 3rem 2rem;
    border-bottom: none;
    border-right: 1px solid var(--border);
    overflow-y: auto;
  }
}

.header-inner {
  display: flex;
  flex-direction: column;
}

.site-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 0.15rem;
}

.site-subtitle {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
}

.site-bio {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.site-nav {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .site-nav {
    flex-direction: column;
    gap: 0.4rem;
  }
}

.site-nav a {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

/* ——— Main Content ——— */
.main {
  flex: 1;
  padding: 3rem 2.5rem;
  max-width: 720px;
}

@media (max-width: 767px) {
  .main {
    padding: 2rem 1.5rem;
  }
}

/* ——— Project Grid (homepage) ——— */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.project-card {
  display: block;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: opacity 0.15s;
}

.project-card:first-child {
  padding-top: 0;
}

.project-card:last-child {
  border-bottom: none;
}

.project-card:hover {
  opacity: 0.6;
}

.project-card-image {
  margin-bottom: 0.75rem;
  border-radius: 3px;
  overflow: hidden;
}

.project-card-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.project-card h3 {
  color: var(--text);
  margin-bottom: 0.3rem;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ——— Project Page ——— */
.project-page {
  max-width: 600px;
}

.back-link {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--text);
}

.project-page h1 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.project-body {
  margin-top: 2rem;
}

.project-body h2 {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.project-body h2:first-child {
  margin-top: 0;
}

.project-body p {
  font-size: 0.95rem;
  line-height: 1.75;
}

.project-body ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}

.project-body li {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  padding-left: 1rem;
  position: relative;
}

.project-body li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
}

.project-body strong {
  font-weight: 500;
  color: var(--text);
}

/* ——— Project Nav (prev/next) ——— */
.project-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.project-nav-link {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}

.project-nav-link:hover {
  color: var(--text);
}

.project-nav-next {
  margin-left: auto;
}

/* ——— Project Gallery ——— */
.project-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 480px) {
  .project-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-gallery-item {
  margin: 0;
  cursor: pointer;
}

.project-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  transition: opacity 0.15s;
}

.project-gallery-item:hover img {
  opacity: 0.7;
}

/* ——— Lightbox ——— */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.lightbox-close:hover {
  opacity: 1;
}

/* ——— Tags ——— */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.tag {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
}

/* ——— Page Content (experience, education, contact) ——— */
.page-content h1 {
  margin-bottom: 2.5rem;
}

/* ——— Timeline ——— */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1.5rem;
}

.timeline-date {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  padding-top: 0.2rem;
  white-space: nowrap;
}

.timeline-content h3 {
  margin-bottom: 0.15rem;
}

.timeline-role {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.timeline-content p {
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ——— Contact ——— */
.contact-intro {
  font-size: 1rem;
  max-width: 440px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.contact-linkedin {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 1.25rem;
  margin-bottom: 2.5rem;
  transition: border-color 0.15s;
}

.contact-linkedin:hover {
  border-color: var(--text);
}

.contact-form {
  max-width: 380px;
}

.contact-form label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 0.35rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 1.25rem;
  transition: border-color 0.15s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--text-tertiary);
}

.contact-form textarea {
  resize: vertical;
  min-height: 110px;
}

.contact-form button {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.6rem 1.75rem;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.contact-form button:hover {
  opacity: 0.7;
}

/* ——— Footer ——— */
.footer {
  padding: 3rem 2.5rem;
}

.footer p {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

@media (max-width: 767px) {
  .footer {
    padding: 2rem 1.5rem;
  }
}

/* ——— Responsive ——— */
@media (max-width: 767px) {
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}
