/* Sentinel House V16 final stabilization layer. Mobile first, content first. */
:root {
  --content-narrow: 42rem;
  --content-reading: 68ch;
  --tap: 48px;
}
html { overflow-x: clip; scroll-behavior: smooth; }
body { overflow-x: clip; text-rendering: optimizeLegibility; }
main, section, header, footer { min-width: 0; }
img, svg, video, iframe { max-width: 100%; height: auto; }
figure { min-width: 0; }
:where(p, li) { overflow-wrap: anywhere; }
:where(h1,h2,h3,h4) { text-wrap: balance; overflow-wrap: normal; hyphens: none; }
:where(p) { text-wrap: pretty; }
.prose, .chapter-copy, .v7-final-grid > div, .studio-copy { min-width: 0; }
.prose p, .chapter-copy p, .studio-copy p, .v7-final p { max-width: var(--content-reading); }

/* Consistent controls */
.button, button, [role="button"] {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}
.button:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 4px;
}

/* Stable media */
.media-frame, .plymouth-landmark-grid figure, .plymouth-hero-art { overflow: hidden; }
.media-frame img, .plymouth-landmark-grid img, .plymouth-hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.plymouth-landmark-grid figure { display: grid; grid-template-rows: auto 1fr; }
.plymouth-landmark-grid figure img { aspect-ratio: 4 / 3; }
.plymouth-landmark-grid figcaption { position: static; }

/* Mobile header and menu */
.site-header { width: 100%; }
.nav-shell { min-height: 72px; }
.brand-cluster { min-width: 0; }
.brand-wordmark strong { line-height: 1; }
.nav-toggle { width: 48px; height: 48px; flex: 0 0 48px; }
.site-nav {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
body.nav-open { overflow: hidden; }
@media (max-width: 900px) {
  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    padding: calc(92px + env(safe-area-inset-top)) clamp(1rem, 5vw, 2rem) calc(2rem + env(safe-area-inset-bottom));
    max-height: 100dvh;
  }
  .site-nav .nav-primary { display: grid; gap: 0; }
  .site-nav .nav-primary a {
    font-size: clamp(2rem, 11vw, 4rem);
    line-height: .96;
    padding: .65rem 0;
    min-height: 64px;
  }
  .site-nav .nav-secondary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem 1rem; margin-top: 1rem; }
  .site-nav .nav-secondary a { min-height: 44px; display:flex; align-items:center; }
  .site-nav .header-cta { width: 100%; margin-top: 1rem; }
  .nav-toggle { position: relative; z-index: 1001; }
  .division-switcher { display: inline-flex !important; }
}
@media (max-width: 430px) {
  .brand-wordmark { display: none; }
  .site-nav .nav-primary a { font-size: clamp(1.8rem, 10vw, 3.1rem); }
  .site-nav .nav-secondary { grid-template-columns: 1fr; }
}

/* Cards and homepage service blocks are always legible */
.v7-path-grid { align-items: stretch; }
.v7-path { min-width: 0; }
.v7-path:nth-child(1), .v7-path:nth-child(2) { background: var(--v7-ivory, #f4ecdf); color: var(--v7-ink, #161616); }
.v7-path:nth-child(3) { background: #171716; color: #f7f0e5; }
.v7-path:nth-child(4) { background: var(--v7-crimson, #9e1722); color: #fff; }
.v7-path :where(h2,h3,p,a,span,b) { color: inherit; }
.v7-path:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(0,0,0,.12); }

/* Reading rhythm */
section { scroll-margin-top: 88px; }
:where(.section,.chapter-hero,.v7-final,.plymouth-place,.plymouth-landmarks) { padding-block: clamp(3rem, 8vw, 7rem); }
:where(h1) { font-size: clamp(2.6rem, 8vw, 7.5rem); line-height: .94; }
:where(h2) { font-size: clamp(2rem, 5vw, 4.8rem); line-height: 1; }
:where(h3) { line-height: 1.15; }
:where(p,li) { line-height: 1.68; }
.container { width: min(100% - 2rem, 84rem); }

/* Contact email panels */
.inquiry-prompt-list { display: grid; gap: .75rem; padding-left: 1.2rem; }
.form-card { min-width: 0; }
.form-card .button { width: 100%; }

/* Mobile composition */
@media (max-width: 767px) {
  .container { width: min(100% - 1.25rem, 84rem); }
  .chapter-grid, .assessment-grid, .plymouth-contact-grid, .plymouth-place-grid, .v7-final-grid { grid-template-columns: 1fr !important; }
  .chapter-visual, .submission-room { min-height: auto !important; }
  .plymouth-landmark-grid { grid-template-columns: 1fr !important; }
  .v7-path-grid { grid-template-columns: 1fr !important; }
  .v7-path { min-height: auto !important; padding: 1.5rem !important; }
  .mobile-manuscript-cta { left: .75rem; right: .75rem; width: auto; bottom: calc(.75rem + env(safe-area-inset-bottom)); }
  .chapter-rail, .scroll-spine { display: none !important; }
}

/* Large screen discipline */
@media (min-width: 1440px) {
  .container { width: min(100% - 5rem, 90rem); }
  .prose, .chapter-copy { max-width: 52rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* V18 navigation and contrast corrections */
:root {
  --v7-paper: #f3eadc;
  --v7-ivory: #fbf6ed;
  --v7-ink: #171714;
  --v7-crimson: #b51f2a;
  --v7-oxblood: #741018;
  --v7-blue: #17262d;
}

/* Desktop header: no CTA, every destination numbered, no collisions. */
.site-header .nav-shell {
  grid-template-columns: minmax(245px, 300px) minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
}
.site-header .site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.site-header .nav-primary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: clamp(.55rem, 1vw, 1.15rem);
  width: 100%;
  min-width: 0;
}
.site-header .nav-primary a {
  display: inline-flex;
  align-items: baseline;
  gap: .32rem;
  min-width: 0;
  padding: .25rem 0;
  font-size: clamp(.68rem, .72vw, .82rem);
  line-height: 1.15;
  white-space: nowrap;
}
.site-header .nav-primary a::before {
  content: attr(data-chapter);
  flex: 0 0 auto;
  color: var(--v7-crimson);
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.site-header .nav-secondary,
.site-header .header-cta { display: none !important; }

@media (max-width: 1180px) {
  .nav-toggle { display: inline-flex; }
  .site-header .site-nav {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding: calc(92px + env(safe-area-inset-top)) clamp(1rem, 5vw, 2rem) calc(2rem + env(safe-area-inset-bottom));
    background: #111210;
    color: #fff;
    max-height: 100dvh;
  }
  body.nav-open .site-header .site-nav { display: block; }
  .site-header .nav-primary {
    display: grid;
    gap: 0;
    width: 100%;
  }
  .site-header .nav-primary a {
    width: 100%;
    min-height: 64px;
    padding: .7rem 0;
    border-bottom: 1px solid rgba(255,255,255,.16);
    color: #fff;
    font-family: var(--serif);
    font-size: clamp(2rem, 8vw, 4rem);
    line-height: .98;
    white-space: normal;
  }
  .site-header .nav-primary a::before {
    font-family: var(--sans);
    font-size: .7rem;
    color: #ff9d96;
  }
}

@media (min-width: 1181px) {
  .nav-toggle { display: none !important; }
}

/* Founding case study: force a true dark section and full-opacity content. */
body.home-page .v7-case {
  position: relative;
  isolation: isolate;
  background: linear-gradient(108deg, #741018 0 52%, #2d090d 52%) !important;
  color: #fffaf3 !important;
}
body.home-page .v7-case::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(0,0,0,.08), rgba(0,0,0,.22));
}
body.home-page .v7-case :where(.reveal,.is-visible) {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}
body.home-page .v7-case .eyebrow { color: #ffd7d2 !important; opacity: 1 !important; }
body.home-page .v7-case-copy h2 { color: #fffaf3 !important; opacity: 1 !important; }
body.home-page .v7-case-copy h2 span { color: #ffaaa2 !important; }
body.home-page .v7-case-copy > p { color: #fff0ec !important; opacity: 1 !important; }
body.home-page .v7-facts { border-color: rgba(255,255,255,.35) !important; }
body.home-page .v7-facts div { border-color: rgba(255,255,255,.26) !important; }
body.home-page .v7-facts dt { color: #ffaca5 !important; opacity: 1 !important; }
body.home-page .v7-facts dd { color: #fff !important; opacity: 1 !important; }
body.home-page .v7-case .button.signal {
  background: var(--v7-crimson) !important;
  border-color: var(--v7-crimson) !important;
  color: #fff !important;
}
body.home-page .v7-case .button.signal:hover,
body.home-page .v7-case .button.signal:focus-visible {
  background: #8f151e !important;
  border-color: #8f151e !important;
}

/* Author-control promise: deep blue-black field and high-contrast copy. */
body.home-page .v7-rights {
  position: relative;
  isolation: isolate;
  background: #17262d !important;
  color: #fff !important;
}
body.home-page .v7-rights::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(255,255,255,.025), rgba(0,0,0,.18));
}
body.home-page .v7-rights :where(.reveal,.is-visible) {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}
body.home-page .v7-rights .eyebrow { color: #ffb1aa !important; opacity: 1 !important; }
body.home-page .v7-rights h2 { color: #fff !important; opacity: 1 !important; }
body.home-page .v7-rights h2 span { color: #ffaaa2 !important; }
body.home-page .v7-rights p:last-child { color: #edf4f5 !important; opacity: 1 !important; }

/* Preserve earlier fixes that belong in valid CSS. */
body.home-page .v7-manuscript { overflow: hidden; }
body.home-page .v7-manuscript p {
  max-width: 9ch;
  margin: clamp(6rem, 10vw, 8rem) 0 2rem;
  font-size: clamp(3.3rem, 5.3vw, 5.8rem);
  line-height: .9;
  letter-spacing: -.04em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
body.home-page .plymouth-home-art img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transform: none !important;
  filter: none !important;
  image-rendering: auto;
}
body.home-page .v7-fit-no { background: #111210 !important; color: #fff !important; }
body.home-page .v7-fit-no > span { color: #ffb1aa !important; }
body.home-page .v7-fit-no li { color: #fff !important; border-color: rgba(255,255,255,.28) !important; }

.page-studio-project-assessment .studio-form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
}
.page-studio-project-assessment .studio-form-grid > * { min-width: 0; }
.page-studio-project-assessment .studio-form-grid ul {
  list-style: none;
  margin: 2rem 0;
  padding: 0;
}
.page-studio-project-assessment .studio-form-grid ul li {
  display: block;
  padding: .9rem 0;
  border-bottom: 1px solid rgba(23,23,20,.16);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.45;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
.page-studio-project-assessment .studio-project-form {
  display: block;
  padding: clamp(1.75rem, 4vw, 3rem);
}
.page-studio-project-assessment .studio-project-form > * + * { margin-top: 1.2rem; }
.page-studio-project-assessment .studio-project-form p,
.page-studio-project-assessment .studio-form-grid p {
  max-width: 58ch;
  overflow-wrap: normal;
  word-break: normal;
}

@media (max-width: 900px) {
  .page-studio-project-assessment .studio-form-grid { grid-template-columns: 1fr; }
  body.home-page .v7-manuscript p { font-size: clamp(2.8rem, 12vw, 4.6rem); margin-top: 3rem; }
}


/* V19 LIVE FIXES: header, contrast, fit panel, and CTA cleanup */
:root {
  --v19-case: #5d0b14;
  --v19-rights: #102028;
  --v19-black: #0d0e0d;
}

/* Header: uploaded logo, compact division switcher, eight visible numbered links. */
.site-header .nav-shell {
  width: min(100% - 2rem, 1560px) !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: clamp(1rem, 2vw, 2rem) !important;
  align-items: center !important;
  min-height: 78px !important;
}
.site-header .brand-cluster {
  display: inline-flex !important;
  align-items: center !important;
  gap: .55rem !important;
  min-width: max-content !important;
}
.site-header a.brand {
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  padding: 0 !important;
}
.site-header .brand-full-logo {
  display: block !important;
  width: clamp(132px, 11vw, 166px) !important;
  height: auto !important;
  aspect-ratio: 573 / 253 !important;
  object-fit: contain !important;
}
.site-header .division-switcher {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  gap: .38rem !important;
  white-space: nowrap !important;
  font-size: .66rem !important;
  letter-spacing: .1em !important;
}
.site-header .site-nav {
  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
}
.site-header .nav-primary {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: clamp(.55rem, .9vw, 1.05rem) !important;
  min-width: 0 !important;
}
.site-header .nav-primary a {
  display: inline-flex !important;
  align-items: baseline !important;
  gap: .28rem !important;
  padding: .8rem 0 !important;
  white-space: nowrap !important;
  font-family: var(--font-ui, Manrope, sans-serif) !important;
  font-size: clamp(.69rem, .72vw, .82rem) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: -.01em !important;
}
.site-header .nav-primary a::before {
  content: attr(data-chapter) !important;
  position: static !important;
  transform: none !important;
  color: var(--v7-crimson, #b71828) !important;
  font-size: .62rem !important;
  font-weight: 800 !important;
  letter-spacing: .06em !important;
}
.site-header .header-cta,
.site-header a.button,
.site-header a.signal { display: none !important; }

/* Founding case study: solid field, no low-opacity overlays or reveal residue. */
body.home-page section.v7-case {
  background: var(--v19-case) !important;
  background-image: none !important;
  color: #fff !important;
  opacity: 1 !important;
}
body.home-page section.v7-case::before,
body.home-page section.v7-case::after { display: none !important; }
body.home-page section.v7-case * { text-shadow: none !important; }
body.home-page section.v7-case .v7-case-copy,
body.home-page section.v7-case .reveal,
body.home-page section.v7-case .is-visible {
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}
body.home-page section.v7-case .eyebrow { color: #ffd6cf !important; opacity: 1 !important; }
body.home-page section.v7-case h2,
body.home-page section.v7-case h2 * { color: #fff !important; opacity: 1 !important; }
body.home-page section.v7-case h2 span { color: #ffaaa2 !important; }
body.home-page section.v7-case .v7-case-copy > p { color: #fff4f1 !important; opacity: 1 !important; }
body.home-page section.v7-case .v7-facts { border-color: rgba(255,255,255,.48) !important; }
body.home-page section.v7-case .v7-facts div { border-color: rgba(255,255,255,.38) !important; }
body.home-page section.v7-case .v7-facts dt { color: #ffb1aa !important; opacity: 1 !important; }
body.home-page section.v7-case .v7-facts dd { color: #fff !important; opacity: 1 !important; }

/* Author control: solid blue-black and fully opaque copy. */
body.home-page section.v7-rights {
  background: var(--v19-rights) !important;
  background-image: none !important;
  color: #fff !important;
  opacity: 1 !important;
}
body.home-page section.v7-rights::before { display: none !important; }
body.home-page section.v7-rights .reveal,
body.home-page section.v7-rights .is-visible,
body.home-page section.v7-rights .container {
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}
body.home-page section.v7-rights .eyebrow { color: #ffb1aa !important; opacity: 1 !important; }
body.home-page section.v7-rights h2,
body.home-page section.v7-rights h2 * { color: #fff !important; opacity: 1 !important; }
body.home-page section.v7-rights h2 span { color: #ffaaa2 !important; }
body.home-page section.v7-rights p:last-child { color: #eef7f8 !important; opacity: 1 !important; }

/* Poor-fit panel: black field behind white copy. */
body.home-page .v7-fit-no {
  background: var(--v19-black) !important;
  color: #fff !important;
  opacity: 1 !important;
}
body.home-page .v7-fit-no > span { color: #ffb1aa !important; opacity: 1 !important; }
body.home-page .v7-fit-no li { color: #fff !important; border-color: rgba(255,255,255,.35) !important; opacity: 1 !important; }

/* Decorative manuscript phrase removed in HTML. Keep the object clean. */
body.home-page .v7-manuscript p { display: none !important; }

/* Bottom inquiry modules are removed in HTML; defensive hiding prevents stale fragments. */
.v7-final,
.v7-commercial-cta,
.studio-final,
section:has(> .container.cta-panel) { display: none !important; }

@media (max-width: 1180px) {
  .site-header .nav-shell {
    grid-template-columns: minmax(0,1fr) auto !important;
    min-height: 72px !important;
  }
  .site-header .nav-toggle { display: inline-grid !important; }
  .site-header .site-nav {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999 !important;
    display: none !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    padding: max(5.5rem, env(safe-area-inset-top)) 1.4rem max(2rem, env(safe-area-inset-bottom)) !important;
    background: #111210 !important;
  }
  body.nav-open .site-header .site-nav,
  .site-header .site-nav.open { display: block !important; }
  .site-header .nav-primary {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .site-header .nav-primary a {
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 1rem 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.18) !important;
    color: #fff !important;
    font-family: var(--font-display, serif) !important;
    font-size: clamp(1.8rem, 8vw, 3.6rem) !important;
    line-height: 1 !important;
    white-space: normal !important;
  }
  .site-header .nav-primary a::before {
    min-width: 2.2rem !important;
    color: #ffaaa2 !important;
    font-family: var(--font-ui, sans-serif) !important;
    font-size: .72rem !important;
  }
}

@media (max-width: 560px) {
  .site-header .brand-full-logo { width: 118px !important; }
  .site-header .division-switcher { font-size: .58rem !important; }
  .site-header .brand-cluster { gap: .4rem !important; }
}
