:root {
  color-scheme: light;
  --bg: #f6f9fc;
  --panel: #ffffff;
  --text: #1b2430;
  --muted: #5b6b7c;
  --line: #e7edf3;
  --accent: #007acc;
  --accent-dark: #005f9f;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

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

a:hover {
  text-decoration: underline;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0;
}

.brand img {
  width: 30px;
  height: 30px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 122, 204, 0.12);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.nav span {
  display: flex;
  gap: 16px;
}

.page {
  padding: 48px 0 72px;
}

.blog-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 760px) 240px;
  gap: 24px;
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 72px;
  align-items: start;
}

.feed {
  min-width: 0;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 34px 32px 38px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 88% 8%, rgba(0, 172, 239, 0.26), transparent 260px),
    var(--panel);
  box-shadow: 0 18px 40px rgba(16, 42, 67, 0.06);
}

.float-panel {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 40px rgba(16, 42, 67, 0.07);
  backdrop-filter: blur(12px);
}

.panel-logo {
  width: 72px;
  height: 72px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(0, 122, 204, 0.16);
}

.panel-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.float-panel h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.35;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}

.side-link::after {
  content: "→";
  color: var(--accent);
}

.side-link:hover {
  border-color: #cfe6f7;
  color: var(--accent-dark);
  text-decoration: none;
  transform: translateY(-1px);
}

.side-link.primary {
  background: linear-gradient(120deg, #0061d6, #00acef);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 122, 204, 0.22);
}

.side-link.primary::after {
  color: #fff;
}

.side-auth {
  display: grid;
  gap: 10px;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 6px 12px;
  border: 1px solid #d3ebf9;
  border-radius: 999px;
  background: #e8f4fc;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(38px, 6vw, 64px);
  max-width: 760px;
}

h1 span {
  background: linear-gradient(120deg, #0044cc, #00acef);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  color: var(--muted);
  font-size: 18px;
  max-width: 680px;
  margin: 0;
}

.post-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 18px 0 28px;
}

.feature-card {
  display: block;
  min-height: 150px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(16, 42, 67, 0.08);
  text-decoration: none;
}

.feature-card h2 {
  font-size: 22px;
}

.feature-card p:last-child {
  color: var(--muted);
  margin-bottom: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 10px;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.post-card,
.editor,
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.post-card {
  padding: 22px;
}

.post-card h2 {
  font-size: 24px;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 8px;
}

.empty,
.error {
  color: var(--muted);
  padding: 18px 0;
}

.error {
  color: var(--danger);
}

.article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 5vw, 42px);
}

.article-body {
  font-size: 18px;
}

.article-body pre {
  overflow-x: auto;
  background: #1f2933;
  color: #f8fafc;
  padding: 16px;
  border-radius: 6px;
}

.article-body code {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.article-body img {
  max-width: min(100%, 680px);
  border-radius: 12px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 24px;
}

.profile-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.profile-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 16px;
}

.profile-card h3 {
  margin-bottom: 6px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  background: transparent;
  color: var(--accent-dark);
}

.button.danger,
button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.editor {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.preview-body {
  max-height: 520px;
  overflow: auto;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 10px;
  margin: 14px 0;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d7e2ec;
  border-radius: 10px;
  background: #fbfdff;
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input,
select {
  min-height: 44px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.12);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

input[type="file"] {
  padding: 8px;
}

input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

textarea {
  min-height: 360px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
  line-height: 1.5;
}

.admin-tooling textarea {
  min-height: 150px;
}

.inline-control {
  max-width: 260px;
  margin: 10px 0 22px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-uploader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px dashed #cfe0ed;
  border-radius: 12px;
  background: #f8fbfe;
}

.inline-uploader:has(input[type="hidden"]:last-child) {
  grid-template-columns: 1fr;
}

.inline-uploader button {
  min-height: 44px;
}

.auth-panel {
  padding: 24px;
}

@media (max-width: 680px) {
  .topbar .shell,
  .toolbar,
  .grid {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .admin-layout,
  .filters,
  .profile-grid,
  .inline-uploader {
    grid-template-columns: 1fr;
  }

  .nav,
  .actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 1180px) {
  .blog-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(920px, calc(100% - 32px));
  }

  .float-panel {
    position: static;
  }

  .float-left,
  .float-right {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
  }

  .float-panel h2,
  .panel-kicker,
  .panel-logo {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .float-left,
  .float-right {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 26px 22px 30px;
  }
}
