/* Rebecca Dunlop Legal — shared styles.
   Design: "Slate, refined" (Nov 2026). Colours are variables below; change them here, not in the pages. */
/* ---------- Fonts (self-hosted, Latin subset; from Google Fonts, SIL Open Font License) ---------- */
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/cormorant-garamond-600.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 300; font-display: swap; src: url("/fonts/lato-300.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/lato-400.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/lato-700.woff2") format("woff2"); }

:root {
  --brand: #2f4058;        /* navy: headings, footer, hero overlay */
  --slate: #5c6c83;        /* secondary labels */
  --slate-light: #a9b3c1;  /* rules under headings */
  --text: #2b2e30;
  --text-soft: #3e4858;
  --on-dark-soft: #d4dae0;
  --page: #eef0f2;         /* grey page background */
  --card: #ffffff;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Lato", "Helvetica Neue", Arial, sans-serif;
  --max: 1180px;
  --radius: 6px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* Layered shadows: a tight contact shadow plus a wide soft one */
  --shadow-1: 0 1px 2px rgba(31, 43, 60, .06), 0 4px 12px -4px rgba(31, 43, 60, .08);
  --shadow-2: 0 2px 4px rgba(31, 43, 60, .06), 0 18px 40px -12px rgba(31, 43, 60, .22);
  /* Fine film grain (tiny SVG noise tile) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Smooth cross-fade between pages (browsers that support it) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: var(--ease); }

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--page) var(--grain);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
a:hover { color: var(--slate); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 32px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--brand); color: #fff; padding: 8px 12px; z-index: 100;
}
.skip-link:focus { left: 8px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 rgba(47, 64, 88, .08);
  transition: box-shadow .4s var(--ease), background-color .4s var(--ease);
}
.site-header.is-scrolled { background: rgba(255, 255, 255, .9); box-shadow: 0 1px 0 rgba(47, 64, 88, .06), 0 10px 30px -18px rgba(31, 43, 60, .35); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 32px; padding-top: 18px; padding-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { width: 48px; height: 48px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-weight: 700; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; color: var(--brand);
}
.brand-sub {
  font-family: var(--serif); font-weight: 600; font-size: 16px;
  letter-spacing: .5em; text-transform: uppercase; color: var(--slate);
}

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 28px; }
.nav a {
  position: relative; display: inline-block; padding: 10px 0;
  font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  text-decoration: none; color: var(--brand);
}
/* Underline that draws in from the left */
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease);
}
.nav a:hover, .nav a:focus-visible, .nav a[aria-current="page"] { color: var(--brand); }
.nav a:hover::after, .nav a:focus-visible::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Menu button (phones and small tablets) ----------
   Only shown when JavaScript is running (html.js); without it the full menu simply shows. */
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .js .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: -10px; padding: 0;
    background: none; border: 0; border-radius: 8px; color: var(--brand); cursor: pointer;
  }
  .js .nav-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
  /* Three lines that turn into a cross */
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 22px; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform .35s var(--ease), opacity .2s var(--ease);
  }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -7px; }
  .nav-toggle-bars::after { top: 7px; }
  .nav-open .nav-toggle-bars { background: transparent; }
  .nav-open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
  .nav-open .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

  .js .site-header .wrap { flex-wrap: nowrap; }
  /* The menu drops down as a panel under the header */
  .js .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 1px 0 rgba(47, 64, 88, .08), 0 18px 30px -18px rgba(31, 43, 60, .35);
    padding: 4px 20px 12px;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .3s var(--ease), transform .35s var(--ease), visibility 0s linear .35s;
  }
  .js .nav-open .nav {
    visibility: visible; opacity: 1; transform: none;
    transition: opacity .3s var(--ease), transform .35s var(--ease), visibility 0s;
  }
  .js .nav ul { flex-direction: column; gap: 0; max-width: var(--max); margin: 0 auto; }
  .js .nav li + li { border-top: 1px solid rgba(47, 64, 88, .08); }
  .js .nav a { display: block; padding: 15px 0; font-size: 15px; }
  .js .nav a::after { display: none; }
}

/* ---------- Hero (navy over the staircase photo) ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  color: #fff; background: var(--brand);
}
/* Layer 1: the staircase photo, drifting very slowly */
.hero::before {
  content: ""; position: absolute; inset: -4%; z-index: -2;
  background: url("/images/stairs.jpg") center / cover no-repeat;
  animation: drift 40s ease-in-out infinite alternate;
}
/* Layer 2: navy wash, a soft light from the top right, and grain */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    var(--grain),
    radial-gradient(120% 90% at 85% 0%, rgba(255, 255, 255, .10), transparent 55%),
    linear-gradient(180deg, rgba(47, 64, 88, .84), rgba(38, 53, 74, .92));
}
@keyframes drift {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to   { transform: scale(1.06) translate3d(-1.5%, -1%, 0); }
}
.hero .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 40px 64px;
  padding-top: 96px; padding-bottom: 96px;
}
.hero-photo {
  flex: 0 0 auto; width: 340px; height: 340px; object-fit: cover;
  border-radius: 50%; border: 6px solid rgba(255, 255, 255, .16);
  /* Soft light glowing out from behind the photo, plus a gentle drop shadow */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 0 90px 24px rgba(255, 255, 255, .10), 0 30px 60px -24px rgba(8, 14, 24, .55);
  animation: settle 1.1s var(--ease) both;
}
/* Hero entrance: label, heading and intro rise in one after another */
.hero-text > * { animation: rise .9s var(--ease) backwards; }
.hero-text > :nth-child(2) { animation-delay: .12s; }
.hero-text > :nth-child(3) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes settle { from { opacity: 0; transform: scale(.96); } }

h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.hero-text { flex: 999 1 480px; min-width: 0; }
.eyebrow {
  margin: 0 0 12px; font-family: var(--serif); font-weight: 600; font-size: 22px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-soft);
}
.hero h1 {
  margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: clamp(36px, 4.6vw, 64px); line-height: 1.08;
}
.hero p.lede { margin: 28px 0 0; max-width: 640px; font-weight: 300; font-size: 19px; }

/* Page banner: the hero without the photo (for any future inner page) */
.hero.banner .wrap { padding-top: 64px; padding-bottom: 64px; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section.white { background: var(--card); }
/* Bio flows straight into Contact: tighter gap between them */
#rebecca.section { padding-bottom: 56px; }
#contact.section { padding-top: 56px; }
/* Practice-area boxes flow into the bio: tighter gap between them too */
/* Same gap above the boxes (from the navy banner) as below them (to the bio) */
.section:has(.grid-3) { padding-top: 54px; padding-bottom: 27px; }
#rebecca.section { padding-top: 27px; }
.section-title {
  margin: 0 0 12px; text-align: center;
  font-family: var(--serif); font-weight: 600; font-size: 42px; line-height: 1.15; color: var(--brand);
}
.section-title::after {
  content: ""; display: block; width: 56px; height: 3px;
  background: var(--slate-light); margin: 16px auto 48px;
}

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.card {
  position: relative; overflow: hidden;
  background: var(--card); padding: 36px 32px 40px;
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
/* A thin navy line that draws across the top on hover */
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--brand); transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.card:hover::before { transform: scaleX(1); }
.card h2 { margin: 0 0 14px; font-size: 21px; font-weight: 700; color: var(--brand); }
.card p { margin: 0 0 18px; color: var(--text-soft); }
.card ul { margin: 0; padding-left: 20px; font-weight: 300; color: var(--text-soft); }

/* ---------- Bio ---------- */
.role {
  margin: 0 0 12px; font-size: 14px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--slate);
}

/* ---------- Scroll reveal (classes added by /site.js; without it everything simply shows) ---------- */
.reveal:not(.is-in) { opacity: 0; }
.reveal.is-in { animation: rise .8s var(--ease) var(--d, 0ms) backwards; }

/* Full bio card (home page) */
.person {
  display: grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: center;
  background: var(--card); padding: 40px; border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin: 0 0 24px; /* full width, so its edges line up with the practice boxes */
}
.person:last-child { margin-bottom: 0; }
/* Portrait (4:5), soft corners. The photo file is already cropped to 4:5 with headroom */
.person img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5;
  object-fit: cover; object-position: 50% 50%;
  border-radius: var(--radius); box-shadow: var(--shadow-2);
}
/* Short rule between "Principal" and the bio */
.person .role::after {
  content: ""; display: block; width: 56px; height: 3px; margin: 18px 0 20px; background: var(--slate-light);
}
.person h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 32px; color: var(--brand); }
.person p { margin: 0 0 14px; font-weight: 300; color: var(--text-soft); }

/* ---------- Contact tiles ---------- */
.contact-title {
  margin: 0 0 32px; font-family: var(--serif); font-weight: 600; font-size: 36px; color: var(--brand);
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin: 0; }
.tile {
  background: var(--card); padding: 24px 28px; border-radius: var(--radius); box-shadow: var(--shadow-1);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.tile dt {
  margin: 0 0 6px; font-family: var(--serif); font-weight: 600; font-size: 16px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--slate);
}
.tile dd { margin: 0; font-size: 19px; font-weight: 700; color: var(--brand); overflow-wrap: anywhere; }
.tile a { text-decoration: none; }
.tile a:hover { text-decoration: underline; }

/* ---------- Privacy / 404 text pages ---------- */
.prose {
  background: var(--card); max-width: 856px; margin: 48px auto; padding: 48px 56px 56px;
  border-radius: var(--radius); box-shadow: var(--shadow-1); font-size: 16px;
}
.prose h1 { font-family: var(--serif); font-weight: 600; font-size: 40px; color: var(--brand); margin: 0 0 8px; line-height: 1.1; }
.prose h2 { font-size: 18px; font-weight: 700; color: var(--brand); margin: 32px 0 8px; }
.prose h3 { font-size: 16px; font-weight: 700; font-style: italic; margin: 20px 0 6px; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose .meta { color: var(--slate); font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand) var(--grain); color: var(--on-dark-soft); font-size: 14px; }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between;
  padding-top: 28px; padding-bottom: 28px;
}
.site-footer p { margin: 0; }
.site-footer a { color: #fff; font-weight: 700; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  /* Compact header on phones: it stays pinned, and the menu sits behind the button */
  .site-header .wrap { padding-top: 12px; padding-bottom: 12px; }
  html { scroll-padding-top: 80px; }
  .brand img { width: 44px; height: 44px; }
  .brand-name { font-size: 18px; }
  .brand-sub { font-size: 15px; }
  .nav ul { gap: 0 18px; }
  .nav a { font-size: 13px; padding: 8px 0; }
  .hero .wrap { padding-top: 48px; padding-bottom: 56px; justify-content: center; text-align: center; }
  .hero-photo { width: 220px; height: 220px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 0 60px 14px rgba(255, 255, 255, .10), 0 24px 48px -20px rgba(8, 14, 24, .55); }
  .hero p.lede { font-size: 17px; }
  .section { padding: 56px 0; }
  #rebecca.section { padding-bottom: 40px; }
  #contact.section { padding-top: 40px; }
  .section:has(.grid-3) { padding-top: 36px; padding-bottom: 18px; }
  #rebecca.section { padding-top: 18px; }
  .section-title { font-size: 34px; }
  .card { padding: 28px 22px 32px; }
  .person { grid-template-columns: 1fr; padding: 22px 22px 32px; gap: 24px; }
  .person img { max-width: 420px; }
  .prose { margin: 24px auto; padding: 32px 22px 40px; }
}

/* ---------- Respect "reduce motion" settings: no drift, rises, lifts or page fades ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal:not(.is-in) { opacity: 1; }
  .card:hover, .tile:hover { transform: none; }
  @view-transition { navigation: none; }
}
