/* ============================================================
   Bilkent University Social Space Lab
   Design system — modular hairline grid
   (visual language after The London School of Architecture)
   ============================================================ */

:root {
  --ink: #141414;
  --paper: #ffffff;
  --paper-2: #f4f3ef;
  --muted: #5c5c57;
  --line: #141414;          /* hairlines are near-black, like LSA */
  --line-soft: #d8d7d2;
  --accent: #ed1a4d;        /* b.ssl brand crimson */
  --accent-dark: #c60e3d;

  /* Titles: CoFo Sans (licensed) with a close free fallback, Schibsted Grotesk.
     Text + UI: Inter. */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "CoFo Sans", "Schibsted Grotesk", "Inter", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1400px;
  --gutter: 0px;            /* the grid runs edge-to-edge like LSA */
  --pad: clamp(1.4rem, 2.2vw, 2.4rem);

  --step--1: clamp(0.76rem, 0.73rem + 0.12vw, 0.83rem);
  --step-0: clamp(0.96rem, 0.92rem + 0.2vw, 1.06rem);
  --step-1: clamp(1.15rem, 1.05rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.9vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 1.9vw, 3rem);
  --step-4: clamp(2.6rem, 1.9rem + 3.4vw, 4.6rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.58;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; }

/* Frame the whole page like LSA's ruled sheet */
.sheet { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
@media (max-width: 1420px) { .sheet { border-left: 0; border-right: 0; } }

.eyebrow {
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
  display: block;
}
.muted { color: var(--muted); }
.lede { font-family: var(--sans); font-size: var(--step-1); line-height: 1.45; font-weight: 400; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: stretch; justify-content: space-between;
  max-width: var(--wrap); margin-inline: auto;
}
.brand {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0 var(--pad); min-height: 74px;
  border-right: 1px solid var(--line);
}
.brand img { height: 38px; width: auto; }
.header-right { display: flex; align-items: stretch; }
.nav { display: flex; align-items: stretch; }
.nav a {
  display: flex; align-items: center;
  font-family: var(--sans);
  font-size: var(--step--1); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink); padding: 0 clamp(0.9rem, 1.4vw, 1.4rem);
  border-left: 1px solid var(--line);
  transition: background 0.18s, color 0.18s;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav a[aria-current="page"] { color: var(--accent); }
.nav a:hover { color: #fff; }
.nav a.cta { background: var(--accent); color: #fff; border-left: 1px solid var(--line); }
.nav a.cta:hover { background: var(--ink); color: #fff; }

.nav-toggle { display: none; background: none; border: 0; border-left: 1px solid var(--line); cursor: pointer; width: 74px; padding: 0; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px auto; transition: 0.3s; }

/* ---------- The hairline grid ---------- */
.wall {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  max-width: var(--wrap); margin-inline: auto;
}
.wall:last-of-type { border-bottom: 1px solid var(--line); }
.wall .cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: var(--pad);
  display: flex; flex-direction: column;
  min-height: 240px; position: relative;
  background: var(--paper);
}
.wall .cell:first-child { border-left: 1px solid var(--line); }
/* keep a continuous left rule when a row starts mid-grid */
.wall { border-left: 1px solid var(--line); }
.wall .cell { border-left: 0; }
.wall .cell.fill { background: var(--paper-2); }
.wall .cell.ink { background: var(--ink); color: #fff; }
.wall .cell.ink .muted { color: #b4b4ae; }
.wall .cell.ink .eyebrow { color: #fff; }
.wall .cell.accent { background: var(--accent); color: #fff; }
.wall .cell.accent .eyebrow { color: #fff; }

/* column-count variants */
.wall.cols-2 { grid-template-columns: repeat(2, 1fr); }
.wall.cols-3 { grid-template-columns: repeat(3, 1fr); }
.wall.cols-5 { grid-template-columns: repeat(5, 1fr); }
.wall.cols-6 { grid-template-columns: repeat(6, 1fr); }

/* spans */
.c2 { grid-column: span 2; }
.c3 { grid-column: span 3; }
.c4 { grid-column: span 4; }
.r2 { grid-row: span 2; }

/* cell internals */
.cell h2 { font-size: var(--step-2); margin: 0 0 0.6rem; }
.cell h3 { font-size: var(--step-1); margin: 0 0 0.5rem; }
.cell p { color: var(--muted); font-size: var(--step-0); }
.cell.ink p, .cell.accent p { color: rgba(255,255,255,0.82); }
.cell .spacer { flex: 1 1 auto; min-height: 0.8rem; }
.cell-link {
  font-family: var(--sans); font-size: var(--step--1);
  font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--ink); margin-top: auto;
}
.cell.ink .cell-link, .cell.accent .cell-link { color: #fff; }
.cell-link .arrow { transition: transform 0.2s; }
a.cell:hover .cell-link .arrow, .cell-link:hover .arrow { transform: translateX(4px); }
a.cell { color: inherit; transition: background 0.18s; }
a.cell:hover { background: var(--paper-2); }
a.cell.ink:hover { background: #000; }
a.cell.accent:hover { background: var(--accent-dark); }

.cell .kicker { font-family: var(--display); font-size: var(--step-3); font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.cell .kicker .accent { color: var(--accent); }
.cell.ink .kicker .accent { color: var(--accent); }

/* Big statement cell (hero) */
.cell.statement { min-height: 340px; justify-content: center; }
.cell.statement h1 { font-family: var(--display); font-weight: 700; font-size: var(--step-4); letter-spacing: -0.028em; margin: 0 0 1rem; }
.cell.statement h1 .accent { color: var(--accent); }
.cell.statement .lede { max-width: 46ch; color: var(--muted); }

/* Circular CTA (the "APPLY" motif) */
.cell.badge { align-items: center; justify-content: center; text-align: center; }
.disc {
  width: clamp(140px, 15vw, 200px); aspect-ratio: 1; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: var(--step-1);
  letter-spacing: 0.02em; transition: background 0.2s, transform 0.3s;
}
a.cell.badge:hover { background: var(--paper); }
a.cell.badge:hover .disc { background: var(--accent); transform: rotate(-4deg); }

/* Media cell (image fills, caption overlays) */
.cell.media { padding: 0; overflow: hidden; min-height: 300px; }
.cell.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) contrast(1.02); transition: filter 0.4s, transform 0.6s; }
a.cell.media:hover img { filter: grayscale(0%); transform: scale(1.03); }
.cell.media .cap { position: absolute; left: 0; bottom: 0; width: 100%; padding: var(--pad); background: linear-gradient(to top, rgba(20,20,20,0.85), transparent); color: #fff; }
.cell.media .cap h3 { color: #fff; }
.cell.media.color img { filter: none; }

/* ---------- Section titling bar ---------- */
.rail {
  max-width: var(--wrap); margin-inline: auto;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  padding: var(--pad);
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.rail h2 { font-size: var(--step-2); margin: 0; }
.rail .eyebrow { margin: 0; }
@media (max-width: 1420px) { .rail { border-left: 0; border-right: 0; } }

/* ---------- People cells ---------- */
.member .m-photo { margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) var(--pad); border-bottom: 1px solid var(--line); }
.member .m-photo img { width: 100%; aspect-ratio: 1/1; object-fit: cover; filter: grayscale(100%) contrast(1.02); transition: filter 0.4s, transform 0.6s; }
a.member:hover .m-photo img { filter: grayscale(0%); }
.member h3 { margin: 0 0 0.15rem; }
.member .dept { font-size: var(--step--1); color: var(--accent); font-weight: 600; }
.member .role { font-size: var(--step--1); color: var(--muted); }

/* ---------- News / updates column ---------- */
.newsitem { display: block; padding: 1rem 0; border-top: 1px solid var(--line-soft); }
.newsitem:first-of-type { border-top: 0; }
.newsitem .when { font-size: var(--step--1); color: var(--accent); font-weight: 600; letter-spacing: 0.04em; }
.newsitem h3 { font-size: var(--step-1); margin: 0.2rem 0 0; }
.newsitem:hover h3 { color: var(--accent); }

/* ---------- Prose ---------- */
.prose { max-width: 68ch; }
.prose p { margin-bottom: 1.15em; color: var(--ink); }
.prose h3 { font-size: var(--step-2); margin-top: 1.6em; }
.prose ul { padding-left: 1.1em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--accent); }
a.inline { color: var(--accent); border-bottom: 1px solid var(--accent); }
a.inline:hover { opacity: 0.65; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; max-width: var(--wrap); margin-inline: auto; }
.footer-grid > div { padding: var(--pad); border-right: 1px solid #333; border-bottom: 1px solid #333; }
.footer-grid .foot-brand img { height: 30px; margin-bottom: 1rem; filter: brightness(0) invert(1); }
.footer-grid .foot-brand p { color: #b4b4ae; max-width: 34ch; font-size: var(--step--1); }
.footer-col h4 { font-family: var(--sans); font-size: var(--step--1); letter-spacing: 0.12em; text-transform: uppercase; color: #85857f; font-weight: 600; margin-bottom: 0.9rem; }
.footer-col a { display: block; font-family: var(--sans); color: #e4e3de; padding: 0.28rem 0; font-size: var(--step-0); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; max-width: var(--wrap); margin-inline: auto; padding: 1.2rem var(--pad); color: #85857f; font-size: var(--step--1); }
.footer-bottom img { height: 38px; }

/* ---------- Reveal ---------- */
html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .wall, .wall.cols-3, .wall.cols-6 { grid-template-columns: repeat(2, 1fr); }
  .c3 { grid-column: span 2; }
  .c4 { grid-column: span 2; }
}
@media (max-width: 1100px) {
  .wall.cols-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .wall.cols-6, .wall.cols-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav {
    position: fixed; inset: 74px 0 auto 0; background: var(--paper);
    flex-direction: column; border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height 0.35s ease;
  }
  .nav.open { max-height: 80vh; }
  .nav a { border-left: 0; border-top: 1px solid var(--line); padding: 1rem var(--pad); }
  .nav a.cta { border-left: 0; }
  .nav-toggle { display: block; }
  .wall, .wall .cell.c2, .wall .cell.c3, .wall .cell.c4 { grid-template-columns: 1fr; }
  .wall { grid-template-columns: 1fr; }
  .c2, .c3, .c4 { grid-column: span 1; }
  .footer-grid { grid-template-columns: 1fr; }
  .cell.statement h1 { font-size: var(--step-3); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; }
}
