:root {
  --bg: #fffdf9;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #111111;
  --muted: #5a5a57;
  --line: rgba(17, 17, 17, 0.14);
  --line-strong: rgba(17, 17, 17, 0.24);
  --accent: #c11f0e;
  --accent-soft: rgba(193, 31, 14, 0.08);
  --max-width: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(193, 31, 14, 0.03), transparent 18rem),
    var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

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

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

p,
ul,
ol,
blockquote {
  margin: 0;
}

.site-shell {
  width: min(var(--max-width), calc(100% - 2.5rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(20px);
  background: rgba(255, 253, 249, 0.82);
  border-bottom: 1px solid var(--line);
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 4.75rem;
}

.site-logo {
  position: relative;
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.site-logo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 0.12rem;
  background: var(--accent);
  transform: scaleX(0.2);
  transform-origin: left;
  transition: transform 240ms ease;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.95rem;
}

.nav-link {
  position: relative;
  padding: 0.4rem 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 0.12rem;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.nav-link:hover::after,
.nav-link.is-current::after {
  transform: scaleX(1);
}

.hero {
  padding: 5.75rem 0 2.5rem;
}

.hero--compact {
  padding: 4.5rem 0 1rem;
}

.hero__grid,
.contacts-hero {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.8fr);
  align-items: end;
}

.eyebrow {
  margin-bottom: 1rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title,
.section-title {
  line-height: 0.96;
  letter-spacing: -0.05em;
  margin: 0;
}

.page-title {
  max-width: 11ch;
  font-size: clamp(3.3rem, 10vw, 7.2rem);
}

.page-title--compact {
  max-width: 16ch;
  font-size: clamp(2.4rem, 7vw, 5rem);
}

.page-lead {
  max-width: 42rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.page-lead--compact {
  max-width: 48rem;
}

.section {
  padding: 2rem 0 4rem;
}

.section--tight-top {
  padding-top: 0.5rem;
}

.section-head,
.list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.section-title {
  max-width: 12ch;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.surface {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--surface));
}

.surface::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 0.16rem;
  background: linear-gradient(90deg, var(--accent), transparent 72%);
  opacity: 0;
  transition: opacity 220ms ease;
}

.surface:hover::before,
.surface:focus-within::before {
  opacity: 1;
}

.hero-aside,
.info-card,
.details-panel,
.contact-card,
.content-card,
.detail-sidebar {
  padding: 1.35rem;
}

.meta-row {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.meta-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.meta-row span,
.detail-fact span {
  color: var(--muted);
  font-size: 0.92rem;
}

.meta-row strong,
.detail-fact strong {
  font-size: 1rem;
  font-weight: 500;
}

.cards-grid,
.details-grid,
.content-grid,
.latest-grid {
  display: grid;
  gap: 1.25rem;
}

.cards-grid--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-grid--double,
.details-grid,
.latest-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-grid--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card h3,
.list-head h3,
.contact-card h2,
.content-card h3,
.panel-title {
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
  line-height: 1.15;
}

.info-card p,
.contact-card p,
.content-card p,
.timeline-row p {
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.tag {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  font-size: 0.9rem;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-row {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.9rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.timeline-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.timeline-row span {
  color: var(--accent);
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 0.9rem;
}

.inline-link,
.card-link,
.detail-back {
  color: var(--accent);
  font-size: 0.95rem;
}

.content-list {
  display: grid;
  gap: 1rem;
}

.content-card {
  display: grid;
  gap: 0.95rem;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-title-link {
  display: inline-block;
  transition: color 180ms ease;
}

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

.detail-wrap {
  padding: 4rem 0 5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.detail-sidebar {
  position: sticky;
  top: 6.25rem;
  display: grid;
  gap: 1rem;
}

.detail-fact {
  display: grid;
  gap: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.detail-content {
  min-width: 0;
}

.detail-content .page-title {
  max-width: 14ch;
}

.detail-content .tag-list {
  margin-top: 1.5rem;
}

.article-body {
  margin-top: 2rem;
  max-width: 50rem;
  display: grid;
  gap: 1.25rem;
}

.article-body h2 {
  margin: 1.5rem 0 0;
  font-size: 1.65rem;
  line-height: 1.1;
}

.article-body h3 {
  margin: 1rem 0 0;
  font-size: 1.2rem;
}

.article-body p,
.article-body li {
  color: #222222;
  font-size: 1rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.2rem;
  display: grid;
  gap: 0.6rem;
}

.article-body blockquote {
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.article-body .callout {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(193, 31, 14, 0.24);
  background: var(--accent-soft);
}

.reveal-text {
  position: relative;
  display: inline-block;
  --reveal-x: 50%;
  --reveal-y: 50%;
  --reveal-radius: 0px;
}

.reveal-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--accent);
  clip-path: circle(var(--reveal-radius) at var(--reveal-x) var(--reveal-y));
  transition: clip-path 120ms ease-out;
  pointer-events: none;
}

.empty-state {
  padding: 1.25rem;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}

.site-footer {
  padding: 1.75rem 0 2.25rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.92);
  flex-shrink: 0;
}

.site-footer__row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto auto;
  gap: 1.5rem;
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: 0.9rem;
}

.footer-brand p,
.footer-contact span {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: center;
  justify-content: center;
  padding-top: 0.1rem;
}

.footer-nav a,
.footer-contact a {
  transition: color 180ms ease;
}

.footer-nav a:hover,
.footer-contact a:hover {
  color: var(--accent);
}

.footer-contact {
  display: grid;
  gap: 0.4rem;
  justify-items: end;
  text-align: right;
}

@media (max-width: 980px) {
  .hero__grid,
  .contacts-hero,
  .cards-grid--triple,
  .cards-grid--double,
  .details-grid,
  .content-grid,
  .latest-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-sidebar {
    position: static;
  }

  .page-title {
    max-width: 13ch;
  }

  .site-footer__row {
    grid-template-columns: 1fr;
  }

  .footer-contact {
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 760px) {
  .site-shell {
    width: min(var(--max-width), calc(100% - 1.25rem));
  }

  .site-header__row,
  .section-head,
  .list-head {
    align-items: start;
    flex-direction: column;
  }

  .site-nav {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .hero {
    padding-top: 4rem;
  }

  .page-title {
    max-width: 100%;
  }

  .hero-aside,
  .info-card,
  .details-panel,
  .contact-card,
  .content-card,
  .detail-sidebar {
    padding: 1.1rem;
  }
}
