/* Tokens come from frontend/design-system/themes/platform00000.css; the fonts are in
   /shared/fonts/fonts.css. */

:root {
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --tracking-tight: -0.025em;
  --tracking-wide: 0.025em;
  --rounded: 0.25rem;
  --rounded-lg: 0.5rem;
  --rounded-full: 9999px;

  --color-brand: #336099;
  --color-brand-dark: #294d7a;
  --color-brand-light: #d6dfeb;
  --color-accent: #fdbf54;
  --color-surface: #eeeceb;
  --color-border: #d8d9da;
  --color-text-heading: #000000;
  --color-text-primary: #000000;
  --color-text-muted: #3c4045;
  --color-text-link: #336099;
  --color-error: #df2e1b;
  --color-success: #38b437;

  --typography-headings-font-family: 'Poppins', sans-serif;
  --typography-body-font-family: 'Alegreya Sans', sans-serif;
  --typography-mono-font-family: 'Roboto Mono', monospace;
  --typography-components-button-font-family: 'Poppins', sans-serif;

  --spacing-button-sm-padding-x: 1rem;
  --spacing-button-sm-min-height: 32px;
  --spacing-button-lg-padding-x: 2rem;
  --spacing-button-lg-min-height: 48px;
  --border-radius-button-sm-border-radius: 0.125rem;
  --border-radius-button-lg-border-radius: 0.125rem;

  --topbar-height: 52px;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--typography-body-font-family);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: var(--color-text-link);
}

:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--typography-headings-font-family);
  font-weight: 700;
  color: var(--color-text-heading);
}

/* Heading emphasis, as in the platform's Section and HeroSection variants */

.heading__highlight {
  /* Thick accent stroke painted behind the lower part of the glyphs */
  background-image: linear-gradient(var(--color-accent), var(--color-accent));
  background-repeat: no-repeat;
  background-size: 100% 0.35em;
  background-position: 0 85%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.heading__nowrap {
  white-space: nowrap;
}

h2 .heading__mark {
  color: var(--color-accent);
}

/* The period stays in the text; the hero shows it as the square accent dot on the baseline. */
h1 .heading__mark {
  display: inline-block;
  width: 0.16em;
  height: 0.16em;
  margin-left: 0.16em;
  overflow: hidden;
  color: transparent;
  background-color: var(--color-accent);
}

/* A closing period in a section heading, drawn as the hero's square accent dot. */
.heading__mark--dot {
  display: inline-block;
  width: 0.24em;
  height: 0.24em;
  margin-left: 0.06em;
  overflow: hidden;
  color: transparent;
  background-color: var(--color-accent);
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
}

/* The bar spans the window; its content keeps the page's content width. */
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

/* Texts in the bar never wrap; below the width they need, the menu folds instead. */
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.25em;
  min-width: 0;
  white-space: nowrap;
}

.topbar__mark {
  flex: none;
  width: auto;
  height: 32px;
  margin-right: 4px;
}

.topbar__name {
  font-weight: 700;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar__toggle {
  display: none;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--rounded);
  background: #ffffff;
  font-size: var(--text-base);
  cursor: pointer;
}

.menu {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--rounded);
  font-size: var(--text-base);
  white-space: nowrap;
  text-decoration: none;
  color: var(--color-text-muted);
}

.menu a:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
}

/* Buttons follow the platform's button tokens */

.btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  border: 1px solid var(--color-brand);
  background: #ffffff;
  font-family: var(--typography-components-button-font-family);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-brand);
}

.btn:hover {
  background: var(--color-brand-light);
}

.btn--sm {
  min-height: var(--spacing-button-sm-min-height);
  padding: 0 var(--spacing-button-sm-padding-x);
  border-radius: var(--border-radius-button-sm-border-radius);
  font-size: var(--text-sm);
}

.btn--lg {
  min-height: var(--spacing-button-lg-min-height);
  padding: 0 var(--spacing-button-lg-padding-x);
  border-radius: var(--border-radius-button-lg-border-radius);
  font-size: var(--text-lg);
}

.btn--primary {
  background: var(--color-brand);
  color: #ffffff;
}

.btn--primary:hover {
  border-color: var(--color-brand-dark);
  background: var(--color-brand-dark);
}

/* Hero */

.hero {
  padding: 112px 0 96px;
  border-bottom: 1px solid var(--color-border);
}

.hero h1 {
  margin-bottom: 24px;
  font-size: var(--text-5xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.lead {
  max-width: 58ch;
  margin: 0 0 16px;
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

.hero__note {
  margin: 0 0 32px;
  font-family: var(--typography-mono-font-family);
  font-size: var(--text-sm);
  color: var(--color-brand);
}

/* The text with the story's animation beside it, as on the platform page. */
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
}

.hero__visual img {
  display: block;
  width: 100%;
  height: auto;
}

/* Sections */

.section {
  padding: 80px 0;
  /* Anchored sections stop below the sticky top bar. */
  scroll-margin-top: var(--topbar-height);
}

.section--surface {
  background: var(--color-surface);
}

.section h2 {
  margin-bottom: 32px;
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-align: center;
}

.section__lead {
  margin: 0 auto 64px;
  text-align: center;
}

/* Team: one card per person, side by side under the heading. */

.card {
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--rounded-lg);
  background: #ffffff;
}

.card h3 {
  margin-bottom: 4px;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

.card p {
  margin: 0;
  color: var(--color-text-muted);
}

.team {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* The LinkedIn links sit at the bottom of both cards, whatever the length of the story. */
.person {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card .person__link {
  margin-top: auto;
  padding-top: 16px;
}

.person__link .tag-link {
  margin-left: 0;
}

.person__photo {
  display: block;
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
  border-radius: var(--rounded-full);
  object-fit: cover;
}

.card .person__role {
  margin-bottom: 12px;
  font-family: var(--typography-mono-font-family);
  font-size: var(--text-sm);
  color: var(--color-brand);
}

/* Products: each one a chapter of the story. The product's own icon stands beside the
   text, on the left and the right in turn; the product's name sits above the headline
   of its own page. */

.products {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

/* Anchored products stop below the sticky top bar. */
.product {
  position: relative;
  scroll-margin-top: var(--topbar-height);
}

/* A white line halfway through the gap between two engines; the website builder's card below
   them needs none. */
.product:not(.card) + .product:not(.card)::before {
  content: '';
  position: absolute;
  top: -40px;
  right: 0;
  left: 0;
  height: 1px;
  background: #ffffff;
}

.product__inner {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: center;
  gap: 64px;
}

.product--reverse .product__inner {
  grid-template-columns: minmax(0, 1fr) 200px;
}

.product--reverse .product__icon {
  order: 1;
}

.product__icon {
  justify-self: center;
  width: auto;
  height: 160px;
}

.product__name {
  margin: 0 0 8px;
  font-family: var(--typography-mono-font-family);
  font-size: var(--text-sm);
  color: var(--color-brand);
}

.product h3 {
  margin-bottom: 16px;
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.product__text {
  margin: 0 0 16px;
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

/* In a card, the paragraphs keep the spacing they have outside it. */
.card .product__text {
  margin-bottom: 16px;
}

.product__more {
  margin: 0;
}

.product__more .tag-link {
  margin-left: 0;
}

/* Contact: the story ends with an invitation, and the ways to reach us are links inside
   the sentence. */

.contact__story {
  max-width: 60ch;
  margin: 0 auto;
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  text-align: center;
}

/* A link that looks like a small outlined button inside a sentence, as on the other pages. */
.tag-link {
  margin: 0 4px;
  padding: 1px 8px 1px 6px;
  border: 1px solid var(--color-brand);
  border-radius: var(--rounded);
  background: transparent;
  white-space: nowrap;
  text-decoration: none;
  color: var(--color-text-link);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.tag-link:hover {
  background: #ffffff;
}

.tag-link__icon {
  width: auto;
  height: 0.9em;
  margin-right: 4px;
  vertical-align: -0.1em;
}

/* Links that leave the page carry the arrow after the text, so the padding is mirrored. */
.tag-link--external {
  padding: 1px 6px 1px 8px;
}

.tag-link--external .tag-link__icon {
  margin-right: 0;
  margin-left: 2px;
}

/* Footer follows the platform's FooterSection */

.footer {
  padding: 64px 0 32px;
  background: var(--color-text-heading);
  color: #ffffff;
}

/* The brand-blue link colour is unreadable on the black footer. */
.footer a {
  color: #ffffff;
}

.footer a:hover {
  text-decoration: none;
}

/* Two halves: the story's last word on the left; the company and the contact share the
   right half, each as wide as its content, the contact at the right edge. */
.footer__content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer__aside {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}

.footer__section h3 {
  margin-bottom: 16px;
  font-size: var(--text-lg);
  color: #ffffff;
}

/* "Dive brightly.in" has the size of the footer's "Contact" heading. The
   wordmark is sized as one of its words: its lowercase letters match the x-height of
   the heading font, and its baseline sits on theirs (in logo-light.svg the baseline is
   89 of 112 units high). That leaves it below the brand manual's 136px minimum width. */
.footer__brand {
  display: flex;
  align-items: baseline;
  gap: 0.25em;
  margin-bottom: 16px;
  font-family: var(--typography-headings-font-family);
  font-size: var(--text-lg);
  font-weight: 700;
  color: #ffffff;
}

/* Baseline alignment puts the image's bottom on the text baseline, so it moves down by
   the part of the wordmark below its own baseline. */
.footer__logo {
  position: relative;
  top: 0.23em;
  display: block;
}

.footer__logo img {
  display: block;
  width: auto;
  height: 1.1em;
}

.footer__section p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.8);
}

/* Links take the colour of the text they sit in; the underline marks them. */
.footer__section p a {
  color: inherit;
}

.footer__bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.footer__bottom p {
  margin: 0;
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.6);
}

.footer__bottom a {
  color: inherit;
}

/* Below the width the full menu needs, it folds under the Menu button (see app.js). */

@media (max-width: 1020px) {
  .topbar__toggle {
    display: block;
  }

  .topbar__nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
  }

  .topbar.is-open .topbar__nav {
    display: flex;
  }

  .menu {
    flex-direction: column;
  }

  .menu a {
    justify-content: center;
  }

  .topbar__nav .btn {
    align-self: center;
  }
}

/* Narrow screens */

@media (max-width: 760px) {
  .wrap {
    padding: 0 16px;
  }

  .hero {
    padding: 56px 0 48px;
  }

  .hero h1 {
    font-size: var(--text-4xl);
  }

  .lead,
  .product__text,
  .contact__story {
    font-size: var(--text-lg);
  }

  .team {
    grid-template-columns: 1fr;
  }

  .products {
    gap: 48px;
  }

  .product:not(.card) + .product:not(.card)::before {
    top: -24px;
  }

  .product h3 {
    font-size: var(--text-xl);
  }

  .footer__content {
    grid-template-columns: 1fr;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* One column: the icon always comes first, above the text. */
  .product__inner,
  .product--reverse .product__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .product--reverse .product__icon {
    order: 0;
  }

  .product__icon {
    justify-self: start;
    height: 96px;
  }

  .section {
    padding: 48px 0;
  }

  .section h2 {
    margin-bottom: 24px;
    font-size: var(--text-2xl);
  }
}
