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

:root {
  --bg: #faf8f5;
  --bg-card: #ffffff;
  --text: #2c2c2c;
  --text-muted: #6b6b6b;
  --accent: #c96d3c;
  --accent-hover: #a8572e;
  --border: #e8e4df;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --max-width: 960px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1816;
    --bg-card: #242120;
    --text: #e8e4df;
    --text-muted: #9a9490;
    --accent: #e0865a;
    --accent-hover: #c96d3c;
    --border: #3a3634;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--accent-hover);
}

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

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header / Nav ---- */
header {
  padding: 32px 0;
}

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

.site-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

nav {
  display: flex;
  gap: 24px;
}

nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* ---- Hero / Intro ---- */
.hero {
  padding: 64px 0 48px;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
}

/* ---- Project Grid ---- */
.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 80px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

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

.project-card a {
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card .thumb {
  aspect-ratio: 16 / 10;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.project-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card .thumb .placeholder-icon {
  font-size: 2.4rem;
  opacity: 0.5;
}

.project-card .info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card .info h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.project-card .info p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.project-card .info .platform {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 12px;
}

/* ---- CTA Section ---- */
.cta {
  padding: 56px 0;
  border-top: 1px solid var(--border);
  margin-bottom: 40px;
}

.cta h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.cta p {
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 480px;
}

.cta .btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.cta .btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* ---- Project Detail Page ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-weight: 500;
}

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

.project-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
}

.project-hero .hero-img {
  aspect-ratio: 16 / 9;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-hero .hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-hero .hero-img .placeholder-icon {
  font-size: 4rem;
  opacity: 0.4;
}

.project-detail {
  padding-bottom: 80px;
}

.project-detail h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.project-detail .meta {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.project-detail .meta .tag {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 4px 12px;
  border-radius: 20px;
}

.project-detail .description {
  max-width: 640px;
}

.project-detail .description p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 1.05rem;
  line-height: 1.8;
}

/* ---- Contact ---- */
.contact {
  padding: 64px 0;
}

.contact h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.contact p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin-bottom: 12px;
  line-height: 1.7;
}

.contact .email {
  font-size: 1.2rem;
  font-weight: 600;
}

/* ---- Footer ---- */
footer {
  margin-top: auto;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

footer nav {
  gap: 16px;
}

footer nav a {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .hero {
    padding: 40px 0 32px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

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

  .cta h2 {
    font-size: 1.3rem;
  }

  header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  footer .container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .project-detail h1 {
    font-size: 1.5rem;
  }
}
