/* LegalAIWorld — design system
   Tokens first: every colour is defined on :root and only re-mapped in the
   dark block, so the whole site (35 static pages) restyles from here without
   touching page markup. */

:root {
  /* Neutrals carry a slight warm cast to sit with the sienna accent. */
  --bg:          #ffffff;
  --bg-alt:      #faf8f6;
  --bg-sunken:   #f4f1ed;
  --ink:         #1a1613;
  --ink-soft:    #57504a;
  --ink-mute:    #8a827a;
  --line:        #e8e3dc;
  --line-soft:   #f0ece6;

  --accent:      #7c2d12;
  --accent-hi:   #9c3a17;
  --accent-soft: #fcf0ea;
  --accent-ink:  #ffffff;

  --shadow-sm: 0 1px 2px rgba(26, 22, 19, 0.05);
  --shadow-md: 0 6px 20px -6px rgba(26, 22, 19, 0.13), 0 2px 6px -2px rgba(26, 22, 19, 0.07);
  --shadow-lg: 0 18px 44px -12px rgba(26, 22, 19, 0.2), 0 4px 12px -4px rgba(26, 22, 19, 0.08);

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --max:       720px;
  --max-wide:  1180px;
  --radius:    14px;
  --radius-sm: 9px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #131110;
    --bg-alt:      #1a1816;
    --bg-sunken:   #221f1c;
    --ink:         #f2ede7;
    --ink-soft:    #b3aaa1;
    --ink-mute:    #8b8279;
    --line:        #302b26;
    --line-soft:   #262220;

    --accent:      #e08055;
    --accent-hi:   #ee9871;
    --accent-soft: #2a1a12;
    --accent-ink:  #1a1613;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px -6px rgba(0, 0, 0, 0.6), 0 2px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 44px -12px rgba(0, 0, 0, 0.7), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
}

.container       { max-width: var(--max-wide); margin: 0 auto; padding: 0 32px; }
.article-container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }

::selection { background: var(--accent); color: var(--accent-ink); }

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

/* ---------------------------------------------------------------- masthead */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  padding: 15px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.masthead .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand img { height: 30px; width: auto; }
.brand span {
  font-family: var(--font-sans);
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.brand:hover span { color: var(--accent); }

.main-nav {
  display: flex;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
}
.main-nav a {
  color: var(--ink-soft);
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 100px;
  transition: background-color 0.16s ease, color 0.16s ease;
}
.main-nav a:hover { color: var(--ink); background: var(--bg-sunken); }
.main-nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* ----------------------------------------------------------------- eyebrow */

.eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent);
}

/* -------------------------------------------------------------- home hero */

.hero {
  padding: 76px 0 12px;
  max-width: 780px;
}
.hero .eyebrow { display: block; margin-bottom: 18px; }
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 1.5rem + 3.6vw, 4.1rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.028em;
  margin: 0 0 22px;
}
.hero .meta {
  font-family: var(--font-sans);
  color: var(--ink-soft);
  font-size: 1.03rem;
  line-height: 1.6;
  margin: 0 0 14px;
  max-width: 62ch;
}
.hero .meta:last-child { margin-bottom: 0; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.pill {
  font-family: var(--font-sans);
  font-size: 0.855rem;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 100px;
  padding: 9px 17px;
  transition: border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.pill:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* Thin rule that opens the article river. */
.hero-rule { border: none; border-top: 1px solid var(--line); margin: 60px 0 0; }

/* --------------------------------------------------------- section headers */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 56px 0 26px;
}
.section-head h2 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-mute);
  margin: 0;
  white-space: nowrap;
}
/* Rule that fills the space to the right of the label. */
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.section-head a {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ------------------------------------------------------------------- cards */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 30px 26px;
  margin: 0 0 64px;
}

.card {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  border-radius: var(--radius);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}
.card:hover { transform: translateY(-3px); color: var(--ink); }

.card-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover .card-thumb { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.2, 0, 0.2, 1);
}
.card:hover .card-thumb img { transform: scale(1.035); }

/* Articles with no hero image get a deliberate monogram plate rather than
   a gap, so a mixed grid still reads as designed. */
.card-thumb--placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(130% 130% at 15% 0%, color-mix(in srgb, var(--accent) 15%, transparent) 0%, transparent 62%),
    var(--bg-sunken);
}
.card-thumb--placeholder img {
  width: 34px;
  height: 34px;
  opacity: 0.85;
  transform: none !important;
}
.card-thumb--placeholder span {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: color-mix(in srgb, var(--accent) 70%, var(--ink-mute));
}
.card--lead .card-thumb--placeholder img { width: 46px; height: 46px; }
.card--lead .card-thumb--placeholder span { font-size: 0.78rem; }

.card-body { padding: 15px 2px 0; display: flex; flex-direction: column; flex: 1; }
.card .eyebrow { display: block; margin-bottom: 9px; font-size: 0.66rem; }
.card h3 {
  font-family: var(--font-serif);
  font-size: 1.235rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.28;
  margin: 0 0 10px;
  color: var(--ink);
}
.card:hover h3 { color: var(--accent); }
.card .dek {
  font-family: var(--font-sans);
  font-size: 0.89rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .foot {
  font-family: var(--font-sans);
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--ink-mute);
  margin-top: auto;
  letter-spacing: 0.01em;
}

/* Lead story: the newest article gets a wide two-column treatment. */
.card--lead {
  grid-column: 1 / -1;
  flex-direction: row;
  gap: 40px;
  align-items: center;
  padding: 0;
  margin-bottom: 8px;
}
.card--lead .card-thumb { flex: 0 0 56%; aspect-ratio: 16 / 9; }
.card--lead .card-body { padding: 0; flex: 1; }
.card--lead h3 {
  font-size: clamp(1.6rem, 1.1rem + 1.5vw, 2.3rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.022em;
  margin-bottom: 14px;
}
.card--lead .dek { font-size: 1rem; -webkit-line-clamp: 3; margin-bottom: 18px; }

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

.article { padding: 0 0 40px; }
.article .article-container > .eyebrow { display: block; margin: 52px 0 16px; }
.article h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.05rem, 1.4rem + 2.4vw, 3.05rem);
  font-weight: 500;
  line-height: 1.11;
  letter-spacing: -0.026em;
  margin: 48px 0 18px;
}
.article .meta {
  font-family: var(--font-sans);
  color: var(--ink-mute);
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: 34px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.article .meta .eyebrow { margin-right: 4px; }

.featured-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  margin: 0 0 40px;
  display: block;
}

.entry-content { font-size: 1.115rem; line-height: 1.75; }
.entry-content p { margin: 0 0 24px; }
/* Opening paragraph reads as a standfirst. */
.entry-content > p:first-of-type {
  font-size: 1.235rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.pillar > p:first-of-type,
.statement > p:first-of-type,
.contact-block > p:first-of-type { font-size: inherit; color: inherit; }
.entry-content h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 1.25rem + 0.85vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.25;
  margin: 54px 0 18px;
}
.entry-content h3 {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 38px 0 14px;
}
.entry-content ul, .entry-content ol { margin: 0 0 24px; padding-left: 22px; }
.entry-content li { margin-bottom: 11px; padding-left: 4px; }
.entry-content li::marker { color: var(--accent); }

.entry-content blockquote {
  margin: 32px 0;
  padding: 22px 26px;
  border: none;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: normal;
  color: var(--ink);
  font-size: 1.04rem;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 48px 0;
}
.entry-content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 38%, transparent);
  transition: text-decoration-color 0.16s ease;
}
.entry-content a:hover { text-decoration-color: var(--accent); }
.entry-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.entry-content strong { color: var(--ink); font-weight: 600; }

/* Comparison tables. Wide pricing/feature tables must scroll inside their own
   box rather than forcing the page to scroll sideways on mobile, which is
   where this site's best CTR comes from. */
.entry-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 32px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.55;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.entry-content thead th {
  background: var(--bg-sunken);
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.entry-content th,
.entry-content td {
  border-bottom: 1px solid var(--line-soft);
  padding: 13px 16px;
  vertical-align: top;
}
.entry-content tbody tr:last-child td { border-bottom: none; }
.entry-content tbody tr:hover { background: var(--bg-alt); }
.entry-content figure.wp-block-table { margin: 0 0 32px; }
.entry-content figure.wp-block-table table { margin-bottom: 0; }

.disclosure-note {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-left: 3px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  margin: 0 0 34px;
}
.disclosure-note a { color: var(--accent); text-decoration: underline; }

/* Editorial-standard panels. Used on About and any future methodology page
   where the point is showing how the work is done, not who did it. */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 18px;
  margin: 32px 0 36px;
}
.pillar {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  padding: 20px 21px;
}
.pillar h3 {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--accent);
  margin: 0 0 10px;
}
.pillar p {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

/* A single emphasised statement — the standards promise on About. */
.statement {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 22px 26px;
  margin: 32px 0;
  font-size: 1.09rem;
  line-height: 1.6;
}
.statement p { margin: 0; }
.statement p + p { margin-top: 14px; }

/* Contact / closing block. */
.contact-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 36px 0 8px;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}
.contact-block h2 { margin-top: 0 !important; }
.contact-block p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 52px 0 40px;
  margin-top: 84px;
}
.footer .container {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  margin-bottom: 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.footer-links a {
  color: var(--ink-soft);
  font-weight: 500;
  transition: color 0.16s ease;
}
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--ink-mute);
  font-size: 0.81rem;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .card--lead { flex-direction: column; gap: 18px; align-items: stretch; }
  .card--lead .card-thumb { flex: none; width: 100%; aspect-ratio: 16 / 10; }
  .card--lead .card-body { padding: 0 2px; }
}

@media (max-width: 700px) {
  .container { padding: 0 20px; }
  .article-container { padding: 0 20px; }
  .main-nav { display: none; }

  .hero { padding: 44px 0 8px; }
  .hero-rule { margin-top: 44px; }
  .section-head { margin: 40px 0 22px; }
  .card-grid { grid-template-columns: 1fr; gap: 34px; margin-bottom: 44px; }

  .article h1 { margin-top: 34px; }
  .article .article-container > .eyebrow { margin-top: 34px; }
  .featured-image { margin-bottom: 30px; }
  .entry-content { font-size: 1.06rem; }
  .entry-content > p:first-of-type { font-size: 1.14rem; }
  .entry-content h2 { margin-top: 42px; }

  /* Wide tables scroll in their own box; the page itself never does. */
  .entry-content table { display: block; overflow-x: auto; white-space: nowrap; }
  .entry-content td, .entry-content th { white-space: normal; min-width: 128px; }

  .footer { margin-top: 56px; padding: 40px 0 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .card:hover { transform: none; }
  .card:hover .card-thumb img { transform: none; }
}
