@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,700;1,400;1,500&family=Playfair+Display+SC:wght@400&display=swap');

/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img { max-width: 100%; display: block; }

/* ─── ONE FONT SYSTEM ─────────────────────────────────
   Playfair Display for everything:
   - Headings: weight 700, large
   - Body: weight 400, normal size
   - Labels/UI: SC variant or tracked weight 400
   ──────────────────────────────────────────────────── */

:root {
  /* Palette — drawn from East Lothian: pale sand, deep firth, sea-glass, warm stone */
  --ink:        #1a1814;       /* near-black, warm */
  --ink-light:  #3d3830;       /* body text */
  --mist:       #f8f4ee;       /* off-white background */
  --sand:       #ede5d4;       /* warm sand sections */
  --dune:       #d9ccb5;       /* borders/dividers */
  --firth:      #1d4f5e;       /* deep teal — primary */
  --firth-mid:  #2e6b7d;       /* mid teal */
  --firth-pale: #c8dfe4;       /* pale teal accent */
  --gold:       #b8833a;       /* warm gold accent */
  --gold-pale:  #e8d5b0;       /* very pale gold */
  --nav-h: 72px;
}

body {
  font-family: 'Playfair Display', Georgia, serif;
  background: var(--mist);
  color: var(--ink-light);
  font-weight: 400;
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.85;
  min-width: 320px;
  overflow-x: hidden;
}

/* Subtle grain overlay on entire page */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ─── NAVIGATION ─── */
nav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(248,244,238,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--dune);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.2rem, 4vw, 3rem);
  width: 100%;
}

.nav-brand {
  display: flex; align-items: center; gap: 0.8rem;
  text-decoration: none; flex-shrink: 0;
}

.nav-logo-img {
  width: 48px; height: 48px;
  border-radius: 50%; object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.nav-brand-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 500; letter-spacing: 0.01em;
  color: var(--firth); line-height: 1.25;
}

.nav-brand-sub {
  display: block;
  font-size: clamp(0.55rem, 0.7vw, 0.62rem);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-light); opacity: 0.65; font-weight: 400;
  font-style: italic;
}

.nav-links { display: flex; gap: clamp(1.2rem, 2vw, 2.2rem); list-style: none; }
.nav-links a {
  font-family: 'Playfair Display SC', serif;
  font-size: clamp(0.6rem, 0.72vw, 0.68rem);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-light); text-decoration: none;
  font-weight: 400; transition: color 0.25s;
  padding-bottom: 3px; border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--firth); border-bottom-color: var(--gold);
}

.hamburger {
  display: none; flex-direction: column; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 6px;
  -webkit-tap-highlight-color: transparent;
}
.hamburger span { display: block; width: 22px; height: 1px; background: var(--ink-light); transition: all 0.3s; }

.mobile-menu {
  display: none; width: 100%;
  background: var(--mist); border-bottom: 1px solid var(--dune);
  padding: 0.5rem clamp(1.2rem, 4vw, 3rem) 1.2rem;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block; padding: 0.7rem 0;
  font-family: 'Playfair Display SC', serif;
  font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-light); text-decoration: none;
  border-bottom: 1px solid var(--dune);
}
.mobile-menu a:last-child { border-bottom: none; }

/* ─── PAGE HEADER ─── */
.page-header {
  background: var(--firth);
  /* Extra bottom padding ensures title text clears the wave curve on all devices */
  padding: clamp(3rem, 6vw, 5rem) clamp(1.2rem, 4vw, 3rem) clamp(4rem, 9vw, 6rem);
  position: relative; overflow: hidden;
}

/* Ink-wash wave at bottom of header */
.page-header::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: clamp(50px, 8vw, 90px);
  background: var(--mist);
  clip-path: ellipse(55% 100% at 50% 100%);
  z-index: 0;
}

.page-header-inner {
  max-width: 1100px; margin: 0 auto; position: relative; z-index: 2;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2rem;
}

.page-header-text { flex: 1; }

.page-header-logo {
  height: clamp(90px, 13vw, 150px);
  width: clamp(90px, 13vw, 150px);
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 0;
  opacity: 0.95;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.3));
  margin-bottom: 0.2rem;
}

@media (max-width: 480px) {
  .page-header-logo { height: 58px; width: 58px; }
}

.eyebrow {
  display: block;
  font-family: 'Playfair Display SC', serif;
  font-size: clamp(0.6rem, 0.8vw, 0.65rem);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--firth-pale); margin-bottom: 0.8rem;
  font-style: italic;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700; line-height: 1.08;
  color: white; letter-spacing: -0.01em;
}
.page-title em { font-style: italic; font-weight: 400; color: var(--gold-pale); }

/* ─── CONTENT WRAPPER ─── */
.wrap {
  max-width: 1100px; margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.2rem, 4vw, 3rem);
}

/* ─── TYPOGRAPHY ─── */
h2.display {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.01em;
  color: var(--ink); margin-bottom: 1.4rem;
}
h2.display em { font-style: italic; font-weight: 400; color: var(--firth); }

h3.heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 500; color: var(--ink); margin-bottom: 0.6rem;
  line-height: 1.25;
}

.label {
  font-family: 'Playfair Display SC', serif;
  font-size: clamp(0.58rem, 0.75vw, 0.63rem);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); display: block; margin-bottom: 0.6rem;
  font-style: italic;
}

p { margin-bottom: 1.3rem; color: var(--ink-light); line-height: 1.85; }
p:last-child { margin-bottom: 0; }
a { color: var(--firth); }
strong { font-weight: 700; color: var(--ink); }

/* Decorative initial cap drop */
.drop-cap::first-letter {
  font-size: 3.5em; font-weight: 700; float: left;
  line-height: 0.75; margin: 0.08em 0.08em 0 0;
  color: var(--firth);
}

/* Thin gold rule */
.gold-rule {
  border: none; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: clamp(2rem, 4vw, 3.5rem) 0; opacity: 0.5;
}

/* Wave SVG rule */
.wave-rule {
  height: 20px; border: none; margin: 1.5rem 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 20'%3E%3Cpath d='M0 10 Q20 2 40 10 Q60 18 80 10 Q100 2 120 10 Q140 18 160 10' fill='none' stroke='%231d4f5e' stroke-width='1' opacity='0.25'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-size: 160px;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-block;
  padding: 0.85rem clamp(1.8rem, 3vw, 2.8rem);
  background: var(--firth); color: white;
  font-family: 'Playfair Display SC', serif;
  font-size: clamp(0.62rem, 0.8vw, 0.68rem);
  letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; border: none; cursor: pointer;
  border-radius: 1px;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
  box-shadow: 0 4px 20px rgba(29,79,94,0.25);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--firth-mid); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(29,79,94,0.3); color: white; }

.btn-ghost {
  display: inline-block;
  padding: 0.85rem clamp(1.8rem, 3vw, 2.8rem);
  border: 1px solid var(--firth); color: var(--firth);
  font-family: 'Playfair Display SC', serif;
  font-size: clamp(0.62rem, 0.8vw, 0.68rem);
  letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; border-radius: 1px;
  background: transparent;
  transition: background 0.3s, color 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.btn-ghost:hover { background: var(--firth); color: white; }

/* ─── CARDS ─── */
.card {
  background: white;
  border-radius: 2px;
  padding: clamp(1.5rem, 2.5vw, 2.5rem);
  box-shadow: 0 2px 20px rgba(26,24,20,0.06);
  position: relative;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--firth), var(--gold));
  border-radius: 2px 2px 0 0;
}

/* ─── TAGS ─── */
.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.tag {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(0.72rem, 0.9vw, 0.8rem);
  color: var(--firth); border: 1px solid var(--firth-pale);
  padding: 0.2rem 0.8rem; border-radius: 100px;
  background: white;
}

/* ─── QUOTE BLOCK ─── */
.pullquote {
  border-left: 3px solid var(--gold);
  padding: 1.5rem 2rem;
  background: white;
  box-shadow: 0 2px 20px rgba(26,24,20,0.05);
  margin: 2rem 0;
}
.pullquote p {
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-style: italic; font-weight: 400;
  color: var(--ink); line-height: 1.6; margin: 0;
}
.pullquote cite {
  display: block; margin-top: 0.8rem;
  font-size: 0.75rem; letter-spacing: 0.1em;
  color: var(--gold); font-style: normal; text-transform: uppercase;
  font-family: 'Playfair Display SC', serif;
}

/* ─── QUALIFICATIONS LIST ─── */
.quals { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--dune); }
.qual-item {
  display: flex; gap: 1rem; padding: 0.8rem 0;
  border-bottom: 1px solid var(--dune); align-items: flex-start;
}
.qual-item:last-child { border-bottom: none; }
.qual-year {
  font-family: 'Playfair Display SC', serif;
  font-size: 0.7rem; color: var(--gold); letter-spacing: 0.1em;
  min-width: 42px; padding-top: 0.15rem;
}
.qual-text { font-size: clamp(0.82rem, 1vw, 0.9rem); color: var(--ink-light); }

/* ─── FOOTER ─── */
footer {
  background: var(--ink);
  padding: clamp(2rem, 4vw, 3rem) clamp(1.2rem, 4vw, 3rem);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1.5rem; width: 100%;
}
.footer-brand { display: flex; align-items: center; gap: 0.8rem; }
.footer-logo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.footer-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem; color: rgba(255,255,255,0.8); font-style: italic;
}
.footer-links { display: flex; gap: clamp(1rem, 2vw, 2rem); list-style: none; flex-wrap: wrap; }
.footer-links a {
  font-family: 'Playfair Display SC', serif;
  font-size: clamp(0.58rem, 0.75vw, 0.65rem); letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.35); text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: var(--gold); }
.footer-reg { font-size: clamp(0.6rem, 0.8vw, 0.68rem); color: rgba(255,255,255,0.3); line-height: 1.8; text-align: right; font-style: italic; }

/* ─── SCROLL REVEAL ─── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ════════════ BREAKPOINTS ════════════ */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 768px) {
  :root { --nav-h: 64px; }
  footer { flex-direction: column; align-items: flex-start; }
  .footer-reg { text-align: left; }
}
@media (max-width: 480px) {
  :root { --nav-h: 60px; }
  .nav-logo-img { width: 40px; height: 40px; }
  .nav-brand-sub { display: none; }
  footer { align-items: center; text-align: center; }
  .footer-links { justify-content: center; }
  .footer-reg { text-align: center; }
}
