/* ============================================================================
   YCRG Labs — site stylesheet
   ----------------------------------------------------------------------------
   Sections:
     1.  Tokens (colors)
     2.  Base reset
     3.  Page layout (shell)
     4.  Sidebar (brand, nav, socials, copyright)
     5.  Hero (Home page title + animation)
     6.  Subnav (Research tabs)
     7.  Items (paper rows, sector tag)
     8.  Roster (Team list)
     9.  Tier (Sponsor rows)
     10. Partner cards (Research Partners)
     11. Wordmarks (typographic logos)
     12. Responsive
   ============================================================================ */


/* 1. Tokens ----------------------------------------------------------------- */
:root {
  --bg:     #f6f3ec;   /* page background, warm cream */
  --ink:    #1a1a17;   /* primary text */
  --muted:  #6b6b66;   /* secondary text */
  --rule:   #e2dfd8;   /* hairline dividers */
  --soft:   #c8c4b8;   /* tertiary text */
  --link:   #1a1a17;
  --accent: #8a3b1f;   /* warm-brown accent for hover and active */
}


/* 2. Base reset ------------------------------------------------------------- */
* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }

body {
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--accent); }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 30px; }
h2 {
  font-size: 13px;
  font-weight: 600;
  margin: 40px 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

p  { margin: 0 0 14px; }
ul { padding: 0; list-style: none; margin: 0; }


/* 3. Page layout ------------------------------------------------------------ */
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 48px 80px;
}

main { max-width: 760px; min-width: 0; }

@media (min-width: 1440px) {
  .shell {
    max-width: 1400px;
    gap: 72px;
    padding: 64px 56px 96px;
  }
  main { max-width: 820px; }
}

.lede   { font-size: 20px; line-height: 1.55; margin: 0 0 8px; }
.muted  { color: var(--muted); }
.small  { font-size: 14px; }


/* 4. Sidebar ---------------------------------------------------------------- */
aside.rail {
  position: sticky;
  top: 56px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Brand block (logo + wordmark) --- */
aside.rail .brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
aside.rail .brand:hover { color: var(--accent); }
aside.rail .brand-logo {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
  transition: opacity 200ms ease;
}
aside.rail .brand:hover .brand-logo { opacity: 0.75; }
aside.rail .brand-title {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0;
  line-height: 1.18;
  display: block;
}

/* --- Nav (Home / Research / ...) --- */
aside.rail nav { display: flex; flex-direction: column; gap: 2px; }
aside.rail nav button {
  position: relative;
  background: none;
  border: 0;
  padding: 5px 0 5px 12px;
  font: inherit;
  font-family: inherit;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  display: block;
  transition: color 180ms ease;
}
aside.rail nav button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: var(--ink);
  opacity: 0;
  transition: opacity 180ms ease;
}
aside.rail nav button:hover { color: var(--ink); }
aside.rail nav button[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}
aside.rail nav button[aria-current="page"]::before { opacity: 1; }

/* --- Rail footer (social icons + copyright) --- */
aside.rail .rail-foot {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
aside.rail .rail-foot .copy {
  font-size: 11.5px;
  color: #9a9789;
  line-height: 1.5;
  max-width: 220px;
}
aside.rail .socials {
  display: flex;
  gap: 14px;
}
aside.rail .socials a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: color 180ms ease;
}
aside.rail .socials a:hover { color: var(--accent); }
aside.rail .socials svg {
  width: 18px;
  height: 18px;
  display: block;
}


/* 5. Hero (Home page) ------------------------------------------------------- */
.hero-title {
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-weight: 600;
  font-size: clamp(36px, 5.4vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--ink);
}
/* Full-viewport background field on the Home page. Sits behind all content
   (z-index 0); the .shell sits in front. Pointer events disabled so it
   doesn't interfere with clicks. */
.hero-anim-wrap {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}
.hero-anim {
  display: block;
  width: 100%;
  height: 100%;
  /* Vignette mask: fade edges so text in the sidebar / corners stays clean */
  -webkit-mask-image: radial-gradient(ellipse 110% 90% at 50% 50%, #000 30%, rgba(0,0,0,0.55) 75%, transparent 100%);
          mask-image: radial-gradient(ellipse 110% 90% at 50% 50%, #000 30%, rgba(0,0,0,0.55) 75%, transparent 100%);
}
/* PIML equation pinned to the bottom-right of the viewport */
.hero-anim-eqn {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 0;
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.02em;
  pointer-events: none;
  user-select: none;
}
.hero-anim-eqn sub  { font-size: 0.72em; vertical-align: -0.28em; }
.hero-anim-eqn sup  { font-size: 0.72em; vertical-align: 0.5em; }
.hero-anim-eqn .op  { font-style: normal; }

/* Make sure the page chrome stacks above the background field */
.shell { position: relative; z-index: 1; }


/* 6. Subnav (Research tabs) ------------------------------------------------- */
.subnav {
  display: flex;
  gap: 24px;
  margin: 22px 0 4px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.subnav button {
  background: none;
  border: 0;
  padding: 8px 0;
  font: inherit;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -1px;
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}
.subnav button:hover { color: var(--ink); }
.subnav button[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--ink);
}


/* 7. Items (paper rows + sector tag) ---------------------------------------- */
.item {
  position: relative;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  transition: padding-left 200ms ease;
}
.item.first { border-top: 0; padding-top: 6px; }

/* Accent bar slides in on hover */
.item::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  transform: scaleY(0.6);
  transform-origin: center;
}
.item:hover { padding-left: 14px; }
.item:hover::before { opacity: 1; transform: scaleY(1); }
.item:hover .title { color: var(--accent); }

.item .item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.item .title {
  display: block;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
  transition: color 200ms ease;
}
.item .blurb {
  margin: 6px 0 0;
  color: #3a3a37;
  font-size: 14.5px;
  line-height: 1.5;
}
.item .links { margin-top: 8px; font-size: 13px; color: var(--muted); }
.item .links a + a { margin-left: 12px; }

/* Sector tag — italic serif, hidden by default, fades in on hover */
.tag {
  flex-shrink: 0;
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  padding: 0;
  border: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 200ms ease;
}
.item:hover .tag { opacity: 1; }
.tag-physics { color: #a07a1f; }
.tag-social  { color: #8a3b1f; }
.tag-bio     { color: #4d6b32; }


/* 7b. News items ------------------------------------------------------------ */
.news-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: start;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}
.news-item:first-of-type { border-top: 0; padding-top: 12px; }
.news-image {
  width: 120px;
  height: 120px;
  background: #efece4;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.news-image.no-bg {
  background: transparent;
  padding: 0;
}
.news-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.news-content { min-width: 0; }
.news-date {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}
.news-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.3;
}
.news-body {
  margin: 0;
  color: #3a3a37;
  line-height: 1.55;
  font-size: 15px;
}
@media (max-width: 640px) {
  .news-item { grid-template-columns: 1fr; gap: 14px; }
  .news-image { width: 240px; height: 180px; }
}


/* 7d. Home news teaser ------------------------------------------------------ */
.home-news {
  list-style: none;
  padding: 0;
  margin: 0;
}
.home-news li {
  border-top: 1px solid var(--rule);
}
.home-news li:first-child { border-top: 0; }
.home-news a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  text-decoration: none;
  color: var(--ink);
  transition: color 180ms ease;
}
.home-news a:hover { color: var(--accent); }
.home-news-title { font-size: 15px; font-weight: 500; line-height: 1.4; }
.home-news-date  { font-size: 13px; color: var(--muted); white-space: nowrap; }


/* 7c. Notebooks (Models & Data) -------------------------------------------- */
.notebook-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}
.notebook-list li {
  border-top: 1px solid var(--rule);
}
.notebook-list li:first-child { border-top: 0; }
.notebook-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  text-decoration: none;
  color: var(--ink);
  transition: color 180ms ease, padding-left 180ms ease;
}
.notebook-link:hover {
  color: var(--accent);
  padding-left: 6px;
}
.notebook-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.notebook-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 4px;
}
.notebook-arrow {
  color: var(--muted);
  font-size: 18px;
  flex-shrink: 0;
  transition: color 180ms ease;
}
.notebook-link:hover .notebook-arrow { color: var(--accent); }


/* 8. Roster (Team list) ----------------------------------------------------- */
.roster li {
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  font-size: 16px;
}
.roster li:first-child { border-top: 0; }
.roster .aff { color: var(--muted); font-size: 13px; }


/* 9. Tier (Sponsor rows) ---------------------------------------------------- */
.tier {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 14px 0;
  align-items: center;
  border-top: 1px solid var(--rule);
}
.tier:first-of-type { border-top: 0; }
.tier .tlabel {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.tier .tnames { font-size: 16px; }
.tier .tempty { color: var(--soft); }

.tier-logo {
  max-height: 22px;
  max-width: 110px;
  object-fit: contain;
  filter: grayscale(1) contrast(0.95) opacity(0.78);
  transition: filter 220ms ease;
  display: inline-block;
  vertical-align: middle;
}
.tier-logo:hover { filter: none; }


/* 10. Partner cards (Research Partners) ------------------------------------ */
.partner-card {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: color 200ms ease;
}
.partner-card:first-child { border-top: 0; }
a.partner-card:hover { color: var(--accent); }
a.partner-card:hover .logo-frame img { filter: none; }

.logo-frame {
  height: 36px;
  width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-frame img {
  max-height: 36px;
  max-width: 130px;
  object-fit: contain;
  filter: grayscale(1) contrast(0.95) opacity(0.78);
  transition: filter 220ms ease;
}
.logo-frame img:hover { filter: none; }
.partner-name { font-size: 16px; font-weight: 600; }
.partner-role { color: var(--muted); font-size: 13px; }


/* 11. Wordmarks (typographic logos) ---------------------------------------- */
.wordmark-text {
  font-family: "Source Serif 4", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.wordmark-aiygo {
  font-family: "Cinzel", "Trajan Pro", "Source Serif 4", serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--ink);
}


/* 12. Responsive ----------------------------------------------------------- */
@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 24px 64px;
  }
  aside.rail {
    position: static;
    flex-direction: column;
    gap: 20px;
  }
  aside.rail nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }
  aside.rail .rail-foot { display: none; }
  h1 { font-size: 26px; }
  .lede { font-size: 18px; }
  .partner-card { grid-template-columns: 110px 1fr; row-gap: 4px; }
  .partner-card .partner-role { grid-column: 2; }
}
