/* Numa Koudsie · portfolio
   Editorial physics-journal layout: paper, ink, burgundy.
   IBM Plex Serif display · IBM Plex Sans text · IBM Plex Mono labels */

@import url('../fonts/plex.css');

:root {
  --paper: #f5f1ea;
  --card: #fffaf3;
  --card-soft: #fbf6ee;
  --ink: #1c1518;
  --ink-2: #3a322e;
  --ink-3: #5a504b;
  --muted: #8b8079;
  --rule: #d9d0c2;
  --rule-soft: #e6dfd2;
  --accent: #7a1f2b;
  --accent-dark: #4d0f18;
  --accent-rose: #e2a2aa;
  --tan: #efe4c8;
  --tan-ink: #7a4b12;
  --serif: 'IBM Plex Serif', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --grid:
    linear-gradient(rgba(122, 31, 43, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 31, 43, 0.075) 1px, transparent 1px);
  --shadow: 0 14px 40px rgba(60, 40, 20, 0.12);
  --shadow-sm: 0 1px 2px rgba(60, 40, 20, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--paper);
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  color: var(--ink);
  margin: 0;
}
p {
  margin: 0 0 1em;
}
p:last-child {
  margin-bottom: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection {
  background: var(--accent-rose);
  color: var(--ink);
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  z-index: 100;
}
.skip-link:focus {
  left: 8px;
}

.mono {
  font-family: var(--mono);
}
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--tan);
  color: var(--tan-ink);
  padding: 3px 7px;
  border-radius: 3px;
  vertical-align: middle;
  white-space: nowrap;
}
.tag--soft {
  background: #f0eae0;
  color: var(--ink-3);
  border: 1px solid var(--rule-soft);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11px;
}

/* ================= hero ================= */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 32px 40px;
  min-height: min(100vh, 860px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero__name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(60px, 9vw, 124px);
  line-height: 0.94;
  letter-spacing: -0.03em;
  margin: 0 0 22px;
  animation: rise 0.9s ease both;
}
.hero__name span {
  display: block;
}
.hero__name .dot {
  display: inline;
  color: var(--accent);
}
.hero__tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.2vw, 27px);
  line-height: 1.3;
  color: var(--ink-2);
  max-width: 560px;
  margin: 0 0 28px;
  animation: rise 0.9s 0.12s ease both;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 30px;
  animation: rise 0.9s 0.22s ease both;
}
.hero__meta a {
  color: var(--accent);
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  animation: rise 0.9s 0.32s ease both;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  padding: 11px 20px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  white-space: nowrap;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(122, 31, 43, 0.25);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--rule);
}
.btn--ghost:hover {
  background: var(--card);
  color: var(--accent-dark);
  border-color: var(--accent);
  box-shadow: none;
}

.figure {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fade 1.2s 0.3s ease both;
}
.figure__stage {
  position: relative;
  aspect-ratio: 1 / 1.02;
  background-color: var(--card);
  background-image: var(--grid);
  background-size: 24px 24px;
}
.figure__stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.figure__cap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.figure__cap span {
  flex: 1;
}
.figure__cap b {
  font-weight: 500;
  color: var(--accent);
}
.figure__cap button {
  flex-shrink: 0;
  white-space: nowrap;
  font: inherit;
  color: var(--ink-3);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  letter-spacing: inherit;
}
.figure__cap button:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ================= layout ================= */
.layout > * {
  min-width: 0;
}
.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px 80px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 72px;
}
.index {
  position: sticky;
  top: 28px;
  align-self: start;
  padding-top: 104px;
  min-width: 0;
}
.index__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px 18px;
}
.index ul {
  border-left: 1px solid var(--rule);
}
.index a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    padding-left 0.2s ease;
}
.index a:hover {
  color: var(--accent);
  text-decoration: none;
  padding-left: 20px;
}
.index a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}
.content {
  min-width: 0;
}

.section {
  padding-top: 104px;
}
.section h2 {
  font-weight: 600;
  font-size: clamp(32px, 3.4vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  padding-top: 18px;
  position: relative;
}
.section h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.section.is-visible h2::before {
  width: 96px;
}
.section__intro {
  font-size: 16px;
  color: var(--ink-2);
  max-width: 620px;
  margin: -8px 0 28px;
}

/* ================= timeline ================= */
.timeline {
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--rule);
}
.timeline__line {
  position: absolute;
  left: 7px;
  top: 8px;
  width: 2px;
  height: 0;
  background: var(--accent);
  transition: height 1.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.timeline.is-visible .timeline__line {
  height: calc(100% - 16px);
}
.entry {
  position: relative;
  padding: 0 0 34px;
}
.entry:last-child {
  padding-bottom: 0;
}
.entry::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
}
.entry--current::before {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(122, 31, 43, 0.35);
  animation: halo 2.6s ease-out infinite;
}
.entry__when {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.entry h3 {
  font-weight: 600;
  font-size: 26px;
  line-height: 1.15;
  margin: 4px 0 2px;
  transition: color 0.2s ease;
}
.entry:hover h3 {
  color: var(--accent);
}
.entry__org {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  margin: 0 0 10px;
}
.bullets li {
  position: relative;
  padding-left: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  margin-bottom: 5px;
}
.bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 6px;
  height: 6px;
  background: var(--accent);
  opacity: 0.75;
}
.bullets li:last-child {
  margin-bottom: 0;
}

/* ================= ledger rows ================= */
.ledger {
  border-top: 1px solid var(--rule);
}
.row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-soft);
  transition: background 0.2s ease;
}
.row:hover {
  background: linear-gradient(to right, var(--card-soft), transparent);
}
.row__when {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 6px;
}
.row h3 {
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
}
.row__org {
  font-size: 15px;
  color: var(--ink-2);
  margin: 2px 0 0;
}
.row__note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ================= research ================= */
.projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.project {
  position: relative;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 22px 20px 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}
.project::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--accent-dark),
    var(--accent),
    var(--accent-rose)
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.project:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(122, 31, 43, 0.4);
}
.project:hover::before {
  transform: scaleX(1);
}
.project__status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.project__status b {
  font-weight: 500;
  color: var(--accent);
}
.project h3 {
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 12px;
}

/* ================= plates (simulations) ================= */
.plates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.plate {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}
.plate:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: rgba(122, 31, 43, 0.4);
}
.plate__fig {
  height: 156px;
  padding: 12px 16px 6px;
  background-color: #fffdf9;
  background-image: var(--grid);
  background-size: 20px 20px;
  border-bottom: 1px solid var(--rule-soft);
}
.plate__fig svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.5s ease;
}
.plate:hover .plate__fig svg {
  transform: scale(1.05);
}
.plate__fig .ink {
  stroke: var(--ink);
}
.plate__fig .acc {
  stroke: var(--accent);
}
.plate__fig .soft {
  stroke: var(--accent-rose);
}
.plate__fig .grey {
  stroke: #cdc1ae;
}
.plate__fig .acc-fill {
  fill: var(--accent);
}
.plate__fig .grey-fill {
  fill: var(--muted);
}
.plate__body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.plate__num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.plate h3 {
  font-weight: 600;
  font-size: 24px;
  line-height: 1.15;
  margin: 4px 0 8px;
}
.plate h3 a {
  color: inherit;
}
.plate h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}
.plate p {
  font-size: 14.5px;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.plate__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.plate__launch {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  padding: 8px 16px;
  border-radius: 6px;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.plate__launch::after {
  content: '→';
  transition: transform 0.2s ease;
}
.plate__launch:hover {
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
  transform: translateX(3px);
  box-shadow: 0 8px 20px rgba(122, 31, 43, 0.25);
}
.plate__launch:hover::after {
  transform: translateX(3px);
}
.plates__more {
  margin: 22px 0 0;
}

/* ================= skills ================= */
.skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
  border-top: 1px solid var(--rule);
}
.skills > div {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 14.5px;
  color: var(--ink-2);
}
.skills dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 4px;
}
.skills dd {
  margin: 0;
}
.skills .lvl {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-left: 6px;
}

/* ================= footer ================= */
footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 32px 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
footer a {
  color: var(--ink-3);
}

/* ================= motion ================= */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes halo {
  to {
    box-shadow: 0 0 0 14px rgba(122, 31, 43, 0);
  }
}
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s ease var(--d, 0ms),
    transform 0.7s ease var(--d, 0ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
.js .reveal.is-visible.plate:hover {
  transform: translateY(-5px);
}
.js .reveal.is-visible.project:hover {
  transform: translateY(-4px);
}

/* ================= responsive ================= */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 36px;
    padding: 40px 20px 28px;
  }
  .figure {
    max-width: 540px;
  }
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 20px 60px;
  }
  .index {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 0;
    margin: 0 -20px;
    background: rgba(245, 241, 234, 0.94);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--rule);
  }
  .index__label {
    display: none;
  }
  .index ul {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    border-left: 0;
    padding: 0 12px;
    scrollbar-width: none;
  }
  .index ul::-webkit-scrollbar {
    display: none;
  }
  .index a,
  .index a:hover {
    padding: 14px 10px;
    margin: 0;
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  .index a.active {
    border-bottom-color: var(--accent);
  }
  .section {
    padding-top: 64px;
  }
  .projects,
  .plates,
  .skills {
    grid-template-columns: 1fr;
  }
  .row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .row__when {
    padding-top: 0;
  }
  footer {
    padding: 24px 20px 36px;
  }
}
@media (max-width: 480px) {
  .hero__name {
    font-size: 56px;
  }
  .skills > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero__name,
  .hero__tag,
  .hero__meta,
  .hero__cta,
  .figure {
    animation: none;
  }
  .entry--current::before {
    animation: none;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .timeline.is-visible .timeline__line {
    transition: none;
  }
}
@media print {
  .index,
  .skip-link,
  .btn,
  .figure {
    display: none;
  }
  body {
    background: #fff;
  }
  .hero {
    min-height: 0;
  }
}
