/* ============================================================
   aditiwary.com — design system
   v3.1 brand tokens. Master-brand layer + Lab Thoughts publication layer.
   ============================================================ */

/* ------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------ */

:root {
  /* Colour tokens — v3.1 palette only */
  --charcoal: #1f1f1f;
  --off-white: #faf6f0;
  --white: #ffffff;
  --warm-grey: #7a7670;
  --graphite: #d8d2ca;
  --deep-ink: #24313a;

  /* Default register: master-brand layer */
  --bg: var(--white);
  --text: var(--charcoal);
  --text-secondary: var(--warm-grey);
  --rule: var(--graphite);
  --accent: var(--charcoal); /* Master brand uses charcoal for links by default */
  --accent-hover: var(--deep-ink);

  /* Type families */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* Type scale */
  --text-xs: 0.75rem;     /* 12px — small metadata */
  --text-sm: 0.875rem;    /* 14px — secondary text */
  --text-base: 1.0625rem; /* 17px — body */
  --text-md: 1.1875rem;   /* 19px — body emphasised */
  --text-lg: 1.5rem;      /* 24px — section heading */
  --text-xl: 2rem;        /* 32px — page heading */
  --text-2xl: 2.75rem;    /* 44px — hero on desktop */
  --text-3xl: 3.5rem;     /* 56px — large hero on wide screens */

  /* Line heights */
  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* Layout */
  --content-width: 38rem;     /* ~620px — reading column */
  --container-width: 64rem;   /* ~1024px — outer container */
  --container-padding: 1.5rem;

  /* Tracking (letter-spacing) */
  --track-tight: -0.01em;
  --track-normal: 0;
  --track-wide: 0.08em;
  --track-wider: 0.14em;
}

/* Lab Thoughts publication layer — applied via body class or wrapper */
body.lab-thoughts,
.lab-thoughts {
  --bg: var(--off-white);
  --accent: var(--deep-ink);
  --accent-hover: var(--charcoal);
}

.lab-thoughts {
  background-color: var(--off-white);
  color: var(--charcoal);
}

/* ------------------------------------------------------------
   2. Reset
   ------------------------------------------------------------ */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text);
  background-color: var(--bg);
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--charcoal);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  z-index: 100;
}

.skip-link:focus {
  left: var(--space-4);
}

/* Focus styles — visible, brand-correct */
:focus-visible {
  outline: 2px solid var(--charcoal);
  outline-offset: 2px;
}

body.lab-thoughts :focus-visible,
.lab-thoughts :focus-visible {
  outline-color: var(--deep-ink);
}

/* ------------------------------------------------------------
   3. Layout containers
   ------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.content {
  max-width: var(--content-width);
  /* Left-aligned content, not centred — strong left alignment per brand */
}

/* ------------------------------------------------------------
   4. Typography utilities
   ------------------------------------------------------------ */

.font-sans { font-family: var(--font-sans); }
.font-serif { font-family: var(--font-serif); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text);
  letter-spacing: var(--track-tight);
  line-height: var(--leading-tight);
}

p {
  margin-bottom: var(--space-5);
}

p:last-child {
  margin-bottom: 0;
}

/* Hierarchy: page title (used for /about, /advisory, /lab-thoughts page titles) */
.page-title {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: var(--track-tight);
  line-height: var(--leading-tight);
  color: var(--text);
  margin-bottom: var(--space-7);
}

@media (min-width: 720px) {
  .page-title {
    font-size: 2.5rem; /* 40px */
  }
}

/* Hierarchy: section heading (sub-sections within a page) */
.section-heading {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: var(--track-tight);
  line-height: var(--leading-snug);
  color: var(--text);
  margin-top: var(--space-7);
  margin-bottom: var(--space-5);
}

/* Hierarchy: smaller heading, used inside engagement type list etc */
.subheading {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: var(--track-tight);
  line-height: var(--leading-snug);
  color: var(--text);
  margin-bottom: var(--space-3);
}

/* Metadata: small Inter in warm grey for dates, captions, role lines, footer */
.meta {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  letter-spacing: var(--track-normal);
  line-height: var(--leading-normal);
}

.meta-xs {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  letter-spacing: var(--track-wide);
  line-height: var(--leading-normal);
  text-transform: uppercase;
}

/* Body emphasis: slightly larger, for opening paragraphs */
.lead {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text);
}

/* ------------------------------------------------------------
   5. Hairline rule
   ------------------------------------------------------------ */

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--space-7) 0;
}

.rule-tight {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--space-5) 0;
}

/* ------------------------------------------------------------
   6. Links
   ------------------------------------------------------------ */

a.link {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
  transition: color 120ms ease;
}

a.link:hover,
a.link:focus {
  color: var(--accent-hover);
}

/* Quiet text link — no underline by default, underline on hover. Used in nav. */
a.link-quiet {
  color: var(--text);
  transition: color 120ms ease;
}

a.link-quiet:hover,
a.link-quiet:focus {
  color: var(--accent-hover);
}

/* Cross-link arrow style (used for "Read about the advisory work →" patterns) */
a.cross-link {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text);
  font-weight: 500;
  display: inline-block;
  transition: color 120ms ease;
}

a.cross-link:hover,
a.cross-link:focus {
  color: var(--accent-hover);
}

a.cross-link::after {
  content: " →";
  display: inline;
}

/* ------------------------------------------------------------
   7. Site header (top navigation)
   ------------------------------------------------------------ */

.site-header {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-5);
}

.wordmark {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: var(--track-tight);
  color: var(--text);
  transition: color 120ms ease;
}

.wordmark:hover,
.wordmark:focus {
  color: var(--accent-hover);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  letter-spacing: var(--track-normal);
  transition: color 120ms ease;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--accent-hover);
}

.site-nav a[aria-current="page"] {
  color: var(--text-secondary);
}

/* Mobile navigation: keep flat, no hamburger. Stack if necessary. */
@media (max-width: 540px) {
  .site-nav {
    gap: var(--space-3) var(--space-4);
  }
  .site-nav a {
    font-size: var(--text-xs);
  }
}

/* Defensive: long words and URLs never push the layout wider than the viewport */
.prose, .hero-supporting, .lt-item-description, .engagement-description, .cta-paragraph {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* ------------------------------------------------------------
   8. Site footer
   ------------------------------------------------------------ */

.site-footer {
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  padding-bottom: var(--space-7);
  border-top: 1px solid var(--rule);
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  align-items: center;
}

.footer-links a {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text);
  transition: color 120ms ease;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--accent-hover);
}

.footer-meta {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  letter-spacing: var(--track-normal);
}

@media (min-width: 720px) {
  .site-footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
  }
}

/* ------------------------------------------------------------
   9. Page sections
   ------------------------------------------------------------ */

main {
  padding-top: var(--space-6);
  padding-bottom: var(--space-8);
}

.section {
  padding-top: var(--space-7);
  padding-bottom: var(--space-7);
}

.section + .section {
  border-top: 1px solid var(--rule);
}

/* ------------------------------------------------------------
   10. Hero (homepage)
   ------------------------------------------------------------ */

.hero {
  padding-top: var(--space-9);
  padding-bottom: var(--space-9);
}

.hero-headline {
  font-family: var(--font-sans);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: var(--track-tight);
  line-height: var(--leading-tight);
  color: var(--text);
  margin-bottom: var(--space-6);
  max-width: 24ch;
}

@media (min-width: 720px) {
  .hero-headline {
    font-size: var(--text-3xl);
  }
}

.hero-supporting {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text);
  max-width: var(--content-width);
  margin-bottom: var(--space-6);
}

@media (min-width: 720px) {
  .hero-supporting {
    font-size: 1.3125rem; /* 21px */
  }
}

.hero-cta {
  margin-top: var(--space-5);
}

/* ------------------------------------------------------------
   11. Lab Thoughts publication label
   ------------------------------------------------------------ */

.publication-label {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--track-wider);
  text-transform: uppercase;
  color: var(--deep-ink);
  margin-bottom: var(--space-4);
  display: block;
}

/* On master-brand pages, the publication label uses charcoal not Deep Ink */
body:not(.lab-thoughts) .publication-label {
  color: var(--charcoal);
}

/* ------------------------------------------------------------
   12. Lab Thoughts list (used on homepage and /lab-thoughts)
   ------------------------------------------------------------ */

.lt-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lt-item {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--rule);
}

.lt-item:last-child {
  border-bottom: 1px solid var(--rule);
}

.lt-item-title {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: var(--track-tight);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-2);
}

.lt-item-title a {
  color: var(--text);
  transition: color 120ms ease;
}

body.lab-thoughts .lt-item-title a,
.lab-thoughts .lt-item-title a {
  color: var(--deep-ink);
}

.lt-item-title a:hover,
.lt-item-title a:focus {
  color: var(--accent-hover);
}

.lt-item-meta {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.lt-item-description {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text);
  max-width: var(--content-width);
}

/* ------------------------------------------------------------
   13. Engagement types list (/advisory)
   ------------------------------------------------------------ */

.engagement-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.engagement-item {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--rule);
}

.engagement-item:last-child {
  border-bottom: 1px solid var(--rule);
}

.engagement-name {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: var(--track-tight);
  margin-bottom: var(--space-3);
  color: var(--text);
}

.engagement-description {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text);
  max-width: var(--content-width);
}

/* ------------------------------------------------------------
   14. Portrait (used on /about)
   ------------------------------------------------------------ */

.portrait {
  margin-bottom: var(--space-6);
}

.portrait img {
  max-width: 100%;
  width: 18rem; /* ~288px on desktop */
  height: auto;
  /* No rounded corners. No border. No shadow. Per brand. */
}

@media (min-width: 720px) {
  .portrait img {
    width: 20rem; /* ~320px */
  }
}

/* ------------------------------------------------------------
   15. Body content within sections
   ------------------------------------------------------------ */

.prose {
  max-width: var(--content-width);
}

.prose p {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text);
  margin-bottom: var(--space-5);
}

.prose p.lead {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

.prose a {
  color: var(--text);
  border-bottom: 1px solid var(--rule);
  transition: border-color 120ms ease, color 120ms ease;
}

body.lab-thoughts .prose a,
.lab-thoughts .prose a {
  color: var(--deep-ink);
  border-bottom-color: var(--deep-ink);
}

.prose a:hover,
.prose a:focus {
  color: var(--accent-hover);
  border-bottom-color: currentColor;
}

/* ------------------------------------------------------------
   16. CTA paragraph (advisory homepage block + advisory page)
   ------------------------------------------------------------ */

.cta-paragraph {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--text);
  max-width: var(--content-width);
  margin-bottom: 0;
}

.cta-paragraph a {
  color: var(--text);
  border-bottom: 1px solid var(--text);
  transition: color 120ms ease, border-color 120ms ease;
}

.cta-paragraph a:hover,
.cta-paragraph a:focus {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* ------------------------------------------------------------
   17. Utilities
   ------------------------------------------------------------ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }

.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-7 { margin-bottom: var(--space-7); }

/* ------------------------------------------------------------
   18. Narrow-phone overrides (kept last so they win source order)
   ------------------------------------------------------------ */

@media (max-width: 480px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
  .hero {
    padding-top: var(--space-7);
    padding-bottom: var(--space-7);
  }
  .hero-headline {
    font-size: 2.125rem; /* ~34px */
  }
  .hero-supporting {
    font-size: var(--text-base);
  }
  .page-title {
    font-size: 1.625rem; /* ~26px */
  }
  .section-heading {
    font-size: 1.25rem; /* ~20px */
  }
}
