/* ============================================================
   PROJECTS.CSS — isladjan.com/work-style project rows for the
   subpages (/about/, /work/). Each row = small index card +
   meta column + big content card, alternating sides per row.
   Reuses the homepage hero-card recipe: flat solid face + a
   clip-path'd sibling strip faking the extruded 3D edge + 2px
   ink borders + pixel/mono type (see card.css).
   Scoped to .proj-* / .idx-* / .page-intro so nothing collides
   with the homepage cards.
   ============================================================ */

/* ---------- shared tokens ---------- */
.page-stage {
  --ink: #14101f;
  --paper: #f2f0ea;
  --side-gray: #8d8d8d;
}

/* Native smooth scroll for the intro's "Scroll" link (and any other
   in-page anchor). Subpage-only file, so the homepage's card.js scroll
   handling is untouched. Reduced-motion users get an instant jump. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* per-row palette — same face/side pairs as the homepage
   click-to-recolor palette (card.js) so the site stays cohesive */
.c-pink   { --face:#fac6f7; --side:#8f3d8b; }
.c-tan    { --face:#d3b88c; --side:#74654d; }
.c-yellow { --face:#ffc900; --side:#7a6000; }
.c-green  { --face:#90ffa8; --side:#457750; }
.c-blue   { --face:#90a8ed; --side:#4c62a5; }
.c-salmon { --face:#f9a392; --side:#8a4a3d; }

/* ============================================================
   PAGE INTRO — first viewport belongs to the hero background;
   a bracketed pixel title floats over it, cards start below.
   ============================================================ */
.page-intro {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.1rem;
  padding: 0 1rem;
}

.page-intro .intro-kicker {
  margin: 0;
  font-family: ibm-plex-mono, monospace;
  font-size: 0.85rem;
  letter-spacing: 3px;
  color: #9b9bb4;
  text-transform: uppercase;
}

.page-intro .page-title {
  margin: 0;
  font-family: vcr-osd-mono, ibm-plex-mono, monospace;
  font-weight: 400;
  /* keep "[ CREATIONS ]" on ONE line (never wrap the closing bracket to its
     own row). white-space:nowrap + a viewport-width-scaled size so the
     longest title still fits without overflowing on narrow screens;
     letter-spacing is relative so it shrinks with the font. */
  font-size: clamp(1.9rem, 10vw, 6.5rem);
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: #fff;
  text-shadow: 5px 5px 0 rgba(0, 0, 0, 0.85);
  text-transform: uppercase;
}

.page-intro .page-title .bracket {
  color: #f9a392;                 /* header-pill salmon */
}

.page-intro .intro-sub {
  margin: 0;
  font-family: ibm-plex-mono, monospace;
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  color: #c8c8dc;
  max-width: 46ch;
  line-height: 1.6;
}

/* clickable link that smooth-scrolls to the first section header
   (see projects.js is not needed — native fragment nav + html
   scroll-behavior below does the work; scroll-margin-top on the
   target lands it clear of the floating header pills). inline-block
   so the intro-bob translateY animation applies. */
.page-intro .intro-scroll {
  margin-top: 2.2rem;
  display: inline-block;
  font-family: vcr-osd-mono, monospace;
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: #9b9bb4;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: 0;
  transition: color 0.25s ease;
  animation: intro-bob 1.6s ease-in-out infinite;
}

.page-intro .intro-scroll:hover,
.page-intro .intro-scroll:focus-visible {
  color: #f9a392;                 /* header-pill salmon on hover */
}

.page-intro .intro-scroll:focus-visible {
  outline: 2px solid #f9a392;
  outline-offset: 4px;
}

@keyframes intro-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .page-intro .intro-scroll { animation: none; }
}

/* ============================================================
   SECTION HEADINGS — "// WEBSITES", "// APPS"
   ============================================================ */
.proj-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem) 7rem;
}

.proj-section-title {
  margin: 5rem 0 3.5rem;
  /* no-JS fallback for fragment nav: offset the heading down so it
     clears the fixed header pills. The JS handler (projects.js) does
     the precise landing when scripting is on. */
  scroll-margin-top: 5.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-family: vcr-osd-mono, ibm-plex-mono, monospace;
  font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.85);
  text-transform: uppercase;
}

.proj-section-title .slashes { color: #f9a392; }

.proj-section-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.22);
}

/* ============================================================
   ROW GRID — [ index card | meta | big card ], flipped rows
   mirror to [ big card | meta | index card ]
   ============================================================ */
.proj-row {
  display: grid;
  grid-template-columns: minmax(210px, 290px) minmax(120px, 170px) minmax(0, 1fr);
  gap: clamp(1.2rem, 3vw, 2.6rem);
  align-items: stretch;
  margin-bottom: clamp(4rem, 9vh, 7rem);
  /* a "Next" card button scrolls to the next row down; land it clear of
     the fixed header pills (same offset as the section headings) */
  scroll-margin-top: 5.5rem;
}

.proj-row--flip {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 170px) minmax(210px, 290px);
}

/* source order is always idx / meta / card; flipped rows rearrange */
.proj-row--flip .idx-card  { order: 3; }
.proj-row--flip .proj-meta { order: 2; text-align: left; }
.proj-row--flip .proj-card { order: 1; }

/* ============================================================
   META COLUMN — number, name, #tags, category (gray mono,
   aligned toward the big card like the reference)
   ============================================================ */
.proj-meta {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding-top: 0.4rem;
  text-align: right;
  font-family: ibm-plex-mono, monospace;
  color: #a8a8bd;
  font-size: 0.82rem;
  line-height: 1.5;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.proj-meta .meta-num {
  font-family: vcr-osd-mono, monospace;
  font-size: 1.5rem;
  color: #fff;
}

.proj-meta .meta-tags { color: #8f8fa8; }

/* ============================================================
   BIG CONTENT CARD — face + extruded side (homepage recipe)
   ============================================================ */
.proj-card {
  display: flex;
  min-width: 0;
  font-family: ibm-plex-mono, monospace;
  color: var(--ink);
  /* hard offset shadow via box-shadow, NOT filter:drop-shadow — with a
     dozen cards over the animated hero canvas, per-element filters
     wedge the rasterizer to 0 fps (measured); box-shadow composites
     cheap. The rectangular shadow peeking through the side strip's
     folded-corner notch reads as the fold's own shadow. */
  box-shadow: 8px 10px 0 rgba(0, 0, 0, 0.45);
}

.proj-card .proj-face {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  background: var(--face);
  border: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
}

/* the fold: side strip's outer-top corner dips, reading as a
   folded-back 3D edge — same polygon trick as card.css */
.proj-card .proj-side {
  flex: none;
  width: 24px;
  background: var(--side);
  clip-path: polygon(0 0, 100% 26px, 100% 100%, 0 100%);
}

/* ---------- title band ---------- */
.proj-card .proj-title {
  margin: 0;
  padding: 1rem 1.4rem 0.85rem;
  border-bottom: 2px solid var(--ink);
  font-family: vcr-osd-mono, ibm-plex-mono, monospace;
  font-weight: 400;
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ---------- body: description + texture panel ---------- */
.proj-card .proj-body {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  padding: 1.2rem 1.4rem 1.3rem;
  align-items: flex-start;
}

.proj-card .proj-desc {
  flex: 1 1 260px;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(20, 16, 31, 0.55);
  padding: 0.9rem 1rem;
  font-size: 0.86rem;
  line-height: 1.6;
}

/* square pattern panel with big outline pixel text */
.proj-card .proj-panel {
  flex: none;
  width: clamp(140px, 17vw, 195px);
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  overflow: hidden;
}

/* pattern A: scattered × lattice (inline SVG so it needs no asset) */
.proj-panel.pat-cross {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cpath d='M11 11l8 8M19 11l-8 8' stroke='%2314101f' stroke-opacity='0.28' stroke-width='1.6'/%3E%3C/svg%3E");
}

/* pattern B: dot grid */
.proj-panel.pat-dots {
  background-image: radial-gradient(circle, rgba(20, 16, 31, 0.30) 1.6px, transparent 1.8px);
  background-size: 21px 21px;
}

.proj-card .panel-text {
  font-family: vcr-osd-mono, ibm-plex-mono, monospace;
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
  /* pixel outline lettering + hard offset for pseudo-3D depth */
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 rgba(20, 16, 31, 0.28);
}

@supports not (-webkit-text-stroke: 2px black) {
  .proj-card .panel-text { color: var(--ink); text-shadow: none; }
}

/* ---------- live animated panel (panels.js) ----------
   The pattern/outline-text combo above is the no-JS fallback; when
   panels.js boots it drops a canvas in and flips the window into a
   tiny near-black CRT. The scanline/vignette dressing is drawn
   INSIDE the canvas by panels.js — a CSS gradient overlay here
   stalled Chrome's rasterizer ~10s when composited over the live
   canvas (same lesson as the .proj-card drop-shadow note). */
.proj-panel.proj-panel--live {
  position: relative;
  background: #0a0913;
  background-image: none;
  overflow: hidden;
}

.proj-panel--live .panel-text { display: none; }

.proj-panel--live canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- footer band: chips + explore ---------- */
.proj-card .proj-foot {
  display: flex;
  align-items: flex-end;
  gap: 1.4rem;
  border-top: 2px solid var(--ink);
  padding: 1rem 1.4rem 1.1rem;
}

.proj-card .proj-tags {
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.55;
}

.proj-card .proj-tags .chip {
  display: inline-block;
  background: var(--ink);
  color: var(--face);
  padding: 2px 7px;
  margin-bottom: 5px;
}

.proj-card .proj-tags .list { display: block; }

.proj-card .proj-btn {
  margin-left: auto;
  font-family: vcr-osd-mono, ibm-plex-mono, monospace;
  font-size: 0.92rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  padding: 0.55rem 1.05rem;
  box-shadow: 3px 3px 0 var(--ink);
  transition: box-shadow 0.15s, transform 0.15s, background-color 0.25s ease;
}

.proj-card .proj-btn:hover {
  background: #f9a392;
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

/* ============================================================
   SMALL INDEX CARD — paper face, big outline numeral, status +
   arrow block; gray extruded side
   ============================================================ */
.idx-card {
  display: flex;
  font-family: ibm-plex-mono, monospace;
  color: var(--ink);
  box-shadow: 7px 9px 0 rgba(0, 0, 0, 0.45);   /* see .proj-card note */
}

.idx-card .idx-face {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  background: var(--paper);
  /* fine dot grid across the whole face (isladjan about-card look);
     the header strip re-paints solid paper over it */
  background-image: radial-gradient(circle, rgba(20, 16, 31, 0.15) 1px, transparent 1.2px);
  background-size: 7px 7px;
  border: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
}

.idx-card .idx-side {
  flex: none;
  width: 20px;
  background: var(--side-gray);
  clip-path: polygon(0 0, 100% 22px, 100% 100%, 0 100%);
}

/* header strip: number box + clean paper filler */
.idx-card .idx-head {
  display: flex;
  align-items: stretch;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}

.idx-card .idx-num {
  font-family: vcr-osd-mono, monospace;
  font-size: 1.35rem;
  padding: 0.45rem 0.9rem;
  border-right: 2px solid var(--ink);
}

.idx-card .idx-fill { flex: 1; }

/* project name line under the header strip */
.idx-card .idx-name {
  font-family: vcr-osd-mono, ibm-plex-mono, monospace;
  font-size: 0.8rem;            /* fits longer names (e.g. COMPUTER SCIENCE) */
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.85rem 1rem 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* big isometric numeral — projects.js swaps the text digits for a
   generated isometric-voxel SVG (.idx-art--voxel); the outline-text
   styling below is the no-JS fallback */
.idx-card .idx-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.idx-card .idx-art {
  font-family: vcr-osd-mono, ibm-plex-mono, monospace;
  font-size: clamp(4.2rem, 7vw, 6rem);
  letter-spacing: 6px;
  color: transparent;
  -webkit-text-stroke: 2.5px var(--ink);
}

@supports not (-webkit-text-stroke: 2px black) {
  .idx-card .idx-art { color: var(--ink); }
}

.idx-card .idx-art--voxel {
  -webkit-text-stroke: 0;
  width: min(62%, 175px);
  letter-spacing: 0;
}

.idx-card .idx-art--voxel svg {
  display: block;
  width: 100%;
  height: auto;
}

/* footer: black arrow block flush in the bottom-left corner,
   year/status beside it (isladjan about-card layout) */
.idx-card .idx-foot {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1.1rem;
}

.idx-card .idx-year {
  font-family: vcr-osd-mono, monospace;
  font-size: 0.85rem;           /* fits longer labels (e.g. Circuit City) */
  letter-spacing: 1.5px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.idx-card .idx-arrow {
  width: 46px;
  height: 46px;
  flex: none;                    /* keep the square from shrinking beside a long label */
  display: grid;
  place-items: center;
  overflow: hidden;              /* the glyph slides out through this mask */
  background: var(--ink);
  color: var(--paper);
  font-size: 1.35rem;
}

/* looping slide: rest, dart out the left edge, wrap in from the right */
.idx-card .idx-arrow .idx-arrow-glyph {
  display: inline-block;
  animation: idx-arrow-slide 2.6s ease-in-out infinite;
}

@keyframes idx-arrow-slide {
  0%, 58%  { transform: translateX(0); }
  76%      { transform: translateX(-220%); }
  76.01%   { transform: translateX(220%); }
  100%     { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .idx-card .idx-arrow .idx-arrow-glyph { animation: none; }
}

/* ============================================================
   SCROLL REVEAL — projects.js adds .revealed as rows enter the
   viewport; reduced-motion never hides anything (no transform,
   no wait)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  /* opacity ONLY — no transform. Transitioning translateY on these
     big rows (box-shadows + stroke text + live canvases, over the
     animated hero) forced continuous re-rasterization and stalled
     the renderer for ~10s per reveal burst (measured). A pure
     opacity fade composites clean at 60fps. */
  .reveal {
    opacity: 0;
    transition: opacity 0.7s ease;
  }
  .reveal.revealed {
    opacity: 1;
  }
}

/* ============================================================
   RESPONSIVE — below ~1080px the three-column row collapses:
   meta becomes a horizontal strip above the big card, the
   decorative index card bows out
   ============================================================ */
@media (max-width: 1080px) {
  .proj-row,
  .proj-row--flip {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .idx-card { display: none; }

  .proj-meta,
  .proj-row--flip .proj-meta {
    order: 1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 1.2rem;
    text-align: left;
    padding-top: 0;
  }

  .proj-card,
  .proj-row--flip .proj-card { order: 2; }
}

@media (max-width: 560px) {
  .proj-card .proj-side { width: 16px; }
  .proj-card .proj-title { padding: 0.85rem 1rem 0.7rem; }
  .proj-card .proj-body { padding: 1rem; gap: 1rem; }
  .proj-card .proj-desc { flex-basis: 100%; }
  .proj-card .proj-panel { width: 100%; aspect-ratio: auto; min-height: 110px; }

  .proj-card .proj-foot {
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
    padding: 0.9rem 1rem 1rem;
  }
  .proj-card .proj-btn { margin-left: 0; flex: 1 1 100%; text-align: center; }
}
