/* Design tokens from Figma */
:root {
  --beg: #f3f1ea;
  --beg2: #e8e3d8;
  --black: #010101;
  --white: #f9f9f9;
  --red: #8b1e15;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --container-pad: 16px;
  --section-pad-y: 40px;
  --gap-sm: 10px;
  --gap-md: 20px;
  --gap-lg: 30px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--beg);
  color: var(--black);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

/* Typography */
.font-serif {
  font-family: var(--font-serif);
  font-weight: 700;
}

.text-upper {
  text-transform: uppercase;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Layout */
.page {
  width: 100%;
  overflow-x: hidden;
  padding-bottom: 40px;
}

.container {
  width: 100%;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.container--wide {
  max-width: 1440px;
  margin: 0 auto;
}

.divider {
  background: var(--black);
  height: 1px;
  width: 100%;
}

.divider--thick {
  height: 2px;
}

.section {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}

.section--beg2 {
  background: var(--beg2);
}

.section--beg {
  background: var(--beg);
}

/* Header */
.header {
  background: var(--beg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--container-pad);
}

.header__brand {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.header__brand--desktop {
  display: none;
}

.header__burger {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.header__burger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--black);
}

.header__nav {
  display: none;
}

.header__nav-list {
  display: flex;
  align-items: center;
  gap: 30px;
}

.header__nav-link {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  padding: 5px 0;
  white-space: nowrap;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--beg);
  flex-direction: column;
  padding: 20px var(--container-pad);
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu__close {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  color: var(--black);
  margin-bottom: 40px;
}

.mobile-menu__list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mobile-menu__link {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
}

/* Info bar */
.info-bar {
  background: var(--beg);
  padding: 6px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 100%;
}

.info-bar__text {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.info-bar__text--center {
  justify-self: start;
}

.info-bar__text--right {
  justify-self: end;
  text-align: right;
}

.info-bar__brand {
  display: none;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Masthead */
.masthead {
  background: var(--beg);
  padding: 12px var(--container-pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-md);
}

.masthead__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 40px;
  text-transform: uppercase;
  line-height: normal;
}

.masthead__subtitle {
  font-size: 14px;
  text-transform: uppercase;
  text-align: center;
}

/* Articles */
.articles-grid {
  background: var(--beg);
  padding: var(--section-pad-y) var(--container-pad);
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.article-card__meta {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.article-card__category {
  font-size: 14px;
  text-transform: uppercase;
}

.article-card__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
  line-height: normal;
}

.article-card__title--featured {
  font-size: 24px;
  color: var(--red);
  text-decoration: underline;
  text-underline-position: from-font;
}

.article-card__text {
  font-size: 14px;
  line-height: normal;
}

.img-hover {
  position: relative;
  width: 100%;
  height: clamp(220px, 45vw, 290px);
  overflow: hidden;
  isolation: isolate;
}

.img-hover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-hover__color {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1.04);
  will-change: opacity, transform;
}

.img-hover:hover .img-hover__color,
.img-hover:focus-within .img-hover__color {
  opacity: 1;
  transform: scale(1);
}

/* B&W → color crossfade for article images */
.img-hover--reveal .img-hover__bw {
  position: relative;
  z-index: 1;
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-hover--reveal:hover .img-hover__bw,
.img-hover--reveal:focus-within .img-hover__bw {
  opacity: 0;
}

@media (hover: hover) {
  .img-hover--reveal:hover .img-hover__color,
  .img-hover--reveal:focus-within .img-hover__color {
    opacity: 1;
    transform: scale(1);
  }
}

@media (hover: none) {
  .img-hover--reveal .img-hover__color {
    opacity: 1;
    transform: scale(1);
  }

  .img-hover--reveal .img-hover__bw {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .img-hover__color,
  .img-hover--reveal .img-hover__bw {
    transition: none;
  }

  .img-hover--reveal .img-hover__color {
    transform: none;
  }
}

.article-card__image {
  width: 100%;
  height: clamp(220px, 45vw, 290px);
  object-fit: cover;
}

.article-card__video {
  width: 100%;
  height: clamp(220px, 45vw, 290px);
  object-fit: cover;
  background: var(--black);
  display: block;
}

.article-card__image--hero {
  height: clamp(260px, 55vw, 325px);
}

.img-hover--grayscale img {
  filter: grayscale(100%);
  transition: filter 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-hover--grayscale:hover img,
.img-hover--grayscale:focus-within img {
  filter: grayscale(0);
}

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 40px;
  border: 1px solid var(--black);
  background: transparent;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--black);
  cursor: pointer;
  text-decoration: none;
  appearance: none;
}

.invite-box {
  background: var(--black);
  color: var(--white);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.invite-box__label {
  font-size: 14px;
  text-transform: uppercase;
}

.invite-box__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
}

.featured-section .article-card__video--hero {
  height: clamp(260px, 55vw, 325px);
}

/* Featured section */
.featured-section {
  background: var(--beg);
  padding: var(--section-pad-y) var(--container-pad);
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.featured-section__body {
  font-size: 14px;
  white-space: pre-wrap;
}

.featured-section__body p {
  margin-bottom: 0;
}

.featured-section__body p + p {
  margin-top: 0;
}

/* Patterns */
.patterns {
  padding: var(--section-pad-y) var(--container-pad);
}

.patterns__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  text-align: center;
  margin-bottom: var(--gap-md);
}

.patterns__grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  max-width: 1042px;
  margin: 0 auto;
  width: 100%;
}

.pattern-card {
  border: 1px solid var(--black);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  width: 100%;
  min-height: 161px;
}

.pattern-card__icon {
  width: 40px;
  height: 40px;
}

.pattern-card__icon img,
.pattern-card__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Game popup / slots */
.game-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-color: #1a0a2e;
  background-size: cover;
  background-position: center;
  overflow-y: auto;
}

.game-overlay[hidden] {
  display: none;
}

.game-modal {
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  padding: 40px 16px;
}

.game-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1080px;
  position: relative;
}

.game-modal__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 28px;
  color: var(--white);
  text-transform: uppercase;
  text-align: center;
  flex: 1;
}

.game-modal__close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--white);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-board {
  background: var(--black);
  padding: 20px;
  width: 100%;
  max-width: 680px;
}

.slot-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}

.slot-cell {
  aspect-ratio: 1;
  background-color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.slot-cell__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slot-divider--h {
  height: 1px;
  background: #999;
  width: 100%;
  margin: 0;
}

.game-modal__spin {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(16px, 4vw, 20px);
  text-transform: uppercase;
  color: var(--black);
  background: var(--beg);
  border: 1px solid var(--black);
  padding: clamp(14px, 3vw, 20px) clamp(40px, 12vw, 100px);
  cursor: pointer;
  width: 100%;
  max-width: 320px;
}

.game-modal__spin:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.footer__contact-info a {
  color: inherit;
}

.footer__contact-info a:hover {
  text-decoration: underline;
}

.pattern-card__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
}

.pattern-card__text {
  font-size: 14px;
}

/* Editor letter */
.editor-letter {
  padding: var(--section-pad-y) var(--container-pad);
}

.editor-letter__box {
  border: 1px solid var(--black);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  align-items: center;
}

.editor-letter__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  text-align: center;
}

.editor-letter__text {
  font-size: 14px;
  width: 100%;
}

.editor-letter__sign {
  font-size: 14px;
  text-align: right;
  width: 100%;
}

/* FAQ */
.faq {
  padding: var(--section-pad-y) var(--container-pad);
}

.faq__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  text-align: center;
  margin-bottom: var(--gap-md);
}

.faq__grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.faq-card {
  border: 1px solid var(--black);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.faq-card__question {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 20px;
}

.faq-card__answer {
  font-size: 14px;
}

/* Visual excellence */
.visual {
  padding: var(--section-pad-y) var(--container-pad);
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  align-items: center;
}

.visual__header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.visual__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
}

.visual__text {
  font-size: 14px;
}

.visual__gallery {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.visual__gallery img {
  width: 100%;
  height: clamp(220px, 40vw, 290px);
  object-fit: cover;
}

.visual__caption {
  font-size: 14px;
  text-align: center;
  width: 100%;
}

/* Footer */
.footer {
  background: var(--beg2);
  padding: var(--section-pad-y) var(--container-pad);
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  font-size: 14px;
}

.footer__warning {
  border: 1px solid var(--black);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  align-items: center;
  text-align: center;
}

.footer__warning-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
}

.footer__warning-text {
  font-size: 14px;
}

.footer__regulators {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

.footer__regulators a {
  font-size: 16px;
  text-decoration: underline;
  text-underline-position: from-font;
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.footer__contact-text {
  font-size: 16px;
}

.footer__contact-info {
  font-size: 14px;
  line-height: normal;
}

.footer__copyright {
  font-size: 14px;
}

/* Legal pages */
.legal-content {
  padding: var(--section-pad-y) 0;
}

.legal-content__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 40px;
  text-align: center;
  margin-bottom: 20px;
  padding: 0 var(--container-pad);
}

.legal-content__body {
  font-size: 14px;
  line-height: 1.5;
  padding: 5px var(--container-pad);
  max-width: 1260px;
  margin: 0 auto;
}

.legal-content__body p {
  margin-bottom: 1em;
}

/* Desktop spacer (hidden on mobile) */
.desktop-spacer {
  display: none;
}

.articles-col--center {
  display: none;
}

.faq__row {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

/* Tablet layout */
@media (min-width: 600px) {
  .faq__row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--gap-sm);
  }

  .faq-card {
    flex: 1 1 calc(50% - var(--gap-sm) / 2);
    min-width: 240px;
  }

  .visual__gallery {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .visual__gallery img {
    flex: 1 1 calc(33.333% - 0px);
    min-width: 200px;
    height: clamp(200px, 28vw, 290px);
  }

  .footer__links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--gap-md);
  }

  .footer__regulators {
    gap: 20px;
  }
}

@media (min-width: 768px) {
  :root {
    --container-pad: 32px;
    --section-pad-y: 48px;
  }

  .info-bar {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .info-bar__brand {
    display: block;
    justify-self: start;
    font-size: 12px;
  }

  .info-bar__text--center {
    justify-self: center;
    text-align: center;
  }

  .info-bar__text--right {
    justify-self: end;
    text-align: right;
  }

  .masthead__title {
    font-size: clamp(48px, 8vw, 64px);
  }

  .articles-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap-md);
    max-width: 960px;
    margin: 0 auto;
  }

  .articles-col {
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
    min-width: 0;
  }

  .articles-col--center {
    display: none;
  }

  .featured-section {
    display: block;
    max-width: 960px;
    margin: 0 auto;
  }

  .article-card__title {
    font-size: clamp(18px, 2.5vw, 22px);
  }

  .article-card__title--featured {
    font-size: clamp(22px, 3vw, 28px);
  }

  .img-hover {
    height: clamp(240px, 35vw, 320px);
  }

  .article-card__video,
  .article-card__video--hero {
    height: clamp(260px, 40vw, 380px);
  }

  .featured-section .article-card__video--hero {
    height: clamp(260px, 40vw, 380px);
  }

  .editor-letter__box {
    max-width: 720px;
    margin: 0 auto;
  }

  .patterns__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap-md);
    max-width: 1042px;
  }

  .footer__contact {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--gap-lg);
  }
}

/* Desktop layout */
@media (min-width: 1024px) {
  :root {
    --container-pad: 48px;
  }

  .header {
    justify-content: center;
    padding: 12px var(--container-pad);
  }

  .header__burger {
    display: none;
  }

  .header__nav {
    display: block;
  }

  .info-bar {
    grid-template-columns: 1fr 1fr 1fr;
    padding: 6px 0;
  }

  .header__brand--mobile {
    display: none;
  }

  .info-bar__brand {
    display: block;
    justify-self: start;
    font-size: 14px;
  }

  .info-bar__text {
    font-size: 14px;
  }

  .info-bar__text--center {
    justify-self: center;
    text-align: center;
  }

  .info-bar__text--right {
    justify-self: end;
    text-align: right;
  }

  .masthead__title {
    font-size: 80px;
  }

  .masthead__subtitle {
    font-size: 16px;
  }

  .desktop-spacer {
    display: block;
    height: 45px;
    background: var(--beg);
  }

  .articles-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.82fr) minmax(0, 1fr);
    gap: clamp(12px, 1.5vw, 24px);
    align-items: start;
    padding: 0 var(--container-pad);
    max-width: 1280px;
    margin: 0 auto;
  }

  .articles-col {
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
    min-width: 0;
    width: auto;
  }

  .articles-col--left,
  .articles-col--right {
    width: auto;
    flex-shrink: 1;
  }

  .articles-col--center {
    width: auto;
    flex-shrink: 1;
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
  }

  .article-card {
    padding: 20px;
    border-radius: 12px;
  }

  .article-card__image,
  .img-hover {
    height: clamp(260px, 22vw, 330px);
  }

  .article-card__image--hero,
  .article-card__video--hero {
    height: clamp(340px, 32vw, 462px);
  }

  .img-hover--hero {
    height: clamp(340px, 32vw, 462px);
  }

  .article-card__title--featured {
    font-size: 32px;
  }

  .btn-outline {
    width: auto;
    align-self: flex-start;
  }

  .featured-section {
    display: none;
  }

  .articles-col--center {
    display: flex;
  }

  .articles-col--center .featured-body {
    display: block;
    font-size: 14px;
    white-space: pre-wrap;
    padding: 0 20px;
  }

  .faq__row {
    flex-direction: row;
    gap: var(--gap-md);
  }

  .patterns__title {
    font-size: 32px;
    margin-bottom: var(--gap-lg);
  }

  .patterns__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gap-md);
    max-width: 1042px;
    margin: 0 auto;
    width: 100%;
  }

  .pattern-card {
    width: 100%;
    min-height: 161px;
  }

  .editor-letter__title {
    font-size: 32px;
  }

  .editor-letter__box {
    max-width: 840px;
    margin: 0 auto;
    padding: 20px;
    gap: var(--gap-lg);
  }

  .editor-letter__text {
    max-width: 800px;
  }

  .editor-letter__sign {
    max-width: 800px;
  }

  .faq__title {
    font-size: 32px;
    margin-bottom: var(--gap-lg);
  }

  .faq__grid {
    max-width: 1280px;
    margin: 0 auto;
    gap: var(--gap-md);
  }

  .faq__row {
    display: flex;
    gap: var(--gap-md);
    justify-content: center;
  }

  .faq-card {
    width: auto;
    flex: 1 1 280px;
    max-width: 334px;
  }

  .visual__gallery {
    flex-direction: row;
    flex-wrap: nowrap;
    max-width: 1280px;
    width: 100%;
  }

  .visual__gallery img {
    flex: 1 1 0;
    min-width: 0;
    height: clamp(240px, 22vw, 320px);
  }

  .visual__title {
    font-size: 32px;
  }

  .visual__text {
    max-width: 800px;
  }

  .game-modal__title {
    font-size: 40px;
  }

  .slot-board {
    max-width: 720px;
  }

  .visual__caption {
    max-width: 800px;
  }

  .footer {
    padding: var(--section-pad-y) clamp(32px, 8vw, 120px);
    align-items: center;
    gap: var(--gap-lg);
  }

  .footer__links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    max-width: 840px;
  }

  .footer__warning-text {
    max-width: 800px;
  }

  .footer__contact {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    max-width: 840px;
    align-items: flex-start;
  }

  .legal-content__title {
    font-size: 53px;
  }

  .legal-content__body {
    padding: 5px 0;
  }
}

@media (min-width: 1280px) {
  :root {
    --container-pad: 80px;
  }

  .container--wide {
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
  }

  .articles-grid {
    max-width: 1280px;
  }
}
