/* yafla.com: one stylesheet for every page.
   Colours, type and spacing are custom properties on :root, so the look can be retuned in one place. */

:root {
  --red: #e92d37;          /* the logo's red: marks, highlights, glows */
  --red-strong: #cf1f2a;   /* red text on white, and backgrounds behind white text (both pass WCAG AA) */
  --red-deep: #a8121c;     /* hover and pressed states */
  --red-tint: #fff4f4;     /* soft section backgrounds */
  --red-line: #f5d9da;     /* borders on tinted surfaces */
  --ink: #1d1416;
  --ink-muted: #5f5557;
  --line: #ece5e5;
  --chip: #f7f3f3;
  --white: #fff;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(29 20 22 / .05), 0 10px 28px -14px rgb(29 20 22 / .2);
  --shadow-lift: 0 2px 4px rgb(29 20 22 / .06), 0 28px 56px -24px rgb(29 20 22 / .32);
  --max: 1160px;
  --gutter: clamp(16px, 5vw, 40px);
  --header-h: 68px;

  color-scheme: light;
}

/* Base */

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

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; }

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  margin: 0;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--red-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
a:hover { color: var(--red-deep); }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-red :focus-visible { outline-color: var(--white); }

::selection { background: var(--red); color: var(--white); }

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

.skip {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  padding: .6em 1em;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
}
.skip:focus { top: 12px; color: var(--white); }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / .9);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand { flex: none; border-radius: 6px; }
.brand img { width: auto; height: 34px; }

.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { background: var(--red-tint); color: var(--red-strong); }

@media (max-width: 420px) {
  .site-nav a { padding: 8px 9px; font-size: .9rem; }
}
@media (max-width: 360px) {
  .brand img { height: 28px; }
  .site-nav ul { gap: 0; }
  .site-nav a { padding: 6px 7px; font-size: .875rem; }
}

/* Buttons and small labels */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 50px;
  padding: 0 1.5em;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: none; }

.button--light {
  background: var(--white);
  color: var(--red-strong);
  box-shadow: 0 12px 30px -14px rgb(70 0 0 / .6);
}
.button--light:hover { color: var(--red-deep); box-shadow: 0 16px 36px -14px rgb(70 0 0 / .7); }

.button--ghost { border-color: rgb(255 255 255 / .6); color: var(--white); }
.button--ghost:hover { border-color: var(--white); background: rgb(255 255 255 / .12); color: var(--white); }

.button--red { background: var(--red-strong); color: var(--white); }
.button--red:hover { background: var(--red-deep); color: var(--white); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .65em;
  color: var(--red-strong);
  font-size: .8125rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.badge {
  flex: none;
  padding: .3em .75em;
  border: 1px solid var(--red-line);
  border-radius: 999px;
  background: var(--red-tint);
  color: var(--red-strong);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.5;
  text-transform: uppercase;
}
.badge--soon { border-color: var(--line); background: var(--chip); color: var(--ink-muted); }

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(70% 110% at 100% 0%, var(--red) 0%, rgb(233 45 55 / 0) 70%),
    var(--red-strong);
  color: var(--white);
}
.hero .wrap { padding-block: clamp(64px, 11vw, 144px) clamp(80px, 12vw, 160px); }

.hero__mark {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: max(-40px, calc((100vw - var(--max)) / 2 - 120px));
  width: auto;
  height: 128%;
  translate: 0 -46%;
  fill: var(--white);
  opacity: .1;
}
@media (max-width: 720px) {
  .hero__mark { right: -28%; height: 110%; opacity: .08; }
}

.announce {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .35em .9em .35em .4em;
  border: 1px solid rgb(255 255 255 / .3);
  border-radius: 999px;
  background: rgb(255 255 255 / .12);
  color: var(--white);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.announce:hover { border-color: rgb(255 255 255 / .6); background: rgb(255 255 255 / .2); color: var(--white); }
.announce__tag {
  padding: .15em .65em;
  border-radius: 999px;
  background: var(--white);
  color: var(--red-strong);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 11em;
  margin-top: 28px;
  font-size: clamp(2.75rem, 1.5rem + 5.6vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.lede {
  max-width: 36rem;
  margin-top: 24px;
  font-size: clamp(1.125rem, 1rem + .5vw, 1.3rem);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}
@media (max-width: 480px) {
  .actions .button { flex: 1 1 auto; }
}

/* Sections */

.section {
  padding-block: clamp(72px, 10vw, 128px);
  scroll-margin-top: var(--header-h);
}
.section--tint { background: var(--red-tint); }
.section--red {
  background:
    radial-gradient(60% 120% at 0% 100%, var(--red) 0%, rgb(233 45 55 / 0) 70%),
    var(--red-strong);
  color: var(--white);
}

.section-head {
  max-width: 42rem;
  margin-bottom: clamp(40px, 5vw, 60px);
}
.section-head h2 {
  margin-top: 14px;
  font-size: clamp(2.1rem, 1.4rem + 2.8vw, 3.4rem);
  letter-spacing: -0.04em;
}
.section-head p {
  margin-top: 18px;
  color: var(--ink-muted);
  font-size: 1.125rem;
}
.section--red .eyebrow,
.section--red .section-head p { color: var(--white); }

/* Product portfolio */

.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.product:hover { border-color: var(--red-line); box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.product:has(.product__link:focus-visible) { outline: 3px solid var(--red); outline-offset: 3px; }

.product__media {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background-color: var(--product-colour, var(--red-strong));
}
.product__media img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 22px 44px -18px rgb(0 0 0 / .6);
  transition: transform .3s;
}
.product:hover .product__media img { transform: scale(1.05) rotate(-2deg); }

/* A faint chessboard, for products that want one behind their icon */
.product__media--board {
  background-image: repeating-conic-gradient(rgb(255 255 255 / .07) 0 25%, transparent 0 50%);
  background-size: 64px 64px;
  background-position: center;
}

/* One line per product: its brand colour, behind its icon */
.product--chessreport { --product-colour: #2d6a4f; }

.product__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: clamp(24px, 3vw, 32px);
}
.product__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.product__name { font-size: 1.6rem; letter-spacing: -0.03em; }
.product__domain {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: .95rem;
  font-weight: 600;
}
.product__tagline { font-size: 1.15rem; font-weight: 700; line-height: 1.4; }
.product__desc { color: var(--ink-muted); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: .2em .65em;
  border-radius: 6px;
  background: var(--chip);
  color: var(--ink-muted);
  font-size: .8125rem;
  font-weight: 600;
}

.product__link {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  margin-top: auto;
  padding-top: 10px;
  font-weight: 700;
  text-decoration: none;
}
.product__link:focus-visible { outline: none; }
/* The whole card is the link */
.product__link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.product__link span { transition: translate .2s; }
.product:hover .product__link span { translate: 4px 0; }

.product--next {
  justify-content: center;
  padding: clamp(28px, 4vw, 44px);
  border: 2px dashed var(--red-line);
  background: transparent;
  box-shadow: none;
}
.product--next:hover { border-color: var(--red-line); box-shadow: none; transform: none; }
.product--next .icon-badge { margin-bottom: 22px; }
.product--next h3 { font-size: 1.5rem; letter-spacing: -0.03em; }
.product--next p { max-width: 26rem; margin-top: 10px; color: var(--ink-muted); }

.icon-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--red-tint);
  color: var(--red-strong);
}
.icon-badge svg { width: 26px; height: 26px; }
.icon-badge .mark { width: auto; height: 28px; fill: currentColor; }

/* About */

.principles {
  display: grid;
  gap: clamp(32px, 4vw, 56px);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: principle;
}
@media (min-width: 760px) {
  .principles { grid-template-columns: repeat(3, 1fr); }
}
.principles li {
  padding-top: 24px;
  border-top: 2px solid var(--red);
  counter-increment: principle;
}
.principles li::before {
  content: counter(principle, decimal-leading-zero);
  display: block;
  margin-bottom: 14px;
  color: var(--red-strong);
  font-size: .875rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.principles h3 { font-size: 1.4rem; letter-spacing: -0.03em; }
.principles p { margin-top: 10px; color: var(--ink-muted); }

/* Contact */

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
}

.contact-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 40px);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 30px 60px -30px rgb(70 0 0 / .6);
  transition: transform .2s, box-shadow .2s;
}
.contact-card:hover { box-shadow: 0 36px 70px -30px rgb(70 0 0 / .75); transform: translateY(-3px); }
.contact-card:has(a:focus-visible) { outline: 3px solid var(--white); outline-offset: 4px; }
.contact-card .icon-badge { margin-bottom: 24px; }
.contact-card h3 { font-size: 1.4rem; letter-spacing: -0.03em; }
.contact-card p { margin-top: 8px; color: var(--ink-muted); }
.contact-card a {
  margin-top: auto;
  padding-top: 24px;
  font-size: clamp(1.25rem, 1rem + 1.1vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.contact-card a:focus-visible { outline: none; }
.contact-card a::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* Footer */

.site-footer {
  padding-block: 56px 32px;
  border-top: 1px solid var(--line);
  font-size: .95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 24px; }
  .footer-brand { grid-column: 1 / -1; }
}

.footer-brand img { width: auto; height: 30px; }
.footer-brand p { max-width: 22rem; margin-top: 16px; color: var(--ink-muted); }

.site-footer h2 {
  margin-bottom: 14px;
  font-size: .8125rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.site-footer ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer ul a { color: var(--ink-muted); text-decoration: none; overflow-wrap: anywhere; }
.site-footer ul a:hover { color: var(--red-strong); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: .875rem;
}
.footer-bottom a { color: var(--ink-muted); text-decoration: none; }
.site-footer--compact { padding-block: 28px; }
.site-footer--compact .footer-bottom { margin-top: 0; padding-top: 0; border-top: 0; }
.footer-bottom a:hover { color: var(--red-strong); }

/* Legal pages */

.page-head {
  border-bottom: 1px solid var(--red-line);
  background: var(--red-tint);
}
.page-head .wrap { padding-block: clamp(56px, 8vw, 96px) clamp(40px, 6vw, 64px); }
.page-head h1 {
  margin-top: 14px;
  font-size: clamp(2.4rem, 1.5rem + 3.4vw, 3.75rem);
  letter-spacing: -0.04em;
}
.page-head p { margin-top: 14px; color: var(--ink-muted); }

.prose {
  max-width: 70ch;
  padding-block: clamp(48px, 7vw, 80px) clamp(72px, 10vw, 120px);
}
.prose h2 {
  margin-top: 2.4em;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}
.prose h2:first-child { margin-top: 0; }
.prose p,
.prose ul { margin-top: 1em; }
.prose ul { padding-left: 1.25em; }
.prose li + li { margin-top: .6em; }
.prose li::marker { color: var(--red); }
.prose .intro { font-size: 1.15rem; }

/* 404 */

.notfound {
  padding-block: clamp(80px, 14vw, 160px);
  text-align: center;
}
.notfound .mark {
  width: auto;
  height: 112px;
  margin: 0 auto 32px;
  fill: var(--red);
}
.notfound h1 {
  font-size: clamp(2.4rem, 1.5rem + 3.4vw, 3.75rem);
  letter-spacing: -0.04em;
}
.notfound p {
  max-width: 30rem;
  margin: 16px auto 36px;
  color: var(--ink-muted);
  font-size: 1.125rem;
}

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