/* Riptide Solutions — page layout.
   Every measurement here comes from the approved mockup
   (project/Riptide Website.dc.html), which was designed at 1440x900 with no
   breakpoints. The desktop rules match it; the media queries at the bottom are
   new work, written to hold the same rhythm and framing as the layout narrows.
   Design-system tokens and components live in industry.css — take colors,
   fonts and spacing from there, never a raw hex. */

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}
.site main { flex: 1; }

.wrap {
  max-width: 1240px;
  margin: 0 auto;
}

/* Skip link — keyboard users would otherwise tab the whole nav on every page. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 10px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-accent);
}
.skip:focus { left: 12px; top: 12px; }

/* ─── masthead ─────────────────────────────────────────────────────────────
   The wave sits flush to every edge (object-fit:fill, multiply) with the
   logo overhanging it — the geometry went through several rounds in design,
   so the 285px band, 255px logo and 12px left inset are all deliberate. */

.masthead {
  position: relative;
  overflow: hidden;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider);
}
.masthead__wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0.95;
  pointer-events: none;
  mix-blend-mode: multiply;
}
.masthead__inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px 0 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  min-height: 285px;
}
.masthead__logo {
  display: block;
  padding: 14px 0 12px;
  text-decoration: none;
}
.masthead__logo img {
  height: 255px;
  width: auto;
  mix-blend-mode: multiply;
}

.mainnav {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  padding-bottom: 30px;
}
.mainnav a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text);
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
}
.mainnav a:hover { color: var(--color-accent-700); }
.mainnav a[aria-current="page"] {
  color: var(--color-accent-700);
  border-bottom-color: var(--color-accent);
}

/* ─── shared page furniture ───────────────────────────────────────────── */

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 40px 60px;
}
.page__title {
  font-size: 52px;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
/* The uppercase accent label that opens a section, with its hairline rule. */
.section-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-700);
}
.section-label--ruled {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-divider);
}
.btn-lg { font-size: 16px; padding: 14px 26px; }
.btn-md { font-size: 15px; padding: 13px 22px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 14px; }
.btnrow--spaced { margin-top: 32px; }
.page__title--spaced { margin-bottom: 32px; }

/* ─── home ────────────────────────────────────────────────────────────── */

.hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 52px 40px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 56px;
  align-items: start;
}
.hero__title {
  font-size: 50px;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  max-width: 19ch;
}
.hero__lede {
  font-size: 19px;
  line-height: 1.45;
  max-width: 52ch;
  margin: 0 0 28px;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}
.pillars {
  padding: 22px;
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}
.pillars .section-label { margin-bottom: 14px; }
.pillar {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--color-divider);
}
.pillar__num {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--color-accent);
  flex: none;
}
.pillar__label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.15;
}

/* ─── services ────────────────────────────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 64px;
  align-items: start;
}
.split--services { margin-top: 36px; }
.lede-italic {
  font-style: italic;
  color: var(--color-accent-800);
}
.services__lede {
  font-size: 20px;
  line-height: 1.45;
  margin: 0 0 40px;
  max-width: 56ch;
}
.service {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 20px;
  padding: 26px 0;
  border-top: 1px solid var(--color-divider);
}
.service__num {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--color-accent);
  padding-top: 6px;
}
.service__title { font-size: 27px; margin: 0 0 6px; }
.service__body {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  max-width: 60ch;
  color: color-mix(in srgb, var(--color-text) 76%, transparent);
}
.rail {
  padding: 28px 26px;
  margin-top: 8px;
  position: sticky;
  top: 160px;
}
.rail__title { font-size: 26px; line-height: 1.15; margin: 0 0 18px; }
.rail .btn-block { font-size: 15px; padding: 13px 20px; }

/* ─── platform ────────────────────────────────────────────────────────── */

.platform__lede {
  font-size: 23px;
  margin: 20px 0 44px;
}
.layers {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 26px;
}
.layer {
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(0, 2.1fr);
  gap: 32px;
  padding: 24px 26px;
  align-items: center;
}
.layer__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 25px;
  line-height: 1.1;
}
.layer__kicker {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  margin-top: 5px;
}
.layer__parts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.layer__parts .tag { font-size: 12px; padding: 5px 12px; }

/* ─── resources ───────────────────────────────────────────────────────── */

/* The mockup had three columns; a fourth group (articles hosted here, split
   from links published elsewhere) does not fit that rhythm at 1240px, so the
   grid goes 2x2 and each cell keeps its full column width. */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 52px 44px;
  align-items: start;
}
.reslist__head {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-700);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-divider);
}
.reslist { display: flex; flex-direction: column; }
.linkrow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid var(--color-divider);
  text-decoration: none;
  color: inherit;
  font-size: 16px;
}
.linkrow:hover { color: var(--color-accent-700); }
/* A tool with no destination yet: same row, no hover, no pointer. */
.linkrow--inert { color: inherit; }
.linkrow__mark {
  color: var(--color-accent);
  font-size: 13px;
  flex: none;
}
.linkrow__source {
  font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.article-card {
  display: block;
  padding: 22px 20px;
  text-decoration: none;
  color: inherit;
}
.article-card:hover { background: color-mix(in srgb, var(--color-accent) 7%, transparent); }
.article-card .tag { margin-bottom: 14px; }
/* Clear the featured card's bottom registration marks before the list starts. */
.reslist--after-card { margin-top: 26px; }
.article-card__title {
  font-size: 25px;
  line-height: 1.15;
  margin: 12px 0 0;
}
.article-card__meta {
  font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  margin-top: 10px;
}
.reslist__cta { margin-top: 20px; font-size: 15px; padding: 12px 20px; }

/* ─── about ───────────────────────────────────────────────────────────── */

.about__lede {
  font-size: 22px;
  line-height: 1.35;
  margin: 0 0 28px;
  max-width: 38ch;
}
.about__body {
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
  max-width: 70ch;
}
.download-card {
  display: block;
  padding: 24px 22px;
  text-decoration: none;
  color: inherit;
  margin-top: 6px;
}
.download-card:hover { background: color-mix(in srgb, var(--color-accent) 7%, transparent); }
.download-card .section-label { margin-bottom: 12px; }
.download-card__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.15;
}
.about-section { margin-top: 72px; }
.mission__body {
  font-size: 17px;
  line-height: 1.6;
  max-width: 70ch;
  margin-top: 32px;
}
.mission__body p { margin: 0 0 18px; }
.mission__body p:last-child { margin-bottom: 0; }
.team-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px;
  margin-top: 32px;
}
.member__frame {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.member__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}
.member__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 22px;
  margin-top: 16px;
}
.member__role {
  font-size: 14px;
  line-height: 1.35;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
  margin-top: 2px;
}

/* ─── article pages ───────────────────────────────────────────────────── */

.article { max-width: 1240px; margin: 0 auto; padding: 48px 40px 60px; }
.article__head { max-width: 70ch; }
.article__title { font-size: 44px; letter-spacing: -0.03em; margin: 12px 0 0; }
.article__meta {
  font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  margin-top: 14px;
}
.article__summary {
  font-style: italic;
  font-size: 20px;
  line-height: 1.45;
  color: var(--color-accent-800);
  margin: 24px 0 0;
  max-width: 60ch;
}
/* Prose written in the CMS: the editor emits plain semantic HTML, so these
   element selectors are the only styling those articles get. */
.prose {
  max-width: 70ch;
  margin-top: 40px;
  font-size: 17px;
  line-height: 1.65;
}
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 30px; margin: 44px 0 14px; }
.prose h3 { font-size: 23px; margin: 34px 0 10px; }
.prose p { margin: 0 0 20px; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 24px; }
.prose li { margin-bottom: 8px; }
.prose img { margin: 28px 0; border: 1px solid var(--color-divider); }
.prose figure { margin: 28px 0; }
.prose figcaption { font-size: 13px; margin-top: 8px; }
.prose blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--color-accent);
  font-style: italic;
  color: var(--color-accent-800);
}
.prose pre {
  overflow-x: auto;
  padding: 16px 18px;
  border: 1px solid var(--color-divider);
  font-size: 14px;
  line-height: 1.5;
}
.prose code {
  font-size: 0.92em;
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
  padding: 1px 5px;
}
.prose pre code { background: none; padding: 0; }
/* Tables come from the raw-Markdown escape hatch, so they need to survive
   arbitrary column counts on a narrow screen. Goldmark emits a bare <table>
   with nothing to hang a scroll container on, so the table scrolls itself. */
.prose table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  margin: 28px 0;
  border-collapse: collapse;
  font-size: 15px;
}
.prose th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: 8px;
  border-bottom: 1px solid var(--color-divider);
}
.prose td {
  padding: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.article__back { margin-top: 56px; }

/* ─── contact band ────────────────────────────────────────────────────── */

/* The mockup put a single mailto button in the right-hand cell. A working
   form needs more room, so the band is taller than the mock — the one place
   the approved layout changed, and only to carry a requested feature. The
   mailto link stays as a fallback beneath the form. */
.contact {
  background: var(--color-accent-900);
  color: var(--color-bg);
}
.contact__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 48px;
  align-items: start;
}
.contact__title {
  font-size: 38px;
  line-height: 1.05;
  margin: 0 0 8px;
  color: var(--color-bg);
}
.contact__lede {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  max-width: 58ch;
  color: color-mix(in srgb, #f2f2f3 76%, transparent);
}
.contact__fallback {
  margin: 22px 0 0;
  font-size: 15px;
  color: color-mix(in srgb, #f2f2f3 62%, transparent);
}
.contact__fallback a { color: var(--color-bg); }
.contact__form { display: grid; gap: 12px; }
.contact__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Reverse the field styling onto the accent-900 ground: still hairline,
   square and transparent, just drawn in paper instead of ink. */
.contact .field > label { color: color-mix(in srgb, #f2f2f3 72%, transparent); }
.contact .input {
  background: transparent;
  border-color: color-mix(in srgb, #f2f2f3 35%, transparent);
  color: var(--color-bg);
}
.contact .input::placeholder { color: color-mix(in srgb, #f2f2f3 45%, transparent); }
.contact .input:hover { border-color: color-mix(in srgb, #f2f2f3 60%, transparent); }
.contact .input:focus-visible {
  border-color: #f2f2f3;
  outline: 2px solid color-mix(in srgb, #f2f2f3 70%, transparent);
  outline-offset: 0;
}
.contact .btn {
  color: var(--color-bg);
  border-color: color-mix(in srgb, #f2f2f3 35%, transparent);
}
.contact .btn:hover { background: color-mix(in srgb, #f2f2f3 10%, transparent); }
.contact :focus-visible { outline-color: #f2f2f3; }
/* Bot bait: a real field, visually gone, never focusable by keyboard. */
.contact__hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.contact__status {
  margin: 0;
  font-size: 15px;
  min-height: 1.4em;
  color: color-mix(in srgb, #f2f2f3 85%, transparent);
}
.contact__status[data-state="error"] { color: #f0b7b7; }

/* ─── footer ──────────────────────────────────────────────────────────── */

.sitefoot { border-top: 1px solid var(--color-divider); }
.sitefoot__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}
.sitefoot__tag {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
}
/* Legal links and the copyright line share the right-hand end of the footer,
   and wrap onto separate lines together before the tagline gives up its row. */
.sitefoot__end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 22px;
}
.sitefoot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}
.sitefoot__meta,
.sitefoot__links a {
  font-size: 13px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.sitefoot__links a {
  text-decoration: none;
}
.sitefoot__links a:hover,
.sitefoot__links a:focus-visible {
  color: var(--color-accent-700);
  text-decoration: underline;
}

/* ══ responsive ═══════════════════════════════════════════════════════════
   Not in the mockup — it was fixed-width at 1440. The aim is to keep the
   blueprint framing, the type hierarchy and the horizontal rhythm intact and
   only let the grid fold, rather than to redraw anything. */

/* Tablet: the two-column splits fold; the masthead loses its oversized logo
   but keeps the wave band. */
@media (max-width: 1080px) {
  .masthead__inner { padding: 0 28px 0 12px; min-height: 210px; gap: 28px; }
  .masthead__logo img { height: 180px; }
  .mainnav { gap: 26px; padding-bottom: 24px; }
  .mainnav a { font-size: 16px; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding: 44px 28px 48px;
  }
  .hero__title { font-size: 44px; }
  .page { padding: 40px 28px 52px; }
  .page__title { font-size: 46px; }

  .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  /* Sticky only makes sense beside a long column; once stacked it would
     pin the card over the content it belongs to. */
  .rail { position: static; }

  .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

  .contact__inner { padding: 32px 28px; gap: 32px; }
  .article { padding: 40px 28px 52px; }
  .sitefoot__inner { padding: 30px 28px; }
}

/* Phone: everything is one column. The masthead stacks so the logo keeps a
   usable size instead of shrinking to a stamp, and the wave switches to
   cover — stretched to a short band, object-fit:fill would visibly squash it. */
@media (max-width: 720px) {
  .masthead__inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: 0;
    padding: 0 20px;
    gap: 0;
  }
  .masthead__wave { object-fit: cover; }
  .masthead__logo { padding: 10px 0 4px; margin-left: -8px; }
  .masthead__logo img { height: 128px; }
  .mainnav {
    gap: 16px 20px;
    padding: 0 0 18px;
  }
  .mainnav a { font-size: 14px; padding-bottom: 4px; }

  .hero { padding: 32px 20px 40px; gap: 32px; }
  .hero__title { font-size: 34px; }
  .hero__lede { font-size: 17px; }
  .btn-lg { font-size: 15px; padding: 12px 20px; }

  .page { padding: 32px 20px 44px; }
  .page__title { font-size: 36px; }
  .services__lede { font-size: 18px; }
  .platform__lede { font-size: 20px; margin-bottom: 34px; }
  .about__lede { font-size: 19px; }

  .service { grid-template-columns: 26px minmax(0, 1fr); gap: 14px; padding: 22px 0; }
  .service__title { font-size: 23px; }

  .layer { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px 18px; }
  .layer__name { font-size: 22px; }

  .resources-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .article-card__title { font-size: 22px; }

  .about-section { margin-top: 56px; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .member__name { font-size: 19px; }

  .article { padding: 32px 20px 44px; }
  .article__title { font-size: 32px; }
  .article__summary { font-size: 18px; }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 26px; }
  .prose h3 { font-size: 21px; }

  .contact__inner { grid-template-columns: minmax(0, 1fr); padding: 32px 20px; gap: 26px; }
  .contact__title { font-size: 29px; }
  .contact__pair { grid-template-columns: minmax(0, 1fr); }

  .sitefoot__inner { padding: 26px 20px; gap: 14px; }
  .sitefoot__tag { font-size: 16px; }
}

/* The corner registration marks sit 6px outside the frame, so a blueprint
   flush to a 20px gutter would clip them. */
@media (max-width: 400px) {
  .page, .hero, .article { padding-left: 16px; padding-right: 16px; }
  .team-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
