/* ==========================================================================
   understanding.today — Publication System CSS
   Calibrated for editorial minimalism, author-tov voice, and physical moodboard tokens.
   ========================================================================== */

/* 1. RESET & BASE */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--ut-black);
  color: var(--ut-bone);
  font-family: var(--f-grotesk);
  overflow-x: hidden;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; background: none; border: none; }
button { cursor: pointer; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }

:root {
  --color-bg: var(--ut-bone);
  --color-ink: var(--ut-cypress);
  --color-ink-dark: var(--ut-black);
  --max-width: 1440px;
  --frame-padding: clamp(1.25rem, 3.5vw, 3rem);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-resolve: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* ==========================================================================
   PACED PRELOADER (08 MATRIX UT MARK: ENTROPY TO COHERENCE)
   ========================================================================== */
.ut-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: #070a08;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--frame-padding);
  color: var(--ut-bone);
  transition: opacity 0.65s var(--ease-smooth), visibility 0.65s var(--ease-smooth);
}

.ut-preloader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-matrix-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#preloader-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   SITE HEADER & EXPANDING BRAND WORDMARK
   ========================================================================== */
/* Standard Pill Navigation */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  width: 100%;
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 1.5rem) var(--frame-padding);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  background: transparent;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

.site-header .header-nav {
  background: rgba(14, 18, 15, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 0.5rem 1.25rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.site-header .brand-link {
  background: rgba(14, 18, 15, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.site-header a, .site-header button {
  pointer-events: auto;
}

/* Interactive Brand Wordmark: "ut" -> "understanding.today" */
.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s var(--ease-smooth);
}

.brand-expandable {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--f-dot);
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ut-lime);
  white-space: nowrap;
}

.brand-anchor {
  color: var(--ut-lime);
  display: inline-block;
  transition: transform 0.35s var(--ease-smooth);
}

.brand-fill {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: baseline;
  transition: max-width 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.brand-fill-inner {
  display: inline-block;
  color: #ffffff;
  transition: color 0.35s ease;
}

/* Expand on hover or programmatically */
.brand-link:hover .brand-fill,
.brand-link.is-expanded .brand-fill {
  opacity: 1;
}

.brand-link:hover .brand-fill-middle,
.brand-link.is-expanded .brand-fill-middle {
  max-width: 22ch;
}

.brand-link:hover .brand-fill-end,
.brand-link.is-expanded .brand-fill-end {
  max-width: 8ch;
}

/* Fill letters transition to green */
.brand-link.is-green .brand-fill-inner,
.brand-link:hover .brand-fill-inner {
  color: var(--ut-lime);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  transition: all 0.3s ease;
}

.nav-item {
  color: var(--ut-bone);
  font-size: 11px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease, transform 0.2s var(--ease-smooth);
}

.nav-item:hover {
  color: var(--ut-lime);
  transform: translateY(-1px);
}

.nav-item:active {
  transform: translateY(0);
}

/* ==========================================================================
   HERO SECTION (SUPER MINIMAL, VERY VISUAL, FOLDER IMAGERY)
   ========================================================================== */
.hero-section {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(5rem, 8vw, 7.5rem) var(--frame-padding) clamp(3rem, 5vw, 4.5rem);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-stage {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 3vw, 2.5rem);
}

.hero-specimen-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 68vh;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.hero-specimen-panel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 3px;
  background-color: #121312;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}

.hero-specimen-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: contrast(1.05) brightness(0.92);
}

.hero-headline-overlay {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-top: 0.5rem;
}

.hero-headline {
  font-family: var(--f-dot);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ut-bone);
}

.scramble-char {
  display: inline;
}

.hero-headline .scramble-char {
  color: var(--ut-lime);
  opacity: 0.95;
}

.article-title .scramble-char {
  color: var(--ut-black);
  opacity: 0.85;
}

/* ==========================================================================
   ARTICLES SECTION
   ========================================================================== */
.articles-section {
  position: relative;
  z-index: 20;
  background-color: var(--ut-bone);
  color: var(--ut-black);
  width: 100%;
  padding: clamp(5rem, 8vw, 8rem) 0;
}

.articles-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--frame-padding);
}

.articles-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--ut-rule);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.articles-header .ut-label b {
  color: var(--ut-cypress);
}

.articles-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 6vw, 5.5rem);
}

.article-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  padding-bottom: clamp(2.5rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--ut-rule);
  transition: transform 0.3s var(--ease-smooth);
}

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

.article-row.reverse {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
}

.article-row.reverse .article-media {
  order: 2;
}

.article-row.reverse .article-info {
  order: 1;
}

.article-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  overflow: hidden;
  background-color: #000;
  box-shadow: 0 12px 36px rgba(7, 60, 50, 0.08);
  transition: transform 0.4s var(--ease-smooth), box-shadow 0.4s ease;
}

.article-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-smooth);
}

.article-row:hover .article-media {
  transform: translateY(-4px);
  box-shadow: 0 20px 45px rgba(7, 60, 50, 0.16);
}

.article-row:hover .article-media img {
  transform: scale(1.04);
}

.article-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
  width: 100%;
}

.article-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ut-sage);
  font-size: 11px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.article-title {
  font-family: var(--f-dot);
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ut-black);
  transition: color 0.2s ease;
  min-height: 2.3em;
  display: block;
  width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

.article-row:hover .article-title {
  color: var(--ut-cypress);
}

.article-summary {
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  font-weight: 300;
  line-height: 1.55;
  color: #3e443b;
  max-width: 44ch;
}

.article-action {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ut-cypress);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.article-row:hover .article-action .ut-plus {
  transform: rotate(90deg);
}

/* ==========================================================================
   ARTICLE READER MODAL
   ========================================================================== */
.reader-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--frame-padding);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-smooth);
}

.reader-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.reader-card {
  position: relative;
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--ut-bone);
  color: var(--ut-black);
  border-radius: 4px;
  padding: clamp(2rem, 5vw, 3.5rem);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.reader-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--ut-rule);
  padding-bottom: 1.25rem;
}

.reader-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--ut-black);
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.reader-close:focus-visible {
  outline: 1px solid var(--ut-cypress);
}

.reader-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 2px;
}

.reader-title {
  font-family: var(--f-dot);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--ut-black);
}

.reader-prose {
  font-size: 1.1rem;
  line-height: 1.65;
  color: #2a2e28;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ==========================================================================
   ABOUT MODAL (FULLSCREEN UTILITARIAN 1990s WEB LAYOUT)
   ========================================================================== */
.about-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background-color: var(--ut-black);
  display: none;
  flex-direction: column;
  padding: clamp(1.25rem, 3.5vw, 3rem) var(--frame-padding);
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  transition: opacity 0.2s ease;
}

.about-modal.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.about-fullscreen-stage {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(2rem, 4vw, 3.5rem);
}

/* Header bar matching homepage articles-header */
.about-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.about-close-btn {
  background: none;
  border: none;
  color: var(--ut-bone);
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0;
}

.about-close-btn:hover {
  color: var(--ut-lime);
}

/* Utilitarian multi-column grid */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1.15fr 0.9fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  flex: 1;
  align-items: start;
  padding: clamp(1.5rem, 3vw, 3rem) 0;
}

.about-col {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding-left: clamp(1.25rem, 2vw, 2rem);
}

.about-col:first-child {
  border-left: none;
  padding-left: 0;
}

.about-col-label {
  color: var(--ut-sage);
}

.about-title {
  font-family: var(--f-dot);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--ut-bone);
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.about-col p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ut-silver);
  font-weight: 300;
}

.about-col .about-lead {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ut-bone);
  font-weight: 400;
}

.about-col .about-conclusion {
  color: var(--ut-lime);
  font-size: 13px;
  font-weight: 400;
}

.about-meta-text {
  font-size: 11px;
  line-height: 1.6;
  color: var(--ut-meta);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.about-contact-block {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.about-email-link {
  font-family: var(--f-dot);
  font-size: 13px;
  color: var(--ut-lime);
  border-bottom: 1px solid rgba(182, 255, 0, 0.4);
  padding-bottom: 2px;
  transition: all 0.2s ease;
  word-break: break-all;
  display: inline-block;
}

.about-email-link:hover {
  color: #ffffff;
  border-color: #ffffff;
}

/* Bottom frame rule matching 1990s scientific document index */
.about-footer-rule {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1.5rem;
  color: var(--ut-meta);
}

/* ==========================================================================
   SITE FOOTER (WITH RIGHT-ALIGNED EXPANDABLE CONTACT)
   ========================================================================== */
.site-footer {
  position: relative;
  z-index: 25;
  background-color: var(--ut-black);
  border-top: 1px solid var(--ut-rule-dark);
  padding: clamp(2rem, 4vw, 3.5rem) var(--frame-padding);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ut-meta);
}

.footer-contact-expandable {
  display: inline-flex;
  align-items: center;
  color: var(--ut-bone);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.footer-contact-expandable:hover {
  color: var(--ut-lime);
}

.contact-prefix {
  color: inherit;
}

.contact-suffix {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  color: var(--ut-lime);
  transition: max-width 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.footer-contact-expandable:hover .contact-suffix {
  max-width: 30ch;
  opacity: 1;
}

/* Prevent body scroll when modal open */
body.modal-open {
  overflow: hidden;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media screen and (max-width: 960px) {
  .hero-specimen-stage {
    grid-template-columns: 1fr;
    aspect-ratio: auto;
    height: 52vh;
  }
  .hero-specimen-micro {
    display: none;
  }
  .article-row, .article-row.reverse {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .article-row.reverse .article-media {
    order: 1;
  }
  .article-row.reverse .article-info {
    order: 2;
  }
  .footer-content {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
  }
}

@media screen and (max-width: 600px) {
  .hero-section {
    padding-top: 5rem;
    padding-bottom: 2.5rem;
  }
  .hero-specimen-stage {
    height: 44vh;
  }
  .hero-headline {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
  }
  .about-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}
