/* Layout and type. Values come from tokens.css (generated from Figma);
   class names follow the Figma layer names on "Home — example (reference layout)". */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arimo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-hover); }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; font-weight: 400; }
/* Arimo has no ↗ glyph; use a system font for it so it never turns into an emoji */
.arrow { font-family: system-ui, -apple-system, "Segoe UI Symbol", sans-serif; }

/* ---------- Rail (Figma: "Rail (fixed)") ---------- */
.rail {
  position: fixed;
  top: var(--layout-margin);
  bottom: var(--layout-margin);
  left: var(--layout-margin);
  width: var(--layout-rail-width);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.photo {
  aspect-ratio: 150 / 209;
  width: 100%;
  object-fit: cover;
  background: var(--placeholder);
}
.rail-links { display: flex; flex-direction: column; gap: var(--space-20); }
.rail-links a {
  display: block;
  padding: 2px 0;
  border-top: var(--layout-hairline) solid var(--hairline);
  font-size: var(--type-nav-size);
  line-height: var(--type-nav-line);
}

/* ---------- Content (Figma: "Content") ---------- */
.content {
  /* margin + rail + margin, then a hairline and 10px of padding */
  margin-left: calc(var(--layout-margin) * 2 + var(--layout-rail-width));
  margin-right: var(--layout-margin);
  padding: var(--space-10) 0 var(--space-80) var(--space-10);
  border-left: var(--layout-hairline) solid var(--hairline);
}
.hero {
  padding-left: calc(var(--layout-info-width) + var(--space-20));
  padding-bottom: var(--layout-section-gap);
}
.hero h1 {
  color: var(--ink-soft);
  font-size: var(--type-hero-size);
  line-height: var(--type-hero-line);
  letter-spacing: -0.5px;
  text-transform: uppercase;
  text-align: center;
}
.faint { color: var(--ink-faint); }

/* ---------- Project (Figma: "Project / …") ---------- */
.projects { display: flex; flex-direction: column; gap: var(--layout-section-gap); }
.project { display: flex; gap: var(--space-10); align-items: flex-start; }

.info {
  flex: 0 0 var(--layout-info-width);
  position: sticky;
  top: var(--layout-margin);
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}
.info h2 { font-size: var(--type-heading-size); line-height: var(--type-heading-line); letter-spacing: -1px; }
.info h3, .entry h3 { font-weight: 700; color: var(--ink-muted); }
.case-link {
  font-weight: 700;
  padding: 2px 0;
  border-top: var(--layout-hairline) solid var(--hairline);
  border-bottom: var(--layout-hairline) solid var(--hairline);
}
.highlights { display: flex; flex-direction: column; gap: var(--space-10); }
.highlights li { display: flex; gap: 4px; }
.highlights li::before { content: "✓"; }

.snippets {
  flex: 1;
  min-width: 0;
  padding-left: var(--space-10);
  border-left: var(--layout-hairline) solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}
.label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: var(--type-label-size);
  line-height: var(--type-label-line);
}
/* The meta row sticks at the top; slides stick just under it and stack over each other */
.meta {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-10);
  padding: var(--space-5) 0 var(--space-10);
  border-bottom: var(--layout-hairline) solid var(--hairline);
  font-weight: 700;
}
.snippets img {
  position: sticky;
  top: var(--layout-sticky-top);
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
}

/* Slide wrapper only matters on phones (swipe row); on desktop the images stack as before */
.slides { display: contents; }
.jump { display: none; }

/* Art: a masonry gallery instead of stacking slides */
.gallery { columns: 3; column-gap: var(--space-10); }
.snippets .gallery img {
  position: static;
  aspect-ratio: auto;
  margin-bottom: var(--space-10);
  break-inside: avoid;
}

/* Work at NYIT: a text list of entries instead of slides */
.job-title { font-weight: 700; }
.entries { gap: var(--space-20); }
.entry {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  padding-bottom: var(--space-20);
  border-bottom: var(--layout-hairline) solid var(--hairline);
}
.entry .meta { position: static; }
.entry .case-link { align-self: flex-start; }

/* Closing line under the art gallery (Figma: type/outro/size + line, Desktop/Mobile) */
.outro { font-size: var(--type-outro-size); line-height: var(--type-outro-line); }

/* ---------- Tablet and phone: one column, nothing fixed ---------- */
@media (max-width: 767px) {
  .rail {
    position: static;
    width: auto;
    margin: var(--layout-margin);
    flex-direction: row;
    gap: var(--space-10);
    align-items: flex-start;
  }
  .photo { width: var(--layout-rail-width); flex: none; }
  .rail-links { flex: 1; gap: var(--space-10); }
  .content { margin-left: var(--layout-margin); border-left: 0; padding-left: 0; }
  .hero { padding-left: 0; }
  .hero h1 { text-align: left; }
  .project { flex-direction: column; gap: var(--space-20); }
  .info { position: static; flex-basis: auto; }
  .snippets { padding-left: 0; border-left: 0; width: 100%; }
  .meta { grid-template-columns: 1fr; gap: 0; }
  .gallery { columns: 2; }

  /* Jump bar: pinned to the top while scrolling */
  .jump {
    display: flex;
    gap: var(--space-20);
    position: sticky;
    top: 0;
    z-index: 5;
    overflow-x: auto;
    white-space: nowrap;
    padding: var(--space-10) var(--layout-margin);
    background: var(--paper);
    border-bottom: var(--layout-hairline) solid var(--hairline);
    font-size: var(--type-nav-size);
    line-height: var(--type-nav-line);
  }
  .project { scroll-margin-top: var(--layout-sticky-top); }

  /* Case studies lead with images: title, swipeable slides, meta, then the text */
  .case { gap: var(--space-10); }
  .case .info, .case .snippets { display: contents; }
  .case h2 { order: 1; }
  .case .slides { order: 2; }
  .case .meta { order: 3; position: static; }
  .case .info p { order: 4; }
  .case .case-link { order: 5; }
  .case h3 { order: 6; }
  .case .highlights { order: 7; }
  .case .label { display: none; }
  .slides {
    display: flex;
    gap: var(--space-10);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .case .slides img {
    flex: none;
    width: 85%;
    position: static;
    scroll-snap-align: start;
  }
}
