:root {
  --ink: #171814;
  --muted: #686a61;
  --surface: #f4f1ea;
  --paper: #fffdf8;
  --line: rgba(23, 24, 20, 0.13);
  --acid: #d7ff43;
  --coral: #ff6d4a;
  --deep-green: #173d2d;
  --shadow: 0 28px 70px rgba(44, 41, 31, 0.14);
  --font-display: "Manrope", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(215, 255, 67, 0.3), transparent 27rem),
    var(--surface);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

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

.page-shell {
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  padding: 0 clamp(24px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
}

.brand,
.site-nav,
.site-nav a,
.instagram-link {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--surface);
  background: var(--ink);
  border-radius: 50%;
  font-size: 0.64rem;
  letter-spacing: -0.03em;
}

.site-nav {
  gap: clamp(18px, 3vw, 38px);
}

.site-nav a {
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--deep-green);
}

.instagram-link svg {
  width: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(380px, 0.94fr);
  min-height: 720px;
  padding: clamp(72px, 8vw, 118px) clamp(24px, 7vw, 104px);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  z-index: 2;
  align-self: center;
  max-width: 690px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--deep-green);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #61a83d;
  border: 2px solid rgba(97, 168, 61, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(97, 168, 61, 0.12);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 28px;
  font-family: var(--font-display);
  font-size: clamp(3.7rem, 7vw, 7rem);
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 0.93;
}

h1 span {
  display: block;
  color: var(--deep-green);
}

.hero-description {
  max-width: 555px;
  margin-bottom: 36px;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.button svg {
  width: 20px;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: white;
  background: var(--ink);
  box-shadow: 0 10px 24px rgba(23, 24, 20, 0.15);
}

.button-primary:hover {
  box-shadow: 0 14px 30px rgba(23, 24, 20, 0.2);
}

.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.author-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--paper);
  background: var(--deep-green);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
}

.author-chip > span:last-child {
  display: flex;
  flex-direction: column;
  font-size: 0.84rem;
  font-weight: 700;
}

.author-chip small {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.mobile-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.mobile-note svg {
  width: 17px;
}

.library-visual {
  position: relative;
  align-self: center;
  min-height: 530px;
}

.visual-card {
  position: absolute;
  left: 50%;
  display: flex;
  width: min(330px, 74%);
  aspect-ratio: 0.72;
  flex-direction: column;
  padding: 29px;
  border: 1px solid rgba(23, 24, 20, 0.11);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.visual-card > span,
.visual-topline,
.visual-footer {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.visual-card > strong {
  margin: auto 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.5vw, 4.2rem);
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.card-back {
  top: 26px;
  color: white;
  background: var(--coral);
  transform: translateX(-27%) rotate(11deg);
}

.card-middle {
  top: 15px;
  color: var(--ink);
  background: #bbadef;
  transform: translateX(-45%) rotate(3deg);
}

.card-front {
  top: 0;
  z-index: 2;
  background:
    linear-gradient(rgba(23, 24, 20, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 24, 20, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  transform: translateX(-62%) rotate(-5deg);
}

.visual-topline {
  display: flex;
  justify-content: space-between;
}

.card-front > strong {
  margin: 100px 0 20px;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  letter-spacing: -0.075em;
  line-height: 0.91;
}

.formula {
  display: inline-block;
  align-self: flex-start;
  padding: 8px 10px;
  background: var(--acid);
  font-family: Georgia, serif;
  font-size: 0.83rem;
}

.visual-footer {
  margin-top: auto;
}

.visual-line {
  width: 58px;
  height: 4px;
  margin-top: auto;
  background: currentColor;
}

.floating-badge {
  position: absolute;
  right: -18px;
  bottom: 44px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--acid);
  border: 1px solid rgba(23, 24, 20, 0.1);
  border-radius: 7px;
  box-shadow: 0 14px 34px rgba(44, 41, 31, 0.16);
  font-size: 0.75rem;
  font-weight: 700;
  transform: rotate(2deg);
}

.floating-badge svg {
  width: 19px;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(23, 24, 20, 0.12);
  border-radius: 50%;
}

.orbit-large {
  top: -20px;
  right: -90px;
  width: 210px;
  height: 210px;
}

.orbit-small {
  bottom: 5px;
  left: 5px;
  width: 90px;
  height: 90px;
  background: rgba(215, 255, 67, 0.55);
}

.library-section {
  padding: clamp(76px, 8vw, 116px) clamp(24px, 7vw, 104px);
  background: var(--paper);
}

.stats-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 0.4fr)) minmax(260px, 1fr);
  align-items: center;
  gap: 1px;
  padding: 0 clamp(24px, 7vw, 104px);
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid var(--line);
}

.stats-band > div,
.stats-band > p {
  min-height: 116px;
  margin: 0;
  padding: 25px clamp(16px, 2.5vw, 34px);
  background: var(--ink);
}

.stats-band > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stats-band strong {
  color: var(--acid);
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: -0.05em;
}

.stats-band span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
}

.stats-band > p {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  line-height: 1.55;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 42px;
}

.section-kicker {
  margin-bottom: 10px;
  color: var(--coral);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h2 {
  max-width: 650px;
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.8vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.search-field {
  display: flex;
  width: min(100%, 310px);
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.search-field:focus-within {
  border-color: var(--deep-green);
  box-shadow: 0 0 0 3px rgba(23, 61, 45, 0.08);
}

.search-field svg {
  width: 18px;
  color: var(--muted);
}

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

.search-field input::placeholder {
  color: #8a8c84;
}

.library-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.filter-stack {
  display: grid;
  gap: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.language-filters {
  align-items: center;
}

.filter-label {
  margin-right: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.filter-button {
  padding: 9px 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.filter-button:hover,
.filter-button.is-active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.result-count {
  flex: none;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.document-card {
  --card-accent: var(--acid);
  position: relative;
  display: flex;
  min-height: 445px;
  flex-direction: column;
  padding: clamp(25px, 4vw, 42px);
  overflow: hidden;
  background: var(--paper);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.document-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--card-accent);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.document-card:hover {
  z-index: 1;
  background: #fffefb;
  box-shadow: 0 18px 50px rgba(42, 40, 33, 0.09);
  transform: translateY(-2px);
}

.document-card:hover::before {
  transform: scaleX(1);
}

.document-card[hidden] {
  display: none;
}

.theme-coral {
  --card-accent: #ff795a;
}

.theme-blue {
  --card-accent: #67aee8;
}

.theme-sand {
  --card-accent: #d7aa62;
}

.theme-violet {
  --card-accent: #9d84e8;
}

.theme-orange {
  --card-accent: #f09a47;
}

.theme-pink {
  --card-accent: #ec83ad;
}

.theme-teal {
  --card-accent: #49aa9c;
}

.card-number {
  position: absolute;
  top: 28px;
  right: 32px;
  color: rgba(23, 24, 20, 0.12);
  font-family: var(--font-display);
  font-size: 3.7rem;
  font-weight: 700;
  letter-spacing: -0.08em;
  line-height: 1;
}

.card-tags {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 55px;
}

.featured-label {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 7px 11px;
  color: var(--ink);
  background: var(--acid);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-tags span {
  padding: 6px 8px;
  background: color-mix(in srgb, var(--card-accent) 24%, white);
  border-radius: 4px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-tags span + span {
  color: var(--muted);
  background: #f0eee8;
}

.document-card h3 {
  max-width: 500px;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.document-card > p {
  max-width: 560px;
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.65;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: auto;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.72rem;
}

.card-meta span {
  position: relative;
}

.card-meta span + span::before {
  position: absolute;
  top: 50%;
  left: -10px;
  width: 3px;
  height: 3px;
  background: #a3a59c;
  border-radius: 50%;
  content: "";
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.read-link svg {
  width: 14px;
  transition: transform 160ms ease;
}

.read-link:hover svg {
  transform: translate(2px, -2px);
}

.download-link {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  text-decoration: none;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.card-icon-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-link {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.share-link:hover {
  color: white;
  background: var(--deep-green);
}

.share-link svg {
  width: 17px;
}

.download-link:hover {
  color: white;
  background: var(--ink);
}

.download-link svg {
  width: 18px;
}

.empty-state {
  padding: 80px 24px;
  text-align: center;
  border: 1px solid var(--line);
  border-top: 0;
}

.empty-state[hidden] {
  display: none;
}

.empty-state > span {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  place-items: center;
  background: var(--acid);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.empty-state h3 {
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.about-section {
  display: grid;
  grid-template-columns: 0.45fr 1.1fr 0.8fr;
  align-items: center;
  gap: clamp(30px, 5vw, 76px);
  padding: clamp(74px, 9vw, 130px) clamp(24px, 7vw, 104px);
  color: white;
  background: var(--deep-green);
}

.about-label {
  align-self: start;
  color: var(--acid);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.about-copy h2 {
  margin-bottom: 22px;
  color: white;
}

.about-copy p {
  max-width: 610px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.67);
  font-size: 1rem;
  line-height: 1.75;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  color: var(--ink);
  background: var(--acid);
  border-radius: 9px;
  text-decoration: none;
  transition: transform 180ms ease;
}

.profile-card:hover {
  transform: translateY(-3px) rotate(-1deg);
}

.profile-monogram {
  display: grid;
  width: 49px;
  height: 49px;
  flex: none;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 700;
}

.profile-card > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.profile-card small {
  margin-bottom: 3px;
  color: rgba(23, 24, 20, 0.65);
  font-size: 0.66rem;
}

.profile-card strong {
  overflow: hidden;
  font-size: 0.83rem;
  text-overflow: ellipsis;
}

.profile-card svg {
  width: 20px;
  margin-left: auto;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 34px clamp(24px, 5vw, 76px);
  color: white;
  background: var(--ink);
}

.site-footer strong {
  font-family: var(--font-display);
  font-size: 0.86rem;
}

.site-footer p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.74rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.74rem;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: white;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 40px));
  padding: 14px 18px;
  color: white;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(23, 24, 20, 0.25);
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding-bottom: 86px;
  }

  .hero-copy {
    max-width: 780px;
  }

  .library-visual {
    width: min(100%, 590px);
    min-height: 520px;
    margin: 86px auto 0;
  }

  .floating-badge {
    right: 1%;
  }

  .about-section {
    grid-template-columns: 0.35fr 1fr;
  }

  .profile-card {
    grid-column: 2;
    width: min(100%, 360px);
  }

  .stats-band {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-band > p {
    grid-column: 1 / -1;
    min-height: auto;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 760px) {
  .site-header {
    height: 76px;
  }

  .site-nav > a:not(.instagram-link) {
    display: none;
  }

  .section-heading,
  .library-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .document-grid {
    grid-template-columns: 1fr;
  }

  .stats-band {
    padding: 0 24px;
  }

  .result-count {
    order: -1;
  }

  .about-section {
    grid-template-columns: 1fr;
  }

  .profile-card {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .brand > span:last-child {
    display: none;
  }

  .site-nav {
    gap: 0;
  }

  .instagram-link {
    font-size: 0.8rem !important;
  }

  .hero {
    min-height: auto;
    padding-top: 64px;
  }

  h1 {
    font-size: clamp(3.15rem, 15.5vw, 4.7rem);
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .library-visual {
    min-height: 410px;
    margin-top: 66px;
  }

  .visual-card {
    width: 68%;
    padding: 21px;
  }

  .card-front > strong {
    margin-top: 72px;
    font-size: 2.8rem;
  }

  .formula {
    font-size: 0.7rem;
  }

  .floating-badge {
    right: 0;
    bottom: 20px;
  }

  .orbit-large {
    right: -125px;
  }

  .filters {
    width: calc(100vw - 48px);
    flex-wrap: nowrap;
    padding-bottom: 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .stats-band {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-band > div {
    min-height: 94px;
    padding: 20px 10px;
    text-align: center;
  }

  .stats-band strong {
    font-size: 1.45rem;
  }

  .stats-band > p {
    padding: 18px 20px;
  }

  .language-filters {
    width: calc(100vw - 48px);
    flex-wrap: nowrap;
    padding-bottom: 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .language-filters::-webkit-scrollbar {
    display: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter-button {
    flex: none;
  }

  .document-card {
    min-height: 420px;
  }

  .card-number {
    top: 24px;
    right: 24px;
    font-size: 3.2rem;
  }

  .card-tags {
    margin-bottom: 48px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
