/* ========================================
   Base & Reset
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;900&family=Playfair+Display:wght@400&display=swap');

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

:root {
  --bg: #ffffff;
  --bg-card: #f0f0f0;
  --bg-card-hover: #f2f2f2;
  --text: #2f2e2a;
  --text-secondary: #535247;
  --text-muted: #848484;
  --border: #f2f2f2;
  --transition: 0.15s ease;
}

[data-mode="dark"] {
  --bg: #0b0b0b;
  --bg-card: #212123;
  --bg-card-hover: #7e7e82;
  --text: #ffffff;
  --text-secondary: #bfc1c2;
  --text-muted: #a8a4a4;
  --border: #212123;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.56;
  font-size: 16px;
  transition: background-color 0.3s;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

/* ========================================
   Layout
   ======================================== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ========================================
   Header
   ======================================== */
.site-header {
  height: 60px;
  display: flex;
  align-items: center;
  background-color: var(--bg);
  transition: background-color 0.3s;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.site-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

.site-logo:hover {
  opacity: 0.7;
  text-decoration: none;
}

/* ========================================
   Dark Mode Toggle
   ======================================== */
.dark-mode-switcher {
  display: inline-flex;
}

.dark-mode-switcher input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.dark-mode-switch {
  border: 1px solid var(--bg-card);
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px;
  position: relative;
  width: 55px;
  height: 28px;
  background-color: var(--bg-card);
}

.dark-mode-switch .ball {
  background-color: var(--text);
  border-radius: 50%;
  position: absolute;
  top: 4px;
  left: 4px;
  height: 20px;
  width: 20px;
  transform: translateX(0);
}

.dark-mode-switch.animated .ball {
  transition: transform 0.2s ease-out;
}

.dark-mode-switch.dark .ball {
  transform: translateX(25px);
}

.dark-mode-switch svg {
  width: 14px;
  height: 14px;
  fill: var(--text);
}

/* ========================================
   Hero / About
   ======================================== */
.hero {
  padding: 80px 0 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-avatar {
  margin-bottom: 20px;
}

.hero-avatar img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
}

.hero-bio {
  max-width: 910px;
  margin: 0 auto 24px;
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.3;
  text-align: center;
}

.hero-bio a {
  color: var(--text);
  text-decoration: underline;
}

.hero-bio a:hover {
  opacity: 0.8;
}

.hero-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 30px;
  padding: 3px 32px;
  border-radius: 50px;
  color: var(--text);
}

.hero-social a {
  color: inherit;
  display: block;
  padding: 8px;
  font-size: 24px;
}

.hero-social a:hover {
  opacity: 0.8;
  text-decoration: none;
}

.hero-social svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: none;
}

.btn-contact {
  display: inline-block;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  background-color: #000;
  border-radius: 7px;
  padding: 0 3.5rem;
  height: 2.81rem;
  line-height: 2.8rem;
  box-shadow: rgba(0,0,0,0.1) 0 20px 25px -5px, rgba(0,0,0,0.04) 0 10px 10px -5px;
  transition: box-shadow 0.15s ease;
  text-decoration: none;
}

.btn-contact:hover {
  color: #fff;
  box-shadow: rgba(0,0,0,0.25) 0 25px 50px -12px;
  text-decoration: none;
}

[data-mode="dark"] .btn-contact {
  background-color: #fff;
  color: #000;
}

/* ========================================
   Selected Work
   ======================================== */
.projects {
  padding: 40px 0 80px;
}

.section-heading {
  font-size: 26px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 32px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border-radius: 26px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  text-decoration: none;
  color: var(--text);
}

.project-card:hover .project-card-inner {
  background: var(--bg-card-hover);
  transition: background-color 0.3s;
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.project-icon {
  width: 40px;
  height: 40px;
  background-color: var(--bg-card-hover);
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-mode="dark"] .project-icon {
  background-color: var(--bg-card);
}

.project-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-muted);
  fill: none;
}

[data-mode="dark"] .project-icon svg {
  stroke: #aaaaaa;
}

.project-arrow {
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.project-arrow svg {
  width: 16px;
  height: 16px;
}

[data-mode="dark"] .project-arrow {
  filter: brightness(0) invert(0.5);
}

.project-title {
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 5px;
  line-height: 1.25;
  color: var(--text);
  font-family: 'Playfair Display', serif;
}

.project-desc {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
  margin-bottom: 16px;
}

.project-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
}

/* ========================================
   Contact Page
   ======================================== */
.contact {
  padding: 80px 0 80px;
  max-width: 600px;
  margin: 0 auto;
}

.contact h1 {
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 0;
  line-height: 1.5;
  letter-spacing: 0;
}

.contact-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 48px;
}

.contact-rows {
  list-style: none;
}

.contact-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}

.contact-row:first-child {
  border-top: 1px solid var(--border);
}

.contact-label {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

.contact-value {
  text-align: right;
  color: var(--text);
}

.contact-value a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-thickness: from-font;
}

.contact-value a:hover {
  color: var(--text);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 20px;
  }

  .hero {
    padding: 48px 0 32px;
  }

  .hero-avatar img {
    width: 80px;
    height: 80px;
  }

  .hero-bio {
    font-size: 20px;
  }

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

  .contact {
    padding: 48px 20px 60px;
  }

  .contact-row {
    flex-direction: column;
    gap: 2px;
  }

  .contact-value {
    text-align: left;
  }
}
