/* Suttons Wharf Residents' Association — site styles
   Palette pulled from the estate itself: buff brick, dark cladding,
   white render, canal-side sky. */

:root {
  --paper: #f7f4ee;
  --paper-2: #efe9dd;
  --ink: #1e2126;
  --ink-2: #4b5260;
  --muted: #7a8290;
  --line: #e2dccf;
  --brick: #b8924e;
  --brick-deep: #8a6a30;
  --brick-tint: #f3e9d6;
  --slate: #2f3a4a;
  --sky: #2b4c7e;
  --white: #ffffff;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --measure: 66ch;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(30, 33, 38, 0.06), 0 10px 30px -12px rgba(30, 33, 38, 0.18);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--sky); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brick-deep); }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }

.wrap { width: min(100% - 2.5rem, 1080px); margin-inline: auto; }
.prose { max-width: var(--measure); }

.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brick-deep);
  margin-bottom: .9rem;
}

/* ---------------------------------------------------------- header */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  padding: 1.25rem 0;
  transition: background .25s ease, box-shadow .25s ease, padding .25s ease;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header.solid { position: sticky; top: 0; }
.site-header:is(.solid, .scrolled) {
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 20px -14px rgba(30, 33, 38, .25);
}
.site-header.scrolled { padding: .85rem 0; }

.wordmark { display: inline-flex; flex-direction: column; text-decoration: none; line-height: 1.05; }
.wordmark .name { white-space: nowrap; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--white); letter-spacing: -0.01em; text-shadow: 0 1px 12px rgba(0,0,0,.45); }
.wordmark .sub { white-space: nowrap; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.9); margin-top: .25rem; text-shadow: 0 1px 10px rgba(0,0,0,.45); }
:is(.solid, .scrolled) .wordmark .name { color: var(--ink); text-shadow: none; }
:is(.solid, .scrolled) .wordmark .sub { color: var(--muted); text-shadow: none; }

.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { color: var(--white); text-decoration: none; font-weight: 500; font-size: .95rem; white-space: nowrap; text-shadow: 0 1px 10px rgba(0,0,0,.45); }
.nav a:hover { opacity: 1; text-decoration: underline; }
:is(.solid, .scrolled) .nav a { color: var(--ink-2); text-shadow: none; }
:is(.solid, .scrolled) .nav a:hover { color: var(--brick-deep); }
.nav .pill {
  border: 1px solid rgba(255,255,255,.55); padding: .45rem .95rem; border-radius: 999px;
}
:is(.solid, .scrolled) .nav .pill { border-color: var(--line); background: var(--paper); }
@media (max-width: 520px) {
  .site-header { padding: 1rem 0; }
  .site-header .wrap { width: calc(100% - 1.75rem); }
  .wordmark .name { font-size: 1.15rem; }
  .wordmark .sub { font-size: .62rem; letter-spacing: .12em; }
  .nav { gap: 1rem; }
  .nav a { font-size: .88rem; }
  .nav .pill { padding: .4rem .8rem; }
  /* On phones the wordmark + pill is enough; the other links are one tap away. */
  .nav a:not(.pill) { display: none; }
}

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

.hero {
  position: relative; min-height: 78vh; display: grid; align-items: end;
  color: var(--white); isolation: isolate; background: var(--slate);
}
.hero img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; z-index: -2;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, rgba(20, 24, 30, .6) 0%, rgba(20, 24, 30, 0) 28%),
    linear-gradient(to top, rgba(20, 24, 30, .9) 0%, rgba(20, 24, 30, .45) 45%, rgba(20, 24, 30, .12) 100%);
}
.hero .wrap { padding: 4rem 0 3.5rem; }
.hero h1 { color: var(--white); max-width: 14ch; margin-bottom: 1rem; text-wrap: balance; text-shadow: 0 2px 24px rgba(0,0,0,.45); }
.hero .eyebrow { color: #e8cf9a; text-shadow: 0 1px 10px rgba(0,0,0,.5); }
.hero .buildings { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.hero .buildings span {
  display: inline-block; white-space: nowrap;
  font-size: .82rem; font-weight: 500; letter-spacing: .03em; color: rgba(255,255,255,.95);
  padding: .32rem .8rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero .cta { margin-top: 1.75rem; display: flex; gap: .8rem; flex-wrap: wrap; }

/* --------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.25rem; border-radius: 8px; font-weight: 600; font-size: .95rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: var(--sans);
  transition: transform .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brick); color: var(--ink); }
.btn-primary:hover { background: #c9a262; color: var(--ink); }
.btn-ghost { background: rgba(255,255,255,.12); color: var(--white); border-color: rgba(255,255,255,.4); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.2); color: var(--white); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--slate); color: var(--white); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink-2); }
.btn-outline:hover { background: var(--paper-2); color: var(--ink); }
.btn svg { width: 1em; height: 1em; }

/* -------------------------------------------------------- sections */

section { padding: 5rem 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 2.5rem; }
.section-head h2 { text-wrap: balance; }
.section-head .lede { color: var(--ink-2); font-size: 1.1rem; max-width: 60ch; }

/* --------------------------------------------------------- letter */

.letter {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(1.75rem, 5vw, 3.5rem);
  max-width: 760px;
}
.letter .salutation { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 1.4rem; }
.letter p { color: var(--ink); }
.letter ul { padding-left: 1.2rem; margin: 0 0 1.2em; }
.letter li { margin-bottom: .45em; padding-left: .2rem; }
.letter li::marker { color: var(--brick); }
.letter .signoff { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--ink-2); }
.letter .signoff strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 1.1rem; font-weight: 500; }

.callout {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
  background: var(--brick-tint); border-left: 3px solid var(--brick); border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.callout .icon { width: 1.5rem; height: 1.5rem; color: var(--brick-deep); margin-top: .1rem; }
.callout p { margin: 0; }
.callout strong { display: block; margin-bottom: .15rem; }

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

.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .75rem;
}
.card h3 { margin: 0; }
.card p { color: var(--ink-2); margin: 0; }
.card .meta { font-size: .85rem; color: var(--muted); }
.card .actions { margin-top: auto; padding-top: 1rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.card.featured { border-color: var(--brick); background: linear-gradient(180deg, var(--white), var(--brick-tint)); }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); align-self: flex-start;
}
.tag.brick { background: var(--brick); color: var(--ink); }

.lock-panel {
  background: var(--slate); color: var(--white); border-radius: var(--radius);
  padding: clamp(1.75rem, 5vw, 3rem); display: grid; gap: 1.5rem;
  grid-template-columns: 1fr auto; align-items: center;
}
.lock-panel h2 { color: var(--white); margin-bottom: .4rem; }
.lock-panel p { color: rgba(255,255,255,.8); margin: 0; max-width: 52ch; }
@media (max-width: 640px) { .lock-panel { grid-template-columns: 1fr; } }

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

.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--brick-deep); text-decoration: underline; }
.site-footer nav { display: flex; gap: 1.25rem; }

/* -------------------------------------------------- page chrome (inner) */

.page-head { padding: 3rem 0 2rem; }
.page-head h1 { text-wrap: balance; }
.page-head .lede { color: var(--ink-2); font-size: 1.1rem; max-width: 60ch; margin: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brick-deep); }
.crumbs span::before { content: "/"; margin: 0 .5em; opacity: .6; }

/* ----------------------------------------------------- login page */

.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-visual { position: relative; background: var(--slate); isolation: isolate; }
.auth-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,24,30,.8), rgba(20,24,30,.2)); }
.auth-visual .wordmark { position: absolute; left: 2rem; top: 1.75rem; z-index: 1; }
.auth-form { display: grid; place-items: center; padding: 3rem 1.5rem; }
.auth-form form { width: min(100%, 380px); }
.auth-form h1 { font-size: 2rem; margin-bottom: .4rem; }
.auth-form .lede { color: var(--ink-2); margin-bottom: 2rem; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--ink-2); }
input[type="password"], input[type="text"] {
  width: 100%; padding: .8rem .95rem; font: inherit; border-radius: 8px;
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
}
input:focus { outline: 2px solid var(--brick); outline-offset: 1px; border-color: var(--brick); }
.field { margin-bottom: 1.1rem; }
.error {
  display: none; background: #fbe9e7; color: #8a2b21; border: 1px solid #f2c9c4;
  padding: .7rem .9rem; border-radius: 8px; font-size: .9rem; margin-bottom: 1.1rem;
}
.error.show { display: block; }
.auth-form .btn { width: 100%; justify-content: center; }
.auth-form .help { font-size: .85rem; color: var(--muted); margin-top: 1.5rem; }
@media (max-width: 800px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { min-height: 34vh; }
}

/* ---------------------------------------------- constitution (doc) */

.doc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 3rem; align-items: start; padding-bottom: 5rem; }
.doc-toc { position: sticky; top: 1.5rem; font-size: .88rem; }
.doc-toc .eyebrow { margin-bottom: .6rem; }
.doc-toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.doc-toc li a {
  display: block; padding: .35rem 0 .35rem .9rem; color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent; margin-left: -1px;
}
.doc-toc li a:hover { color: var(--brick-deep); border-left-color: var(--brick); }
.doc-toc .dl { margin-top: 1.5rem; display: grid; gap: .5rem; }
.doc { max-width: 72ch; }
.doc h2 { font-size: 1.45rem; margin: 2.6rem 0 .9rem; padding-top: .5rem; scroll-margin-top: 1.5rem; }
.doc h2 .num { color: var(--brick); margin-right: .5em; font-variant-numeric: tabular-nums; }
.doc h2:first-of-type { margin-top: 0; }
.doc .clause { display: grid; grid-template-columns: 3.2rem 1fr; gap: .5rem; margin-bottom: .9rem; }
.doc .clause .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .95rem; padding-top: .1rem; }
.doc .clause p { margin: 0; }
.doc .clause ol { margin: .5rem 0 0; padding-left: 1.6rem; }
.doc .clause ol li { margin-bottom: .35rem; }
.doc .clause ol.alpha { list-style: lower-alpha; }
.doc .clause ol.alpha li::marker { color: var(--muted); }
.doc .plain p { margin-bottom: .9rem; }
.doc .adoption { margin-top: 3rem; padding: 1.5rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.doc .adoption .sig { display: grid; grid-template-columns: 6rem 1fr; gap: .5rem; margin-top: .6rem; color: var(--ink-2); }
.doc .adoption .sig span:last-child { border-bottom: 1px solid var(--line); }
.doc-status {
  display: flex; gap: .75rem; align-items: center; flex-wrap: wrap;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1.1rem; margin-bottom: 2rem; font-size: .92rem; color: var(--ink-2);
}
@media (max-width: 860px) {
  .doc-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .doc-toc { position: static; }
  .doc-toc ol { display: none; }
}

/* ----------------------------------------------------- pdf viewer */

.pdf-frame {
  width: 100%; height: min(80vh, 1000px); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow);
}
.pdf-fallback { text-align: center; padding: 3rem 1rem; }

/* ----------------------------------------------------- utilities */

.stack > * + * { margin-top: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
