/* ==========================================================================
   Drawn To Life · Asis Patel Ltd
   One stylesheet for the site and the pattern library (styleguide.html).

   1. Design tokens
   2. Base
   3. Layout
   4. Typography
   5. Components
   6. Page sections
   7. Motion
   ========================================================================== */


/* 1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette */
  --strawberry: #FF0049;
  --orange:     #FF4900;
  --lemon:      #FFCB00;
  --apple:      #00B874;
  --blueberry:  #2558F5;
  --grape:      #A72AFF;
  --panda:      #000000;
  --bunny:      #FFFFFF;

  /* Roles: use these in components rather than the raw palette */
  --color-text:        var(--panda);
  --color-background:  var(--bunny);
  --color-accent:      var(--orange);
  --color-action:      var(--blueberry);
  --color-line:        var(--panda);
  --color-on-accent:   var(--bunny);

  /* Font families */
  --font-body:    "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --font-hand:    "Indie Flower", "Comic Sans MS", cursive;

  /* Type scale (fluid: mobile → desktop) */
  --text-sm:   clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);   /* labels, small print */
  --text-base: clamp(1.15rem, 1rem + 0.6vw, 1.4896rem);   /* body: 23.83px on desktop, as on Carrd */
  --text-lg:   clamp(1.4rem, 1rem + 1.3vw, 2.1667rem);  /* roles: 34.67px */
  --text-md:   clamp(1.25rem, 1rem + 0.7vw, 1.625rem);  /* Juice intro, copyright: 26px */
  --text-xl:   clamp(1.6rem, 1.3rem + 1.2vw, 2.1667rem);  /* footer links: 34.67px */
  --text-button:  clamp(1.5rem, 1.2rem + 1vw, 2rem);      /* pill buttons: 32px */
  --text-link-sm: clamp(1.35rem, 1.15rem + 0.6vw, 1.625rem); /* The Details: 26px */
  --text-2xl:  clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);   /* story names: 52px */
  --text-title: clamp(3rem, 1.5rem + 5.4vw, 6.23rem);     /* PEOPLE'S STORIES: 100px */
  --text-3xl:  clamp(3.25rem, 1.6rem + 6.6vw, 7.58rem);   /* THE JUICE: 121px */

  --leading-tight: 1.05;
  --leading-body:  1.375;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;
  --space-8: 7rem;

  /* Widths */
  --measure: 32.5rem;   /* 520px reading column */
  --wide:    80.2rem;   /* 1283px wide container */
  --illo:    43.3rem;   /* 693px illustrations and hero */
  --gutter:  clamp(1.25rem, 4vw, 3.25rem);
  --block:   2.1667rem; /* 35px gap between blocks, as on Carrd */

  /* Lines, corners, shadows */
  --rule:          3px;
  --radius-sm:     4px;
  --radius-pill:   999px;
  --shadow-hard:   6px 6px 0 var(--panda);
  --shadow-hard-sm: 3px 3px 0 var(--panda);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-reveal: 900ms;
  --duration-press:  120ms;
}


/* Desktop (981px and up): fixed sizes, exactly as on Carrd, which doesn't
   scale type with window width. Below this the fluid sizes above apply. */
@media (min-width: 61.3125rem) {
  :root {
    --text-base:    1.4896rem;  /* 23.83px */
    --text-md:      1.625rem;   /* 26px */
    --text-lg:      2.1667rem;  /* 34.67px */
    --text-xl:      2.1667rem;  /* 34.67px */
    --text-button:  2rem;       /* 32px */
    --text-link-sm: 1.625rem;   /* 26px */
    --text-2xl:     3.25rem;    /* 52px */
    --text-title:   6.23rem;    /* 99.7px */
    --text-3xl:     7.58rem;    /* 121px */
    --gutter:       3.25rem;    /* 52px */
  }
}


/* 2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Backdrop, as on Carrd: black with orange juice dots, fixed behind the
   page. It shows in the strip under the footer and whenever you bounce
   past the top or bottom of the page. The content sits on white. */
html:has(.site-footer) { background-color: var(--panda); }
html:has(.site-footer) body { background: transparent; }
html:has(.site-footer) body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--panda);
  background-image: radial-gradient(circle, var(--orange) 0 5px, transparent 6px);
  background-size: 67px 67px;
  background-position: 18px 14px;
  pointer-events: none;
}
html:has(.site-footer) main { background: var(--bunny); }
.dots { height: 3rem; }   /* see-through strip under the footer */

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
}

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

p { margin: 0 0 0.7em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-underline-offset: 0.12em; }

:focus-visible {
  outline: 3px solid var(--blueberry);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -4rem;
  z-index: 10;
  padding: var(--space-2) var(--space-3);
  background: var(--panda);
  color: var(--bunny);
  font-family: var(--font-display);
  text-transform: uppercase;
}
.skip-link:focus { top: var(--space-3); }


/* 3. Layout
   -------------------------------------------------------------------------- */
.measure {
  width: min(100% - 2 * var(--gutter), var(--measure));
  margin-inline: auto;
}

.wide {
  width: min(100% - 2 * var(--gutter), var(--wide));
  margin-inline: auto;
}

.full { width: 100%; }

.section { margin-block: var(--block); }
.section--tight { margin-block: var(--space-5); }

.stack > * + * { margin-top: var(--space-3); }

.center { text-align: center; }
.center img { margin-inline: auto; }


/* 4. Typography
   -------------------------------------------------------------------------- */
.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  text-transform: uppercase;
  letter-spacing: 0.005em;
}
.display--xl { font-size: var(--text-3xl); }
.display--title { font-size: var(--text-title); }
.display--lg { font-size: var(--text-2xl); }
.display--md { font-size: var(--text-xl); }

.hand {
  margin: 0;
  font-family: var(--font-hand);
  font-size: var(--text-lg);
  line-height: 1.2;
  text-transform: uppercase;
}

/* Hand-drawn lettering supplied as artwork: the <img> alt carries the words */
.lettering { margin-block: 0 1.5rem; }   /* drawn heading, then a small gap, then the text */
.lettering img { width: 100%; }
.lettering--caption { width: min(100%, 21.8rem); margin: 0.52rem auto 0; }

.lede { font-size: var(--text-base); }


/* 5. Components
   -------------------------------------------------------------------------- */

/* Button: Anton pill, ink outline, hard shadow. Fills with Orange on hover. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7em 1.4em;
  border: var(--rule) solid var(--panda);
  border-radius: var(--radius-pill);
  background: var(--bunny);
  color: var(--panda);
  box-shadow: var(--shadow-hard);
  font-family: var(--font-display);
  font-size: var(--text-button);
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--duration-press) ease-out,
    transform var(--duration-press) var(--ease-out),
    box-shadow var(--duration-press) var(--ease-out);
}
@media (hover: hover) {
  .button:hover { background-color: var(--orange); }
}
.button:focus-visible { background-color: var(--orange); }
/* Press: pushes into its shadow and fills orange (mouse click or finger tap) */
.button:active {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 var(--panda);
  background-color: var(--orange);
}
.button { -webkit-tap-highlight-color: transparent; }

.button--action {
  background: var(--color-action);
  color: var(--bunny);
}

/* Thin arrow, as on the original site */
.arrow { font-family: Arial, Helvetica, sans-serif; font-weight: 400; }

/* Text link in Anton (The Details →, footer links) */
.link-display {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.link-display:hover,
.link-display:focus-visible { text-decoration: none; }
.link-display--sm { font-size: var(--text-link-sm); }

/* Tag: small ink label, e.g. BUSINESS STORY */
.tag {
  display: inline-block;
  padding: 0.2em 0.5em 0.15em;
  border-radius: var(--radius-sm);
  background: var(--panda);
  color: var(--bunny);
  box-shadow: 2px 2px 3px rgb(0 0 0 / 0.25);
  font-family: var(--font-hand);
  font-size: clamp(1rem, 0.9rem + 0.3vw, 1.2rem);
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Rule: 3px ink line */
.rule {
  height: 0;
  margin: 0;
  border: 0;
  border-top: var(--rule) solid var(--color-line);
}
.rule--light { border-top-color: var(--bunny); }

/* Ruled title: rule / big Anton title / rule (PEOPLE'S STORIES) */
.ruled-title {
  display: grid;
  gap: 1.3rem;
  text-align: center;
}

/* Book: product shots with soft shadow already baked into the artwork */
.book img { margin-inline: auto; }

/* Story card: artwork + button in one column, words in the other */
.story {
  display: grid;
  gap: var(--space-5) 2.1667rem;   /* 35px between columns */
  align-items: start;
  margin-block: 0;
  padding-block: 2.1667rem;        /* 70px between stories */
}
.story__media { display: grid; justify-items: center; gap: var(--space-5); }
.story__media img { width: 100%; }
.story__body > .tag { margin-bottom: 0.15rem; }
.story__name { margin: 0; line-height: 1.25; }
.story__role { margin: 0 0 0.8rem; line-height: 1.25; }

@media (min-width: 48rem) {
  .story { grid-template-columns: 1fr 1fr; }
  /* Artwork runs slightly past its column, as on Carrd (694px on a 624px column) */
  .story__media img {
    width: calc(100% + 4.3333rem);
    max-width: none;
    margin-inline: -3.25rem -1.0833rem;
  }
  .story--reverse .story__media img { margin-inline: -1.0833rem -3.25rem; }
  .story__body { padding-top: 4.3333rem; }  /* words start 69px below the artwork's top */
  .story--reverse .story__media { order: 2; }
}

/* Signup panel: THE JUICE */
.panel {
  display: grid;
  gap: var(--space-5);
  padding: 2.1667rem clamp(1.25rem, 4vw, 3.25rem);
  border: var(--rule) solid var(--panda);
  background: var(--color-accent);
  color: var(--color-on-accent);
}
.panel__copy { display: grid; gap: 0.8rem; }
.panel__copy p { font-size: var(--text-md); line-height: 1.25; }
.panel__action { align-self: start; }

@media (min-width: 48rem) {
  .panel { grid-template-columns: 2fr 1fr; align-items: start; }
  .panel__action { justify-self: center; }
}

/* Offer grid: two books, ruled cells, links underneath */
.offers {
  display: grid;
  margin-top: 4.3333rem;
  margin-bottom: 0;   /* sits directly on the footer */
  border-top: var(--rule) solid var(--color-line);
  border-bottom: var(--rule) solid var(--color-line);
}
.offers__cell {
  display: grid;
  grid-template-rows: 1fr auto;
}
.offers__art { padding: var(--space-6) 0 0; overflow: hidden; }
.offers__art img { width: 100%; }
.offers__link {
  padding: 2rem var(--space-3);
  border-top: var(--rule) solid var(--color-line);
  text-align: center;
}

@media (max-width: 47.99rem) {
  .offers__cell + .offers__cell { border-top: var(--rule) solid var(--color-line); }
}
@media (min-width: 48rem) {
  .offers { grid-template-columns: 1fr 1fr; }
  .offers__cell + .offers__cell { border-left: var(--rule) solid var(--color-line); }
}


/* 6. Page sections
   -------------------------------------------------------------------------- */
.cover {
  width: min(100% - 2 * var(--gutter), var(--measure));   /* front and back covers, same size */
  margin-inline: auto;
}
.cover img { width: 100%; }
.hero { padding-top: 3.25rem; margin-bottom: 0; }
.hero + .section { margin-top: 1.0833rem; }  /* 17px under the cover */
.gap-ready { margin-top: 4.5875rem; }        /* signature to "Ready to get your Story" */
.gap-next  { margin-top: 4.6875rem; }        /* caption to "You want to choose" */

.measure--illo {
  width: min(100% - 2 * var(--gutter), var(--illo));
  margin-inline: auto;
}
.illustration { margin-inline: auto; }
.illustration img { margin-inline: auto; }

/* Two images side by side (stacks on mobile) */
.pair {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-6);
}
@media (min-width: 48rem) { .pair { grid-template-columns: 1fr 1fr; } }

.story__quote { margin: 0; }
.illustration--wide img { width: 100%; }

.signature img { width: min(100%, 13.375rem); margin-inline: auto; }

.site-footer {
  margin-top: 0;
  padding: var(--space-6) 0 2.3rem;
  background: var(--color-accent);
  color: var(--color-on-accent);
  text-align: center;
}
.site-footer .lettering { width: min(100%, 65rem); margin: 0 auto 2.75rem; }
.site-footer .button { margin-bottom: 3.25rem; }
.footer-links {
  display: grid;
  gap: 0.1rem;
  margin: 0;
  padding: 3.25rem 0;
  line-height: 1.25;
  list-style: none;
}
.footer-legal {
  margin: 3.25rem 0 3.9rem;
  font-family: var(--font-display);
  font-size: var(--text-md);
  text-transform: uppercase;
}
.footer-mark { width: 5.4rem; margin-inline: auto; }


/* 8. Phones (736px and narrower), matched to Carrd on an iPhone 15 Pro (393px)
   -------------------------------------------------------------------------- */
@media (max-width: 46rem) {
  :root {
    --text-base:    1.03125rem;  /* 16.5px body */
    --text-md:      1.03125rem;  /* 16.5px Juice intro */
    --text-lg:      1.375rem;    /* 22px roles */
    --text-xl:      1.375rem;    /* 22px footer links */
    --text-link-sm: 1.1458rem;   /* 18.33px The Details */
    --text-2xl:     1.8333rem;   /* 29.33px names */
    --text-title:   2.75rem;     /* 44px PEOPLE'S STORIES */
    --text-3xl:     3.2083rem;   /* 51.33px THE JUICE */
    --gutter:       1.8333rem;   /* 29.33px: covers, illustrations, stories */
    --block:        0.9167rem;   /* 14.67px between blocks */
  }
  .measure       { width: calc(100% - 5.5rem); }     /* 305px text column */
  .measure--m1   { width: calc(100% - 4.5833rem); }  /* 320px */
  .measure--m2   { width: calc(100% - 5.0417rem); }  /* 312px */
  .measure--illo { width: calc(100% - 2 * var(--gutter)); }
  .cover         { width: calc(100% - 2 * var(--gutter)); }
  .hero          { padding-top: 2.75rem; }            /* 44px */
  .hero + .section { margin-top: 0.9167rem; }
  .gap-ready     { margin-top: 2.75rem; }
  .gap-next      { margin-top: 2.8rem; }
  .signature img { width: 41.15%; }

  .pair { grid-template-columns: 1fr 1fr; gap: 0; margin-top: var(--block); }

  /* Stories: words first, then the artwork full width, then the button */
  .story { padding-block: 1.8333rem; gap: var(--block); }
  .story__body { order: 1; padding-top: 0; }
  .story__media { order: 2; margin-inline: calc(-1 * var(--gutter)); }
  .story__media img { width: 100%; max-width: none; margin: 0; }
  .tag { font-size: 0.95rem; }

  .panel { padding: 1.8333rem; }
  .panel__copy p { line-height: 1.25; }

  .offers { grid-template-columns: 1fr 1fr; margin-top: 2.75rem; }
  .offers__cell + .offers__cell { border-top: 0; border-left: var(--rule) solid var(--color-line); }
  .offers__art { padding-top: var(--space-5); }
  .offers__link { padding: 1.25rem 0.5rem; }

  .footer-legal { font-size: 1.1458rem; margin: 1.8125rem 0 2rem; }  /* 18.33px */
  .footer-mark  { width: 4.5833rem; }                /* 73px */

  /* Pill buttons: full width of the text column, as on Carrd */
  .button {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 4.5833rem;                   /* 73.3px */
    padding: 0 2.2917rem;                /* 36.7px */
    font-size: 1.375rem;                 /* 22px */
    box-shadow: 5.192px 5.192px 0 var(--panda);
    gap: 0.3em;                          /* arrow sits close to the words */
  }
  .button:active { transform: translate(5.192px, 5.192px); }
  .story__media .button { width: calc(100% - 2 * var(--gutter)); }
  .panel__action { justify-self: stretch; }

  /* Section spacing, measured ink-to-ink against Carrd at 393px */
  .section { margin-bottom: 0; }
  [style*="--m-mt"] { margin-top: var(--m-mt) !important; }
  .lettering--caption { width: 11.92rem; margin-top: 0.4575rem; }   /* 190.7px, as on Carrd */
  .signature { margin: -0.375rem 0 0; }
  .gap-ready .lettering { margin-bottom: 0.9375rem; }
  .ruled-title { gap: 1rem; }
  .ruled-title + .story { padding-top: 3.45rem; }
  .site-footer { padding-top: 3.7rem; }
  .site-footer .lettering { margin-bottom: 1.5rem; }
  .site-footer .button { margin-bottom: 2.25rem; }
  .footer-links { padding: 1.8125rem 0; }
}


/* 7. Motion: sections fade up as they scroll into view.
   Only applied when JS is running, and never for reduced-motion users.
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity var(--duration-reveal) var(--ease-out),
    transform var(--duration-reveal) var(--ease-out);
}
.js .footer-mark[data-reveal] {          /* orange slice rises up from below, as on Carrd */
  transform: translateY(1.828rem);         /* 29px */
  transition-duration: 1s;
  transition-delay: 0.25s;
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .button { transition: none; }
}
