/* RasiTech Blog — editorial design system */
:root {
  --bg: #eef2f6;
  --bg-elevated: #f7f9fc;
  --ink: #0f1c2e;
  --ink-soft: #3d4f66;
  --ink-muted: #6b7c90;
  --line: rgba(15, 28, 46, 0.12);
  --accent: #0a7c72;
  --accent-deep: #065f58;
  --accent-soft: rgba(10, 124, 114, 0.12);
  --danger: #c23b4a;
  --radius: 4px;
  --max: 720px;
  --max-wide: 1100px;
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-ui: "Manrope", system-ui, sans-serif;
  --shadow-soft: 0 18px 50px rgba(15, 28, 46, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(10, 124, 114, 0.16), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(47, 92, 140, 0.12), transparent 50%),
    linear-gradient(180deg, #f4f7fb 0%, var(--bg) 40%, #e8eef4 100%);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 70%);
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
}

.site-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(247, 249, 252, 0.82);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand span {
  color: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
}

.nav a,
.nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.nav a:hover,
.nav button:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

/* —— Hero —— */
.hero {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 2.25rem;
  animation: rise-in 0.7s var(--ease) both;
}

.hero-brand {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
  color: var(--ink);
}

.hero-brand em {
  font-style: normal;
  color: var(--accent);
}

.hero-title {
  margin: 0 0 0.75rem;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}

.hero-lead {
  margin: 0 0 1.5rem;
  max-width: 38ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-deep);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* —— Main feed —— */
.main {
  flex: 1;
  width: 100%;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.75rem;
  animation: rise-in 0.75s var(--ease) 0.08s both;
}

.search-field {
  flex: 1 1 240px;
  display: flex;
  align-items: stretch;
  min-width: 0;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0.75rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--ink);
}

.search-field button,
.toolbar > .btn {
  flex: 0 0 auto;
}

.search-field button {
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  padding: 0 1rem;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent-deep);
  cursor: pointer;
}

.section-label {
  margin: 0 0 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.posts-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  animation: rise-in 0.8s var(--ease) 0.12s both;
}

.post-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem 1.25rem;
  align-items: start;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.25s var(--ease), padding-left 0.25s var(--ease);
}

.post-item:hover {
  background: linear-gradient(90deg, rgba(10, 124, 114, 0.06), transparent 70%);
  padding-left: 0.5rem;
}

.post-index {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 2ch;
  padding-top: 0.2rem;
}

.post-body h2 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--ink);
}

.post-excerpt {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.55;
}

.post-meta {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.post-cta {
  align-self: center;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-deep);
  opacity: 0.75;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.post-item:hover .post-cta {
  opacity: 1;
  transform: translateX(3px);
}

.empty-state {
  padding: 2.5rem 0;
  color: var(--ink-muted);
  text-align: center;
  font-family: var(--font-body);
}

/* —— Pagination —— */
.pagination {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;
}

.pagination-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.page-btn {
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.page-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(247, 249, 252, 0.7);
  padding: 1.5rem 1.25rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer strong {
  color: var(--ink-soft);
}

/* —— Article reader (full-screen) —— */
.article-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  background:
    radial-gradient(900px 400px at 50% -10%, rgba(10, 124, 114, 0.12), transparent 55%),
    var(--bg-elevated);
  animation: fade-in 0.28s var(--ease);
}

.article-overlay.is-open {
  display: flex;
}

.article-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  backdrop-filter: blur(12px);
  background: rgba(247, 249, 252, 0.88);
  border-bottom: 1px solid var(--line);
}

.article-toolbar .brand {
  font-size: 1.05rem;
}

.article-actions {
  display: flex;
  gap: 0.5rem;
}

.article-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 1.25rem 4rem;
}

.article-content {
  max-width: var(--max);
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--ink);
  animation: rise-in 0.45s var(--ease);
}

.article-content > :first-child {
  margin-top: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}

.article-content h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 1.25rem;
}

.article-content h2 {
  font-size: 1.45rem;
  margin: 2rem 0 0.75rem;
}

.article-content h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.6rem;
}

.article-content p {
  margin: 0 0 1.1rem;
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.1rem;
  padding-left: 1.35rem;
}

.article-content li {
  margin-bottom: 0.35rem;
}

.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.article-content pre {
  overflow-x: auto;
  padding: 1rem;
  background: #0f1c2e;
  color: #e8eef4;
  border-radius: var(--radius);
  margin: 0 0 1.25rem;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.article-content blockquote {
  margin: 0 0 1.25rem;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}

.article-content a {
  color: var(--accent-deep);
}

.article-kicker {
  margin: 0 0 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* —— Toast —— */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  z-index: 200;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.is-warn {
  background: var(--danger);
}

.toast.is-ok {
  background: var(--accent-deep);
}

/* —— About / Editor pages —— */
.page-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.25rem 1.5rem;
  animation: rise-in 0.7s var(--ease) both;
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.page-hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 42ch;
}

.prose {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 3.5rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink);
  animation: rise-in 0.75s var(--ease) 0.08s both;
}

.prose p {
  margin: 0 0 1.15rem;
}

.editor-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
  animation: rise-in 0.7s var(--ease) both;
}

.editor-wrap h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.04em;
}

.editor-wrap .sub {
  margin: 0 0 1.75rem;
  color: var(--ink-soft);
}

.field {
  margin-bottom: 1.15rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.85rem 1rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field textarea {
  min-height: 280px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.preview-panel {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.preview-panel h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.preview-content {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .post-item {
    grid-template-columns: auto 1fr;
  }

  .post-cta {
    display: none;
  }

  .hero {
    padding-top: 2.5rem;
  }

  .nav a,
  .nav button {
    padding: 0.4rem 0.55rem;
    font-size: 0.82rem;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
