:root {
  --bg: #fbfaf8;
  --bg-card: #f4f2ee;
  --bg-card-hover: #eeebe4;
  --text: #24262b;
  --text-dim: #6b6f76;
  --accent: #3a56c5;
  --border: #e4e1da;
  --max-width: 780px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

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

/* ---------- App shell: sticky header + sticky footer, scrollable middle ---------- */

.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

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

/* Header */

header.site-header {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 250, 248, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.identity {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.identity .name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.identity .name:hover { text-decoration: none; color: var(--accent); }

.identity .tagline {
  font-size: 0.85rem;
  color: var(--text-dim);
  border-left: 1px solid var(--border);
  padding-left: 0.65rem;
}

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

nav.site-nav a {
  color: var(--text-dim);
  font-size: 0.92rem;
}

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

/* Scrollable middle */

main.scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

main.scroll-area > .wrap {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

/* Footer */

footer.site-footer {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: rgba(251, 250, 248, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.footer-inner a {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  color: var(--text);
  font-size: 0.85rem;
  background: #fff;
}

.footer-inner a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Intro / hero ---------- */

.intro {
  margin-bottom: 2.5rem;
}

.intro h1 {
  font-size: 1.9rem;
  line-height: 1.35;
  margin: 0 0 0.75rem;
}

.intro p {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 60ch;
}

/* ---------- Work grid ---------- */

section.work-section h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0 0 1.1rem;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.work-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.work-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(36, 38, 43, 0.08);
  transform: translateY(-2px);
}

.work-thumb {
  position: relative;
  display: block;
  height: 92px;
  background: linear-gradient(135deg, #eef1fb, #f4f2ee);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.work-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.work-thumb:hover img {
  transform: scale(1.03);
}

.thumb-label {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text);
}

.work-card .work-body {
  display: block;
  padding: 0.85rem 0.9rem 1rem;
  color: var(--text);
}

.work-card .work-body:hover {
  text-decoration: none;
  background: var(--bg-card);
}

.work-card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  line-height: 1.3;
}

.work-card h3 .ext-icon {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.work-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.5;
}

.work-card .work-tags {
  margin-top: 0.6rem;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.work-note {
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* ---------- About page ---------- */

.about-section {
  margin-bottom: 2.25rem;
}

.about-section h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0 0 0.75rem;
}

.about-section p {
  max-width: 64ch;
}

/* ---------- Blog ---------- */

.post-list a.post-link {
  display: block;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.post-list a.post-link:hover { text-decoration: none; color: var(--accent); }

.post-list .post-date {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

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

article.post h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

article.post .post-meta {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* ---------- Tablet ---------- */

@media (max-width: 720px) and (min-width: 601px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
  .header-inner {
    padding: 0.9rem 1.25rem;
  }

  .identity {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .identity .tagline {
    border-left: none;
    padding-left: 0;
  }

  nav.site-nav {
    gap: 1rem;
    font-size: 0.88rem;
  }

  main.scroll-area > .wrap {
    padding-top: 1.75rem;
  }

  .intro h1 {
    font-size: 1.5rem;
  }

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

  .footer-inner {
    gap: 0.5rem;
  }

  .footer-inner a {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
  }
}
