/* waitwhydoc.com
   Navy and the cover-label yellow from the videos; white like the wall he records against.
   Rubik for headings in both scripts, Source Serif 4 for English reading, Noto Naskh Arabic for Arabic reading. */

:root {
  --ink: #14213d;
  --paper: #ffffff;
  --mist: #eef2f7;
  --label: #ffd23f;
  --muted: #55627a;
  --rule: #d5dce6;

  --display: "Rubik", "Segoe UI", system-ui, sans-serif;
  --read-en: "Source Serif 4", Georgia, "Times New Roman", serif;
  --read-ar: "Noto Naskh Arabic", "Traditional Arabic", "Geeza Pro", serif;

  --s-1: 0.875rem;
  --s0: 1rem;
  --s1: 1.25rem;
  --s2: 1.5625rem;
  --s3: 1.953rem;
  --s4: 2.441rem;

  --gutter: clamp(1.25rem, 4vw, 3rem);
}

*,
*::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(--read-en);
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
}

[lang="ar"],
html[lang="ar"] body {
  font-family: var(--read-ar);
}

html[lang="ar"] body {
  font-size: 1.3rem;
  line-height: 1.95;
}

/* Naskh runs small next to Latin type, so Arabic blocks on the bilingual root page get a size bump too */
.half[lang="ar"] .half-intro {
  font-size: 1.25rem;
  line-height: 1.9;
}

/* Interface links stay in the heading face whatever their language */
.article-nav a,
.lang-switch,
.half-latest a {
  font-family: var(--display);
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--label);
  text-decoration-thickness: 0.2em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: var(--ink);
}

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

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.9rem;
  font-family: var(--display);
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

/* ---------- the hook: the one loud thing ---------- */

.hook {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-size: clamp(2.75rem, 7.5vw, 5.75rem);
}

[dir="rtl"] .hook,
.hook:lang(ar) {
  letter-spacing: 0;
  line-height: 1.3;
}

.hook span {
  background-image: linear-gradient(var(--label), var(--label));
  background-repeat: no-repeat;
  background-size: 100% 0.42em;
  background-position: 0 88%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-inline: 0.06em;
}

[dir="rtl"] .hook span {
  background-position: 100% 88%;
}

@media (prefers-reduced-motion: no-preference) {
  .root .hook span {
    animation: mark 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 250ms both;
  }
  .root .half-ar .hook span {
    animation-delay: 450ms;
  }
}

@keyframes mark {
  from {
    background-size: 0% 0.42em;
  }
  to {
    background-size: 100% 0.42em;
  }
}

/* ---------- root page: the two hooks facing each other ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100svh - 7rem);
}

.half {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.4rem;
  padding: clamp(3rem, 8vw, 7rem) var(--gutter);
}

/* The root page is laid out left to right: English on the left, Arabic on the right. */
.split .half:first-child {
  border-right: 1px solid var(--rule);
}

.half-intro {
  margin: 0;
  max-width: 30em;
  color: var(--ink);
}

.half-latest {
  margin: 0;
  font-family: var(--display);
  font-size: var(--s-1);
  color: var(--muted);
  max-width: 30em;
}

.half-latest a {
  color: var(--ink);
}

.button {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--s0);
  line-height: 1.2;
  padding: 0.85rem 1.4rem;
  border-radius: 6px;
  text-decoration: none;
}

.button:hover {
  background: #22335a;
}

@media (max-width: 760px) {
  .split {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .split .half:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
}

/* ---------- header and footer ---------- */

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  font-family: var(--display);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: var(--s1);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.mark {
  display: inline-grid;
  place-items: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 0.35em;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.85em;
  box-shadow: inset 0 -0.42em 0 var(--label);
}

.lang-switch {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--s0);
  padding: 0.35rem 0.2rem;
}

.foot {
  background: var(--mist);
  padding: 2rem var(--gutter) 2.5rem;
  font-family: var(--display);
  font-size: var(--s-1);
  line-height: 1.6;
  color: var(--muted);
}

.foot > * {
  max-width: 72rem;
  margin-inline: auto;
}

.foot-disclaimer {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--ink);
  font-weight: 500;
}

.foot-disclaimer span + span {
  margin-inline-start: 1.25rem;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

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

.foot-copy {
  margin-top: 1rem;
  margin-bottom: 0;
}

/* ---------- language home ---------- */

.home {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}

.intro {
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--rule);
}

.intro-text {
  margin: 1.6rem 0 1rem;
  max-width: 32em;
  font-size: var(--s1);
}

.intro-cred {
  margin: 0;
  font-family: var(--display);
  font-size: var(--s-1);
  color: var(--muted);
  line-height: 1.55;
}

.articles h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--s2);
  margin: 2.5rem 0 0.5rem;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 46rem;
}

.list li {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.list-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--s2);
  line-height: 1.25;
  text-decoration: none;
}

.list-title:hover {
  text-decoration: underline;
  text-decoration-color: var(--label);
  text-decoration-thickness: 0.2em;
}

.list-desc {
  margin: 0.5rem 0 0.4rem;
}

.list-meta {
  margin: 0;
  font-family: var(--display);
  font-size: var(--s-1);
  color: var(--muted);
}

.sample-tag {
  margin-inline-start: 0.5rem;
  padding: 0.05rem 0.45rem;
  border: 1px dashed var(--muted);
  border-radius: 4px;
}

.empty {
  margin: 1rem 0 0;
  padding: 1.25rem 1.4rem;
  background: var(--mist);
  border-radius: 6px;
  max-width: 40rem;
}

/* ---------- article ---------- */

.article {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) var(--gutter) 4rem;
}

.sample-banner {
  margin: 0 0 2rem;
  padding: 0.75rem 1rem;
  border: 2px dashed var(--muted);
  border-radius: 6px;
  font-family: var(--display);
  font-size: var(--s-1);
  color: var(--muted);
}

.reviewed {
  margin: 0 0 1.1rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--s-1);
}

.reviewed span {
  display: inline-block;
  background: var(--label);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
}

.article h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 5.2vw, var(--s4));
  line-height: 1.15;
  letter-spacing: -0.01em;
}

html[lang="ar"] .article h1 {
  line-height: 1.4;
  letter-spacing: 0;
}

.byline {
  margin: 1.1rem 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--s0);
  line-height: 1.5;
}

.byline span {
  font-weight: 400;
  font-size: var(--s-1);
  color: var(--muted);
}

.lead {
  margin: 1.6rem 0 0;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--rule);
  font-size: var(--s1);
  line-height: 1.55;
}

.prose {
  margin-top: 1.8rem;
}

.prose h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--s2);
  line-height: 1.3;
  margin: 2.4rem 0 0.6rem;
}

.prose h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--s1);
  margin: 1.8rem 0 0.4rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1.1rem;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.4rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose strong {
  font-weight: 600;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding-inline-start: 1.1rem;
  border-inline-start: 4px solid var(--label);
}

/* The last list in an article is its sources: smaller, and long links wrap */
.prose h2:last-of-type + ol,
.prose h2:last-of-type + ul {
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.disclaimer {
  margin-top: 2.5rem;
  padding: 1.1rem 1.3rem;
  background: var(--mist);
  border-inline-start: 6px solid var(--ink);
  border-radius: 4px;
  font-family: var(--display);
  font-weight: 500;
}

.disclaimer p {
  margin: 0;
}

.article-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--s0);
}

/* ---------- 404 ---------- */

.notfound .hook {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
}

@media print {
  .bar,
  .foot,
  .article-nav,
  .skip {
    display: none;
  }
  a {
    text-decoration: none;
  }
}
