:root {
  color-scheme: light;
  --bg: #f4efe9;
  --surface: #fffaf4;
  --surface-soft: #eee4da;
  --text: #2d241f;
  --muted: #75685f;
  --line: #dccfc3;
  --accent: #a47864;
  --accent-strong: #6f4e3f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.site-header,
.site-main,
.site-footer {
  width: min(100% - 32px, 980px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
}

.site-title {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--accent-strong);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: center;
  gap: 48px;
  padding: 72px 0 56px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.25rem, 8vw, 4.75rem);
  line-height: 1;
}

.hero-copy > p:last-of-type {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.15rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  font-weight: 650;
  text-decoration: none;
}

.contact-links a:hover,
.contact-links a:focus {
  border-color: var(--accent);
  background: #ffffff;
}

.hero-avatar {
  width: 240px;
  height: 240px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 28%;
  box-shadow: 0 18px 45px rgb(111 78 63 / 0.16);
}

.content-section,
.overview-section,
.page-header,
.post {
  padding: 48px 0;
}

.overview-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  border-bottom: 1px solid var(--line);
}

.overview-section h2 {
  max-width: 420px;
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1.08;
}

.overview-copy {
  color: var(--muted);
  font-size: 1.15rem;
}

.overview-copy p {
  margin: 0;
}

.overview-copy p + p {
  padding-top: 18px;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.skill-list li {
  padding: 7px 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.92rem;
}

.location {
  color: var(--accent-strong);
  font-weight: 650;
}

.page-header {
  border-top: 1px solid var(--line);
}

.page-header h1 {
  font-size: clamp(2rem, 7vw, 3.5rem);
}

.page-intro {
  max-width: 680px;
  color: var(--muted);
}

.post-list {
  display: grid;
  gap: 18px;
}

.post-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.post-card--compact {
  padding: 20px;
}

.post-card h2,
.post-card h3 {
  margin: 0 0 8px;
  line-height: 1.25;
}

.post-card .summary {
  margin: 12px 0 0;
  color: var(--muted);
}

.post-card--compact .summary {
  font-size: 0.98rem;
  line-height: 1.5;
}

.post-card .summary p {
  margin: 0;
}

time {
  color: var(--muted);
  font-size: 0.92rem;
}

.post-content {
  max-width: 720px;
  font-size: 1.05rem;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 40px;
  align-items: start;
}

.posts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 40px;
  align-items: start;
}

.post-toc,
.category-nav {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px;
  background: linear-gradient(180deg, #fffaf4 0%, #f1e4da 100%);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgb(111 78 63 / 0.1);
  color: var(--accent-strong);
  font-size: 1rem;
}

.post-toc p,
.category-nav p {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.category-nav nav {
  display: grid;
  gap: 10px;
}

.category-nav__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: var(--accent-strong);
  line-height: 1.35;
  text-decoration: none;
}

.category-nav__item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.category-nav__item:hover,
.category-nav__item:focus,
.category-nav__item--active {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.1em;
}

.post-toc nav ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-toc nav ul ul {
  gap: 8px;
  margin-top: 8px;
  padding-left: 16px;
  border-left: 2px solid rgb(164 120 100 / 0.24);
  font-size: 0.95rem;
}

.post-toc a {
  display: block;
  padding: 4px 0;
  color: var(--accent-strong);
  line-height: 1.35;
  text-decoration: none;
}

.post-toc a:hover,
.post-toc a:focus {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.1em;
}

.heading-anchor {
  color: inherit;
  text-decoration: none;
}

.heading-anchor:hover,
.heading-anchor:focus {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.08em;
}

.post-content h2,
.post-content h3 {
  scroll-margin-top: 24px;
}

.term-list {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.term-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a:focus {
  color: var(--accent-strong);
  text-decoration: underline;
}

.footer-button {
  display: inline;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.footer-button:hover,
.footer-button:focus {
  color: var(--accent-strong);
  text-decoration: underline;
}

.cookie-consent {
  position: fixed;
  right: max(16px, calc((100vw - 980px) / 2));
  bottom: 16px;
  left: max(16px, calc((100vw - 980px) / 2));
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgb(111 78 63 / 0.18);
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent__copy {
  display: grid;
  gap: 6px;
}

.cookie-consent__copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.cookie-consent__copy .cookie-consent__title {
  color: var(--text);
  font-weight: 700;
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.cookie-consent__button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}

.cookie-consent__button--secondary {
  background: transparent;
  color: var(--accent-strong);
}

.cookie-consent__button--primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--surface);
}

.cookie-consent__button:hover,
.cookie-consent__button:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(164 120 100 / 0.18);
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 48px 0 40px;
  }

  .hero-avatar {
    order: -1;
    width: 144px;
    height: 144px;
  }

  .overview-section {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .post-layout {
    display: block;
  }

  .posts-layout {
    display: block;
  }

  .category-nav {
    position: static;
    max-height: none;
    margin-bottom: 24px;
  }

  .post-toc {
    display: none;
  }

  .cookie-consent {
    grid-template-columns: 1fr;
  }

  .cookie-consent__actions {
    justify-content: stretch;
  }

  .cookie-consent__button {
    flex: 1 1 180px;
  }
}
