/* khalil.phd: project index (mockup C). Light and dark follow the system setting. */

@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #f3f4f6;
  --fg: #101318;
  --muted: #4a5160;
  --dim: #5d6573;
  --rule: #dfe2e7;
  --chip-border: #c9cdd4;
  --chip-fg: #3d4450;
  --link: #0b57d0;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --fg: #e6e8eb;
    --muted: #a4abb6;
    --dim: #8a93a0;
    --rule: #2a2f37;
    --chip-border: #3a404a;
    --chip-fg: #c3c9d2;
    --link: #8ab4f8;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Filtered rows use the hidden attribute. On phones the rows use display: grid,
   so this rule must win over it. */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

.site-header, main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header { padding-top: 3.5rem; }

h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tagline, .degrees { margin: 0; color: var(--dim); }
.tagline { font-size: 0.95rem; }
.degrees { margin-top: 0.2rem; font-family: var(--sans); font-size: 0.9rem; }

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}
.profile-links a::before { content: "["; content: "[" / ""; color: var(--dim); display: inline-block; }
.profile-links a::after { content: "]"; content: "]" / ""; color: var(--dim); display: inline-block; }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 2.25rem 0 0.75rem;
}
.filters button {
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--chip-border);
  border-radius: 4px;
  background: transparent;
  color: var(--chip-fg);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.filters button:hover { border-color: var(--fg); color: var(--fg); }
.filters button[aria-pressed="true"] { border-color: var(--fg); background: var(--fg); color: var(--bg); }
#filter-status { margin: 0 0 0 0.5rem; color: var(--dim); font-size: 0.8rem; }

.projects {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.projects thead th {
  padding: 0.4rem 1rem 0.4rem 0;
  border-bottom: 1px solid var(--fg);
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}
.projects tbody td, .projects tbody th {
  padding: 0.8rem 1rem 0.8rem 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.projects .years { width: 6.5rem; white-space: nowrap; }
.projects .kind { width: 7.5rem; }
.projects .role { width: 10.5rem; }
.projects .links { width: 12rem; line-height: 1.7; }
.projects th.project { font-weight: 400; }

.project .title { display: block; font-weight: 600; }
.project .desc {
  display: block;
  max-width: 46rem;
  margin-top: 0.2rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
}

.tag {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--chip-border);
  border-radius: 3px;
  color: var(--chip-fg);
  font-size: 0.72rem;
  white-space: nowrap;
}

.role .where { display: block; margin-top: 0.15rem; color: var(--dim); font-size: 0.78rem; }
.links a { margin-right: 0.15rem; white-space: nowrap; }

#earlier { max-width: 46rem; margin: 2.5rem 0 4rem; }
#earlier h2 {
  margin: 0 0 0.5rem;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#earlier p { margin: 0; color: var(--muted); font-family: var(--sans); font-size: 0.9rem; }

/* Below 960px the table has too little room for the project column
   (iPad portrait is 768-834px), so each row becomes a block. */
@media (max-width: 960px) {
  .site-header, main { padding: 0 1rem; }
  .site-header { padding-top: 2rem; }

  .projects thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .projects, .projects tbody { display: block; }
  .projects tbody tr {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "years kind"
      "project project"
      "role role"
      "links links";
    gap: 0.35rem 0.75rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--rule);
  }
  /* The column widths above have higher specificity, so name the cells here too. */
  .projects tbody td, .projects tbody th,
  .projects .years, .projects .kind, .projects .role, .projects .links { width: auto; padding: 0; border: 0; }
  .projects .years { grid-area: years; }
  .projects .kind { grid-area: kind; }
  .projects .project { grid-area: project; }
  .projects .role { grid-area: role; color: var(--dim); }
  .projects .links { grid-area: links; }
  .role .where { display: inline; }
  .role .where::before { content: " · "; }
}
