/*
* Site: Color by Number Monochrome (monochromemysteries.com)
* Exact match domain landing page for 100 Color by Number Monochrome Mysteries.
* Code conventions follow the PixelColorist theme and hatchandfill.com
* (custom properties, reset, kebab-case semantic classes, nested media
* queries). The design is the book's own: white paper, guide dot grid, the
* six marks, black ink and the gold of the cover.
* Version: 1.0.0
*/

/* FONTS */
@font-face {
  font-display: swap;
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 400 700;
  src: url('../fonts/rubik-v31-latin.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Averia Sans Libre';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/averia-sans-libre-v20-latin-700.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Averia Sans Libre';
  font-style: italic;
  font-weight: 700;
  src: url('../fonts/averia-sans-libre-v20-latin-700italic.woff2') format('woff2');
}

/* VARS */
:root {
  --page-width-max: 1024px;
  --header-height: 4.5rem;
  --strip-height: 0.75rem;
  --contrast-color: #111111;
  --contrast-color-rgb: 17, 17, 17;
  --base-color: #F6F5F2;
  --paper-color: white;
  --placeholder-color: #e4e2dd;
  --link-color: #8A6514;
  --link-color-light: #B8891A;
  --secondary-color: #85827c;
  --default-padding: 1rem;
  --default-spacing: 1.5rem;
  --slant: 2.5rem;

  --mobile-breakpoint: 640px;

  --font-size-sm: 0.90rem;
  --font-size-base: 1.1rem;
  --font-size-md: 1.3rem;
  --font-size-xl: 1.8rem;
  --font-size-2xl: 2.4rem;
  --font-size-3xl: 3.4rem;

  --border-radius: 1rem;

  /* The gold of the "100" and of the One Pen Only badge on the cover */
  --gold-dark: #B8891A;
  --gold: #D4A632;
  --gold-light: #E9BC4A;
  --gold-gradient: linear-gradient(160deg, var(--gold-dark), var(--gold-light));

  /* The light guide dots printed under every cell of the grid */
  --grid-dot-color: #dcd9d3;
  --grid-pitch: 22px;
}

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: normal;
}

figcaption {
  font-family: 'Averia Sans Libre', 'Rubik', sans-serif;
  font-style: italic;
  color: var(--secondary-color);
  text-align: center;
}

/* STYLES */
body {
  background-color: var(--base-color);
  color: var(--contrast-color);
  font-family: 'Rubik', 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: var(--font-size-base);
}

h1,
h2,
h3 {
  font-weight: 700;
}

h1 {
  font-size: var(--font-size-2xl);
  line-height: 1.1;
  letter-spacing: -0.01em;

  @media(min-width: 640px) {
    font-size: var(--font-size-3xl);
  }
}

h2 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--default-padding);
}

/* Under every section title, the six marks, darkest first */
h2::after {
  content: "";
  display: block;
  width: 5.4rem;
  height: 0.9rem;
  margin-top: calc(var(--default-padding)/2);
  background: url('../images/monochrome-six-marks-rule.svg') left center / auto 100% no-repeat;
}

.band-dark h2::after {
  filter: invert(1);
}

h3 {
  font-size: var(--font-size-md);
}

p {
  line-height: 170%;
  margin-bottom: var(--default-padding);
}

small {
  font-size: var(--font-size-sm);
}

/* LINKS */
a {
  color: var(--link-color);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
  color: var(--link-color-light);
  text-decoration-color: currentColor;
}

.band-dark a:not(.call-to-action) {
  color: var(--gold-light);
}

.band-dark a:not(.call-to-action):hover {
  color: var(--paper-color);
}

.text-link {
  font-weight: 500;
}

/* HEADER */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--default-padding);
  height: var(--header-height);
  padding: 0 var(--default-padding);
  background-color: var(--paper-color);
}

.header-wordmark {
  height: 2.2rem;
  width: auto;

  @media(min-width: 640px) {
    height: 2.6rem;
  }
}

/* A row of slashes, all in one direction: plain hatching. The strokes run the
   full height of the strip, so it closes the header with no white line below */
.hatch-strip {
  height: var(--strip-height);
  background: var(--paper-color) url('../images/hatch-strip-tile.svg') left center / auto 100% repeat-x;
}

header nav {
  display: none;

  @media(min-width: 900px) {
    display: block;
    flex-grow: 1;
  }
}

header nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(0.3rem + 2%);
  list-style: none;
  padding-inline-start: 0;
}

header nav a {
  color: var(--contrast-color);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}

header nav a:hover {
  color: var(--contrast-color);
  border-bottom-color: var(--gold);
}

header .call-to-action {
  font-size: var(--font-size-sm);
  padding: calc(var(--default-padding)/3) calc(var(--default-padding)*0.75);
  flex-shrink: 0;

  @media(min-width: 640px) {
    padding: calc(var(--default-padding)/3) var(--default-padding);
  }
}

/* The bag icon is the first thing to go when the header gets narrow */
header .call-to-action>svg {
  display: none;

  @media(min-width: 640px) {
    display: block;
  }
}

/* BANDS */
.band {
  padding: calc(var(--default-spacing)*2) var(--default-padding);
  scroll-margin-top: calc(var(--header-height) + var(--strip-height));
}

.band-inner {
  width: 100%;
  max-width: var(--page-width-max);
  margin: 0 auto;
}

.band-paper {
  background-color: var(--paper-color);
}

/* A blank page of the book: white paper and its grid of guide dots */
.band-grid {
  background-color: var(--paper-color);
  background-image: radial-gradient(circle, var(--grid-dot-color) 1.6px, transparent 2px);
  background-size: var(--grid-pitch) var(--grid-pitch);
}

.band-dark {
  background-color: var(--contrast-color);
  color: var(--base-color);
  padding-top: calc(var(--default-spacing)*2 + var(--slant));
  padding-bottom: calc(var(--default-spacing)*2 + var(--slant));
  clip-path: polygon(0 0, 100% var(--slant), 100% 100%, 0 calc(100% - var(--slant)));
}

/* Runs straight into the black footer, so only its top edge is slanted */
.band-dark-last {
  padding-bottom: calc(var(--default-spacing)*2);
  clip-path: polygon(0 0, 100% var(--slant), 100% 100%, 0 100%);
}

.band-dark .secondary-text {
  color: #a8a59f;
}

/* HERO */
.hero {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: calc(var(--default-padding)/2);

  @media(min-width: 640px) {
    flex-direction: row;
    align-items: center;
    gap: calc(var(--default-spacing)*2);
  }
}

/* On a phone the text block dissolves into the hero so the cover can slot in
   right after the tagline (see the order values below) */
.hero-content {
  display: contents;
  flex-direction: column;
  align-items: start;
  gap: calc(var(--default-padding)/2);

  @media(min-width: 640px) {
    display: flex;
  }
}

.hero .badge {
  order: 1;
}

.hero h1 {
  order: 2;
}

.hero .tagline {
  order: 3;
}

.hero-subtitle {
  order: 5;
}

.hero-lede {
  order: 6;
}

.hero-actions {
  order: 7;
}

/* Paper behind the text, so the guide dots never run through a line */
.hero-content> :not(.badge) {
  background-color: var(--paper-color);
  box-shadow: 0 0 0.4rem 0.4rem var(--paper-color);
}

.hero h1 {
  margin-bottom: 0;
}

.tagline {
  font-family: 'Averia Sans Libre', 'Rubik', sans-serif;
  font-size: var(--font-size-xl);
  font-style: italic;
  background-color: transparent;
  background-image: var(--gold-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  line-height: 1.3;
}

.hero-content>.tagline {
  background-color: transparent;
  box-shadow: none;
}

.hero-subtitle {
  font-size: var(--font-size-md);
  margin-bottom: 0;
}

.hero-lede {
  margin-top: calc(var(--default-padding)/2);
  margin-bottom: calc(var(--default-padding)/2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--default-padding);
}

/* On a phone the cover sits right under the tagline, so the book shows above the fold */
.hero-image {
  order: 4;
  align-self: center;
  max-width: 11rem;
  margin: calc(var(--default-padding)/2) 0;
  flex-shrink: 0;

  @media(min-width: 640px) {
    order: 0;
    margin: 0;
    max-width: 20rem;
  }
}

/* PHOTOS */
/* Two real photos of the book, side by side from 640px up */
.photo-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--default-spacing);

  @media(min-width: 640px) {
    grid-template-columns: 1fr 1fr;
  }
}

/* FORMAT */
.figure-block {
  display: flex;
  flex-direction: column;
  gap: calc(var(--default-padding)/2);
  margin-top: var(--default-spacing);
}

.photo-block {
  padding-top: 0;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--default-spacing);
  margin-top: var(--default-spacing);

  @media(min-width: 640px) {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.step {
  display: flex;
  flex-direction: column;
  gap: calc(var(--default-padding)/2);
  background-color: var(--paper-color);
  border-radius: var(--border-radius);
  padding: var(--default-padding);
}

.step h3 {
  margin-bottom: 0;
}

.step p {
  margin-bottom: 0;
  font-size: var(--font-size-sm);
}

.step-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5.5rem;
}

.step-visual img {
  width: 100%;
}

.step-visual .close-up {
  width: auto;
  height: 5.5rem;
}

/* ONE PEN */
.one-pen {
  display: flex;
  flex-direction: column;
  gap: var(--default-spacing);

  @media(min-width: 640px) {
    flex-direction: row;
    align-items: center;
  }
}

/* The lifestyle visual, kept small beside the text */
.one-pen-photo {
  width: 100%;
  max-width: 22rem;
  flex-shrink: 0;
  align-self: center;
}

.one-pen-text p:last-child {
  margin-bottom: 0;
}

/* BOOK */
.book {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--default-spacing);

  @media(min-width: 640px) {
    flex-direction: row;
    align-items: center;
  }
}

.book-image {
  max-width: 13rem;
  flex-shrink: 0;
}

.book-detail ul {
  list-style: none;
  margin: 1rem 0 2rem 0;
  padding-left: 0;
}

.book-detail li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 1.7rem;
}

/* The asterisk mark stands in for the check */
.book-detail li::before {
  content: "✱";
  color: var(--gold-dark);
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* FREE PAGE */
.free-page {
  text-align: center;
}

.free-page h2::after {
  margin-inline: auto;
}

.free-page>.band-inner>p {
  max-width: 40rem;
  margin-inline: auto;
}

.free-page-visual {
  display: block;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto var(--default-spacing) auto;
  border: 1px solid var(--placeholder-color);
  box-shadow: 0 0.6rem 1.5rem rgba(var(--contrast-color-rgb), 0.12);
  transition: transform 0.3s;
}

.free-page-visual:hover {
  transform: translateY(-3px);
}

/* FAQ */
.faq-item {
  border-top: 1px solid var(--placeholder-color);
  padding-top: var(--default-padding);
  margin-bottom: var(--default-padding);
}

.faq-item h3 {
  margin-bottom: calc(var(--default-padding)/2);
}

.faq-item p:last-child {
  margin-bottom: 0;
}

/* ABOUT */
.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--default-spacing);

  @media(min-width: 640px) {
    flex-direction: row;
    align-items: start;
  }
}

.author-img {
  width: 9rem;
  height: auto;
  flex-shrink: 0;
  mix-blend-mode: multiply;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* SOCIALS */
.socials {
  text-align: center;
}

.socials h2::after {
  margin-inline: auto;
}

.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--default-spacing);
  list-style: none;
  padding-inline-start: 0;
  margin-top: var(--default-spacing);
}

.social-links a {
  display: block;
  color: var(--contrast-color);
  transition: color 0.3s, transform 0.3s;
}

.social-links a:hover {
  color: var(--gold-dark);
  transform: translateY(-3px);
}

.social-links svg {
  width: 3rem;
  height: 3rem;

  @media(min-width: 640px) {
    width: 3.5rem;
    height: 3.5rem;
  }
}

/* FOOTER */
footer {
  background-color: var(--contrast-color);
  color: var(--base-color);
  text-align: center;
  font-size: var(--font-size-sm);
  padding: calc(var(--default-spacing)*2) var(--default-padding);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--default-padding);
}

/* The wordmark is drawn in black, turned white for the black footer */
.footer-wordmark {
  width: 10rem;
  height: auto;
  filter: invert(1);
  margin-bottom: calc(var(--default-padding)/2);
}

footer a {
  text-decoration: none;
  color: var(--base-color);
}

footer a:hover {
  color: var(--gold-light);
}

footer nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  padding-inline-start: 0;
  gap: var(--default-spacing);
}

.amazon-disclaimer {
  color: var(--secondary-color);
}

/* GENERIC STYLES */
.secondary-text {
  color: var(--secondary-color);
}

.rounded-box {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.spacer {
  height: var(--default-spacing);
}

.badge {
  background-color: var(--contrast-color);
  color: var(--paper-color);
  border-radius: var(--border-radius);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: var(--font-size-sm);
  padding: 0.25rem 0.75rem;
}

/* Gold like the cover badge, with black text so it stays readable */
.call-to-action {
  display: inline-flex;
  align-items: center;
  border-radius: var(--border-radius);
  color: var(--contrast-color);
  background: var(--gold-gradient);
  padding: calc(var(--default-padding)/2) calc(var(--default-padding)*2);
  font-size: var(--font-size-md);
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  gap: 0.5rem;

  transition: filter 0.3s, transform 0.3s;
}

.call-to-action:hover {
  color: var(--contrast-color);
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.call-to-action>svg {
  height: 1.5rem;
  width: auto;
  flex-shrink: 0;
}

.call-to-action-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--default-padding)/2);
}

.download {
  background: var(--contrast-color);
  color: var(--paper-color);
}

.download:hover {
  color: var(--paper-color);
  filter: none;
  background: #333;
}
