/* ============================================================
   Seneca Rubianes — Portfolio
   ============================================================ */

:root {
  --page-bg: #c7cbf3;
  --indigo: #5b51e2;
  --indigo-deep: #4c43c9;
  --tab-active: #bfc1fa;
  --tab-inactive: #786fe8;
  --ink: #16141f;
  --ink-soft: #3c3a4a;
  --ink-faint: #6d6b7e;
  --white: #ffffff;

  --mat-quiz: #ace9cf;
  --mat-tracker: #bcc0f7;
  --mat-lessons: #f2b9dc;

  --note-w: 274px;

  --tilt-x: 0deg;
  --tilt-y: 0deg;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--page-bg);
  color: var(--ink);
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* ============ HERO ============ */

.hero {
  background: var(--page-bg); /* solid color behind the panel */
  padding: clamp(28px, 5vw, 72px) clamp(20px, 5vw, 64px);
  display: flex;
  justify-content: center;
}

.pearlescent-card {
  position: relative;
  width: 100%;
  max-width: 1152px;
  height: clamp(360px, 58vh, 560px);
  border-radius: clamp(24px, 3vw, 40px);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transform: perspective(1000px) rotateX(var(--tilt-y)) rotateY(var(--tilt-x));
  transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5);
}

#shader-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(32px, 6vw, 80px);
}

.hero-copy { max-width: 42rem; }

.hero-name {
  font-family: "Crimson Pro", serif;
  font-weight: 500;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #0a0e14;
}

.hero-sub {
  margin-top: 16px;
  font-size: clamp(17px, 2.2vw, 24px);
  line-height: 1.4;
  color: rgba(10, 14, 20, 0.9);
}

.hero-label {
  margin-top: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(11px, 1.3vw, 14px);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(10, 14, 20, 0.7);
}

/* ============ SANDBOX ============ */

.sandbox {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(8px, 2vw, 24px) clamp(16px, 4vw, 48px) clamp(56px, 7vw, 96px);
}

.sandbox-title {
  font-family: "Crimson Pro", serif;
  font-weight: 600;
  font-size: clamp(24px, 3vw, 32px);
  color: var(--ink);
  margin: 0 0 18px 6px;
}

/* ---- binder > folder > paper ---- */

.folder {
  /* the binder: darkest indigo, holds the folders */
  background: var(--indigo);
  border-radius: 28px;
  padding: clamp(14px, 2.2vw, 22px);
  box-shadow: 0 30px 60px -30px rgba(43, 36, 120, 0.55);
}

.tabs {
  display: flex;
  gap: 8px;
  /* keep the strip within the folder's flat top edge, clear of the corner curve */
  padding: 0 20px;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.tab {
  appearance: none;
  border: none;
  cursor: pointer;
  /* browser-tab squish: inactive tabs shrink and ellipsize to fit */
  flex: 0 999 auto;
  min-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 500;
  font-size: clamp(13px, 1.6vw, 15.5px);
  color: #dddcf9;
  background: var(--tab-inactive);
  border-radius: 14px 14px 0 0;
  padding: 10px clamp(14px, 2vw, 22px) 14px;
  margin-bottom: -4px;
  transition: background 0.2s ease, color 0.2s ease, padding 0.2s ease;
}
.tab:hover { background: #8c85ec; color: #ffffff; }
.tab.active {
  /* the selected folder: same color as the folder frame so they merge */
  background: var(--tab-active);
  color: #221e4e;
  font-weight: 600;
  padding-top: 13px;
  padding-bottom: 18px;
  /* the selected tab keeps its full label; it only shrinks (and
     ellipsizes) once the inactive tabs are already at minimum width */
  flex-shrink: 1;
}

.folder-body {
  /* the folder: lighter indigo frame around the paper */
  background: var(--tab-active);
  border-radius: 18px;
  padding: clamp(10px, 1.6vw, 16px);
  position: relative;
  z-index: 1;
}

.sheet {
  /* the paper inside the folder */
  background: var(--white);
  border-radius: 12px;
  padding: clamp(24px, 4.5vw, 56px);
}

/* ---- project header ---- */

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 28px;
}

.project-title {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.project-oneliner {
  max-width: 30rem;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  padding-top: 8px;
}

/* ---- project image ---- */

.image-mat {
  border-radius: 20px;
  padding: clamp(20px, 4vw, 48px);
  transition: background 0.3s ease;
}
.image-mat.mat-quiz    { background: var(--mat-quiz); }
.image-mat.mat-tracker { background: var(--mat-tracker); }
.image-mat.mat-lessons { background: var(--mat-lessons); }

.shot-link { display: block; }
.shot-link.has-demo { cursor: none; }

.shot {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 24px 48px -18px rgba(20, 20, 50, 0.4);
}

.shot-caption {
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 16px;
}

/* ---- divider ---- */

.dashed-divider {
  border: none;
  border-top: 2px dashed #a9aef2;
  margin: clamp(32px, 5vw, 56px) calc(-1 * clamp(24px, 4.5vw, 56px)) 0;
}

/* ---- notes ---- */

.notes-section { padding-top: clamp(28px, 4vw, 48px); }

.notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(24px, 4vw, 44px);
}

.notes-title {
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: clamp(24px, 3vw, 34px);
}

.grid-snap {
  appearance: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #8f93e8;
  background: #eef0fd;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.grid-snap:hover { background: #dfe2fb; color: var(--indigo); }
.grid-snap:active { transform: scale(0.92); }

.notes-board {
  position: relative;
  transition: height 0.35s ease;
}

/* ---- sticky notes ---- */

.note, .stack {
  position: absolute;
  width: var(--note-w);
  user-select: none;
  -webkit-user-select: none;
}

.notes-board.settling .note,
.notes-board.settling .stack {
  transition: left 0.4s cubic-bezier(0.3, 0.9, 0.3, 1), top 0.4s cubic-bezier(0.3, 0.9, 0.3, 1);
}

.note {
  height: var(--note-w);
  overflow: hidden;
  padding: 20px 20px 22px;
  background: var(--note-bg, #eee);
  box-shadow: 0 10px 24px -8px rgba(38, 34, 90, 0.28);
  cursor: grab;
  transform: rotate(0deg);
  transition: transform 0.25s ease, height 0.35s ease, box-shadow 0.25s ease;
  touch-action: pan-y;
}

.note:not(.open):hover { transform: rotate(-5deg); }

.note.open { transform: rotate(0deg); height: auto; }
.note.dragging {
  cursor: grabbing;
  transform: rotate(0deg) scale(1.03);
  box-shadow: 0 22px 44px -12px rgba(38, 34, 90, 0.45);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.note.open.dragging { transform: scale(1.02); }

.note-cat {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--note-accent, #666);
  margin-bottom: 10px;
}

.note-sub {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--note-accent, #666);
  opacity: 0.75;
  margin: -6px 0 10px;
}

.note-front {
  font-size: 13.5px;
  line-height: 1.5;
  color: #2a2833;
}
.note-front ul { padding-left: 18px; }
.note-front li { margin-bottom: 4px; }

.note-more {
  font-size: 13.5px;
  line-height: 1.55;
  color: #2a2833;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
}
.note.open .note-more { opacity: 1; }

/* note palettes */
.c-problem { --note-bg: #e9cdf5; --note-accent: #a558cb; }
.c-idea    { --note-bg: #fce3ab; --note-accent: #bd8c2e; }
.c-process { --note-bg: #b7f4c8; --note-accent: #43985f; }
.c-result  { --note-bg: #b6bff7; --note-accent: #5d6bd2; }
.c-vision  { --note-bg: #b8f1f4; --note-accent: #2b9ba3; }
.c-next    { --note-bg: #fccce6; --note-accent: #e2569e; }

/* ---- stacks of notes ---- */

.stack { height: calc(var(--note-w) + 20px); }

.stack .note {
  position: absolute;
  left: 0;
  top: 0;
  transition: transform 0.3s ease, height 0.35s ease, left 0.35s ease, top 0.35s ease, box-shadow 0.25s ease;
}

/* closed stack: peeking cards behind the first */
.stack:not(.open) .note:nth-child(1) { z-index: 3; }
.stack:not(.open) .note:nth-child(2) { z-index: 2; transform: translate(9px, 9px) rotate(2.5deg); }
.stack:not(.open) .note:nth-child(3) { z-index: 1; transform: translate(18px, 18px) rotate(-2deg); }

/* hover: spread slightly + counter-clockwise tilt on top card */
.stack:not(.open):hover .note:nth-child(1) { transform: rotate(-5deg); }
.stack:not(.open):hover .note:nth-child(2) { transform: translate(26px, 16px) rotate(5deg); }
.stack:not(.open):hover .note:nth-child(3) { transform: translate(50px, 32px) rotate(-6deg); }

.stack.open .note { transform: rotate(0deg); }
.stack.dragging .note { cursor: grabbing; }

/* ============ FOOTER ============ */

.footer {
  background: var(--indigo);
  color: #eceafd;
  padding: clamp(28px, 4vw, 44px) clamp(20px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-note {
  max-width: 34rem;
  font-size: 13.5px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 28px;
}

.footer-links a {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.footer-links a:hover { border-color: rgba(255, 255, 255, 0.7); }

/* ============ CUSTOM CURSOR ============ */

.cursor-pill {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  background: #14121f;
  color: #ffffff;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 999px;
  transform: translate(-50%, -140%);
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}
.cursor-pill.visible { opacity: 1; }

/* ============ RESPONSIVE ============ */

@media (max-width: 760px) {
  .project-header { flex-direction: column; gap: 10px; }
  .project-oneliner { padding-top: 0; }
  .footer { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .pearlescent-card { transition: none; }
  .note, .stack .note, .notes-board { transition: none; }
}
