/* ---------------------------------------------------------------------
   Design tokens
--------------------------------------------------------------------- */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f6f7f9;
  --color-text: #1a1d23;
  --color-text-muted: #5b6270;
  --color-border: #e5e7eb;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-bg: #eef2ff;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --max-width: 880px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #14161a;
    --color-bg-alt: #1b1e24;
    --color-text: #eef0f3;
    --color-text-muted: #9aa1ad;
    --color-border: #2a2e37;
    --color-accent: #5b8def;
    --color-accent-hover: #7fa4f2;
    --color-accent-bg: #1c2436;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  }
}

/* ---------------------------------------------------------------------
   Reset & base
--------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------------
   Header
--------------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-text);
}
.brand:hover { color: var(--color-accent); }
.nav { display: flex; gap: 24px; }
.nav a { color: var(--color-text-muted); font-weight: 500; font-size: 0.95rem; }
.nav a:hover { color: var(--color-accent); }

/* ---------------------------------------------------------------------
   Hero
--------------------------------------------------------------------- */
.hero {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 72px 24px 56px;
}
.hero__avatar {
  flex: none;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
  background: var(--color-accent-bg);
}
.hero__avatar-img { width: 100%; height: 100%; object-fit: cover; }
.hero__avatar-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  color: var(--color-accent);
}
.hero__text h1 { font-size: 2.25rem; margin-bottom: 0.15em; }
.hero__role { color: var(--color-accent); font-weight: 600; margin: 0 0 0.6em; }
.hero__tagline { color: var(--color-text-muted); max-width: 46ch; margin: 0 0 1.5em; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__actions--center { justify-content: center; }

/* ---------------------------------------------------------------------
   Sections
--------------------------------------------------------------------- */
.section { padding: 48px 24px; border-top: 1px solid var(--color-border); }
.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section__title { font-size: 1.5rem; }
.section__title--page { font-size: 2rem; }
.section--contact { text-align: center; }
.section--contact .prose { margin: 0 auto 20px; }

.prose { color: var(--color-text-muted); max-width: 68ch; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }

.link { font-weight: 600; font-size: 0.95rem; }

/* ---------------------------------------------------------------------
   Cards / project grid
--------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--color-bg-alt);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card__title { font-size: 1.1rem; margin-bottom: 0.4em; }
.card__tagline { color: var(--color-text-muted); font-size: 0.92rem; margin: 0 0 12px; flex-grow: 1; }
.card__actions { display: flex; gap: 10px; margin-top: 14px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-bg);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn--primary { background: var(--color-accent); color: #fff; }
.btn--primary:hover { background: var(--color-accent-hover); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn--small { padding: 7px 14px; font-size: 0.85rem; }

/* ---------------------------------------------------------------------
   Project detail (projects.html)
--------------------------------------------------------------------- */
.project-detail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}
.project-detail__header h2 { margin: 0; }
.project-detail .tag-list { margin-bottom: 16px; }
.highlight-list { margin: 16px 0; }
.highlight-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--color-text-muted);
}
.highlight-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}
.project-detail__meta,
.project-detail__note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.project-detail__meta:empty,
.project-detail__note:empty { display: none; }
.project-detail__note { border-left: 3px solid var(--color-accent); padding-left: 12px; }

/* ---------------------------------------------------------------------
   Footer
--------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--color-border); }
.site-footer__inner {
  padding: 28px 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------- */
@media (max-width: 640px) {
  .hero { flex-direction: column; text-align: center; padding-top: 48px; }
  .hero__actions { justify-content: center; }
  .site-header__inner { height: 56px; }
  .nav { gap: 16px; }
}
