* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #fff;
  color: #000;
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

.sw-page {
  position: relative;
  width: 1440px;
  height: 5209px;
  margin: 0 auto;
  overflow: clip;
}

.sw-title {
  position: absolute;
  left: 108px;
  top: 165px;
  margin: 0;
  padding: 10px;
  font-weight: 900;
  font-size: 96px;
  line-height: normal;
  white-space: nowrap;
}

/* strips (flyers and craft rows): a frame cut off at the edges of the content column; the strip slides left by
   itself (js/flyer-marquee.js) and can be scrolled sideways, so it is a scroller with no visible scrollbar */
.marquee {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  outline: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.marquee::-webkit-scrollbar { display: none; }
.marquee.is-dragging { cursor: grabbing; }

.marquee-track {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: max-content;
}

.flyers {
  position: absolute;
  left: 118px;
  top: 1499px;
  width: 1204px;
  height: 550px;
}

.flyer {
  flex: none;
  display: block;
  width: 439px;
  height: 549px;
  object-fit: cover;
  -webkit-user-drag: none;
}

.flyer-nudge { margin-top: 1px; }

/* section copy */
.sw-text {
  position: absolute;
  left: 118px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.sw-subtitle {
  flex: none;
  margin: 0;
  font-weight: 500;
  font-size: 64px;
  line-height: normal;
}

.sw-desc {
  flex: none;
  margin: 0;
  font-weight: 400;
  font-size: 24px;
  line-height: normal;
}

.sw-desc em {
  font-weight: 300;
  font-style: italic;
}

.text-acs { top: 2069px; width: 630px; }
.text-acs .sw-desc { width: 630px; height: 119px; }

.text-photo { top: 3713px; width: 551px; }
.text-photo .sw-desc { width: 579px; height: 119px; }

.text-crafts { top: 4809px; width: 630px; }
.text-crafts .sw-desc { width: 579px; }

/* Stickers: a little tilted, with a very light shadow and the bottom-right corner peeled up.
   The face is cut along a 45 degree fold line; the flap is the cut-off corner (the same picture) mirrored across that line,
   painted as the paper back with a soft shadow. --a is the length of the folded corner along each edge, and it
   grows on hover so the corner lifts a bit more. */
@property --a {
  syntax: '<length>';
  inherits: true;
  initial-value: 20px;
}

.sw-sticker {
  position: absolute;
  display: block;
  width: var(--w);
  height: var(--h);
  transform: rotate(var(--tilt));
  cursor: pointer;
  outline: none;
  transition: --a 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.14)) drop-shadow(0 2px 5px rgba(0, 0, 0, 0.08));
}

.sw-sticker:focus-visible { outline: 2px solid #000; outline-offset: 6px; border-radius: 12px; }

.sticker-face {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(var(--h) - var(--a)), calc(var(--w) - var(--a)) 100%, 0 100%);
}

.sticker-curl {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--w);
  height: var(--h);
  transform-origin: 0 0;
  /* mirror across the line x + y = w + h - a */
  transform: translate(calc(var(--w) + var(--h) - var(--a)), calc(var(--w) + var(--h) - var(--a))) scale(1, -1) rotate(90deg);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.sticker-curl span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ffffff 10%, #e1e1dc 100%);
  -webkit-mask: var(--sticker) center / 100% 100% no-repeat;
  mask: var(--sticker) center / 100% 100% no-repeat;
  clip-path: polygon(100% 100%, 100% calc(100% - var(--a)), calc(100% - var(--a)) 100%);
}

/* about 25% bigger than before, still centred where the arrows were (998 and 2611) */
.sticker-acs {
  --w: 80px; --h: 80px; --a: 38px; --tilt: -8deg;
  --sticker: url('assets/side-works/sticker-acs.png');
  left: 764px; top: 2067px;
}

.sticker-photo {
  --w: 80px; --h: 55.4px; --a: 17px; --tilt: 6deg;
  --sticker: url('assets/side-works/sticker-camera.png');
  left: 514px; top: 3729.3px;
}
.sticker-photo:hover, .sticker-photo:focus-visible { --a: 25px; }

@media (prefers-reduced-motion: reduce) {
  .sw-sticker { transition: none; }
}

/* the note beside each sticker appears while the sticker is hovered or focused. Its box starts at the sticker's right
   edge, so the cursor can cross over to it (and the Instagram link) without it disappearing */
.sw-caption {
  position: absolute;
  display: flex;
  align-items: center;
  height: 24px;
  margin: 0;
  padding-left: 16px;
  font-weight: 400;
  font-size: 13px;
  line-height: normal;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.caption-photo { left: 594px; top: 3745px; }

.sw-sticker:hover + .sw-caption,
.sw-sticker:focus-visible + .sw-caption,
.sw-caption:hover,
.sw-caption:focus-within {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

/* no hover on touch screens, so the notes stay visible there */
@media (hover: none) {
  .sw-caption {
    opacity: 1;
    visibility: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-caption { transition: none; }
}

.sw-caption a {
  color: inherit;
  text-decoration: underline;
  text-underline-position: from-font;
}

/* photo grid: a frame that shows the top of a taller grid; scrolling inside it moves down the rest */
.photo-grid {
  position: absolute;
  left: 118px;
  top: 2372px;
  width: 1204px;
  height: 1321px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  outline: none;
}

.photo-grid::-webkit-scrollbar { display: none; }

.photo-grid-inner {
  position: absolute;
  left: 0;
  top: 0;
  width: 1204px;
  height: 4627.75px;
}

.photo-grid-inner img {
  position: absolute;
  display: block;
  max-width: none;
  object-fit: cover;
}

/* crafts: two staggered rows that slide at their own speeds, cut off at both edges of the content column */
.crafts-grid {
  position: absolute;
  left: 118px;
  top: 4016px;
  width: 1204px;
  height: 768px;
  overflow: clip;
}

.craft-row {
  position: absolute;
  left: 0;
  width: 1204px;
  height: 370px;
}

.craft {
  position: relative;
  flex: none;
  width: 594px;
  height: 370px;
  border-radius: 10px;
  overflow: clip;
}

.craft-img,
.craft-panel {
  position: absolute;
}

.craft-img { overflow: hidden; }

.craft-img img {
  position: absolute;
  -webkit-user-drag: none;
  display: block;
  max-width: none;
}

.craft-img img.cover {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.craft-panel { background: #fff; }

.craft-title,
.craft-tools {
  position: absolute;
  margin: 0;
  font-weight: 400;
  line-height: normal;
  white-space: nowrap;
}

.craft-title { font-size: 32px; }
.craft-title span { display: block; }
.craft-tools { font-size: 14px; }

/* Side Projects: a flashcard-style card (Figma node 277:346, backed by 277:345) that flips on
   click, Quizlet-style. The backing card is rotated 94.47deg against the front's 90deg base
   rotation (a 4.47deg relative tilt) -- its rotated bounding box is wider than the front card,
   so the whole stack is scaled down (0.9447x) to keep that bounding box within the standard
   118px page margins, matching Figma's own wrapper size (1262.951x894.442) proportionally. */
.text-side-projects { top: 1232px; width: 630px; }
.text-side-projects .sw-desc { width: 760px; }

.side-projects-card {
  position: absolute;
  left: 151.5px;
  top: 390px;
  width: 1137px;
  height: 759px;
  perspective: 1800px;
  cursor: pointer;
}

.side-projects-card:focus-visible { outline: none; }

.side-projects-nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.side-projects-nav img {
  position: absolute;
  inset: -4.17%;
  display: block;
  width: 108.34%;
  height: 108.34%;
  max-width: none;
}

.side-projects-nav-prev { left: 16px; transform: translateY(-50%); }
.side-projects-nav-next { right: 16px; transform: translateY(-50%); }

.side-projects-nav-prev img { transform: rotate(-90deg); }
.side-projects-nav-next img { transform: rotate(90deg); }

.side-projects-nav-prev:hover { transform: translateY(-50%) translateX(-10px); }
.side-projects-nav-next:hover { transform: translateY(-50%) translateX(10px); }

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}

.side-projects-card.flipped .flip-card-inner { transform: rotateY(-180deg); }

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 10px 10px 10px 0px rgba(0, 0, 0, 0.25);
}

.flip-card-back {
  transform: rotateY(180deg);
  display: flex;
}

/* Postcard layout: a message side on the left, a divider, and an address side on the
   right (stamp box + ruled lines), like the back of an actual postcard. */
.postcard {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 50px 60px;
  gap: 50px;
}

.postcard-message {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.postcard-title {
  margin: 0 0 26px;
  font-size: 30px;
  font-weight: 600;
  color: #000;
}

.postcard-tools-label {
  margin: 36px 0 22px;
  font-size: 23px;
  font-weight: 500;
  color: #000;
}

.postcard-tools {
  display: flex;
  gap: 32px;
}

.postcard-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #777;
}

.postcard-tool-icon { width: 26px; height: 26px; flex: none; display: block; border-radius: 6px; }

.rp-back-placeholder {
  margin: 0;
  font-size: 22px;
  line-height: 1.6;
  color: #444;
  font-style: italic;
}

.postcard-divider {
  flex: none;
  width: 1px;
  background: #d8d8d8;
}

.postcard-address {
  flex: none;
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-top: 10px;
}

.postcard-stamp {
  flex: none;
  display: block;
  width: 76px;
  height: 96px;
  object-fit: cover;
}

/* Writes the note directly on ruled lines: a repeating gradient draws a rule
   under every wrapped line of text, the way the blank lines used to look. */
.postcard-note {
  width: 100%;
  margin: 32px 0 0;
  padding-bottom: 6px;
  font-size: 18px;
  font-style: italic;
  color: #444;
  text-align: left;
  line-height: 40px;
  background-image: linear-gradient(to bottom, transparent calc(100% - 1px), #d8d8d8 calc(100% - 1px));
  background-size: 100% 40px;
  background-repeat: repeat-y;
}

.rp-video-wrap {
  position: absolute;
  left: 50%;
  top: calc(50% + 0.5px);
  width: 950px;
  height: 534px;
  transform: translate(-50%, -50%);
  overflow: hidden;
}

/* Masks a thin border baked into a source clip's own pixels (not added by this
   page) with the card's own background color, so it reads as a clean edge.
   Needs to be an absolutely-positioned overlay, not a box-shadow -- a plain
   box-shadow paints behind the (opaque, same-size) video and would be hidden. */
.rp-video-wrap.mask-edges::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 4px solid #fff;
  pointer-events: none;
}

.rp-video-wrap video,
.rp-video-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.rp-date-wrap {
  position: absolute;
  right: 30px;
  bottom: 30px;
}

.rp-date {
  margin: 0;
  font-size: 24px;
  white-space: nowrap;
}

/* back to top */
.back-to-top {
  position: absolute;
  left: 50%;
  top: 5083px;
  width: 48px;
  height: 48px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.back-to-top img {
  position: absolute;
  inset: -4.17%;
  display: block;
  width: 108.34%;
  height: 108.34%;
  max-width: none;
}

.back-to-top.visible:hover {
  transform: translateX(-50%) translateY(-10px);
}

/* enlarge on click */
.flyer,
.photo-grid-inner img,
.craft { cursor: pointer; }

.marquee.is-dragging,
.marquee.is-dragging * { cursor: grabbing; }

.flyer:focus-visible,
.photo-grid-inner img:focus-visible,
.craft:focus-visible {
  outline: 2px solid #000;
  outline-offset: 4px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.94);
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lightbox.open .lightbox-stage { transform: scale(1); }

.lightbox-image {
  display: block;
  max-width: none;
  border-radius: 12px;
  object-fit: contain;
}

.lightbox-card {
  position: absolute;
  left: 0;
  top: 0;
  flex: none;
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  padding: 10px;
  line-height: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.lightbox-close img { display: block; width: 48px; height: 48px; }

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox-stage { transition: none; }
}
