/*
Theme Name: Low Ritual Blog
Theme URI: https://blog.lowritual.com
Author: LOWRITUAL
Description: Minimal journal — white, restrained, catalogue-driven.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.7
License: Proprietary
Text Domain: lowritual-blog
*/

:root {
  --bg: #ffffff;
  --ink: #111111;
  --ink-soft: #333333;
  --muted: #8a8a8a;
  --faint: #b9b9b9;
  --line: #e8e8e8;
  --line-soft: #f0f0f0;
  --accent: #ff2a00;

  --font-sans: "Rajdhani", "Helvetica Neue", sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;

  --gutter: clamp(2.5rem, 9vw, 9rem);
  --maxw: 1080px;
  --speed: 180ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.005em;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--bg); }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }

h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.3rem); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Header */
.site-head {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}
.brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nav { display: flex; gap: 1.6rem; }
.nav a { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); position: relative; padding: 0.2rem 0; }
.nav a:hover { color: var(--ink); }
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav a:hover::after { transform: scaleX(1); }

/* menu button */
.menu-btn {
  display: none;
  position: relative;
  z-index: 3001;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
}
.menu-btn span {
  position: absolute;
  left: 10px; width: 24px; height: 2px;
  background: var(--ink);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}
.menu-btn span:nth-child(1) { top: 15px; }
.menu-btn span:nth-child(2) { top: 21px; }
.menu-btn span:nth-child(3) { top: 27px; }
.menu-btn.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.is-open span:nth-child(2) { opacity: 0; }
.menu-btn.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* fullscreen menu */
body.menu-open { overflow: hidden; }
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 2999;
  background: var(--ink);
  display: flex;
  align-items: center;
  padding: 6rem var(--gutter) 4rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}
.menu-overlay.is-open { opacity: 1; visibility: visible; }
.menu-overlay__list { list-style: none; width: 100%; max-width: var(--maxw); margin: 0 auto; }
.menu-overlay__list li { overflow: hidden; }
.menu-overlay__list a {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  font-size: clamp(1.6rem, 4.5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  padding: 0.3rem 0;
  color: var(--bg);
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
}
.menu-overlay.is-open li a { opacity: 1; transform: translateY(0); }
.menu-overlay li:nth-child(1) a { transition-delay: 0.06s; }
.menu-overlay li:nth-child(2) a { transition-delay: 0.12s; }
.menu-overlay li:nth-child(3) a { transition-delay: 0.18s; }
.menu-overlay li:nth-child(4) a { transition-delay: 0.24s; }
.menu-overlay__num { font-family: var(--font-mono); font-size: 0.4em; color: var(--muted); }
.menu-overlay__list a:hover { color: var(--accent); }

/* Home hero */
.blog-hero { padding: clamp(3rem, 8vw, 5.5rem) 0 2.5rem; border-bottom: 1px solid var(--line); }
.blog-hero__mark {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.blog-hero h1 { margin: 1rem 0 0.75rem; }

/* marquee */
.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
  white-space: nowrap;
}
.marquee__track {
  display: inline-block;
  white-space: nowrap;
  animation: marquee 22s linear infinite;
}
.marquee__track span {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.5vw, 1.05rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 1.4rem;
  color: var(--ink);
}
.marquee__track .dot { color: var(--accent); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Post list */
.post-item { padding: 2.1rem 0.5rem; border-bottom: 1px solid var(--line-soft); transition: background var(--speed) ease, color var(--speed) ease; }
.post-item:hover { background: var(--ink); color: var(--bg); }
.post-item__meta { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; margin-bottom: 0.4rem; }
.post-item__meta .cat { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); transition: color var(--speed) ease; }
.post-item:hover .post-item__meta .cat { color: var(--faint); }
.post-item__meta time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; transition: color var(--speed) ease; }
.post-item:hover .post-item__meta time { color: var(--faint); }
.post-item h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); margin-bottom: 0.4rem; }
.post-item h2 a:hover { color: var(--muted); }
.post-item:hover h2 a:hover { color: var(--accent); }
.post-item__excerpt { color: var(--muted); max-width: 70ch; font-size: 14px; transition: color var(--speed) ease; }
.post-item:hover .post-item__excerpt { color: var(--faint); }
.post-item__thumb { margin-bottom: 1.2rem; aspect-ratio: 21/9; border: 1px solid var(--line); overflow: hidden; }
.post-item__thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Single */
.article-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; border-bottom: 1px solid var(--line); }
.article-head h1 { margin: 1rem 0 0; }
.article-head__meta { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.article-head__meta .cat { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.article-head__meta time, .article-head__meta span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; }
.article-hero { margin: 2.5rem 0 0; aspect-ratio: 21/9; border: 1px solid var(--line); overflow: hidden; }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }

.entry { padding: 3rem 0 4rem; max-width: 70ch; }
.entry p { margin-bottom: 1.4rem; color: var(--ink-soft); }
.entry h2, .entry h3 { margin: 2.5rem 0 1rem; }
.entry a { color: var(--ink); border-bottom: 1px solid var(--ink); }
.entry ul, .entry ol { padding-left: 1.5rem; margin-bottom: 1.4rem; color: var(--ink-soft); }
.entry li { margin-bottom: 0.5rem; }
.entry blockquote { border-left: 2px solid var(--ink); padding: 0.25rem 0 0.25rem 1.5rem; margin: 2rem 0; font-size: 1.3rem; line-height: 1.35; }
.entry img { margin: 1.5rem 0; }

/* Pagination */
.pagination { padding: 3rem 0; display: flex; gap: 1rem; }
.pagination a, .pagination span {
  border: 1px solid var(--line);
  padding: 0.6rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.pagination .current { border-color: var(--ink); color: var(--ink); }

/* Page */
.page-head { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.page-content { padding: 3rem 0 4rem; max-width: 70ch; }
.page-content p { margin-bottom: 1.4rem; color: var(--ink-soft); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 3.5rem 0 2.5rem; margin-top: 3rem; }
.site-foot__grid { display: flex; flex-wrap: wrap; gap: 2rem 4rem; justify-content: space-between; margin-bottom: 3rem; }
.site-foot .brand { display: block; margin-bottom: 1rem; }
.site-foot p { color: var(--muted); font-size: 13px; max-width: 36ch; }
.site-foot h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.site-foot ul { list-style: none; }
.site-foot li { margin-bottom: 0.5rem; }
.site-foot li a { color: var(--ink-soft); font-size: 13px; }
.site-foot li a:hover { color: var(--ink); }
.site-foot__bottom {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-top: 1.5rem; border-top: 1px solid var(--line-soft);
  color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}

/* 404 */
.err404 { min-height: 65vh; display: flex; flex-direction: column; justify-content: center; }
.err404 h1 { font-size: clamp(4rem, 16vw, 12rem); font-weight: 600; letter-spacing: -0.04em; }
.err404 p { color: var(--muted); margin: 1rem 0 2rem; }
.err404 a { border: 1px solid var(--ink); padding: 0.7rem 1.4rem; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.455, 0.03, 0.515, 0.955), transform 0.7s cubic-bezier(0.455, 0.03, 0.515, 0.955);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

@media (max-width: 620px) {
  .nav { display: none; }
  .menu-btn { display: block; }
  .post-item__thumb, .article-hero { aspect-ratio: 16/9; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .menu-overlay__list a { opacity: 1; transform: none; }
}
