:root {
  color-scheme: light dark;
  --bg: #fbf3e7;
  --text: #1f2623;
  --muted: #62706a;
  --accent: #9b4d14;
  --card: #fffaf1;
  --border: #dfd3c2;
  --focus: #c7641c;
  --sidebar-bg: #0f0f0f;
  --sidebar-surface: #1a1a1a;
  --sidebar-text: #e6e1d9;
  --sidebar-muted: #aaa39b;
  --sidebar-accent: #ff9e3d;
  --sidebar-amber: #f5c16c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181512;
    --text: #e6e1d9;
    --muted: #aaa39b;
    --accent: #ffb15c;
    --card: #211c17;
    --border: #3a2a1d;
    --focus: #f5c16c;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf3e7;
  --text: #1f2623;
  --muted: #62706a;
  --accent: #9b4d14;
  --card: #fffaf1;
  --border: #dfd3c2;
  --focus: #c7641c;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181512;
  --text: #e6e1d9;
  --muted: #aaa39b;
  --accent: #ffb15c;
  --card: #211c17;
  --border: #3a2a1d;
  --focus: #f5c16c;
}

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

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

.app-shell {
  min-height: 100vh;
}

.site-title {
  color: var(--sidebar-text);
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.05;
  text-decoration: none;
}

.site-sidebar {
  background: radial-gradient(circle at top left, #241a12 0, var(--sidebar-bg) 34rem);
  color: var(--sidebar-text);
  padding: 30px 22px;
}

.profile-link {
  display: inline-block;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 112px;
  height: 112px;
  border: 3px solid var(--sidebar-accent);
  border-radius: 999px;
  box-shadow: 0 0 0 8px rgb(255 158 61 / 12%);
  object-fit: cover;
}

.profile-copy p {
  color: var(--sidebar-muted);
  margin: 12px 0 0;
}

.sidebar-nav,
.sidebar-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 24px;
}

.sidebar-nav a,
.sidebar-social a {
  align-items: center;
  color: var(--sidebar-amber);
  display: inline-flex;
  gap: 7px;
  text-decoration: none;
}

.social-icon {
  display: inline-block;
  fill: currentColor;
  height: 1.05rem;
  width: 1.05rem;
}

.sidebar-nav a {
  color: var(--sidebar-accent);
  font-weight: 700;
}

.theme-toggle {
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  height: 2rem;
  justify-content: center;
  padding: 0;
  width: 2rem;
}

.theme-toggle:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.theme-icon {
  fill: none;
  height: 1.1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 1.1rem;
}

.theme-icon-dark {
  fill: currentColor;
  stroke: none;
}

.content-shell {
  background: var(--bg);
}

.content-toolbar,
.app-container,
.site-footer {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
}

.content-toolbar {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
}

.hero {
  padding: 18px 0 24px;
}

.hero h1,
.page-heading h1,
.article h1 {
  max-width: 780px;
  font-size: clamp(2rem, 4.4vw, 3.45rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.hero p,
.summary {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow,
.badge {
  color: var(--accent);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

.writing-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin: 14px 0 34px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 22px;
}

.card h3 {
  margin-top: 0;
  font-size: 1.4rem;
  line-height: 1.15;
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
}

time,
.card p {
  color: var(--muted);
}

.article {
  max-width: 760px;
  margin: 48px auto 80px;
}

.article-body img {
  max-width: 100%;
}

.article-body code {
  font-size: 0.9em;
}

.article-body blockquote {
  background: color-mix(in srgb, var(--card) 78%, var(--accent));
  border-left: 4px solid var(--accent);
  border-radius: 0 14px 14px 0;
  color: var(--text);
  font-size: 1.08rem;
  font-style: italic;
  line-height: 1.55;
  margin: 2rem 0;
  padding: 1.1rem 1.35rem;
}

.article-body blockquote p {
  margin: 0;
}

.article-body blockquote p::before {
  content: "\201C";
}

.article-body blockquote p::after {
  content: "\201D";
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 18px 0 26px;
}

@media (min-width: 880px) {
  .app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .site-sidebar {
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: start;
  }

  .content-shell {
    min-height: 100vh;
  }

  .content-toolbar,
  .app-container,
  .site-footer {
    width: min(820px, calc(100% - 72px));
  }
}

@media (max-width: 879px) {
  .site-sidebar {
    padding: 24px 20px;
  }

  .profile-avatar {
    width: 88px;
    height: 88px;
  }

  .hero {
    padding-top: 18px;
  }
}
