/*
 * base.css
 * OWNS: @font-face, element defaults, typography classes, the page frame and
 * the two Resend surface devices every section reuses: the gradient heading
 * and the panel "light leak" (a hairline that brightens at its centre with a
 * soft glow falling below it).
 */

/* ------------------------------------------------------------------ fonts */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/Inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/PlayfairDisplay-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/PlayfairDisplay-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Commit Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/CommitMono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Registered so the hairline draw-in can interpolate. Initial value 1 means
   every rule is at full width when JavaScript never runs. */
@property --rule-scale {
  syntax: "<number>";
  inherits: false;
  initial-value: 1;
}

/* Drives the slowly rotating rainbow border on the hero pill. */
@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes rotate-angle {
  to {
    --angle: 360deg;
  }
}

/* ------------------------------------------------------------ elements */

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--s-4));
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  overflow-x: clip;
}

::selection {
  background: rgb(255 255 255 / 0.2);
  color: #ffffff;
}

h1,
h2,
h3,
h4 {
  color: var(--text-emphasis);
  font-family: var(--font-head);
  font-weight: var(--fw-regular);
  line-height: var(--leading-heading);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: var(--fw-semibold);
  color: var(--text-emphasis);
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

a {
  transition: color var(--dur-fast) var(--ease);
}

:focus-visible {
  outline: 2px solid var(--line-focus);
  outline-offset: 2px;
  border-radius: var(--r-md);
}

/* ------------------------------------------------------------ layout */

.frame {
  width: 100%;
  max-width: calc(var(--page-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--s-6);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

/* ---- panel light leak ----
   resend.com opens a panel with a rounded top hairline that is brightest at
   its centre, with a faint radial glow falling below it. Any element given
   .panel gets both, drawn from pseudo-elements so no extra markup is needed. */
.panel {
  position: relative;
  border-top: var(--hairline) solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  left: 50%;
  pointer-events: none;
}

.panel::before {
  top: -1px;
  width: 300px;
  max-width: 100%;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent 0%, rgb(143 143 143 / 0.67) 50%, transparent 100%);
}

.panel::after {
  top: -4px;
  width: min(400px, 100%);
  height: 200px;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 90deg, transparent 50%, #000 50%),
    radial-gradient(rgb(200 200 200 / 0.1) 0%, transparent 80%);
}

/* ------------------------------------------------------------ type */

/* Section headings: aBC Favorit's tight setting, white fading to half white. */
.section__title {
  font-family: var(--font-head);
  font-size: var(--text-heading);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-heading);
  color: var(--text-emphasis);
  background: var(--heading-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  max-width: 20ch;
  padding-bottom: 0.06em;
}

/* While scroll.js has a heading split into word masks, each word carries
   the gradient itself, since a transformed child cannot borrow the parent's. */
.section__title .word__inner,
.hero__title .word__inner,
.cta__title .word__inner {
  background: var(--heading-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* The second half of a headline is part of the same gradient on resend.com,
   so it only loses the italic it may have been authored with. */
.accent {
  font-style: normal;
  color: inherit;
}

.section__intro,
.prose {
  margin-top: var(--s-3);
  max-width: 40rem;
  color: var(--text-muted);
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  text-wrap: balance;
}

/* Centred section heads, as on resend.com's "Integrate" and "Beyond
   expectations" sections. */
.section__head--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.section__head--center .section__title,
.section__head--center .section__intro {
  margin-inline: auto;
}

.lede {
  color: var(--text-muted);
  font-size: var(--text-lg);
  line-height: var(--leading-body);
  max-width: 36rem;
}

.meta {
  font-family: var(--font-text);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
  letter-spacing: 0;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

/* Side note that hangs off a lead column. */
.margin-note {
  margin-top: var(--s-7);
  padding: var(--s-4) var(--s-5);
  max-width: 34ch;
  border: var(--hairline) solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--card-sheen);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.margin-note b {
  display: block;
  margin-bottom: var(--s-1);
  font-weight: var(--fw-medium);
  color: var(--text-emphasis);
}

/* Word mask used by the headline reveal in scroll.js. */
.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.word__inner {
  display: inline-block;
  will-change: transform;
}

/* Small chevron used after text links ("Explore detections >"). */
.chev::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  transition: transform var(--dur-fast) var(--ease);
}

a:hover .chev::after,
.chev:hover::after {
  transform: translate(2px, -1px) rotate(45deg);
}

/* ------------------------------------------------------------ utilities */

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

.skip-link {
  position: fixed;
  top: var(--s-3);
  left: var(--s-3);
  z-index: calc(var(--z-overlay) + 1);
  padding: var(--s-2) var(--s-4);
  border: 2px solid var(--line-glass);
  border-radius: var(--r-lg);
  background: var(--bg);
  color: var(--text-emphasis);
  font-size: var(--text-sm);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease);
}

.skip-link:focus {
  transform: none;
}
