:root {
  --font-ui: "Space Mono", "Roboto Mono", "Courier New", monospace;
  --font-body: Inter, "Segoe UI", system-ui, sans-serif;
  --color-bg: #f4f1ea;
  --color-bg-strong: #fbf8f1;
  --color-surface: rgba(255, 252, 245, 0.86);
  --color-surface-strong: rgba(255, 253, 248, 0.96);
  --color-text: #2c3525;
  --color-muted: #5d6756;
  --color-line: rgba(44, 53, 37, 0.14);
  --color-line-strong: rgba(44, 53, 37, 0.24);
  --color-accent: #ff5a00;
  --color-accent-soft: rgba(255, 90, 0, 0.12);
  --color-hero: #e9e3d4;
  --color-command: #efe8d8;
  --color-dark: #1e1e1e;
  --page-width: 1280px;
  --reading-width: 860px;
  --header-offset: 5.8rem;
  --shadow-soft: 0 20px 48px rgba(62, 47, 29, 0.08);
}

[data-theme="dark"] {
  --color-bg: #1e1e1e;
  --color-bg-strong: #252525;
  --color-surface: rgba(39, 39, 39, 0.88);
  --color-surface-strong: rgba(45, 45, 45, 0.96);
  --color-text: #f2ede2;
  --color-muted: #b8ae9b;
  --color-line: rgba(242, 237, 226, 0.12);
  --color-line-strong: rgba(242, 237, 226, 0.22);
  --color-accent: #ff6a1f;
  --color-accent-soft: rgba(255, 106, 31, 0.16);
  --color-hero: #2a2a2a;
  --color-command: #232323;
  --shadow-soft: 0 20px 54px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .site-header {
  background: rgba(30, 30, 30, 0.9);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 90, 0, 0.06), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 18%),
    var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.7;
  transition: background-color 160ms ease, color 160ms ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background:
    linear-gradient(rgba(44, 53, 37, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 53, 37, 0.05) 1px, transparent 1px);
  background-size: 100% 4.8rem, 4.8rem 100%;
}

a {
  color: inherit;
  text-decoration-color: var(--color-accent);
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease,
    transform 140ms ease;
}

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

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

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  height: 4px;
  background: transparent;
  pointer-events: none;
  opacity: 0;
}

.reading-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--color-accent);
}

.page-post .reading-progress {
  opacity: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  backdrop-filter: blur(14px);
  background: rgba(244, 241, 234, 0.9);
  border-bottom: 1px solid var(--color-line);
}

.site-header__inner,
.site-main,
.site-footer {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 2rem), var(--page-width));
  margin: 0 auto;
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto minmax(18rem, 34rem) auto;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 0.9rem 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.site-mark,
.hero-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  border: 1px solid var(--color-line-strong);
  border-radius: 0.8rem;
  background: var(--color-surface);
  color: var(--color-accent);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.brand-copy {
  display: grid;
  gap: 0.14rem;
  min-width: 0;
}

.site-title,
.home-hero h1,
.section-heading h2,
.hero-highlight h2,
.post-card h3,
.page-post h1,
.page-post h2,
.page-post h3,
.page-about h1,
.page-about h2,
.author-box h2 {
  font-family: var(--font-ui);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.site-title {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
}

.site-domain,
.site-tagline,
.feed-summary,
.search-empty,
.hero-note,
.hero-note p,
.hero-highlight__meta,
.trending-list__meta,
.post-card__stamp,
.page-post time,
.page-post p,
.page-post li,
.page-about p,
.page-about li,
.author-box__note,
.site-footer {
  color: var(--color-muted);
}

.site-domain,
.site-tagline,
.nav-links a,
.lang-switcher a,
.lang-current,
.theme-toggle,
.site-search__input,
.field-tag,
.meta-chip,
.meta-button,
.filter-button,
.command-panel__label,
.section-kicker,
.hero-strip__label {
  font-family: var(--font-ui);
}

.site-domain {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.site-tagline {
  font-size: 0.88rem;
}

.site-search {
  width: 100%;
}

.site-search__input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--color-line-strong);
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: var(--color-surface-strong);
  color: var(--color-text);
  font-size: 0.92rem;
}

.site-search__input:focus-visible,
.theme-toggle:focus-visible,
.filter-button:focus-visible,
.meta-button:focus-visible,
.nav-links a:focus-visible,
.lang-switcher a:focus-visible,
.post-card__link:focus-visible,
.hero-highlight a:focus-visible,
.trending-list a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.nav-utility,
.nav-links,
.lang-switcher,
.post-meta-bar,
.hero-actions,
.hero-highlight__meta,
.post-card__meta,
.archive-summary,
.filter-cluster,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.nav-utility {
  justify-content: flex-end;
}

.nav-links a,
.lang-switcher a,
.lang-current,
.theme-toggle,
.filter-button,
.meta-chip,
.meta-button,
.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: var(--color-surface);
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.82rem;
}

.theme-toggle,
.filter-button,
.meta-button {
  cursor: pointer;
  font: inherit;
}

.button-primary,
.filter-button.is-active,
.meta-button,
.lang-current {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff7f1;
}

.button-primary:hover,
.filter-button.is-active:hover,
.meta-button:hover {
  color: #fff7f1;
}

.button-secondary:hover,
.nav-links a:hover,
.lang-switcher a:hover,
.filter-button:hover,
.meta-chip:hover {
  border-color: var(--color-accent);
}

.site-main {
  padding: 0 0 4rem;
}

.home-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26), transparent 30%),
    linear-gradient(180deg, rgba(255, 90, 0, 0.08), transparent 22%),
    var(--color-hero);
  border-bottom: 1px solid var(--color-line);
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(44, 53, 37, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 53, 37, 0.08) 1px, transparent 1px);
  background-size: 100% 6rem, 6rem 100%;
  opacity: 0.28;
}

.home-hero__inner,
.home-layout {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 2rem), var(--page-width));
  margin: 0 auto;
}

.home-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(19rem, 0.82fr);
  gap: 1.5rem;
  align-items: stretch;
  padding: clamp(2.2rem, 5vw, 4.8rem) 0 2.2rem;
}

.home-hero__lead,
.feed-zone,
.command-panel,
.post-card,
.page-post article,
.author-box,
.page-sheet {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  box-shadow: var(--shadow-soft);
}

.home-hero__lead,
.feed-zone,
.command-panel {
  padding: clamp(1.2rem, 2vw, 1.6rem);
}

.home-hero__lead {
  display: grid;
  gap: 1rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.section-kicker,
.command-panel__label,
.hero-strip__label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.hero-brandline {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hero-brandcopy {
  display: grid;
  gap: 0.25rem;
}

.hero-mark {
  width: 3.35rem;
  height: 3.35rem;
}

.hero-domain {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.home-hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.6rem);
  line-height: 0.95;
}

.home-hero__headline {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1.1rem, 2vw, 1.38rem);
  color: var(--color-text);
}

.hero-deck {
  margin: 0;
  max-width: 38rem;
}

.hero-highlight {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid var(--color-line-strong);
  background: var(--color-surface-strong);
}

.hero-highlight h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.08;
}

.hero-highlight h2 a {
  text-decoration: none;
}

.field-tag {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(255, 90, 0, 0.35);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.hero-dossier {
  display: grid;
  gap: 1rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.hero-note > :first-child,
.command-panel > :first-child,
.feed-zone > :first-child {
  margin-top: 0;
}

.hero-note,
.hero-strip {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid var(--color-line);
  box-shadow: var(--shadow-soft);
}

.hero-note {
  background: var(--color-surface);
}

.hero-strip {
  background: var(--color-command);
}

.hero-strip__links,
.trending-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hero-strip__links {
  display: grid;
  gap: 0.55rem;
}

.hero-strip__links a,
.trending-list a {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--color-line);
  background: var(--color-surface-strong);
  text-decoration: none;
}

.hero-strip__links a:hover,
.trending-list a:hover {
  border-color: var(--color-accent);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  gap: 1.35rem;
  align-items: start;
  padding-top: 1.8rem;
}

.feed-zone {
  min-width: 0;
}

.section-heading {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.section-heading h2,
.page-post h1,
.page-about h1 {
  margin: 0;
}

.section-heading p {
  margin: 0;
  max-width: 42rem;
}

.archive-summary {
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--color-line);
}

.feed-summary {
  margin: 0;
}

.post-feed {
  column-count: 3;
  column-gap: 1rem;
}

.post-card {
  display: block;
  margin: 0 0 1rem;
  break-inside: avoid;
  transition: border-color 140ms ease, transform 140ms ease, background-color 140ms ease;
}

.post-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.post-card__link {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  text-decoration: none;
}

.post-card__meta {
  justify-content: space-between;
}

.post-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.24;
}

.post-card__excerpt {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.command-center {
  position: sticky;
  top: calc(var(--header-offset) + 0.7rem);
  display: grid;
  gap: 1rem;
}

.command-panel {
  display: grid;
  gap: 0.85rem;
}

.command-panel h2,
.command-panel h3 {
  margin: 0;
  font-family: var(--font-ui);
  line-height: 1.1;
}

.command-panel p {
  margin: 0;
}

.filter-cluster {
  gap: 0.6rem;
}

.filter-button {
  padding-inline: 0.8rem;
}

.filter-button[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff7f1;
}

.trending-list {
  display: grid;
  gap: 0.65rem;
}

.trending-list__title {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.3;
}

.trending-list__meta {
  font-size: 0.84rem;
}

.page-post .site-main,
.page-about .site-main {
  width: min(calc(100% - 2rem), var(--reading-width));
  padding-top: 2rem;
}

.page-post article,
.author-box,
.page-sheet {
  padding: clamp(1.2rem, 2vw, 1.9rem);
  background: var(--color-surface-strong);
}

.page-post article time {
  display: block;
  margin-top: 0.8rem;
}

.page-post h1 {
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  line-height: 0.98;
}

.page-post h2,
.page-about h2,
.author-box h2 {
  margin-top: 1.8rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.05;
}

.page-post h3 {
  margin-top: 1.35rem;
  font-size: 1.16rem;
}

.page-post p,
.page-post ul,
.page-post ol,
.page-about p,
.page-about ul,
.page-about ol {
  margin-top: 1rem;
}

.page-post ul,
.page-post ol,
.page-about ul,
.page-about ol {
  padding-left: 1.25rem;
}

.post-meta-bar {
  margin: 1rem 0 1.15rem;
}

.meta-chip {
  background: var(--color-accent-soft);
  border-color: rgba(255, 90, 0, 0.26);
  color: var(--color-accent);
}

.field-warning,
.page-post blockquote {
  margin: 1.4rem 0;
  padding: 1rem 1rem 1rem 1.15rem;
  border-left: 0.45rem solid var(--color-accent);
  background: var(--color-accent-soft);
}

.field-warning strong,
.page-post blockquote strong {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-ui);
}

.field-warning p,
.page-post blockquote p {
  margin: 0;
  color: var(--color-text);
}

.author-box {
  margin-top: 1.25rem;
}

.author-box__eyebrow {
  margin-bottom: 0.5rem;
}

.page-about .page-sheet > :first-child,
.page-post article > :first-child,
.author-box > :first-child {
  margin-top: 0;
}

.site-footer {
  padding: 1.2rem 0 3rem;
  border-top: 1px solid var(--color-line);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0.2rem 0;
}

[dir="rtl"] .brand-lockup,
[dir="rtl"] .hero-brandline,
[dir="rtl"] .nav-utility,
[dir="rtl"] .post-card__meta,
[dir="rtl"] .archive-summary {
  flex-direction: row-reverse;
}

[dir="rtl"] .page-post ul,
[dir="rtl"] .page-post ol,
[dir="rtl"] .page-about ul,
[dir="rtl"] .page-about ol {
  padding-left: 0;
  padding-right: 1.25rem;
}

[dir="rtl"] .field-warning,
[dir="rtl"] .page-post blockquote {
  border-left: none;
  border-right: 0.45rem solid var(--color-accent);
  padding-left: 1rem;
  padding-right: 1.15rem;
}

@media (max-width: 1140px) {
  .site-header__inner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .nav-utility {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .home-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .command-center {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .post-feed {
    column-count: 2;
  }
}

@media (max-width: 820px) {
  :root {
    --header-offset: 8.6rem;
  }

  .site-header__inner,
  .home-hero__inner,
  .command-center {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-main,
  .site-footer,
  .site-header__inner,
  .home-hero__inner,
  .home-layout {
    width: min(calc(100% - 1rem), var(--page-width));
  }

  .nav-utility {
    justify-content: flex-start;
  }

  .post-feed {
    column-count: 1;
  }
}

@media (max-width: 560px) {
  .nav-links,
  .lang-switcher,
  .nav-utility {
    gap: 0.45rem;
  }

  .nav-links a,
  .lang-switcher a,
  .lang-current,
  .theme-toggle,
  .filter-button,
  .meta-chip,
  .meta-button,
  .button-primary,
  .button-secondary {
    min-height: 2.3rem;
    padding-inline: 0.7rem;
    font-size: 0.76rem;
  }

  .home-hero h1 {
    font-size: clamp(2.5rem, 15vw, 3.8rem);
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  body::before,
  .site-header,
  .site-footer,
  .reading-progress,
  .command-center,
  .hero-actions,
  .meta-button {
    display: none !important;
  }

  .home-hero,
  .home-hero__lead,
  .hero-dossier,
  .feed-zone,
  .command-panel,
  .post-card,
  .page-post article,
  .author-box,
  .page-sheet {
    background: transparent;
    border: none;
    box-shadow: none;
  }
}
