/* ─────────────────────────────────────────
   RESET & ROOT
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #1a1814;
  --ink-muted:  #6b6660;
  --ink-faint:  #b0aaa4;
  --paper:      #faf9f7;
  --paper-warm: #f3f0eb;
  --accent:     #c8633a;
  --accent-soft:#f0e6df;
  --border:     #e8e3dc;
  --dark:       #111009;
  --serif:      'Lora', Georgia, serif;
  --sans:       'DM Sans', sans-serif;
  --radius:     6px;
  --nav-h:      64px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* ─────────────────────────────────────────
   NAV
───────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 56px;
  background: rgba(250,249,247,0.93);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -3px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--ink); }
.nav-admin-btn {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 7px 16px;
  background: var(--ink);
  color: var(--paper) !important;
  border-radius: var(--radius);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.2s !important;
}
.nav-admin-btn:hover { background: var(--accent) !important; }
.nav-admin-btn::after { display: none !important; }

.nav-mobile-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; color: var(--ink);
}

/* ─────────────────────────────────────────
   PAGE WRAPPER
───────────────────────────────────────── */
.page { padding-top: var(--nav-h); }

/* ─────────────────────────────────────────
   HERO
───────────────────────────────────────── */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center;
  padding: 80px 56px;
  max-width: 960px;
  margin: 0 auto;
}
.hero-inner { max-width: 660px; }
.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
  opacity: 0;
  animation: fadeUp 0.65s ease 0.1s forwards;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 0.65s ease 0.22s forwards;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-bio {
  font-size: 1.05rem;
  color: var(--ink-muted);
  line-height: 1.8;
  max-width: 500px;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.65s ease 0.34s forwards;
}
.hero-ctas {
  display: flex; gap: 14px; flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.65s ease 0.46s forwards;
}

/* ─────────────────────────────────────────
   BUTTONS
───────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--paper);
  padding: 12px 22px;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500;
  text-decoration: none; border-radius: var(--radius);
  border: none; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--ink-muted);
  padding: 12px 22px;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 400;
  text-decoration: none; border-radius: var(--radius);
  border: 1px solid var(--border); cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-ghost:hover { border-color: var(--ink-muted); color: var(--ink); }
.btn-accent {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--paper);
  padding: 11px 22px;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500;
  text-decoration: none; border-radius: var(--radius);
  border: none; cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-accent:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-danger {
  background: #c0392b; color: #fff;
  padding: 8px 16px; border: none; border-radius: var(--radius);
  font-family: var(--sans); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: opacity 0.2s;
}
.btn-danger:hover { opacity: 0.85; }
.btn-sm {
  padding: 7px 14px !important;
  font-size: 0.8rem !important;
}

/* ─────────────────────────────────────────
   SECTION SHARED
───────────────────────────────────────── */
.section { padding: 88px 56px; }
.section-wrap { max-width: 960px; margin: 0 auto; }
.section-label {
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 12px;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 500; letter-spacing: -0.025em;
  color: var(--ink); margin-bottom: 52px; line-height: 1.2;
}
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 52px;
  flex-wrap: wrap; gap: 16px;
}
.section-header .section-title { margin-bottom: 0; }

/* ─────────────────────────────────────────
   POSTS LIST
───────────────────────────────────────── */
.posts-list { display: flex; flex-direction: column; }
.post-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px; align-items: start;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: opacity 0.2s;
}
.post-card:first-child { border-top: 1px solid var(--border); }
.post-card:hover { opacity: 0.72; }
.post-tag {
  display: inline-block;
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 9px;
}
.post-title {
  font-family: var(--serif);
  font-size: 1.2rem; font-weight: 500;
  color: var(--ink); line-height: 1.35; margin-bottom: 9px;
  letter-spacing: -0.01em;
}
.post-excerpt {
  font-size: 0.875rem; color: var(--ink-muted); line-height: 1.65;
  max-width: 540px;
}
.post-cover-thumb {
  width: 88px; height: 64px;
  object-fit: cover; border-radius: var(--radius);
  flex-shrink: 0;
}
.post-meta-col { text-align: right; flex-shrink: 0; }
.post-date { font-size: 0.78rem; color: var(--ink-faint); white-space: nowrap; }
.post-read { font-size: 0.75rem; color: var(--ink-faint); margin-top: 5px; }

/* ─────────────────────────────────────────
   SINGLE POST
───────────────────────────────────────── */
.post-page { max-width: 700px; margin: 0 auto; padding: 64px 32px 120px; }
.post-page-tag {
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px; display: block;
}
.post-page h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 500; letter-spacing: -0.03em;
  line-height: 1.18; margin-bottom: 20px;
}
.post-page-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 0.82rem; color: var(--ink-faint);
  margin-bottom: 40px;
  padding-bottom: 28px; border-bottom: 1px solid var(--border);
}
.post-cover-img {
  width: 100%; border-radius: var(--radius);
  margin-bottom: 40px;
  max-height: 420px; object-fit: cover;
}
.post-body {
  font-family: var(--serif);
  font-size: 1.08rem; line-height: 1.85;
  color: var(--ink);
}
.post-body p { margin-bottom: 1.4em; }
.post-body h2 {
  font-size: 1.4rem; font-weight: 500;
  letter-spacing: -0.015em;
  margin: 2em 0 0.8em;
}
.post-body h3 { font-size: 1.15rem; margin: 1.6em 0 0.6em; }
.post-body a { color: var(--accent); text-decoration: underline; }
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px; margin: 1.6em 0;
  color: var(--ink-muted); font-style: italic;
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--ink-muted);
  text-decoration: none; margin-bottom: 40px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* ─────────────────────────────────────────
   PROJECTS GRID
───────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}
.project-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.07);
}
.project-cover {
  width: 100%; height: 160px;
  object-fit: cover; border-radius: calc(var(--radius) - 2px);
  margin-bottom: 6px;
}
.project-title {
  font-family: var(--serif);
  font-size: 1.08rem; font-weight: 500; color: var(--ink);
  letter-spacing: -0.01em;
}
.project-desc {
  font-size: 0.875rem; color: var(--ink-muted);
  line-height: 1.6; flex: 1;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag {
  font-size: 0.7rem; font-weight: 500;
  padding: 3px 10px;
  background: var(--paper-warm);
  border: 1px solid var(--border);
  border-radius: 100px; color: var(--ink-muted);
  letter-spacing: 0.03em;
}
.project-url {
  font-size: 0.78rem; color: var(--accent);
  font-weight: 500; margin-top: 4px;
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none;
}
.project-url:hover { text-decoration: underline; }

/* ─────────────────────────────────────────
   TIMELINE
───────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 36px; padding: 36px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:first-child { border-top: 1px solid var(--border); }
.timeline-period {
  font-size: 0.8rem; color: var(--ink-faint);
  padding-top: 5px; line-height: 1.5;
}
.timeline-role {
  font-family: var(--serif);
  font-size: 1.1rem; font-weight: 500; color: var(--ink); margin-bottom: 3px;
}
.timeline-company { font-size: 0.875rem; color: var(--accent); font-weight: 500; margin-bottom: 11px; }
.timeline-desc {
  font-size: 0.875rem; color: var(--ink-muted); line-height: 1.7; max-width: 520px;
}
.timeline-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ─────────────────────────────────────────
   ABOUT
───────────────────────────────────────── */
.about-dark {
  background: var(--dark); color: var(--paper);
}
.about-dark .section-label { color: rgba(250,249,247,0.3); }
.about-dark .section-title { color: var(--paper); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.about-text { font-size: 1rem; color: rgba(250,249,247,0.68); line-height: 1.8; }
.about-text p + p { margin-top: 20px; }
.about-avatar {
  width: 100%; max-width: 240px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.about-details { display: flex; flex-direction: column; gap: 18px; }
.detail-label {
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(250,249,247,0.3); margin-bottom: 5px;
}
.detail-value { font-size: 0.9rem; color: rgba(250,249,247,0.75); }
.social-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.social-link {
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(250,249,247,0.45); text-decoration: none;
  border-bottom: 1px solid rgba(250,249,247,0.15); padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.social-link:hover { color: var(--paper); border-color: rgba(250,249,247,0.5); }

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
.footer {
  background: var(--dark);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 28px 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-note { font-size: 0.78rem; color: rgba(250,249,247,0.28); }
.footer-name { font-family: var(--serif); color: rgba(250,249,247,0.45); font-size: 0.85rem; }

/* ─────────────────────────────────────────
   ADMIN / CMS
───────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--dark);
  padding: 28px 0;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.admin-sidebar-logo {
  font-family: var(--serif); font-size: 1rem; font-weight: 600;
  color: var(--paper); padding: 0 24px 28px;
  display: block; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.07); margin-bottom: 16px;
}
.admin-sidebar-logo span { color: var(--accent); }
.admin-nav { display: flex; flex-direction: column; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 24px;
  font-size: 0.875rem; color: rgba(250,249,247,0.5);
  text-decoration: none; cursor: pointer;
  background: none; border: none; text-align: left; width: 100%;
  font-family: var(--sans);
  transition: color 0.2s, background 0.2s;
}
.admin-nav-item:hover { color: var(--paper); background: rgba(255,255,255,0.04); }
.admin-nav-item.active { color: var(--paper); background: rgba(255,255,255,0.07); }
.admin-nav-item .icon { font-size: 1rem; width: 20px; }
.admin-main { background: var(--paper); padding: 40px 48px; overflow-y: auto; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 36px;
}
.admin-topbar h1 {
  font-family: var(--serif); font-size: 1.8rem; font-weight: 500;
  letter-spacing: -0.02em;
}
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* CMS cards list */
.cms-list { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.cms-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: var(--paper-warm); border: 1px solid var(--border);
  border-radius: var(--radius); gap: 16px;
}
.cms-item-info { flex: 1; min-width: 0; }
.cms-item-title {
  font-family: var(--serif); font-size: 0.95rem; font-weight: 500;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cms-item-sub { font-size: 0.78rem; color: var(--ink-faint); margin-top: 3px; }
.cms-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* FORM */
.cms-form {
  background: var(--paper-warm); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  margin-top: 28px;
}
.cms-form h3 {
  font-family: var(--serif); font-size: 1.2rem; font-weight: 500;
  margin-bottom: 24px; letter-spacing: -0.01em;
}
.form-grid { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.78rem; font-weight: 500; color: var(--ink-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.field input,
.field textarea,
.field select {
  padding: 10px 14px;
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--sans); font-size: 0.9rem; color: var(--ink);
  transition: border-color 0.2s;
  width: 100%;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none; border-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.field small { font-size: 0.75rem; color: var(--ink-faint); }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

/* Stats row */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat-card {
  background: var(--paper-warm); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
}
.stat-number {
  font-family: var(--serif); font-size: 2rem; font-weight: 500;
  color: var(--ink); letter-spacing: -0.03em;
}
.stat-label { font-size: 0.78rem; color: var(--ink-faint); margin-top: 4px; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 9999;
  background: var(--ink); color: var(--paper);
  padding: 12px 22px; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500;
  transform: translateY(80px); opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: #2d7a4f; }
.toast.error { background: #c0392b; }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--ink-faint);
}
.empty-state .icon { font-size: 2.4rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ─────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ─────────────────────────────────────────
   PAGE HEADER (inner pages)
───────────────────────────────────────── */
.page-header {
  padding: 72px 56px 48px;
  max-width: 960px; margin: 0 auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.page-header .section-label { margin-bottom: 10px; }
.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500; letter-spacing: -0.03em;
  line-height: 1.15;
  opacity: 0; animation: fadeUp 0.6s ease 0.1s forwards;
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 840px) {
  .nav { padding: 0 24px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--border);
    padding: 16px 24px;
  }
  .nav-links.open a { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .nav-mobile-toggle { display: block; }
  .hero { padding: 56px 24px 64px; }
  .section { padding: 64px 24px; }
  .page-header { padding: 56px 24px 40px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .timeline-item { grid-template-columns: 1fr; gap: 6px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .footer { padding: 24px 24px; flex-direction: column; gap: 6px; text-align: center; }
  .post-card { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
  .admin-main { padding: 24px 20px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
