/* =====================================================================
   Jain, Neil & Ruddy — Solicitors & Notaries, Glasgow
   Editorial establishment. Ivory paper, ink, single heritage-green accent.
   ===================================================================== */

:root {
  --paper:      #F4F0E8;
  --paper-2:    #EBE5D8;
  --ink:        #1A1B16;
  --ink-soft:   #44463C;
  --muted:      #7B7C70;
  --accent:     #2C4A3B;   /* deep heritage green */
  --accent-2:   #1B3326;   /* darker green */
  --line:       rgba(26, 27, 22, 0.14);
  --line-soft:  rgba(26, 27, 22, 0.08);

  --font-display: 'Archivo', -apple-system, system-ui, sans-serif;
  --font-serif:   'Archivo', -apple-system, system-ui, sans-serif;
  --font-sans:    'Archivo', -apple-system, system-ui, sans-serif;

  --gutter: clamp(20px, 5vw, 96px);
  --maxw: 1480px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }

::selection { background: var(--accent); color: var(--paper); }

/* grain overlay */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ----------------------------------------------------------- type */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow.light { color: rgba(244, 240, 232, 0.7); }

.display-2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.028em;
}
.display-2.light { color: var(--paper); }

.display-3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -0.025em;
  line-height: 1.05;
}

/* ----------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 600; letter-spacing: 0.02em;
  padding: 15px 30px;
  background: var(--accent); color: var(--paper);
  border: 1px solid var(--accent);
  border-radius: 2px;
  cursor: pointer;
  transition: background .4s var(--ease), color .4s var(--ease), transform .4s var(--ease);
}
.btn:hover { background: var(--accent-2); transform: translateY(-2px); }
.btn-sm { padding: 11px 20px; font-size: 13px; }
.btn-light { background: var(--paper); color: var(--accent-2); border-color: var(--paper); align-self: flex-start; }
.btn-light:hover { background: #fff; }

.link-arrow {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
  transition: border-color .4s var(--ease), gap .4s var(--ease);
}
.link-arrow span { transition: transform .4s var(--ease); }
.link-arrow:hover { border-color: var(--accent); }
.link-arrow:hover span { transform: translateX(5px); }

/* ====================================================================
   HEADER
   ==================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .5s var(--ease), border-color .5s var(--ease), backdrop-filter .5s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(244, 240, 232, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 var(--gutter);
  height: 84px;
  display: flex; align-items: center; gap: 40px;
  transition: height .5s var(--ease);
}
.site-header.scrolled .header-inner { height: 66px; }

.brand {
  display: flex; flex-direction: column; margin-right: auto;
  line-height: 1; gap: 4px;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.025em;
  color: var(--ink);
  transition: font-size .5s var(--ease);
}
.brand-sub {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 9.4px;
  letter-spacing: 0.135em;
  text-transform: uppercase;
  color: var(--muted);
  transition: font-size .5s var(--ease);
}
.site-header.scrolled .brand-name { font-size: 18px; }
.site-header.scrolled .brand-sub { font-size: 8.8px; }
@media (max-width: 720px) {
  .brand-name { font-size: 17px; }
  .brand-sub { font-size: 8.4px; letter-spacing: 0.12em; }
}

.nav { display: flex; gap: 34px; }
.nav a {
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--ink-soft);
  position: relative; padding: 6px 0;
  transition: color .3s var(--ease);
}
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

@media (max-width: 940px) {
  .nav, .header-cta { display: none; }
}

.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 30px; height: 20px; position: relative; margin-left: auto;
}
.menu-toggle span {
  position: absolute; left: 0; width: 100%; height: 1.5px; background: var(--ink);
  transition: transform .4s var(--ease), opacity .3s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 4px; }
.menu-toggle span:nth-child(2) { bottom: 4px; }
.menu-toggle.open span:nth-child(1) { top: 9px; transform: rotate(45deg); }
.menu-toggle.open span:nth-child(2) { bottom: 9px; transform: rotate(-45deg); }
@media (max-width: 940px) { .menu-toggle { display: block; } }

/* mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: var(--paper);
  padding: 120px var(--gutter) 60px;
  display: flex; flex-direction: column; justify-content: space-between;
  transform: translateY(-100%);
  transition: transform .6s var(--ease);
  visibility: hidden;
}
.mobile-menu.open { transform: translateY(0); visibility: visible; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 6px; }
.mobile-menu nav a {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(32px, 8.5vw, 52px);
  line-height: 1.25; letter-spacing: -0.035em;
  border-bottom: 1px solid var(--line-soft); padding: 14px 0;
}
.mobile-menu-meta { display: flex; flex-direction: column; gap: 8px; font-family: var(--font-sans); font-size: 16px; color: var(--accent); }

/* ====================================================================
   HERO
   ==================================================================== */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(140px, 17vh, 220px) var(--gutter) 0;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.55fr 0.9fr;
  gap: clamp(40px, 6vw, 110px);
  align-items: end;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; gap: 56px; } }

.hero-lead .eyebrow { margin-bottom: 32px; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 680;
  font-size: clamp(44px, 8.2vw, 132px);
  line-height: 0.94;
  letter-spacing: -0.045em;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line span { display: block; }
.hero-title .line:last-child span { color: var(--accent); }

.hero-sub {
  margin-top: 36px;
  max-width: 50ch;
  font-size: clamp(18px, 1.4vw, 21px);
  color: var(--ink-soft);
  line-height: 1.6;
}
.hero-actions { margin-top: 44px; display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }

/* aside */
.hero-aside {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex; flex-direction: column;
}
.aside-row {
  display: grid; grid-template-columns: 92px 1fr; gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}
.aside-k {
  font-family: var(--font-sans);
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); padding-top: 3px;
}
.aside-v { font-size: 15.5px; line-height: 1.45; }
.aside-v a { color: var(--accent); border-bottom: 1px solid transparent; transition: border-color .3s; }
.aside-v a:hover { border-color: var(--accent); }

/* colonnade */
.colonnade {
  width: 100%; height: clamp(60px, 9vw, 120px);
  margin-top: clamp(60px, 9vh, 110px);
  overflow: visible;
}
.colonnade-lines line { stroke: var(--line); stroke-width: 1; }

/* ====================================================================
   MARQUEE
   ==================================================================== */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 22px 0;
  white-space: nowrap;
}
.marquee-track {
  display: inline-flex; gap: 28px; align-items: center;
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
  will-change: transform;
}
.marquee-track span:nth-child(even) { color: var(--accent); }

/* ====================================================================
   SECTIONS — generic
   ==================================================================== */
section { max-width: var(--maxw); margin: 0 auto; padding: clamp(90px, 13vh, 180px) var(--gutter); }

.section-head { margin-bottom: clamp(40px, 6vh, 80px); }
.section-head.split {
  display: flex; justify-content: space-between; align-items: baseline; gap: 30px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 22px;
}
.section-note {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(16px, 1.4vw, 19px); color: var(--ink-soft); max-width: 42ch; text-align: right;
  letter-spacing: -0.01em;
}
@media (max-width: 640px) { .section-note { text-align: left; } }

/* ----------------------------------------------------------- FIRM */
.firm-grid {
  display: grid; grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(40px, 6vw, 100px); align-items: start;
}
@media (max-width: 900px) { .firm-grid { grid-template-columns: 1fr; gap: 44px; } }

.firm-body p { color: var(--ink-soft); margin-bottom: 22px; max-width: 46ch; }

.firm-stats {
  display: flex; gap: clamp(24px, 4vw, 56px);
  margin-top: 44px; padding-top: 30px; border-top: 1px solid var(--line);
}
.firm-stats dt {
  font-family: var(--font-display); font-size: clamp(34px, 4vw, 48px); font-weight: 700;
  letter-spacing: -0.04em; color: var(--accent); line-height: 1;
}
.firm-stats dd {
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 10px;
}

/* ----------------------------------------------------------- PRACTICE (Contents / Departments) */
.departments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--ink);
}
.dept {
  border-bottom: 1px solid var(--line);
  padding: clamp(32px, 3.4vw, 56px) clamp(30px, 3vw, 56px);
}
.dept:nth-child(odd)  { padding-left: 0; }
.dept:nth-child(even) { padding-right: 0; border-left: 1px solid var(--line); }

.dept-head {
  display: flex; align-items: baseline; gap: 14px;
  padding-bottom: clamp(16px, 1.6vw, 22px);
  margin-bottom: clamp(8px, 1vw, 14px);
  border-bottom: 1px solid var(--line);
}
.dept-no {
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; color: var(--accent);
}
.dept-name {
  font-family: var(--font-sans); font-weight: 600;
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-soft);
}

.dept-list { display: flex; flex-direction: column; }
.entry {
  display: block;
  padding: clamp(16px, 1.5vw, 22px) 0;
  border-bottom: 1px solid var(--line-soft);
}
.dept-list li:last-child .entry { border-bottom: none; padding-bottom: 0; }

.entry-name {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(21px, 2vw, 28px); letter-spacing: -0.032em; line-height: 1.08;
  color: var(--ink);
  transition: color .35s var(--ease), transform .45s var(--ease);
}
.entry-arrow {
  font-family: var(--font-sans); font-size: 0.62em; color: var(--accent);
  opacity: 0; transform: translateX(-7px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.entry-scope {
  display: block; margin-top: 9px; max-width: 40ch;
  font-family: var(--font-sans); font-size: 14px; font-weight: 400; line-height: 1.5;
  letter-spacing: 0; color: var(--muted);
}
.entry:hover .entry-name { color: var(--accent); transform: translateX(5px); }
.entry:hover .entry-arrow { opacity: 1; transform: translateX(0); }

@media (max-width: 820px) {
  .departments { grid-template-columns: 1fr; }
  .dept { padding: clamp(28px, 7vw, 44px) 0; }
  .dept:nth-child(even) { padding-left: 0; border-left: none; }
}

/* ----------------------------------------------------------- APPROACH / QUOTE */
.approach {
  text-align: center;
  padding-top: clamp(80px, 12vh, 150px);
  padding-bottom: clamp(80px, 12vh, 150px);
}
.pull-quote {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(38px, 6.4vw, 96px);
  line-height: 1.0; letter-spacing: -0.04em;
  max-width: 15ch; margin: 0 auto;
}
.quote-attr {
  font-family: var(--font-sans); font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-top: 34px;
}
.values {
  display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(16px, 3vw, 44px);
  margin-top: clamp(50px, 7vh, 90px); padding-top: 36px;
  border-top: 1px solid var(--line); max-width: 760px; margin-left: auto; margin-right: auto;
}
.values li {
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}

/* ----------------------------------------------------------- PEOPLE */
.people-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
@media (max-width: 900px) { .people-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .people-grid { grid-template-columns: 1fr; } }

.person {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: background .5s var(--ease);
}
.person:hover { background: var(--paper-2); }

.person-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-2);
}
.person-photo img {
  width: 100%; height: 100%; object-fit: cover;
  /* unify disparate candid photos into a cohesive monochrome treatment */
  filter: grayscale(1) contrast(1.04) brightness(1.03);
  transition: filter .6s var(--ease), transform 1.2s var(--ease);
}
.person-photo::after {
  content: ''; position: absolute; inset: 0;
  background: var(--accent);
  mix-blend-mode: color;
  opacity: 0.32;
  transition: opacity .6s var(--ease);
}
.person:hover .person-photo img { filter: grayscale(0) contrast(1) brightness(1); transform: scale(1.03); }
.person:hover .person-photo::after { opacity: 0; }

/* monogram tile for solicitors without a photo */
.person-photo--mono {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-2);
}
.person-photo--mono::after { display: none; }
.person-photo--mono span {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(40px, 5vw, 60px); letter-spacing: -0.03em;
  color: rgba(244, 240, 232, 0.92);
}

.person-info { padding: clamp(24px, 2.4vw, 34px); display: flex; flex-direction: column; flex: 1; }
.person-no {
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.1em; color: var(--muted);
}
.person h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(21px, 2.2vw, 27px); letter-spacing: -0.025em; margin-top: 20px;
}
.person-role {
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 9px 0 14px;
}
.person-bio { font-size: 15px; color: var(--ink-soft); line-height: 1.55; }

/* ----------------------------------------------------------- OFFICES */
.offices-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(30px, 5vw, 80px);
}
@media (max-width: 720px) { .offices-grid { grid-template-columns: 1fr; gap: 50px; } }
.office { border-top: 2px solid var(--accent); padding-top: 28px; }
.office address {
  font-style: normal; font-size: 18px; line-height: 1.7;
  color: var(--ink-soft); margin: 22px 0 24px;
}
.office-phone {
  font-family: var(--font-sans); font-size: 17px; font-weight: 600; color: var(--accent);
  border-bottom: 1px solid var(--line); padding-bottom: 4px; transition: border-color .3s;
}
.office-phone:hover { border-color: var(--accent); }

/* ----------------------------------------------------------- CONTACT */
.contact {
  background: var(--accent-2); color: var(--paper);
  max-width: none; width: 100%;
  padding-left: 0; padding-right: 0;
}
.contact-grid {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 100px); align-items: start;
}
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; gap: 50px; } }

.contact-lead .display-2 { margin-top: 28px; max-width: 16ch; }
.contact-direct { margin-top: 40px; display: flex; flex-direction: column; gap: 12px; }
.contact-direct a {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -0.02em;
  color: var(--paper); width: fit-content;
  border-bottom: 1px solid rgba(244,240,232,0.25); padding-bottom: 4px;
  transition: border-color .3s;
}
.contact-direct a:hover { border-color: var(--paper); }

/* form */
.contact-form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.field label {
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: rgba(244,240,232,0.6);
}
.field input, .field select, .field textarea {
  background: transparent; border: none; border-bottom: 1px solid rgba(244,240,232,0.28);
  color: var(--paper); font-family: var(--font-serif); font-size: 17px;
  padding: 10px 0; transition: border-color .3s;
}
.field textarea { resize: vertical; }
.field select option { color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-bottom-color: var(--paper);
}
.form-note {
  font-size: 13.5px; color: rgba(244,240,232,0.55); line-height: 1.5; margin-top: 4px;
}

/* ====================================================================
   FOOTER
   ==================================================================== */
.site-footer {
  background: var(--ink); color: var(--paper);
  padding: clamp(60px, 8vh, 90px) var(--gutter) 36px;
}
.footer-top {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap;
  padding-bottom: 50px; border-bottom: 1px solid rgba(244,240,232,0.14);
}
.footer-brand { display: flex; flex-direction: column; gap: 6px; line-height: 1; }
.footer-brand .brand-name { font-size: 26px; color: var(--paper); }
.footer-brand .brand-sub { font-size: 11px; color: rgba(244,240,232,0.55); letter-spacing: 0.16em; }
.footer-nav { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; }
.footer-nav a {
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.04em; color: rgba(244,240,232,0.7); transition: color .3s;
}
.footer-nav a:hover { color: var(--paper); }
.footer-bottom {
  max-width: var(--maxw); margin: 30px auto 0;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-family: var(--font-sans); font-size: 12.5px; color: rgba(244,240,232,0.5);
}

/* ====================================================================
   ANIMATION HELPERS
   ==================================================================== */
.reveal-fade { opacity: 0; }
[data-reveal] { opacity: 0; }
.line span { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-fade, [data-reveal] { opacity: 1 !important; }
  .marquee-track { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}
