:root {
  --paper: #f7f6f1;
  --paper-deep: #eeeae0;
  --ink: #1d1c1a;
  --muted: #6f6a61;
  --line: #d9d4c9;
  --gold: #c88900;
  --gold-dark: #9a6900;
  --green: #073f25;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(33, 28, 18, 0.09);
  --display: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", sans-serif;
  --body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  background: #e7e3da;
}

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

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

a {
  color: inherit;
}

.page-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 40px rgba(18, 16, 10, 0.09);
}

.hub,
.library,
.material-page,
.error-page {
  padding-right: max(20px, env(safe-area-inset-right));
  padding-left: max(20px, env(safe-area-inset-left));
}

.brand-header {
  position: relative;
  z-index: 3;
  padding-top: max(18px, env(safe-area-inset-top));
}

.brand-logo {
  object-fit: contain;
  border-radius: 50%;
}

.hub-hero {
  position: relative;
  min-height: 455px;
  margin: -10px -20px 0;
  overflow: hidden;
}

.hub-hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  height: 34%;
  content: "";
  background: linear-gradient(transparent, var(--paper) 88%);
}

.hub-hero__copy {
  position: relative;
  z-index: 2;
  width: 67%;
  padding: 72px 0 42px 20px;
}

.hub-hero h1,
.library-header h1,
.error-page h1,
.article-header h1,
.section-title,
.hub-products h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 0.92;
  text-transform: uppercase;
}

.hub-hero h1 {
  font-size: clamp(44px, 12.8vw, 66px);
}

.hub-hero h1 span {
  color: var(--gold);
}

.hub-hero__image {
  position: absolute;
  top: 5px;
  right: -58px;
  width: 84%;
  height: 455px;
  object-fit: cover;
  object-position: 72% center;
  -webkit-mask-image: linear-gradient(to right, transparent 4%, #000 43%);
  mask-image: linear-gradient(to right, transparent 4%, #000 43%);
  filter: saturate(0.96) contrast(1.02);
}

.section-kicker,
.eyebrow,
.premium-label {
  margin: 0 0 6px;
  color: var(--gold-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hub-products {
  position: relative;
  z-index: 2;
  margin-top: -40px;
}

.hub-products h2,
.section-title {
  margin-bottom: 14px;
  font-size: 1.65rem;
}

.hub-card-grid,
.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hub-card,
.library-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 3px 12px rgba(28, 24, 16, 0.06);
}

.hub-card {
  padding: 4px;
}

.hub-card img {
  width: 100%;
  aspect-ratio: 941 / 1450;
  border-radius: 9px 9px 5px 5px;
  object-fit: cover;
  object-position: top;
}

.button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--gold);
  border-radius: 9px;
  color: var(--white);
  background: var(--gold);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(154, 105, 0, 0.16);
}

.button:hover {
  background: var(--gold-dark);
}

.button:focus-visible,
.back-link:focus-visible,
.premium-state a:focus-visible {
  outline: 3px solid rgba(7, 63, 37, 0.55);
  outline-offset: 3px;
}

.button--compact {
  width: 100%;
  min-height: 36px;
  margin-top: 5px;
  padding: 7px 5px;
  font-size: clamp(0.62rem, 2.8vw, 0.78rem);
}

.button--wide {
  width: 100%;
  margin-top: 24px;
}

.button--disabled,
.button--ghost {
  border-color: var(--line);
  color: var(--muted);
  background: var(--paper-deep);
  box-shadow: none;
}

.button--disabled {
  font-size: 0.55rem;
}

.site-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 20px 0;
  padding: 16px 0 max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--green);
}

.site-footer img {
  flex: 0 0 auto;
  border-radius: 50%;
}

.site-footer p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
}

.site-footer span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 500;
}

.library {
  padding-top: max(20px, env(safe-area-inset-top));
}

.library-header {
  margin-bottom: 28px;
}

.library-header .brand-logo {
  margin-bottom: 18px;
}

.library-header h1 {
  margin-bottom: 8px;
  font-size: clamp(44px, 13vw, 64px);
}

.library-header > p:last-child {
  max-width: 33rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.library-card {
  display: flex;
  flex-direction: column;
  padding: 4px;
}

.library-card__visual {
  position: relative;
}

.library-card__visual img {
  width: 100%;
  aspect-ratio: 941 / 1450;
  border-radius: 8px 8px 3px 3px;
  object-fit: cover;
  object-position: top;
}

.library-card.is-locked .library-card__visual img {
  opacity: 0.58;
  filter: grayscale(0.22);
}

.lock-badge {
  position: absolute;
  right: 50%;
  bottom: -17px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  transform: translateX(50%);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
  font-size: 0.6rem;
}

.lock-badge::after {
  position: absolute;
  width: 8px;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  content: "";
}

.library-card__status {
  display: flex;
  min-height: 44px;
  align-items: end;
  justify-content: center;
  padding: 19px 3px 4px;
}

.status {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: clamp(0.57rem, 2.6vw, 0.72rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.status--open {
  color: var(--gold-dark);
}

.premium-state {
  min-height: 48px;
  margin-top: 7px;
  padding: 8px 3px 4px;
  border-top: 1px solid var(--line);
  font-size: clamp(0.53rem, 2.4vw, 0.69rem);
  font-weight: 800;
  line-height: 1.18;
  text-align: center;
}

.premium-state a {
  color: var(--gold-dark);
}

.premium-state__owned {
  color: var(--green);
}

.back-link {
  color: var(--gold-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link--bottom {
  display: block;
  margin: 30px auto 0;
  text-align: center;
}

.material-page {
  padding-top: max(16px, env(safe-area-inset-top));
}

.article-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.article-nav img {
  border-radius: 50%;
}

.article-header h1 {
  max-width: 440px;
  font-size: clamp(45px, 13vw, 67px);
  overflow-wrap: anywhere;
}

.article-header h2 {
  max-width: 430px;
  margin: 12px 0 20px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.32;
}

.article-cover {
  width: 100%;
  height: clamp(240px, 69vw, 340px);
  margin-bottom: 24px;
  border-radius: var(--radius);
  object-fit: cover;
  object-position: center 66%;
  box-shadow: var(--shadow);
}

.article-content {
  color: #292722;
  font-size: 0.96rem;
  line-height: 1.58;
}

.article-content p,
.article-content ul {
  margin: 0 0 1em;
}

.article-content ul {
  padding-left: 1.25em;
}

.article-content li {
  margin-bottom: 0.38em;
}

.article-content strong {
  color: var(--ink);
}

.article-content h1,
.article-content h2,
.article-content h3 {
  font-family: var(--display);
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.article-content h1 {
  margin: 1.1em 0 0.45em;
  padding-left: 12px;
  border-left: 5px solid var(--gold);
  font-size: clamp(31px, 9vw, 43px);
  text-transform: uppercase;
}

.article-content h2 {
  margin: 1.2em 0 0.55em;
  font-size: 2rem;
}

.article-content h3 {
  margin: 1.35em 0 0.55em;
  font-family: var(--body);
  font-size: 1.18rem;
  line-height: 1.22;
}

.premium-article {
  margin-top: 38px;
  padding-top: 26px;
  border-top: 3px solid var(--gold);
}

.premium-cta {
  margin-top: 36px;
  padding: 22px;
  border: 1px solid #e0c887;
  border-radius: var(--radius);
  background: #f6edda;
}

.premium-cta h2 {
  margin: 4px 0 8px;
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
  text-transform: uppercase;
}

.premium-cta > p:not(.premium-label) {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.premium-cta .button {
  width: 100%;
}

.error-page {
  display: flex;
  min-height: 72vh;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-top: max(30px, env(safe-area-inset-top));
}

.error-page h1 {
  max-width: 430px;
  margin-bottom: 12px;
  font-size: clamp(42px, 13vw, 64px);
}

.error-page > p:not(.eyebrow) {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
}

.error-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 24px;
}

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

@media (max-width: 360px) {
  .hub,
  .library,
  .material-page,
  .error-page {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hub-hero {
    margin-right: -14px;
    margin-left: -14px;
  }

  .hub-hero__copy {
    padding-left: 14px;
  }

  .hub-card-grid,
  .library-grid {
    gap: 5px;
  }

  .library-card,
  .hub-card {
    border-radius: 9px;
  }

  .premium-state {
    min-height: 54px;
  }
}

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