:root {
  --ink: #071638;
  --blue: #15448a;
  --paper: #fbfaf6;
  --line: #bdc9d6;
  --accent: #ff6d4f;
  --sky: #dff2ff;
  --sans: "Manrope", sans-serif;
  --serif: "DM Serif Display", Georgia, serif;
  --hand: "Caveat", cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--sky) url("../img/editorial/sky-background.png") center / cover fixed no-repeat;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

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

.page-shell {
  position: relative;
  width: calc(100% - 60px);
  min-height: calc(100vh - 20px);
  margin: 20px 30px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-bottom: 0;
  border-radius: 30px 30px 0 0;
  box-shadow: 0 6px 30px rgba(38, 92, 135, 0.12);
}

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 230px 1fr auto;
  align-items: center;
  min-height: 66px;
  padding: 0 8.8%;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(208, 224, 235, 0.82);
  backdrop-filter: blur(14px);
}

.logo {
  width: max-content;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.logo span { color: var(--accent); }

.main-nav {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 3vw, 40px);
}

.main-nav a {
  position: relative;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.main-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 40px;
  padding: 0 17px;
  color: #274881;
  background: rgba(247, 251, 255, 0.58);
  border: 1px solid #c6d3e1;
  border-radius: 999px;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.search-field:focus-within {
  background: rgba(255, 255, 255, 0.94);
  border-color: #587aa9;
  box-shadow: 0 0 0 3px rgba(45, 82, 137, 0.12);
}

.search-field i { flex: 0 0 auto; font-size: 16px; }

.search-field input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.search-field input::placeholder { color: #7a91b6; opacity: 1; }

.search-field--header { width: 240px; }

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 46px;
  padding: 0 24px;
  color: #fff;
  background: var(--ink);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 180ms ease, background 180ms ease;
}

.primary-button:hover { background: #12356a; transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }

.menu-toggle { display: none; }

.hero {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 151px;
  padding: 26px 24px 0;
}

.hero-copy { position: relative; z-index: 2; text-align: center; }

.hero h1 {
  position: relative;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 4.1vw, 62px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.hero h1::after {
  content: "";
  position: absolute;
  right: 1%;
  bottom: -5px;
  width: 31%;
  height: 3px;
  background: #2864aa;
  border-radius: 50%;
  transform: rotate(-1deg);
}

.hero-copy > p {
  margin: 12px 0 0;
  color: #315e98;
  font-size: 17px;
  font-weight: 500;
}

.hand-note {
  margin: 0;
  color: #245294;
  font-family: var(--hand);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.025em;
  transform: rotate(-5deg);
}

.hero-note { position: absolute; top: 34px; left: 5.4%; }

.plane-mark {
  position: absolute;
  top: 17px;
  right: 4.5%;
  color: #f8f8f4;
  font-size: 78px;
  filter: drop-shadow(-7px 7px 2px rgba(42, 63, 84, 0.22));
  transform: rotate(-11deg);
}

.plane-note { position: absolute; top: 107px; right: 3.6%; transform: rotate(-6deg); }

.catalog {
  position: relative;
  z-index: 3;
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
  padding: 19px 31px 14px;
  background: rgba(251, 250, 246, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(31, 78, 117, 0.13);
}

.catalog::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("../img/editorial/morning-mountains.png");
  background-size: 130px;
  mix-blend-mode: soft-light;
  border-radius: inherit;
}

.catalog-head,
.tag-filter-container,
.newsletter-list,
.empty-state { position: relative; z-index: 1; }

.catalog-head {
  display: grid;
  grid-template-columns: 1fr 340px;
  align-items: center;
  gap: 28px;
}

.catalog h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
}

.search-field--catalog { width: 100%; height: 38px; background: rgba(255,255,255,.5); }

.tag-filter-container {
  display: flex;
  gap: 7px;
  margin: 14px 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tag-filter-container::-webkit-scrollbar { display: none; }

.tag-chip {
  flex: 0 0 auto;
  min-height: 31px;
  padding: 0 14px;
  color: #174583;
  background: transparent;
  border: 1px solid #c5d0dd;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.tag-chip:hover { border-color: #6f88a9; transform: translateY(-1px); }
.tag-chip.active { color: #fff; background: var(--ink); border-color: var(--ink); }
.tag-chip:focus-visible { outline: 3px solid rgba(49, 94, 152, 0.28); outline-offset: 2px; }

.newsletter-list { display: grid; }

.newsletter-item {
  display: grid;
  grid-template-columns: 108px minmax(270px, 1fr) 150px 195px;
  align-items: center;
  min-height: 112px;
  color: inherit;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: background 150ms ease;
}

.newsletter-item:first-child { border-top: 0; }
.newsletter-item:hover { background: rgba(224, 237, 246, 0.34); }
.newsletter-item:focus-visible { outline: 3px solid rgba(49, 94, 152, 0.3); outline-offset: -3px; }

.newsletter-image {
  display: block;
  width: 106px;
  height: 90px;
  object-fit: cover;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px rgba(6, 22, 56, 0.06);
}

.newsletter-copy { align-self: center; padding: 0 20px 0 20px; }

.newsletter-title-row { display: flex; align-items: center; gap: 9px; }

.newsletter-copy h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
}

.featured-stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 3px 7px rgba(186, 64, 40, 0.18);
  font-size: 11px;
  font-weight: 700;
  transform: rotate(-7deg);
}

.newsletter-author,
.newsletter-description {
  margin: 4px 0 0;
  color: #214a84;
  font-size: 12px;
  line-height: 1.35;
}

.newsletter-author { font-weight: 700; }
.newsletter-description { margin-top: 2px; max-width: 370px; font-weight: 500; }

.category-pill {
  justify-self: center;
  padding: 7px 16px;
  color: #15448a;
  background: #d9eaff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.category-pill[data-tone="growth"] { color: #20584e; background: #dcefe1; }
.category-pill[data-tone="culture"] { color: #813d6f; background: #f5dfe9; }
.category-pill[data-tone="sustainable"] { color: #175c50; background: #dceee3; }

.editor-note {
  position: relative;
  margin: 0;
  padding: 18px 0 0 28px;
  color: #315a94;
  font-family: var(--hand);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.02;
  transform: rotate(-2deg);
}

.editor-note i { position: absolute; top: 4px; left: 27px; color: #f4b62f; font-size: 17px; }

.empty-state {
  margin: 32px 0 22px;
  color: #315a94;
  text-align: center;
  font-size: 14px;
}

.selection-note {
  position: relative;
  z-index: 2;
  width: max-content;
  margin: 8px auto 26px;
  font-family: var(--serif);
  font-size: 25px;
}

.selection-note::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -6px;
  width: 50%;
  height: 2px;
  background: var(--accent);
  transform: rotate(-3deg);
}

.side-note { position: absolute; bottom: 18px; z-index: 1; }
.side-note--left { left: 4.4%; }
.side-note--right { right: 4%; transform: rotate(-5deg); }

@media (max-width: 1250px) {
  .site-header { grid-template-columns: 170px 1fr auto; padding-inline: 5%; }
  .search-field--header { display: none; }
  .hero-note { left: 3%; }
  .plane-note { right: 2%; }
  .side-note { display: none; }
}

@media (max-width: 900px) {
  .page-shell { width: calc(100% - 24px); margin: 12px 12px 0; border-radius: 22px 22px 0 0; }
  .site-header { grid-template-columns: 1fr auto; min-height: 62px; padding: 0 22px; }
  .menu-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--ink);
    background: transparent;
    border: 1px solid #bccbda;
    border-radius: 50%;
    cursor: pointer;
  }
  .main-nav {
    position: absolute;
    top: 62px;
    right: 0;
    left: 0;
    display: grid;
    gap: 0;
    padding: 8px 22px 18px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid #d6e1ea;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
  }
  .main-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid #e3eaf0; }
  .header-actions { display: none; }
  .hero { min-height: 178px; padding-top: 34px; }
  .hero h1 { max-width: 690px; font-size: clamp(38px, 7vw, 56px); }
  .hero-copy > p { max-width: 580px; margin-inline: auto; font-size: 15px; }
  .hero-note, .plane-note, .plane-mark { display: none; }
  .catalog { width: calc(100% - 28px); padding: 22px; }
  .catalog-head { grid-template-columns: 1fr; gap: 16px; }
  .catalog h2 { font-size: 32px; }
  .newsletter-item { grid-template-columns: 98px minmax(0, 1fr) 145px; min-height: 108px; }
  .newsletter-image { width: 92px; height: 78px; }
  .newsletter-copy { padding-inline: 14px; }
  .newsletter-copy h3 { font-size: 20px; }
  .editor-note { display: none; }
  .selection-note { font-size: 22px; }
}

@media (max-width: 620px) {
  body { background-attachment: scroll; }
  .page-shell { width: 100%; min-height: 100vh; margin: 0; border: 0; border-radius: 0; }
  .hero { min-height: 210px; padding: 40px 20px 22px; }
  .hero h1 { font-size: 42px; line-height: .98; }
  .hero-copy > p { margin-top: 16px; font-size: 14px; line-height: 1.45; }
  .catalog { width: calc(100% - 20px); padding: 20px 16px 12px; border-radius: 12px; }
  .catalog h2 { font-size: 29px; }
  .tag-filter-container { margin-inline: -16px; padding-inline: 16px; }
  .newsletter-item { grid-template-columns: 82px 1fr; min-height: 112px; padding: 12px 0; }
  .newsletter-image { width: 80px; height: 80px; }
  .newsletter-copy { padding: 0 0 0 12px; }
  .newsletter-title-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .newsletter-copy h3 { font-size: 19px; }
  .newsletter-description { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 11px; }
  .category-pill { display: none; }
  .featured-stamp { padding: 3px 6px; font-size: 9px; }
  .selection-note { margin-top: 14px; font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
