/*
 * Visual language borrowed from Cloudflare's own product pages and docs:
 * dashed hairline guides with small square nodes where they meet, monospace
 * labels, two-tone headings, and the official product icons in Cloudflare
 * orange.
 */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --ground: #fafaf9;
  --surface: #ffffff;
  --guide: #d6d3d1;
  --line: #e7e5e4;
  --line-strong: #cfcac6;
  --dot: rgb(28 25 23 / 0.11);
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #6f6964;
  --faint: #a8a29e;
  --orange: #ff5f08;
  --orange-soft: #fef1e6;
  --shadow: 0 1px 2px rgb(28 25 23 / 0.04), 0 10px 28px -8px rgb(28 25 23 / 0.1);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --gutter: 16px;
  --max: 1040px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f0e0d;
    --surface: #181716;
    --guide: #34312e;
    --line: #292624;
    --line-strong: #3d3936;
    --dot: rgb(255 255 255 / 0.08);
    --ink: #f5f5f4;
    --ink-2: #d6d3d1;
    --muted: #a8a29e;
    --faint: #6f6964;
    --orange-soft: rgb(255 95 8 / 0.12);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -8px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Inter Variable", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv11", "ss01";
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

/* ---------- The frame: two vertical guides, horizontal guides between ---------- */

.frame {
  position: relative;
  width: 100%;
  max-width: var(--max);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
}

@media (min-width: 720px) {
  :root {
    --gutter: 40px;
  }

  /* Vertical dashed guides on both sides of the content column. */
  .frame::before,
  .frame::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: repeating-linear-gradient(to bottom, var(--guide) 0 4px, transparent 4px 8px);
    pointer-events: none;
  }

  .frame::before {
    left: 0;
  }

  .frame::after {
    right: 0;
  }
}

/* A horizontal guide that runs edge to edge across the frame, with a square
   node where it crosses each vertical guide. */
.guide {
  position: relative;
  height: 1px;
  margin: 0 calc(var(--gutter) * -1);
  border: 0;
  background: repeating-linear-gradient(to right, var(--guide) 0 4px, transparent 4px 8px);
  overflow: visible;
}

@media (min-width: 720px) {
  .guide::before,
  .guide::after {
    content: "";
    position: absolute;
    top: -3px;
    width: 7px;
    height: 7px;
    background: var(--ground);
    border: 1px solid var(--guide);
    border-radius: 1.5px;
  }

  .guide::before {
    left: -3px;
  }

  .guide::after {
    right: -3px;
  }
}

/* ---------- Header ---------- */

.lockup {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 30px 0 28px;
}

/* One baseline for the whole row: the bottom of AMINI's letters, the flat
   base of the cloud and the bottom of CLOUDFLARE's letters all line up.
   Sizes are optical, not equal: the cloud is a solid shape, so it stays
   small (about 1.25x AMINI's cap height) to weigh the same as the
   thin-stroked AMINI wordmark. */
.amini {
  display: block;
  color: var(--ink);
  line-height: 0;
  border-radius: 4px;
}

.amini svg {
  display: block;
  height: 15px;
  width: auto;
}

/* A drawn cross instead of the "×" glyph, centred on AMINI's caps. */
.times {
  flex: none;
  width: 9px;
  height: 9px;
  margin-bottom: 3px;
  color: var(--faint);
}

/* Cloudflare's lockup, cloud then wordmark, both on the baseline. */
.cloudflare {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  color: var(--ink);
}

.cf-cloud {
  display: block;
  height: 19px;
  width: auto;
}

.cf-word {
  display: block;
  height: 11px;
  width: auto;
}

/* Narrow phones: the whole row scales down together. */
@media (max-width: 380px) {
  .lockup {
    gap: 14px;
  }

  .amini svg {
    height: 13px;
  }

  .times {
    margin-bottom: 2px;
  }

  .cf-cloud {
    height: 16.5px;
  }

  .cf-word {
    height: 9.5px;
  }
}

/* ---------- Intro ---------- */

.intro {
  padding: clamp(48px, 8vh, 88px) 0 clamp(44px, 7vh, 72px);
}

h1 {
  margin: 0;
  font-size: clamp(48px, 9vw, 92px);
  font-weight: 640;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

/* "Cloudflare" in the quieter tone, on its own line: the name stays the
   strongest word, and the title reads as one phrase. */
.h1-brand {
  display: block;
  color: var(--muted);
}

.lead p {
  margin: 24px 0 0;
  max-width: 34rem;
  font-size: clamp(17px, 2.1vw, 19px);
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------- Talks ---------- */

.talks {
  list-style: none;
  margin: 0;
  padding: clamp(32px, 6vh, 56px) 0;
  display: grid;
  gap: 20px;
}

@media (min-width: 760px) {
  .talks {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

.talks li {
  display: flex;
}

.talk {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  transition:
    border-color 200ms ease,
    box-shadow 280ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.talk:active {
  transform: scale(0.985);
}

/* The visual: a dot grid behind the product icon, like Cloudflare's
   product illustrations. */
.visual {
  position: relative;
  display: grid;
  place-items: center;
  height: 168px;
  border-bottom: 1px solid var(--line);
  background-color: var(--ground);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 16px 16px;
  background-position: center;
}

/* Fade the dots out toward the edges so the icon owns the centre. */
.visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side, transparent 30%, var(--ground) 100%);
  opacity: 0.85;
  pointer-events: none;
}

.tile {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  color: var(--orange);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgb(28 25 23 / 0.05), 0 8px 24px -10px rgb(255 95 8 / 0.35);
  transition: transform 320ms var(--ease-out);
}

.tile svg {
  width: 48px;
  height: 48px;
}

.body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 24px 22px;
}

h2 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 22px);
  font-weight: 600;
  letter-spacing: -0.017em;
  line-height: 1.3;
  text-wrap: balance;
}

/* The talk's one-line definition, as the heading's quieter second line:
   the same two-tone pattern as the page title. */
.tagline {
  display: block;
  margin-top: 1px;
  font-weight: 450;
  letter-spacing: -0.012em;
  color: var(--muted);
}

.body p {
  margin: 12px 0 0;
  max-width: 44ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  text-wrap: pretty;
}

.host {
  margin-top: auto;
  padding-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}

.arrow {
  display: inline-block;
  color: var(--orange);
  transition: transform 240ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .talk:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
  }

  .talk:hover .tile {
    transform: translateY(-3px);
  }

  .talk:hover .arrow {
    transform: translateX(4px);
  }
}

/* ---------- Footer ---------- */

.foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 24px 0 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* "Every demo runs live on Cloudflare", with an orange square marker the
   same size and shape as the guide's corner nodes. */
.note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ink-2);
}

.note::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  background: var(--orange);
}

.foot a {
  text-decoration: none;
  transition: color 160ms ease;
}

.foot a:hover {
  color: var(--ink);
}

/* ---------- Entrance: once, on load ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.intro > *,
.talks li {
  animation: rise 560ms var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  @keyframes rise {
    from {
      opacity: 0;
    }
  }

  .talk,
  .tile,
  .arrow {
    transition-property: border-color, box-shadow, color;
  }

  .talk:active {
    transform: none;
  }
}
