/* =========================================================
   PRAEVIA STUDIO — design tokens
   ========================================================= */
:root {
  --paper: #edebe3;
  --paper-alt: #e3e0d3;
  --ink: #14151a;
  --ink-soft: #4a4940;
  --muted: #726f62;
  --cobalt: #1e3af0;
  --yellow: #f2c230;
  --line: #c9c6bb;

  --display: 'Fraunces', serif;
  --body: 'Inter', sans-serif;
  --mono: 'IBM Plex Mono', monospace;

  --container: 1240px;
  --rail-w: 132px;
  --radius: 2px;
}

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

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 10px 32px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
}

p {
  margin: 0 0 1em;
  color: var(--ink-soft);
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 200;
  font-family: var(--mono);
  font-size: 13px;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

/* =========================================================
   MASTHEAD
   ========================================================= */
.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.masthead__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
}
.wordmark span {
  font-style: italic;
  font-weight: 400;
  color: var(--cobalt);
}

.primary-nav {
  display: flex;
  gap: 32px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.primary-nav a {
  position: relative;
  padding-bottom: 4px;
}
.primary-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--cobalt);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.primary-nav a:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 32px;
  height: 24px;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.nav-toggle span {
  top: 11px;
}
.nav-toggle span::before {
  top: -9px;
}
.nav-toggle span::after {
  top: 9px;
}
.nav-toggle[aria-expanded='true'] span {
  background: transparent;
}
.nav-toggle[aria-expanded='true'] span::before {
  transform: translateY(9px) rotate(45deg);
}
.nav-toggle[aria-expanded='true'] span::after {
  transform: translateY(-9px) rotate(-45deg);
}

/* ticker */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: var(--ink);
}
.ticker__track {
  display: inline-flex;
  white-space: nowrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper);
  padding: 8px 0;
  animation: ticker 32s linear infinite;
}
.ticker:hover .ticker__track {
  animation-play-state: paused;
}
.ticker__track span {
  padding: 0 2px;
}
.ticker__track .dot {
  color: var(--yellow);
}
@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track {
    animation: none;
    overflow-x: auto;
  }
}

/* =========================================================
   INDEX RAIL — signature element
   ========================================================= */
.index-rail {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
}
.index-rail__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: var(--rail-w);
  padding: 12px 18px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.index-rail__item em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}
.index-rail__item:hover {
  background: var(--paper-alt);
  color: var(--ink);
}
.index-rail__item.is-active {
  color: var(--paper);
  background: var(--ink);
}
.index-rail__item.is-active em {
  color: var(--yellow);
}

@media (max-width: 1024px) {
  .index-rail {
    display: none;
  }
}

/* =========================================================
   LAYOUT SPACING (offset main content for fixed rail)
   ========================================================= */
main {
  margin-left: var(--rail-w);
}
@media (max-width: 1024px) {
  main {
    margin-left: 0;
  }
}

section {
  padding: 96px 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.section-num {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--cobalt);
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
}

/* =========================================================
   FEATURED (cover story — sits between hero and works)
   ========================================================= */
.featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.featured-post__media {
  display: block;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  background: var(--plate, var(--ink));
}
.featured-post__meta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.featured-post__meta .journal-row__tag {
  justify-self: auto;
}
.featured-post__title {
  font-size: clamp(26px, 3vw, 38px);
  margin-top: 14px;
}
.featured-post__title a {
  background-image: linear-gradient(var(--cobalt), var(--cobalt));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 3px;
  transition: background-size 0.25s ease;
}
.featured-post__title a:hover {
  background-size: 100% 3px;
}
.featured-post__excerpt {
  font-size: 17px;
  max-width: 52ch;
  margin-top: 16px;
}
.featured-post__cta {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cobalt);
}

@media (max-width: 768px) {
  .featured-post {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  padding-top: 80px;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cobalt);
  margin-bottom: 20px;
}
.hero__title {
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 600;
  max-width: 16ch;
}
.hero__lede {
  font-size: 19px;
  max-width: 56ch;
  margin-top: 28px;
}
.hero__meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 56px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.hero__meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero__meta dt {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__meta dd {
  margin: 0;
  font-weight: 500;
}

@media (max-width: 768px) {
  .hero__meta {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================================
   WORKS
   ========================================================= */
.filters {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}
.filter-btn {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: none;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--ink-soft);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.filter-btn:hover {
  border-color: var(--ink);
}
.filter-btn.is-active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.work-card {
  background: var(--paper);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s ease;
}
.work-card:not(.ad-slot):hover {
  transform: translateY(-4px);
}
.work-card.is-hidden {
  display: none;
}

.work-card__plate {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  background-color: var(--plate, var(--ink));
  display: flex;
  align-items: flex-end;
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.work-card__plate span {
  font-family: var(--mono);
  color: var(--paper);
  font-size: 13px;
  mix-blend-mode: difference;
  position: relative;
  z-index: 1;
}

/* --- image-backed plates: full-page screenshot, slow auto-pan --- */
.work-card__plate--photo {
  background-image: var(--plate-image);
  background-repeat: no-repeat;
  background-size: 100% auto; /* fit width, keep the tall screenshot's natural height */
  background-position: 50% 0%;
  animation: platePan 16s ease-in-out infinite;
}
@keyframes platePan {
  0%,
  100% {
    background-position: 50% 0%;
  }
  50% {
    background-position: 50% 100%;
  }
}
.work-card__plate--photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0) 40%
  );
  pointer-events: none;
}

.work-card h3 {
  font-size: 20px;
}
.work-card__meta {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 900px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .works-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   AD SLOTS
   ========================================================= */
.ad-slot {
  display: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed var(--line);
  background: var(--paper-alt);
  min-height: 220px;
}
.ad-slot__label {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.ad-slot__placeholder {
  display: none;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.ad-slot--banner {
  display: none;
  margin: 0 auto 64px;
  min-height: 120px;
  border: 1px dashed var(--line);
  background: var(--paper-alt);
}

/* =========================================================
   JOURNAL
   ========================================================= */
.journal-list {
  display: flex;
  flex-direction: column;
}
.journal-row {
  display: grid;
  grid-template-columns: 120px 1fr 100px;
  align-items: start;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.journal-list .journal-row:last-child {
  border-bottom: 1px solid var(--line);
}
.journal-row__date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding-top: 6px;
}
.journal-row__title {
  font-size: 24px;
}
.journal-row__title a {
  background-image: linear-gradient(var(--cobalt), var(--cobalt));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  transition: background-size 0.25s ease;
}
.journal-row__title a:hover {
  background-size: 100% 2px;
}
.journal-row__excerpt {
  font-size: 15px;
  margin: 10px 0 0;
  max-width: 60ch;
}
.journal-row__tag {
  justify-self: end;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--cobalt);
  border: 1px solid var(--cobalt);
  border-radius: 20px;
  padding: 4px 10px;
  height: fit-content;
}

.journal-row.ad-slot {
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
  min-height: 140px;
}

@media (max-width: 700px) {
  .journal-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .journal-row__tag {
    justify-self: start;
  }
}

/* =========================================================
   ABOUT
   ========================================================= */
.about__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
}
.about__bio p {
  font-size: 17px;
}
.about__bio em {
  font-style: italic;
  color: var(--ink);
}

.colophon div {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.colophon div:last-child {
  border-bottom: 1px solid var(--line);
}
.colophon dt {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.colophon dd {
  margin: 0;
  font-weight: 500;
}

@media (max-width: 800px) {
  .about__grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 64px;
  align-items: start;
}
.contact__email {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--cobalt);
  display: inline-block;
}
.contact__note {
  margin-top: 16px;
  max-width: 44ch;
}
.contact__social {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
}
.contact__social a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.contact__social a:hover {
  border-color: var(--ink);
}

.newsletter label {
  display: block;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.newsletter__row {
  display: flex;
  gap: 0;
}
.newsletter__row input {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  border-right: none;
  font-family: var(--body);
  font-size: 14px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 0;
}
.newsletter__row input:focus {
  outline: none;
}
.newsletter__row button {
  padding: 14px 20px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.newsletter__row button:hover {
  background: var(--cobalt);
  border-color: var(--cobalt);
}
.newsletter__msg {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--cobalt);
  min-height: 1em;
}

@media (max-width: 800px) {
  .contact__grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  padding: 28px 0;
}
.site-footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.back-to-top {
  background: none;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.back-to-top:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* =========================================================
   MOBILE NAV
   ========================================================= */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  .primary-nav {
    position: fixed;
    inset: 0 0 0 auto;
    top: 0;
    width: min(320px, 80vw);
    height: 100vh;
    background: var(--ink);
    color: var(--paper);
    flex-direction: column;
    gap: 0;
    padding: 100px 32px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-size: 20px;
  }
  .primary-nav.is-open {
    transform: translateX(0);
  }
  .primary-nav a {
    padding: 16px 0;
    border-bottom: 1px solid rgba(237, 235, 227, 0.15);
  }
  .masthead__top {
    padding: 18px 20px;
  }
  .container {
    padding: 0 20px;
  }
  section {
    padding: 64px 0;
  }
}

/* ================ LOGO =================== */
.logo {
  line-height: 0.8;
  padding-bottom: 10px;
  height: 64px;
  width: 64px;
}
