/* The AI Barn — styles.css
   One stylesheet, no frameworks. Mobile-first: base styles are for small
   screens, media queries add layout for wider ones. */

:root {
  --bg: #e9eef6;          /* soft blue-grey page */
  --surface: #ffffff;
  --surface-alt: #dce5f2; /* stronger soft blue */
  --ink: #0b1f3a;         /* dark blue — body text */
  --muted: #4a5d78;       /* secondary text (AA on bg and surface) */
  --barn: #c8102e;        /* red — links, buttons */
  --barn-dark: #9a0c22;
  --hay: #1a3a6b;         /* mid blue — accents / focus */
  --hay-soft: #dce5f2;    /* soft blue for soft panels */
  --field: #0b1f3a;       /* dark blue eyebrows */
  --field-soft: #d0dced;
  --line: #c2cede;
  --hero-bg: #0b1f3a;
  --hero-text: #ffffff;
  --hero-muted: #b8c7de;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 6px 20px rgba(11, 31, 58, .08);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --wrap: 72rem;
  --measure: 42rem;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--barn); text-underline-offset: .18em; }
a:hover { color: var(--barn-dark); }
:focus-visible { outline: 3px solid var(--hay); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--font-serif);
  line-height: 1.2;
  margin: 0 0 .5em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 6vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 3.6vw, 1.95rem); margin-top: 1.6em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.15rem; }
.prose { max-width: var(--measure); }
.small { font-size: .9rem; color: var(--muted); }
.eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--field); margin-bottom: .6rem;
}
.placeholder {
  background: #fff5f6;
  border: 1px dashed #c8102e;
  border-radius: 4px;
  padding: 0 .3em;
  font-style: normal;
}

/* Skip link */
.skip {
  position: absolute; left: -999px; top: .5rem;
  background: var(--ink); color: #fff; padding: .5rem .8rem; border-radius: 6px; z-index: 10;
}
.skip:focus { left: .5rem; color: #fff; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.header-inner { display: flex; flex-direction: column; gap: .35rem; padding-top: .7rem; padding-bottom: .35rem; }
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-serif); font-weight: 700; font-size: 1.3rem;
  color: var(--ink); text-decoration: none;
}
.brand svg { width: 34px; height: 34px; flex: none; }
.brand:hover { color: var(--barn); }

.site-nav ul {
  list-style: none; margin: 0 -1.15rem; padding: 0 1.15rem .35rem;
  display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.site-nav a {
  display: block; white-space: nowrap; padding: .4rem .7rem; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--surface-alt); color: var(--barn-dark); }
.site-nav a.nav-cta { background: var(--barn); color: #fff; }
.site-nav a.nav-cta:hover { background: var(--barn-dark); color: #fff; }

/* Buttons */
.btn {
  display: inline-block; padding: .75rem 1.2rem; border-radius: 10px;
  font-weight: 700; text-decoration: none; line-height: 1.2;
  border: 2px solid transparent;
}
.btn-primary { background: var(--barn); color: #fff; }
.btn-primary:hover { background: var(--barn-dark); color: #fff; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-cta { background: var(--field); color: #fff; font-size: 1.05rem; }
.btn-cta:hover { background: #071628; color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

/* Hero */
.hero {
  background:
    linear-gradient(135deg, #0b1f3a 0%, #132f56 55%, #1a3a6b 100%);
  border-bottom: 4px solid var(--barn);
  padding: 3.2rem 0 2.8rem;
  color: var(--hero-text);
}
.hero .eyebrow { color: #f2b6bf; }
.hero h1 { max-width: 18ch; color: #fff; }
.hero .lede { font-size: 1.15rem; color: var(--hero-muted); max-width: 40rem; }
.hero .btn-ghost { border-color: #fff; color: #fff; background: transparent; }
.hero .btn-ghost:hover { background: #fff; color: var(--ink); }
.hero .promises li { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #e8eef8; }
.hero .promises strong { color: #fff; }

.promises { display: grid; gap: .8rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.promises li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem 1rem; font-size: .97rem;
}
.promises strong { display: block; color: var(--barn-dark); }

/* Sections and cards */
.section { padding: 2.6rem 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; }
.section-head h2 { margin-top: 0; }

.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.25rem; box-shadow: var(--shadow); position: relative;
}
.card h3 { margin-bottom: .35rem; }
.card p { color: var(--muted); margin: 0; font-size: .97rem; }
.card a.stretched { color: var(--ink); text-decoration: none; }
.card a.stretched::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card:hover { border-color: var(--barn); }
.card:hover a.stretched { color: var(--barn); }
.card .tag {
  display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--field-soft); color: var(--field); border-radius: 999px; padding: .15rem .6rem; margin-bottom: .6rem;
}
.card.is-soon { box-shadow: none; background: var(--surface-alt); }
.card.is-soon:hover { border-color: var(--line); }
.hub-icon { width: 40px; height: 40px; margin-bottom: .6rem; color: var(--barn); }

/* Newsletter block */
.newsletter {
  background: var(--field); color: #fff; padding: 2.6rem 0; margin-top: 1rem;
}
.newsletter h2 { color: #fff; margin-top: 0; }
.newsletter p { color: #dce6f5; max-width: 40rem; }
.newsletter a { color: #fff; }
.newsletter .small { color: #b8c7de; }
.beehiiv-embed {
  background: var(--surface); color: var(--ink); border-radius: var(--radius);
  padding: .75rem; margin: 1.2rem 0 .8rem; max-width: 40rem; min-height: 5.5rem;
}

/* Article layout */
.article { padding: 2rem 0 1rem; }
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: .35rem; color: var(--muted); }
.byline { color: var(--muted); font-size: .95rem; display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-bottom: 1.2rem; }

.ad-label {
  display: flex; gap: .9rem; align-items: flex-start;
  background: #fff5f6; border: 2px solid var(--barn); border-radius: var(--radius);
  padding: .9rem 1rem; margin: 0 0 1.6rem; max-width: var(--measure);
}
.ad-tag {
  flex: none; background: var(--ink); color: #fff; font-weight: 800; letter-spacing: .06em;
  border-radius: 6px; padding: .2rem .6rem; font-size: 1rem;
}
.ad-label p { margin: 0; font-size: .97rem; }

.verdict {
  background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--barn);
  border-radius: var(--radius); padding: 1.2rem 1.25rem; box-shadow: var(--shadow);
  max-width: var(--measure); margin-bottom: 1.5rem;
}
.verdict h2 { margin-top: 0; font-size: 1.35rem; }
.verdict dl { display: grid; grid-template-columns: 1fr; gap: .1rem 1rem; margin: 0 0 1rem; }
.verdict dd { margin: 0 0 .5rem; }
.verdict dt { font-weight: 700; }
.score { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 700; color: var(--barn); line-height: 1; }

.proscons { display: grid; gap: 1rem; grid-template-columns: 1fr; max-width: var(--measure); }
.proscons > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.proscons h3 { margin-top: 0; }
.pros h3 { color: var(--field); }
.cons h3 { color: var(--barn); }
.proscons ul { margin: 0; padding-left: 1.2rem; }

.table-wrap { overflow-x: auto; max-width: var(--measure); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
caption { text-align: left; padding: .8rem 1rem 0; color: var(--muted); font-size: .9rem; }
th, td { text-align: left; padding: .65rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-alt); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
/* Wide tables scroll sideways on phones instead of squashing columns */
.table-wrap table { min-width: 38rem; }
@media (max-width: 40rem) { th, td { padding: .55rem .7rem; } }

.cta-box {
  max-width: var(--measure); background: var(--field-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem 1.25rem; margin: 1.6rem 0;
}
.cta-box p { margin-bottom: .8rem; }

.faq { max-width: var(--measure); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .2rem 1rem; margin-bottom: .6rem; }
.faq summary { cursor: pointer; font-weight: 700; padding: .6rem 0; }
.faq details p { margin-top: .2rem; }

.author-box {
  display: flex; gap: 1rem; align-items: flex-start; max-width: var(--measure);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 2rem 0;
}
.avatar {
  flex: none; width: 64px; height: 64px; border-radius: 50%;
  background: var(--barn); color: #fff; display: grid; place-items: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 1.3rem;
}
.author-box h2 { font-size: 1.15rem; margin: 0 0 .3rem; }
.author-box p { margin: 0 0 .4rem; font-size: .97rem; }

.notice {
  max-width: var(--measure); background: #fff5f6; border-left: 6px solid var(--barn);
  border-radius: 8px; padding: .9rem 1rem; margin-bottom: 1.5rem;
}

/* Footer */
.site-footer { background: var(--ink); color: #eadfcd; padding: 2.4rem 0 2rem; margin-top: 0; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem; }
.footer-brand { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 700; color: #fff; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.site-footer .small { color: #cfc3b0; }

/* 404 */
.notfound { padding: 4rem 0; text-align: left; }

/* Wider screens */
@media (min-width: 40rem) {
  .verdict dl { grid-template-columns: max-content 1fr; gap: .35rem 1rem; }
  .verdict dd { margin-bottom: 0; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .promises { grid-template-columns: repeat(3, 1fr); }
  .proscons { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 60rem) {
  .header-inner { flex-direction: row; align-items: center; justify-content: space-between; padding-bottom: .7rem; }
  .site-nav ul { margin: 0; padding: 0; overflow: visible; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 4.5rem 0 3.5rem; }
  .footer-grid { grid-template-columns: 2fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* "(Ad)" note inside affiliate buttons */
.btn-note { font-weight: 600; font-size: .85em; opacity: .9; }

/* Placeholders inside dark buttons stay readable */
.btn .placeholder { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .7); }
