/* ==========================================================================
   Corporate Raiders' Playbook
   Single stylesheet. Tokens follow DESIGN.md exactly.
   ========================================================================== */

/* ---------- Fonts (self hosted, SIL OFL, latin subset) ---------- */

@font-face {
  font-family: 'Libre Caslon Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/libre-caslon-display-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Libre Baskerville';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/libre-baskerville-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Libre Baskerville';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/libre-baskerville-latin-400-italic.woff2') format('woff2');
}

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

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/roboto-latin-500-normal.woff2') format('woff2');
}

/* ---------- Tokens ---------- */

:root {
  /* colors */
  --ink: #000000;
  --paper: #ffffff;
  --beige: #f4f3f0;
  --dark-grey: #666666;
  --on-dark-grey: #ffffff;

  /* font stacks */
  --font-display: 'Libre Caslon Display', 'Big Caslon', Georgia, serif;
  --font-body: 'Libre Baskerville', Georgia, serif;
  --font-label: Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* spacing */
  --space-paragraph: 12px;
  --space-stack: 30px;
  --space-section: 50px;
  --space-hero-top: 130px;
  --column-gap: 100px;
  --margin-desktop: 140px;
  --margin-mobile: 20px;
  --label-column: 206px;
  --content-column: 632px;
  --hero-text-column: 475px;
  --layout-width: 1190px;
  --portrait-width: 247px;

  /* responsive layout variables (desktop values; overridden below) */
  --margin-left: var(--margin-desktop);
  --margin-right: 112px; /* 1190 - 140 - 206 - 100 - 632 */
  --label-col: var(--label-column);
  --gap: var(--column-gap);
  --media-w: 535px; /* book render width in the comp */

  /* components */
  --control-height: 46px;
  --button-min-width: 214px;
  --badge-size: 121px;
  --band-height: 66px;
  --transition: 150ms ease;
}

/* 768px to 1189px: no guidance in the comp, so the desktop grid scales down. */
@media (max-width: 1189.98px) {
  :root {
    --margin-left: clamp(40px, 11.76vw, 140px);
    --margin-right: clamp(40px, 9.41vw, 112px);
    --label-col: clamp(150px, 17.3vw, 206px);
    --gap: clamp(40px, 8.4vw, 100px);
    --media-w: 45vw;
  }
}

/* Below 768px: single column, 20px margins. */
@media (max-width: 767.98px) {
  :root {
    --margin-left: var(--margin-mobile);
    --margin-right: var(--margin-mobile);
    --media-w: min(535px, calc(100vw - 2 * var(--margin-mobile)));
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

p {
  margin: 0 0 var(--space-paragraph);
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
}

a {
  color: var(--ink);
  text-decoration-thickness: 0.5px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 1px;
}

cite,
i,
em {
  font-style: italic;
}

b,
strong {
  font-weight: 700;
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

/* Programmatic focus targets (section anchor, thank-you note) show no ring. */
[tabindex='-1']:focus {
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.container {
  width: 100%;
  max-width: var(--layout-width);
  margin: 0 auto;
  padding-left: var(--margin-left);
  padding-right: var(--margin-right);
}

/* ---------- Type roles ---------- */

.display,
.section-heading {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0.015em;
  font-variant-numeric: oldstyle-nums;
  font-feature-settings: 'onum' 1;
  color: var(--dark-grey);
}

.label {
  font-family: var(--font-label);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fine-print {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 500;
  line-height: 2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-grey);
}

/* ---------- Outline button (link or button) ---------- */

.button-outline,
.hs-form input[type='submit'],
.hs-form .hs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--button-min-width);
  height: var(--control-height);
  margin: 0;
  padding: 0 18px;
  background: var(--paper);
  color: var(--ink);
  border: 0.5px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
  font-family: var(--font-label);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition:
    background-color var(--transition),
    color var(--transition),
    border-color var(--transition);
}

.button-outline:hover,
.hs-form input[type='submit']:hover,
.hs-form .hs-button:hover {
  background: var(--beige);
  color: var(--ink);
}

.button-outline:focus-visible,
.hs-form input[type='submit']:focus-visible,
.hs-form .hs-button:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.button-outline:active,
.hs-form input[type='submit']:active,
.hs-form .hs-button:active {
  background: var(--ink);
  color: var(--paper);
}

.button-outline:disabled,
.button-outline[aria-disabled='true'],
.hs-form input[type='submit']:disabled,
.hs-form .hs-button:disabled,
.hs-form input[type='submit'].is-submitting {
  background: var(--paper);
  color: var(--dark-grey);
  border-color: var(--dark-grey);
  cursor: default;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
}

.hero__inner {
  position: relative;
  min-height: calc(82px + var(--media-w) * 1.0953 + 41px);
  padding-top: var(--space-hero-top);
  padding-bottom: 60px;
}

.hero__text {
  position: relative;
  z-index: 1;
  max-width: min(
    var(--hero-text-column),
    calc(min(100vw, var(--layout-width)) - var(--margin-left) - var(--media-w) - 40px)
  );
}

.hero__lead {
  margin-bottom: var(--space-stack);
}

.hero__cta {
  margin-top: var(--space-stack);
}

.hero__media {
  position: absolute;
  top: 82px;
  right: 17px;
  width: var(--media-w);
  isolation: isolate;
}

.hero__disc {
  position: absolute;
  z-index: 0;
  /* 1068px disc at x 322, y -671 in the comp; render at x 638, y 82, width 535 */
  width: calc(var(--media-w) * 1.9963);
  height: calc(var(--media-w) * 1.9963);
  left: calc(var(--media-w) * -0.5907);
  top: calc(var(--media-w) * -1.4075);
  border-radius: 9999px;
  background: var(--beige);
}

.hero__render {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  /* The with-shadow render has a white ground; multiply lets the beige disc show through. */
  mix-blend-mode: multiply;
}

.hero__render img {
  width: 100%;
  height: auto;
}

.badge-coming-soon {
  position: absolute;
  z-index: 2;
  left: 57.76%;
  top: 43%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--badge-size);
  height: var(--badge-size);
  border-radius: 9999px;
  background: var(--dark-grey);
  color: var(--on-dark-grey);
  font-family: var(--font-label);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.26;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

@media (max-width: 767.98px) {
  /* Book render sits above the text on mobile, so it never runs into the next section. */
  .hero__inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-top: var(--space-section);
    padding-bottom: var(--space-section);
  }

  .hero__text {
    max-width: none;
  }

  .hero__media {
    order: -1;
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    margin-bottom: var(--space-section);
  }

  .badge-coming-soon {
    left: auto;
    right: 4%;
  }
}

/* ==========================================================================
   About the Author (beige section)
   ========================================================================== */

.section-beige {
  background: var(--beige);
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

.about__heading {
  margin-bottom: var(--space-stack);
}

.about__body {
  display: grid;
  grid-template-columns: calc(var(--label-col) + var(--gap)) minmax(0, var(--content-column));
  align-items: start;
}

.portrait {
  display: block;
  width: min(var(--portrait-width), calc(100% - 30px));
  aspect-ratio: 247 / 320;
  border-radius: 0;
}

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

.about__bio {
  padding-top: var(--space-stack);
}

@media (max-width: 767.98px) {
  .about__body {
    display: block;
  }

  .portrait {
    width: var(--portrait-width);
    max-width: 100%;
    margin-bottom: var(--space-stack);
  }

  .about__bio {
    padding-top: 0;
  }
}

/* ==========================================================================
   Editor and Contributors
   ========================================================================== */

.people {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

.people__row {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, var(--content-column));
  column-gap: var(--gap);
  align-items: baseline;
}

/* Editor to Contributors: 71px heading to heading in the comp. */
.people__row + .people__row {
  margin-top: 39px;
}

/* Bio block: 12px between paragraphs, one blank line between people. */
.bio + .bio {
  margin-top: 1.55em;
}

@media (max-width: 767.98px) {
  .people__row {
    display: block;
  }

  .people__row .section-heading {
    margin-bottom: var(--space-stack);
  }
}

/* ==========================================================================
   Coming soon band
   ========================================================================== */

.marquee-band {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--band-height);
  overflow: hidden;
  background: var(--dark-grey);
  color: var(--on-dark-grey);
  font-family: var(--font-label);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.26;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.marquee-band__repeat {
  flex: none;
  white-space: pre;
}

/* ==========================================================================
   Closing CTA and registration
   ========================================================================== */

.closing {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
  text-align: center;
}

.offer__note {
  margin-top: var(--space-paragraph);
}

.register {
  max-width: var(--content-column);
  margin: var(--space-stack) auto 0;
  text-align: left;
}

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

.js .form-fallback {
  display: none;
}

.js .form-fallback.is-visible {
  display: block;
}

.form-error-message,
.hs-form .hs_error_rollup,
.hs-form .hs-error-msgs,
.hs-form .hs-error-msg,
.hs-form .hs-main-font-element {
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.55;
}

.form-error-message {
  margin: 0 0 var(--space-stack);
  text-align: center;
}

/* ---------- HubSpot form overrides (embedded with css: '') ---------- */

.hs-form,
.hs-form fieldset {
  max-width: none !important;
  margin: 0;
  padding: 0;
  border: 0;
}

.hs-form fieldset + fieldset {
  margin-top: 0;
}

.hs-form .hs-form-field {
  margin: 0 0 var(--space-stack);
}

.hs-form fieldset.form-columns-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--space-stack);
}

.hs-form fieldset.form-columns-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  column-gap: var(--space-stack);
}

.hs-form fieldset[class*='form-columns'] .hs-form-field {
  width: auto !important;
  float: none !important;
}

.hs-form fieldset[class*='form-columns'] .input {
  margin-right: 0 !important;
}

@media (max-width: 767.98px) {
  .hs-form fieldset.form-columns-2,
  .hs-form fieldset.form-columns-3 {
    display: block;
  }
}

/* Labels: form-label */
.hs-form .hs-form-field > label,
.hs-form legend.hs-field-desc + label,
.hs-form .hs-form-field > legend:not(.hs-field-desc) {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-label);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hs-form .hs-form-required {
  margin-left: 2px;
}

.hs-form .hs-field-desc {
  margin: 0 0 6px;
  padding: 0;
  font-size: 16px;
  line-height: 1.55;
}

/* Fields: form-field */
.hs-form input[type='text'],
.hs-form input[type='email'],
.hs-form input[type='tel'],
.hs-form input[type='number'],
.hs-form input[type='url'],
.hs-form input[type='date'],
.hs-form select,
.hs-form textarea {
  display: block;
  width: 100% !important;
  height: var(--control-height);
  margin: 0;
  padding: 0 12px;
  background: var(--paper);
  color: var(--ink);
  border: 0.5px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color var(--transition),
    background-color var(--transition);
}

.hs-form textarea {
  height: auto;
  min-height: calc(var(--control-height) * 3);
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
}

.hs-form select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

.hs-form input:focus-visible,
.hs-form select:focus-visible,
.hs-form textarea:focus-visible,
.hs-form input[type='text']:focus,
.hs-form input[type='email']:focus,
.hs-form input[type='tel']:focus,
.hs-form select:focus,
.hs-form textarea:focus {
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

/* form-field-error */
.hs-form .hs-input.invalid,
.hs-form .hs-input.error,
.hs-form .hs-input[aria-invalid='true'] {
  border: 1px solid var(--ink);
}

/* Error messages below fields */
.hs-form .hs-error-msgs {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.hs-form ul.hs-error-msgs label {
  display: block;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  cursor: default;
}

/* Errors never rely on colour: every message starts with the word "Error". */
.hs-form ul.hs-error-msgs label::before {
  content: 'Error: ';
}

.hs-form ul.hs-error-msgs label.has-error-prefix::before {
  content: none;
}

/* Form level error, above submit */
.hs-form .hs_error_rollup {
  margin: 0 0 var(--space-stack);
  text-align: center;
}

.hs-form .hs_error_rollup .hs-error-msgs {
  margin: 0;
}

/* Checkboxes and radios (consent, attendee question) */
.hs-form .inputs-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hs-form .inputs-list li + li {
  margin-top: 8px;
}

.hs-form .inputs-list label,
.hs-form .hs-form-booleancheckbox-display {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.hs-form input[type='checkbox'],
.hs-form input[type='radio'] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.hs-form input[type='radio'] {
  border-radius: 9999px;
}

.hs-form input[type='checkbox']:checked {
  background: var(--ink)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E")
    no-repeat center / 12px 10px;
}

.hs-form input[type='radio']:checked {
  background: radial-gradient(circle, var(--ink) 0 5px, var(--paper) 5.5px);
}

.hs-form input[type='checkbox']:focus-visible,
.hs-form input[type='radio']:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

@media (forced-colors: active) {
  .hs-form input[type='checkbox'],
  .hs-form input[type='radio'] {
    -webkit-appearance: auto;
    appearance: auto;
  }
}

/* Consent and rich text blocks set in HubSpot */
.hs-form .legal-consent-container,
.hs-form .hs-richtext {
  margin: 0 0 var(--space-stack);
  font-size: 16px;
  line-height: 1.55;
}

.hs-form .legal-consent-container .hs-form-booleancheckbox-display > span {
  margin: 0;
}

.hs-form .legal-consent-container p,
.hs-form .hs-richtext p {
  margin: 0 0 var(--space-paragraph);
}

.hs-form .legal-consent-container .hs-form-field {
  margin-bottom: var(--space-paragraph);
}

/* Submit */
.hs-form .hs_submit {
  margin-top: var(--space-stack);
  text-align: center;
}

.hs-form .hs_submit .actions {
  margin: 0;
  padding: 0;
}

@media (max-width: 767.98px) {
  /* EXPERIENCE.md: fields and submit span the content width on mobile */
  .hs-form input[type='submit'],
  .hs-form .hs-button {
    width: 100%;
  }
}

/* Thank you note (HubSpot inline message) */
.submitted-message {
  text-align: center;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

.submitted-message h1,
.submitted-message h2,
.submitted-message h3,
.submitted-message > p:first-child:not(:only-child),
.submitted-message > div > p:first-child:not(:only-child) {
  margin: 0 0 var(--space-stack);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0.015em;
  font-variant-numeric: oldstyle-nums;
  color: var(--dark-grey);
}

/* Anything HubSpot may still inject for branding stays out of sight. */
.hs-form .hs-form__virality-link,
.hbspt-form .hs-form__virality-link {
  display: none !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
  text-align: center;
  color: var(--dark-grey);
}

.site-footer__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__list li {
  display: flex;
  align-items: center;
  min-height: 24px;
}

.site-footer a {
  color: var(--ink);
}

/* ==========================================================================
   Secondary pages (privacy, 404)
   ========================================================================== */

.page {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

.page__back {
  display: inline-block;
  margin-bottom: 80px;
}

.page__body {
  max-width: var(--content-column);
}

.page__body h1 {
  margin-bottom: var(--space-stack);
}

.page__body h2 {
  margin-top: var(--space-section);
  margin-bottom: var(--space-paragraph);
}

.page__body ul {
  margin: 0 0 var(--space-paragraph);
  padding-left: 1.4em;
}

.page__body li + li {
  margin-top: 4px;
}

.page__meta {
  margin-bottom: var(--space-stack);
}

.notfound {
  padding-top: var(--space-hero-top);
  padding-bottom: var(--space-hero-top);
}

.notfound .display {
  margin-bottom: var(--space-stack);
}

.notfound p + .button-outline {
  margin-top: var(--space-stack);
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

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