/* ==========================================================================
   144 Duke — 144duke.com
   Palette and type per design brief: Libre Caslon (display/text) +
   Instrument Sans; colors drawn from the building's brick and trim.
   ========================================================================== */

:root {
  --ink: #17242d;            /* Harbor Ink */
  --cream: #faf6ef;          /* Sailcloth Cream */
  --oyster: #efe7db;         /* Oyster */
  --brick: #9e3b26;          /* Duke Brick */
  --teal: #2e6e63;           /* Gloucester Teal */
  --seafoam: #8fbeb4;        /* Trim Seafoam — decorative on light, text on ink */
  --paper: #ffffff;
  --hairline: rgba(23, 36, 45, 0.15);
  --ink-65: rgba(23, 36, 45, 0.72);

  --font-display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --font-serif: "Libre Caslon Text", Georgia, serif;
  --font-sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --container: 1120px;
  --header-h: 76px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

/* ---------- Type ---------- */

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.625rem); }

h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
}

p { margin: 0 0 1.1rem; max-width: 65ch; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-65);
  margin: 0 0 1.1rem;
}

.eyebrow-light { color: var(--cream); opacity: 0.92; }

.lede {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 150ms ease-out;
}

a:hover { color: var(--brick); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Dark contexts need a lighter focus ring (teal fails 3:1 on ink) */
.hero :focus-visible,
.site-header:not(.scrolled) :focus-visible,
.residents-band :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--seafoam);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--brick);
  background: transparent;
  border: 1px solid var(--brick);
  border-radius: 2px;
  padding: 0.9rem 1.75rem;
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}

.button:hover {
  background: var(--brick);
  color: var(--paper);
}

.button-light {
  color: var(--cream);
  border-color: var(--cream);
}

.button-light:hover {
  background: var(--cream);
  color: var(--ink);
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  text-shadow: 0 1px 8px rgba(23, 36, 45, 0.4);
  transition: background-color 200ms ease-out, box-shadow 200ms ease-out;
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  text-decoration: none;
  color: var(--cream);
  line-height: 1.1;
}

.wordmark-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  margin: 0;
}

.wordmark-sub {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 2px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  padding: 0.4rem 0;
}

.nav-menu a:hover { color: var(--seafoam); }

.nav-residents {
  padding-left: 1.9rem;
  border-left: 1px solid rgba(250, 246, 239, 0.35);
}


/* Scrolled state: cream bar, ink text */
.site-header.scrolled {
  background: var(--cream);
  box-shadow: 0 1px 0 var(--hairline);
  text-shadow: none;
}

.site-header.scrolled .wordmark,
.site-header.scrolled .nav-menu a {
  color: var(--ink);
}

.site-header.scrolled .nav-menu a:hover { color: var(--brick); }
.site-header.scrolled .nav-residents { border-left-color: var(--hairline); }

.nav-toggle { display: none; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 92svh;
  display: flex;
  align-items: flex-end;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 40%;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(23, 36, 45, 0.6) 0%, rgba(23, 36, 45, 0) 18%),
    linear-gradient(to right, rgba(23, 36, 45, 0.45) 0%, rgba(23, 36, 45, 0.12) 42%, rgba(23, 36, 45, 0) 62%),
    linear-gradient(to top, rgba(23, 36, 45, 0.68) 0%, rgba(23, 36, 45, 0.28) 38%, rgba(23, 36, 45, 0) 62%);
}

.hero-content {
  position: relative;
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 72px;
  color: var(--cream);
  text-shadow: 0 1px 16px rgba(23, 36, 45, 0.35);
}

.hero-content .button { text-shadow: none; }

.hero-content h1 {
  margin-bottom: 1rem;
  max-width: 14em;
}

.hero-sub {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  max-width: 46ch;
  opacity: 0.95;
  margin-bottom: 1.75rem;
}

.hero-actions { display: flex; gap: 1rem; }

/* ---------- Sections ---------- */

.section {
  padding: 128px 0;
  border-top: 1px solid var(--hairline);
}

.section-oyster { background: var(--oyster); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.statement {
  padding: 112px 0 104px;
}

.statement-text {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.55;
  max-width: 34em;
  margin: 0 auto;
  text-align: center;
  text-wrap: pretty;
}

/* ---------- Split layout ---------- */

.split {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 48px 64px;
  align-items: center;
}

.split-media { grid-column: span 7; margin: 0; }
.split .split-copy { grid-column: span 5; }

.split-reverse .split-media { order: 2; }
.split-reverse .split-copy { order: 1; }

/* Two-copy split (neighborhood) */
.split > .split-copy:first-child { grid-column: span 6; }
.split > .split-copy + .split-copy { grid-column: span 6; align-self: start; }
.split > .split-media + .split-copy { grid-column: span 5; }

/* Signature keyline on real photography */
.keyline { position: relative; }

.keyline::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--seafoam);
  pointer-events: none;
}

/* ---------- Ledger ---------- */

.ledger {
  margin: 2rem 0;
  font-variant-numeric: tabular-nums;
}

.ledger-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 2rem 0 0;
  padding: 0 0 0.7rem;
  border-bottom: 1px solid var(--hairline);
}

.ledger-head span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-65);
}

.ledger-head + .ledger { margin-top: 0; }
.ledger-head + .ledger .ledger-row:first-child { border-top: 0; }

.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--hairline);
}

.ledger-row:first-child { border-top: 1px solid var(--hairline); }

.ledger-row dt {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-65);
  flex-shrink: 0;
}

.ledger-row dd {
  margin: 0;
  text-align: right;
  font-size: 0.95rem;
}

.ledger-walks .ledger-row dd {
  font-weight: 600;
}

.footnote {
  font-size: 0.8rem;
  color: var(--ink-65);
}

/* ---------- Pull quote ---------- */

.pull-quote {
  margin: 2.25rem 0 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--seafoam);
}

.pull-quote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink);
}

/* ---------- Divider ---------- */

.divider {
  line-height: 0;
}

.divider img {
  width: 100%;
  height: clamp(280px, 44vw, 520px);
  object-fit: cover;
}

/* ---------- Gallery row ---------- */

.gallery-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 88px;
}

.gallery-row figure { margin: 0; }

.gallery-row img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.graded img {
  filter: saturate(0.88) sepia(0.05) brightness(1.02);
}

.gallery-row figcaption {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-65);
  margin-top: 0.8rem;
}

/* ---------- Form ---------- */

.inquiry-form {
  background: var(--oyster);
  padding: 40px;
}

.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-65);
  margin-bottom: 0.45rem;
}

.field .optional {
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 400;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 0.75rem 0.9rem;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 0;
  border-color: var(--teal);
}

.field textarea { resize: vertical; }

.honey {
  position: absolute;
  left: -9999px;
  height: 0;
  width: 0;
  border: 0;
  padding: 0;
}

.form-note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  margin: 1.25rem 0 0;
}

.form-note.error { color: var(--brick); }

.contact-direct { margin-top: 2rem; }

/* ---------- Residents band ---------- */

.residents-band {
  background: var(--ink);
  color: var(--cream);
  padding: 44px 0;
}

.residents-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.residents-inner .eyebrow { margin: 0; }

.residents-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.residents-links a {
  color: var(--seafoam);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration-color: rgba(143, 190, 180, 0.5);
}

.residents-links a:hover { color: var(--cream); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: var(--cream);
  border-top: 1px solid rgba(250, 246, 239, 0.16);
  padding: 64px 0 56px;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  font-size: 0.9rem;
}

.footer-inner p { margin-bottom: 0.6rem; }

.footer-inner .wordmark-name { margin-bottom: 0.75rem; }

.footer-inner a { color: var(--seafoam); text-decoration-color: rgba(143, 190, 180, 0.5); }
.footer-inner a:hover { color: var(--cream); }

.footer-legal { justify-self: end; text-align: right; }

.eho {
  color: var(--seafoam);
  margin-left: auto;
  margin-bottom: 0.75rem;
}

.legal-line {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--seafoam);
}

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Anchor offset for fixed header */
section[id], .residents-band {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .section { padding: 88px 0; }

  .split { grid-template-columns: 1fr; gap: 40px; }

  .split-media,
  .split .split-copy,
  .split > .split-copy:first-child,
  .split > .split-copy + .split-copy,
  .split > .split-media + .split-copy {
    grid-column: 1 / -1;
  }

  .split-reverse .split-media { order: 0; }
  .split-reverse .split-copy { order: 0; }

  .gallery-row { grid-template-columns: 1fr; gap: 40px; }

  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-legal { justify-self: start; text-align: left; }
  .eho { margin-left: 0; }
}

@media (max-width: 820px) {
  :root { --header-h: 64px; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: none;
    border: 0;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--cream);
  }

  .site-header.scrolled .nav-toggle,
  .site-header.nav-open .nav-toggle { color: var(--ink); }

  .nav-toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .nav-toggle-bars { display: inline-flex; flex-direction: column; gap: 5px; }

  .nav-toggle-bars span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: currentColor;
    transition: transform 200ms ease-out;
  }

  .site-header.nav-open .nav-toggle-bars span:first-child { transform: translateY(3.25px) rotate(45deg); }
  .site-header.nav-open .nav-toggle-bars span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--hairline);
    padding: 0.5rem 0 1rem;
  }

  .site-header.nav-open { background: var(--cream); box-shadow: 0 1px 0 var(--hairline); }
  .site-header.nav-open .wordmark { color: var(--ink); }
  .site-header.nav-open .nav-menu { display: flex; }

  .nav-menu a {
    display: block;
    color: var(--ink);
    padding: 0.8rem 24px;
  }

  .nav-residents {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--hairline);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  .hero { min-height: 86svh; }
  .hero-content { padding-bottom: 56px; }

  .statement { padding: 72px 0 64px; }

  .inquiry-form { padding: 28px 22px; }

  .residents-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .button, a, .site-header { transition: none; }
}

/* ---------- Print ---------- */

@media print {
  .site-header, .hero-scrim, .inquiry-form, .residents-band { display: none; }
  .hero { min-height: auto; }
  body { background: #fff; }
}
