:root {
  --font-sans: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: "Georgia", "Times New Roman", serif;
  --color-bg: #f6f6f4;
  --color-surface: #ffffff;
  --color-muted: #717379;
  --color-text: #2c2d30;
  --color-border: #e0e1e3;
  --color-code: #f1f2f4;
  --shadow-soft: 0 18px 48px rgba(30, 31, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.75;
}

.masthead {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.masthead__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand__link {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  text-decoration: none;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.brand__tagline {
  margin: 4px 0 0;
  font-size: 16px;
  color: var(--color-muted);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

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

main {
  max-width: 880px;
  margin: 48px auto 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 28px;
  padding: clamp(32px, 6vw, 64px);
  box-shadow: var(--shadow-soft);
}

header.post-header {
  max-width: 880px;
  margin: 0 auto 24px;
  padding: 0 32px;
}

.post-header h1 {
  margin: 48px 0 12px;
  font-size: clamp(32px, 6vw, 48px);
  letter-spacing: -0.015em;
}

.post-header time {
  color: var(--color-muted);
}

article > *:first-child {
  margin-top: 0;
}

article > * {
  margin-bottom: 28px;
}

h2 {
  margin: 48px 0 16px;
  font-size: clamp(24px, 4vw, 32px);
}

h3 {
  margin: 32px 0 16px;
  font-size: clamp(20px, 3vw, 26px);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(0, 0, 0, 0.2);
}

a:hover,
a:focus {
  text-decoration-color: rgba(0, 0, 0, 0.4);
}

p {
  margin: 0 0 22px;
  font-size: 18px;
}

ul,
ol {
  padding-left: 26px;
  margin: 0 0 28px;
}

blockquote {
  margin: 0;
  padding: 18px 24px;
  border-left: 3px solid #c9cacc;
  background: #f3f4f5;
  border-radius: 16px;
  font-style: italic;
}

pre {
  overflow-x: auto;
  background: var(--color-code);
  padding: 20px;
  border-radius: 18px;
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 28px;
  border: 1px solid var(--color-border);
}

code {
  background: var(--color-code);
  padding: 0 4px;
  border-radius: 4px;
  font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

figure {
  margin: 0 0 28px;
}

figure img,
figure video {
  width: 100%;
  display: block;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  box-shadow: 0 12px 36px rgba(35, 37, 40, 0.15);
}

figure video {
  height: auto;
  background: #000;
}

figure figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: var(--color-muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  overflow: hidden;
  font-size: 16px;
}

table caption {
  caption-side: bottom;
  padding: 12px 18px;
  font-size: 15px;
  color: var(--color-muted);
  text-align: left;
}

table thead th {
  background: #eef0f3;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--color-text);
}

table th,
table td {
  padding: 14px 18px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

table th:last-child,
table td:last-child {
  border-right: none;
}

table tbody tr:last-child td {
  border-bottom: none;
}

table tbody tr:nth-child(even) td {
  background: #f9fafc;
}

.footer {
  margin-top: 48px;
  text-align: center;
  color: var(--color-muted);
  font-size: 15px;
}

.footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.footer a:hover,
.footer a:focus {
  border-color: rgba(0, 0, 0, 0.3);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 32px;
  text-align: center;
  color: var(--color-muted);
  font-size: 14px;
  margin-top: 72px;
}

@media (max-width: 860px) {
  .masthead__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
  }

  header.post-header {
    padding: 0 22px;
  }

  .post-header h1 {
    margin-top: 32px;
  }
}

@media (max-width: 640px) {
  main {
    margin: 32px auto 0;
    padding: 28px 20px;
  }

  p {
    font-size: 17px;
  }

  table {
    font-size: 15px;
  }

  table th,
  table td {
    padding: 12px 14px;
  }
}
