/* ==========================================================================
   PAGE TRANSITION ("flipping a sketchbook page")
   ========================================================================== */
.sc-page-ready .sc-shell {
  animation: sc-page-enter 0.4s var(--sc-ease);
  transform-origin: left center;
}
.sc-page-leave .sc-shell {
  animation: sc-page-leave 0.26s var(--sc-ease) forwards;
  transform-origin: left center;
}
@keyframes sc-page-enter {
  from { opacity: 0; transform: rotateY(-4deg) translateX(-12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes sc-page-leave {
  to { opacity: 0; transform: rotateY(6deg) translateX(16px); }
}

/* ==========================================================================
   RESET / BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  background: var(--sc-paper);
  color: var(--sc-ink);
  font-family: var(--sc-font-body);
  font-size: 16px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; background: none; border: 0; cursor: pointer; }
hr { border: none; border-top: 1px solid var(--sc-line); }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* ==========================================================================
   SHELL / DESKTOP ASYMMETRICAL SPLIT
   ========================================================================== */
.sc-shell {
  display: flex;
  min-height: 100vh;
}

.sc-sidebar {
  width: var(--sc-sidebar-width);
  min-width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--sc-line);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sc-sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sc-logo { display: inline-flex; }

.sc-hamburger, .sc-cart { display: none; } /* shown only on mobile top bar */

.sc-sidebar__rule { margin: 1.5rem 0; }

.sc-primary-nav__list li { margin-bottom: 1.1rem; }
.sc-primary-nav__list a {
  font-family: var(--sc-font-body);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.sc-sidebar__footer { display: flex; flex-direction: column; gap: 1.5rem; }

.sc-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin: 0;
}
.sc-status__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sc-teal);
  animation: sc-pulse 2.2s ease-in-out infinite;
}
@keyframes sc-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(42,157,143,0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(42,157,143,0); }
}

.sc-social__list { display: flex; gap: 0.9rem; }
.sc-social__list a { display: inline-flex; }

.sc-main { flex: 1; min-width: 0; padding: 2rem 3rem; }

/* ==========================================================================
   HERO
   ========================================================================== */
.sc-hero {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: var(--sc-gutter);
  align-items: center;
  padding-block: 1rem 3rem;
}

.sc-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.sc-headline {
  font-family: var(--sc-font-display);
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  margin: 0 0 1.5rem;
  text-transform: uppercase;
}

.sc-hero__desc {
  max-width: 32ch;
  font-size: 1rem;
  margin: 0 0 1.75rem;
}

.sc-link-underline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding-bottom: 3px;
}
.sc-link-underline::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--sc-ink);
  transform-origin: left;
  transition: transform 0.35s var(--sc-ease);
}
.sc-link-underline:hover::after { transform: scaleX(1.08) translateY(-1px) rotate(-0.3deg); }

.sc-hero__pagination {
  margin-top: 3rem;
  font-family: var(--sc-font-display);
  font-size: 1.6rem;
}
.sc-hero__pagination-current { color: var(--sc-teal); }
.sc-hero__pagination-sep { opacity: 0.4; margin: 0 0.25rem; }
.sc-hero__pagination-total { opacity: 0.6; font-size: 1.1rem; }

.sc-hero__art { position: relative; }
.sc-hero__img { width: 100%; height: auto; }

.sc-hero__placeholder {
  aspect-ratio: 4/3;
  border: 1.5px dashed var(--sc-line);
  border-radius: var(--sc-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(42,157,143,0.06), rgba(233,196,106,0.08) 45%, rgba(231,111,81,0.06));
}
.sc-hero__placeholder-label {
  font-family: var(--sc-font-script);
  font-size: 1.1rem;
  text-align: center;
  opacity: 0.6;
}

.sc-marginalia {
  font-family: var(--sc-font-script);
  font-size: 1.05rem;
  color: var(--sc-ink);
}
.sc-marginalia--bubble {
  position: absolute;
  right: -1rem;
  bottom: 8%;
  background: var(--sc-paper);
  border: 1px solid var(--sc-line);
  border-radius: 50% 50% 50% 4px;
  padding: 0.75rem 1.1rem;
  line-height: 1.15;
  text-align: center;
}

/* ==========================================================================
   FEATURED WORK GRID
   ========================================================================== */
.sc-featured { padding-block: 2rem 4rem; }
.sc-featured__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.sc-section-title {
  font-family: var(--sc-font-display);
  text-transform: uppercase;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  margin: 0;
}

.sc-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.sc-gallery__item {
  display: block;
  position: relative;
  border-radius: var(--sc-radius);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: #efeee8;
}
.sc-gallery__img { width: 100%; height: 100%; object-fit: cover; }
.sc-gallery__item--placeholder {
  border: 1px dashed var(--sc-line);
}
.sc-gallery__title {
  position: absolute;
  left: 0; bottom: 0; right: 0;
  padding: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  background: linear-gradient(to top, rgba(26,26,26,0.55), transparent);
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s var(--sc-ease);
}
.sc-gallery__item:hover .sc-gallery__title { opacity: 1; }

/* ==========================================================================
   SINGLE PORTFOLIO PIECE
   ========================================================================== */
.sc-piece {
  max-width: 900px;
  margin: 0 auto;
  padding-block: 1rem 4rem;
}

.sc-piece__back {
  display: inline-flex;
  margin-bottom: 2rem;
}

.sc-piece__title {
  font-family: var(--sc-font-display);
  text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1;
  margin: 0 0 1rem;
}

.sc-piece__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
}
.sc-piece__meta-item {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--sc-teal);
}
.sc-piece__meta-item:not(:last-child)::after {
  content: "\2022";
  margin-left: 1rem;
  color: var(--sc-line);
}

.sc-piece__excerpt {
  font-family: var(--sc-font-script);
  font-size: 1.3rem;
  max-width: 45ch;
  margin: 0 0 2rem;
  color: var(--sc-ink);
  opacity: 0.85;
}

.sc-piece__hero-image {
  margin-bottom: 2rem;
  border-radius: var(--sc-radius);
  overflow: hidden;
  background: #efeee8;
}
.sc-piece__img { width: 100%; height: auto; }

.sc-piece__content {
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 68ch;
}
.sc-piece__content p { margin: 0 0 1.4rem; }
.sc-piece__content img {
  border-radius: var(--sc-radius);
  margin: 1.5rem 0;
}
.sc-piece__content h2, .sc-piece__content h3 {
  font-family: var(--sc-font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 2rem 0 0.75rem;
}

.sc-piece__pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--sc-line);
}
.sc-piece__pager-link {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  max-width: 45%;
}
.sc-piece__pager-link--next { text-align: right; margin-left: auto; }

@media (max-width: 900px) {
  .sc-piece { padding-inline: 0.25rem; }
}

/* ==========================================================================
   MOBILE BOTTOM TAB BAR (hidden on desktop)
   ========================================================================== */
.sc-tabbar {
  display: none;
}

/* ==========================================================================
   RESPONSIVE: MOBILE (< 900px) -- stacked layout, top bar, bottom tabs
   ========================================================================== */
@media (max-width: 900px) {
  .sc-shell { flex-direction: column; }

  .sc-sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-right: 0;
    border-bottom: 1px solid var(--sc-line);
    background: var(--sc-paper);
  }
  .sc-sidebar__top { width: 100%; }
  .sc-sidebar__rule,
  .sc-sidebar__footer,
  .sc-primary-nav { display: none; }

  /* Off-canvas nav opened via hamburger */
  .sc-primary-nav.is-open {
    display: block;
    position: fixed;
    inset: 0 0 0 auto;
    width: min(80vw, 320px);
    height: 100vh;
    background: var(--sc-paper);
    border-left: 1px solid var(--sc-line);
    padding: 5rem 1.75rem 2rem;
    z-index: 30;
  }
  .sc-primary-nav.is-open .sc-primary-nav__list a { font-size: 1.1rem; }

  .sc-hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
  }
  .sc-hamburger span {
    width: 22px; height: 2px;
    background: var(--sc-ink);
    display: block;
  }
  .sc-cart { display: none; }

  .sc-main { padding: 1.25rem 1.25rem 5.5rem; } /* bottom padding clears tab bar */

  .sc-hero {
    grid-template-columns: 1fr;
    padding-block: 1.5rem 2rem;
  }
  .sc-headline { font-size: clamp(2.5rem, 12vw, 3.4rem); }
  .sc-marginalia--bubble { right: 0; }

  .sc-gallery { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
  .sc-gallery__title { font-size: 0.62rem; padding: 0.4rem; }

  .sc-tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 25;
    background: var(--sc-paper);
    border-top: 1px solid var(--sc-line);
    padding: 0.6rem 0.5rem calc(0.6rem + env(safe-area-inset-bottom));
  }
  .sc-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--sc-ink);
    opacity: 0.55;
    position: relative;
  }
  .sc-tab.is-active { color: var(--sc-teal); opacity: 1; }
  .sc-tab__dot {
    position: absolute;
    top: -6px;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--sc-teal);
  }
}
