/* ============================================================
   San Pedro Fiduciary Services — "The Register"
   Palette:
     --navy   #1C244B  deep authority
     --paper  #F7F4EE  warm ledger paper
     --ink    #232A33  body text
     --brass  #9A7B4F  restrained fiduciary accent (rules + seal only)
   Type: Fraunces (display serif) + Inter (body)
   ============================================================ */

:root {
  --navy: #1c244b;
  --navy-deep: #141a38;
  --paper: #f7f4ee;
  --paper-dim: #efe9df;
  --ink: #232a33;
  --ink-soft: #55606e;
  --brass: #9a7b4f;
  --brass-light: #c2a878;
  --white: #ffffff;
  --line: rgba(35, 42, 51, 0.14);

  --wrap: 1120px;
  --gutter: clamp(1.25rem, 5vw, 3rem);

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

  --radius: 3px;
  --shadow: 0 18px 50px -24px rgba(20, 26, 56, 0.45);
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* safety against sub-pixel overflow */
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

img { max-width: 100%; display: block; }
a { color: var(--navy); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

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

/* ---------- Shared type ---------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--navy);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--brass);
  display: inline-block;
}
.eyebrow--light { color: var(--brass-light); }
.eyebrow--light::before { background: var(--brass-light); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  padding: 0.9rem 1.65rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-primary:hover {
  background: var(--navy-deep);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgba(20, 26, 56, 0.7);
}
.btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(247, 244, 238, 0.4);
}
.btn-ghost:hover {
  border-color: var(--paper);
  background: rgba(247, 244, 238, 0.08);
}
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 238, 0.9);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--navy);
}
.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--navy);
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  border: 1px solid var(--navy);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(194, 168, 120, 0.5);
  border-radius: 1px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--serif); font-weight: 500; font-size: 1.08rem; color: var(--navy); }
.brand-sub { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }

.site-nav { display: flex; align-items: center; gap: 0.5rem; }
.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.96rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
}
.site-nav a:hover { color: var(--navy); background: var(--paper-dim); }
.site-nav .nav-cta {
  background: var(--navy);
  color: var(--paper);
}
.site-nav .nav-cta:hover { background: var(--navy-deep); color: var(--paper); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: var(--paper);
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(105deg, rgba(20, 26, 56, 0.94) 0%, rgba(20, 26, 56, 0.78) 55%, rgba(20, 26, 56, 0.62) 100%),
    url("images/hero.jpg") center/cover no-repeat;
}
.hero-inner {
  padding-block: clamp(4.5rem, 12vw, 8.5rem);
  max-width: 780px;
}
#hero-title {
  color: var(--paper);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.hero-lede {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: rgba(247, 244, 238, 0.86);
  max-width: 60ch;
  margin: 0 0 2.25rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------- Duty band (signature) ---------- */
.duty {
  background: var(--navy);
  color: var(--paper);
  border-top: 1px solid rgba(194, 168, 120, 0.35);
  border-bottom: 1px solid rgba(194, 168, 120, 0.35);
}
.duty-inner { padding-block: clamp(2.25rem, 5vw, 3.25rem); }
.duty-text {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 400;
  line-height: 1.4;
  max-width: 46ch;
  margin: 0;
  color: rgba(247, 244, 238, 0.95);
}
.duty-text em { color: var(--brass-light); font-style: italic; }

/* ---------- Section heads ---------- */
.section-head { max-width: 620px; margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.85rem); margin-bottom: 0.85rem; }
.section-intro { color: var(--ink-soft); font-size: 1.1rem; margin: 0; }

/* ---------- Services register ---------- */
.services { padding-block: clamp(4rem, 9vw, 7rem); }
.register {
  border-top: 1px solid var(--line);
}
.entry {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
  border-bottom: 1px solid var(--line);
}
.entry-media {
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
}
.entry-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  filter: saturate(0.92);
}
.entry:hover .entry-media img { transform: scale(1.04); }
.entry-body { max-width: 56ch; }
.entry-body h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  margin-bottom: 0.6rem;
}
.entry-body p { color: var(--ink-soft); margin: 0; }

/* ---------- About ---------- */
.about {
  background: var(--paper-dim);
  padding-block: clamp(4rem, 9vw, 7rem);
  border-block: 1px solid var(--line);
}
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.about-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.about-media img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.about-body h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin-bottom: 1rem; }
.about-body p { color: var(--ink-soft); }

.service-list {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.service-list li {
  position: relative;
  padding-left: 1.75rem;
  font-weight: 500;
  color: var(--ink);
}
.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 9px;
  height: 9px;
  border: 1px solid var(--brass);
  transform: rotate(45deg);
}

/* ---------- License seal (signature credential) ---------- */
.seal {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 2.25rem 0 0;
  padding: 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brass);
  border-radius: var(--radius);
}
.seal-badge {
  flex: none;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--navy) 0 54%, transparent 54%),
    conic-gradient(from 0deg, var(--brass), var(--brass-light), var(--brass));
  color: var(--paper);
  position: relative;
  text-align: center;
}
.seal-badge::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(247, 244, 238, 0.5);
  border-radius: 50%;
}
.seal-ring {
  position: absolute;
  font-size: 0; /* hide raw text; decorative ring only */
}
.seal-num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  z-index: 1;
}
.seal-num::before {
  content: "#";
  font-size: 0.85rem;
  vertical-align: super;
  color: var(--brass-light);
}
.seal-caption { display: flex; flex-direction: column; gap: 0.15rem; }
.seal-caption strong { font-family: var(--serif); font-size: 1.2rem; color: var(--navy); font-weight: 600; }
.seal-caption span { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Contact ---------- */
.contact { padding-block: clamp(4rem, 9vw, 7rem); }
.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.contact-info h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); margin-bottom: 1rem; }
.contact-blurb { color: var(--ink-soft); margin-bottom: 2rem; }
.contact-details {
  margin: 0;
  display: grid;
  gap: 1.4rem;
}
.contact-details > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.contact-details dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  padding-top: 0.2rem;
}
.contact-details dd { margin: 0; font-weight: 500; }
.contact-details a { text-decoration: none; }
.contact-details a:hover { text-decoration: underline; }

/* ---------- Form ---------- */
.contact-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow);
}
.hp { position: absolute; left: -9999px; }
.field { margin-bottom: 1.2rem; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin-bottom: 0.45rem;
}
.field .opt { font-weight: 400; color: var(--ink-soft); letter-spacing: 0; }
.field input,
.field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  padding: 0.75rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(28, 36, 75, 0.12);
}
.field textarea { resize: vertical; min-height: 120px; }
.form-note {
  margin: 1rem 0 0;
  font-size: 0.92rem;
  min-height: 1.2em;
}
.form-note.is-ok { color: #2f6b3f; }
.form-note.is-err { color: #a3372b; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: rgba(247, 244, 238, 0.78);
  padding-block: 2.75rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 0.9rem; }
.footer-brand .brand-mark { background: var(--paper); color: var(--navy); border-color: var(--paper); }
.footer-brand .brand-mark::after { border-color: rgba(154, 123, 79, 0.6); }
.footer-name { font-family: var(--serif); font-size: 1.1rem; color: var(--paper); margin: 0; }
.footer-meta { font-size: 0.85rem; margin: 0.15rem 0 0; }
.footer-legal { font-size: 0.82rem; line-height: 1.6; margin: 0; text-align: right; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .about-inner { grid-template-columns: 1fr; }
  .about-media { order: -1; max-width: 480px; }
  .contact-inner { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; }
  .entry-media { max-width: 420px; aspect-ratio: 16 / 9; }
}

@media (max-width: 620px) {
  .brand-sub { display: none; }
  .brand-name { font-size: 1rem; }
  .site-nav { gap: 0.15rem; }
  .site-nav a:not(.nav-cta) { padding-inline: 0.5rem; font-size: 0.9rem; }
  .site-nav .nav-cta { padding-inline: 0.85rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-legal { text-align: left; }
  .seal { flex-direction: column; align-items: flex-start; text-align: left; }
  .contact-details > div { grid-template-columns: 1fr; gap: 0.25rem; }

  /* Stack hero buttons so nothing is clipped on narrow screens */
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
}

@media (max-width: 400px) {
  .site-nav a:not(.nav-cta) { padding-inline: 0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
