/* Irbet Tong Hub — quiet evening journal */
:root {
  --paper: #F7F1E8;
  --paper-warm: #EDE6DA;
  --paper-shadow: #D4C9B8;
  --ink: #1C1917;
  --ink-muted: #57534E;
  --ink-faint: #78716C;
  --accent: #5B8FA8;
  --accent-soft: rgba(91, 143, 168, 0.18);
  --accent-line: rgba(91, 143, 168, 0.35);
  --rule: rgba(28, 25, 23, 0.12);
  --rule-light: rgba(28, 25, 23, 0.06);
  --font-display: "Noto Naskh Arabic", "Traditional Arabic", serif;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  --max-width: 1080px;
  --article-width: 680px;
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.85;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      var(--rule-light) 27px,
      var(--rule-light) 28px
    );
  pointer-events: none;
  z-index: -1;
  opacity: 0.55;
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-line);
  transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
  width: min(var(--max-width), 90vw);
  margin-inline: auto;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 241, 232, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  width: min(var(--max-width), 90vw);
  margin-inline: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover { color: var(--ink); text-decoration: none; }

.brand-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-tagline {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-faint);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  font-size: 0.88rem;
  color: var(--ink-muted);
  text-decoration: none;
  position: relative;
}

.site-nav a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  inset-inline: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a:hover::after { transform: scaleX(1); }

.geo-mark {
  font-size: 0.75rem;
  color: var(--ink-faint);
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  white-space: nowrap;
}

/* ── Notebook rule ── */
.notebook-rule {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--rule) 8%,
    var(--rule) 92%,
    transparent 100%
  );
  margin-block: 2rem;
}

.notebook-rule--accent {
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent-line) 15%,
    var(--accent-line) 85%,
    transparent 100%
  );
}

/* ── Hero ── */
.hero {
  padding: 3rem 0 2.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
  }
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--accent-line);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 1rem;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-desc {
  font-size: 1.02rem;
  color: var(--ink-muted);
  max-width: 52ch;
  margin-bottom: 1.25rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.hero-meta span {
  padding-inline-end: 1rem;
  border-inline-end: 1px solid var(--rule);
}

.hero-meta span:last-child { border: none; padding: 0; }

.hero-visual {
  position: relative;
  border: 1px solid var(--rule);
  background: var(--paper-warm);
  padding: 0.5rem;
}

.hero-visual img {
  width: 100%;
  aspect-ratio: 800 / 420;
  object-fit: cover;
}

.hero-visual figcaption {
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-align: center;
  padding: 0.5rem 0 0.25rem;
  font-family: var(--font-display);
}

/* ── Feed section ── */
.feed-section {
  padding: 1rem 0 4rem;
}

.feed-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--ink);
}

.feed-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.feed-header p {
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.feed-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 768px) {
  .feed-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0 2.5rem;
  }
}

/* ── Entry card ── */
.entry-card {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: background 0.2s;
}

.entry-card:hover {
  background: rgba(91, 143, 168, 0.04);
  color: inherit;
  text-decoration: none;
}

@media (min-width: 768px) {
  .feed-grid .entry-card:nth-child(odd) {
    border-inline-end: 1px solid var(--rule);
    padding-inline-end: 2.5rem;
  }
}

.entry-date {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.entry-date::before {
  content: "—";
  color: var(--ink-faint);
  font-weight: 300;
}

.entry-thumb {
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--rule);
  overflow: hidden;
}

.entry-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: saturate(0.85);
  transition: filter 0.3s;
}

.entry-card:hover .entry-thumb img { filter: saturate(1); }

.entry-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.entry-card:hover .entry-title { color: var(--accent); }

.entry-lead {
  font-size: 0.92rem;
  color: var(--ink-muted);
  line-height: 1.75;
}

.entry-tag {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--ink-faint);
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

/* ── Article page ── */
.article-page {
  padding: 2.5rem 0 4rem;
}

.article-back {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: none;
  margin-bottom: 2rem;
}

.article-back:hover { color: var(--accent); }

.article-header {
  max-width: var(--article-width);
  margin-inline: auto;
  margin-bottom: 2rem;
}

.article-date {
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.article-deck {
  font-size: 1.05rem;
  color: var(--ink-muted);
  line-height: 1.8;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.article-hero-img {
  max-width: var(--article-width);
  margin: 0 auto 2.5rem;
  border: 1px solid var(--rule);
}

.article-hero-img img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-body {
  max-width: var(--article-width);
  margin-inline: auto;
  font-size: 1rem;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2.25rem 0 0.75rem;
  padding-top: 0.5rem;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: var(--ink-muted);
}

.article-body p {
  margin-bottom: 1.15rem;
  color: var(--ink);
}

.article-body ul, .article-body ol {
  margin: 0 0 1.15rem 1.5rem;
  color: var(--ink-muted);
}

.article-body li { margin-bottom: 0.4rem; }

.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-inline-start: 3px solid var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.article-body .steam-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.patch-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.patch-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule-light);
  font-size: 0.92rem;
}

.patch-list li strong {
  color: var(--accent);
  font-weight: 600;
}

/* ── About page ── */
.about-page {
  padding: 2.5rem 0 4rem;
}

.about-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2rem);
  margin-bottom: 1.5rem;
}

.about-content {
  max-width: var(--article-width);
}

.about-content p {
  margin-bottom: 1.15rem;
  color: var(--ink-muted);
}

.about-content h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
}

/* ── Legal pages ── */
.legal-page {
  padding: 2.5rem 0 4rem;
}

.legal-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 1.85rem);
  margin-bottom: 0.5rem;
}

.legal-updated {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.legal-page h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 1.75rem 0 0.65rem;
}

.legal-page p, .legal-page li {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.legal-page ul {
  margin: 0 1.5rem 1rem 0;
}

.legal-back {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.legal-back:hover { color: var(--accent); }

/* ── Footer ── */
.site-footer {
  border-top: 2px solid var(--ink);
  padding: 2rem 0 2.5rem;
  background: var(--paper-warm);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: var(--ink-faint);
  max-width: 42ch;
  line-height: 1.65;
  margin-top: 0.35rem;
}

.footer-disclaimer-en {
  font-size: 0.72rem;
  color: var(--ink-faint);
  opacity: 0.85;
  margin-top: 0.5rem;
  direction: ltr;
  text-align: left;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--accent); }

.footer-geo {
  font-size: 0.78rem;
  color: var(--ink-faint);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  width: 100%;
}

/* ── Cookie banner ── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 1rem 1.25rem;
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -4px 24px rgba(28, 25, 23, 0.15);
}

.cookie-banner.is-visible { transform: translateY(0); }

.cookie-inner {
  width: min(var(--max-width), 92vw);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .cookie-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cookie-text {
  font-size: 0.85rem;
  line-height: 1.65;
  opacity: 0.9;
}

.cookie-text a {
  color: var(--paper);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 0.65rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.5rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s;
}

.cookie-btn--accept {
  background: var(--accent);
  color: var(--paper);
}

.cookie-btn--accept:hover { background: #4a7a92; }

.cookie-btn--decline {
  background: transparent;
  color: var(--paper);
  border: 1px solid rgba(247, 241, 232, 0.35);
}

.cookie-btn--decline:hover {
  background: rgba(247, 241, 232, 0.1);
}

/* ── Mobile nav toggle ── */
.nav-toggle {
  display: none;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    inset-inline: 0;
    background: var(--paper);
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--rule);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .geo-mark { display: none; }
}
