/* CNR Consulting — shared styles (Cloudflare Pages). */

:root {
  --bg: #f4f6f8;
  --bg2: #e8eef3;
  --surface: #fafbfc;
  --text: #14181f;
  --muted: #4a5560;
  --faint: #6b7580;
  --line: #cfd8e0;
  --brand: #2f5d6e;
  --brand-ink: #1e3d49;
  --stone: #8a7a68;
  --ok: #2f6f53;
  --radius: 4px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --shadow-soft: 0 12px 40px rgba(20, 24, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: linear-gradient(165deg, var(--bg) 0%, var(--bg2) 55%, #dfe8ef 100%);
  background-attachment: fixed;
  background-color: var(--bg2);
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  border: 1px solid var(--line);
  transform: translateY(-200%);
  z-index: 999;
}

.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

/* —— Topbar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(244, 246, 248, 0.9);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  position: relative;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-name .brand-cnr {
  font-weight: 700;
}

.brand-name .brand-consulting {
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.25em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
}

.nav a[aria-current="page"],
.nav a.is-active {
  color: var(--text);
  border-bottom: 2px solid rgba(47, 93, 110, 0.55);
  padding-bottom: 3px;
  text-decoration: none;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: #eef2f5;
  text-decoration: none;
}

.btn-primary {
  border-color: var(--brand-ink);
  background: var(--brand);
  color: #f4f8fa;
}

.btn-primary:hover {
  background: var(--brand-ink);
  color: #fff;
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #f4f6f8;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* —— Full-bleed hero —— */
.hero-bleed {
  position: relative;
  min-height: min(92vh, 820px);
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #f4f6f8;
}

.hero-bleed__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bleed__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.06);
  animation: heroKen 28s ease-in-out infinite alternate;
}

.hero-bleed__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(105deg, rgba(20, 24, 31, 0.94) 0%, rgba(20, 24, 31, 0.82) 38%, rgba(20, 24, 31, 0.45) 100%),
    linear-gradient(0deg, rgba(20, 24, 31, 0.5) 0%, transparent 50%);
}

.hero-bleed__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 72px 0 64px;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 7vw, 4.75rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  max-width: 14ch;
  opacity: 0;
  transform: translateY(18px);
  animation: riseIn 0.9s ease forwards 0.1s;
}

.hero-bleed h1 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 22ch;
  color: #e8eef3;
  opacity: 0;
  transform: translateY(18px);
  animation: riseIn 0.9s ease forwards 0.28s;
}

.hero-bleed .lead {
  margin-top: 16px;
  color: rgba(232, 238, 243, 0.82);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 42ch;
  opacity: 0;
  transform: translateY(18px);
  animation: riseIn 0.9s ease forwards 0.42s;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(18px);
  animation: riseIn 0.9s ease forwards 0.55s;
}

@keyframes riseIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroKen {
  from {
    transform: scale(1.06) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.12) translate3d(-1.5%, -1%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-bleed__media img {
    animation: none;
    transform: scale(1.04);
  }

  .hero-brand,
  .hero-bleed h1,
  .hero-bleed .lead,
  .hero-actions,
  .reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* —— Sections —— */
.section {
  padding: 56px 0;
}

.section-title {
  margin-bottom: 28px;
  max-width: 40rem;
}

.section-title h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.section-title p {
  color: var(--muted);
  margin: 0;
  font-size: 1.05rem;
}

h1,
h2,
h3 {
  margin: 0;
}

.lead {
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 65ch;
}

/* De-carded services */
.service-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}

.service-item {
  padding: 28px 24px 28px 0;
  border-bottom: 1px solid var(--line);
}

.service-item + .service-item {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.service-item h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.015em;
}

.service-item p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 900px) {
  .service-list {
    grid-template-columns: 1fr;
  }

  .service-item,
  .service-item + .service-item {
    padding: 22px 0;
    border-left: 0;
  }
}

/* Work rows */
.work-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.work-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.work-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.work-row:nth-child(even) {
  grid-template-columns: 0.85fr 1.15fr;
}

.work-row:nth-child(even) .work-row__media {
  order: 2;
}

.work-row:nth-child(even) .work-row__body {
  order: 1;
}

.work-row__media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  aspect-ratio: 16 / 10;
  background: #d5dde5;
}

.work-row__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.6s ease;
}

.work-row__media:hover img {
  transform: scale(1.03);
}

.work-row__logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 14px;
}

.work-row__logo--mark {
  width: 48px;
  height: 48px;
  max-width: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 24, 31, 0.12);
}

.work-row__logo--wide {
  height: auto;
  width: min(100%, 260px);
  max-width: 260px;
  max-height: 88px;
  border-radius: 8px;
  object-fit: contain;
  object-position: left center;
  background: #000;
  box-shadow: 0 1px 3px rgba(20, 24, 31, 0.12);
}

.work-row h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.work-row p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.65;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.work-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.work-link {
  font-weight: 600;
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .work-row,
  .work-row:nth-child(even) {
    grid-template-columns: 1fr;
  }

  .work-row:nth-child(even) .work-row__media,
  .work-row:nth-child(even) .work-row__body {
    order: unset;
  }
}

/* Skills */
.tagrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  background: transparent;
  padding: 7px 12px;
  border-radius: var(--radius);
}

.skills-block {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.skills-block .lead {
  margin-top: 18px;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}

.contact-grid h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2rem);
  margin-bottom: 10px;
}

.contact-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.75;
}

.contact-list li {
  margin: 6px 0;
}

.contact-note {
  margin-top: 18px;
  color: var(--faint);
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* Footer */
footer {
  border-top: 1px solid var(--line);
  margin-top: 0;
  padding: 28px 0 40px;
  color: var(--faint);
  background: rgba(232, 238, 243, 0.65);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 14px;
  align-items: start;
}

.footer-grid strong {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-note {
  font-size: 13px;
  color: var(--faint);
  line-height: 1.6;
}

/* Content / legal pages */
.page {
  padding: 28px 0 40px;
}

.page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  margin-top: 12px;
  letter-spacing: -0.02em;
}

.breadcrumbs {
  margin: 6px 0 10px;
  color: var(--faint);
  font-size: 13px;
}

.prose {
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.7;
}

.prose h2,
.prose h3 {
  font-family: var(--font-display);
  color: var(--text);
  margin: 1.4em 0 0.5em;
}

.prose a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

/* Legacy helpers still used on privacy pages */
.hero {
  padding: 24px 0 10px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.hero-grid-stack {
  grid-template-columns: 1fr;
}

.eyebrow {
  display: none;
}

.panel {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 18px 0;
  box-shadow: none;
}

.panel h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: var(--text);
}

.stub-note {
  border: 0;
  border-left: 3px solid var(--brand);
  background: transparent;
  padding: 4px 0 4px 14px;
  color: var(--muted);
  line-height: 1.65;
}

.contact-email {
  display: inline-block;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--brand-ink);
  background: var(--brand);
  color: #f4f8fa;
  font-weight: 700;
}

.contact-email:hover {
  background: var(--brand-ink);
  color: #fff;
  text-decoration: none;
}

.cta-band {
  margin-top: 20px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  padding-top: 18px;
}

@media (max-width: 900px) {
  .container {
    padding: 0 16px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    z-index: 30;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .nav a:last-child {
    border-bottom: 0;
  }

  .nav a[aria-current="page"],
  .nav a.is-active {
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    background: var(--bg2);
  }

  .section {
    padding: 40px 0;
  }

  .hero-bleed {
    min-height: min(88vh, 680px);
  }

  .hero-bleed__content {
    padding: 56px 0 48px;
  }
}
