/* =====================================================================
   2ITZ Studio — /portfolio page
   Standalone stylesheet (mirrors the design tokens used site-wide).
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;500;600;700&family=Noto+Sans+JP:wght@500;700;900&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --paper:        #FBF5EA;
  --paper-2:      #F2E9D6;
  --paper-3:      #E8DCC2;
  --paper-muted:  #D4C7B5;
  --ink:          #1A1714;
  --ink-2:        #3B342E;
  --ink-3:        #6B6158;
  --ink-4:        #9E958A;
  --ink-5:        #A89B8C;
  --rule:         #D6D2CC;

  --accent-orange:    #F26B1F;
  --accent-orange-2:  #D95814;
  --accent-tangerine: #FFB169;
  --accent-peach:     #FCE0C4;

  --ok:    #2C6E7F;
  --warn:  #E0A020;
  --err:   #C63A26;
  --info:  #6B8E9F;

  --font-display: "Archivo Black", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-jp:      "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;

  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset / base --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #C8BFB3; border-radius: 4px; }

/* =====================================================================
   MASTHEAD
   ===================================================================== */
.masthead {
  position: relative;
  overflow: hidden;
}

/* Dark top bar */
.masthead__bar {
  background: var(--ink);
  color: var(--paper);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.masthead__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.masthead__logo-img {
  height: 40px;
  width: auto;
  display: block;
}
.masthead__wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--paper);
}
.masthead__crumb {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-5);
  letter-spacing: 0.1em;
  margin-left: 4px;
}
.masthead__cta {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--accent-orange);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--paper);
  transition: transform 150ms var(--ease-bounce), box-shadow 150ms var(--ease-out);
}
.masthead__cta:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--paper);
}

/* Title block */
.masthead__title-block {
  padding: 60px 40px 32px;
  position: relative;
}
.masthead__watermark {
  position: absolute;
  right: -30px;
  top: -50px;
  pointer-events: none;
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 380px;
  line-height: 0.8;
  color: var(--ink);
  opacity: 0.06;
  user-select: none;
}
.masthead__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-orange);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.masthead__heading {
  font-family: var(--font-display);
  font-size: clamp(64px, 9vw, 132px);
  line-height: 0.88;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
.masthead__body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 600px;
  margin-top: 18px;
}

/* Inline stats */
.masthead__stats {
  padding: 0 40px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
.masthead__stat {
  padding: 0 24px;
  border-left: 1px solid var(--rule);
}
.masthead__stat:first-child {
  padding-left: 0;
  border-left: none;
}
.masthead__stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.masthead__stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* =====================================================================
   STICKY FILTER ROW
   ===================================================================== */
.filter-row {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.filter-row__chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-row__label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-right: 4px;
}
.filter-row__hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.1em;
}

.chip {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  background: transparent;
  border: 2px solid;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 180ms ease-out, color 180ms ease-out;
}
.chip__count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  opacity: 0.85;
}
.chip.is-active .chip__count { color: inherit; opacity: 0.9; }

/* =====================================================================
   MOSAIC
   ===================================================================== */
.mosaic {
  padding: 22px 40px 80px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 8px;
  grid-auto-flow: row dense;
  gap: 16px;
}
/* In the ALL view tiles are sorted by category — turn off dense so
   items render in DOM order and types stay visibly grouped. */
.mosaic.is-grouped {
  grid-auto-flow: row;
}

/* Section divider between category groups (ALL view only). */
.mosaic__divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 56px 4px 32px;
}
.mosaic__divider:first-child { padding-top: 28px; }
.mosaic__divider-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent-orange);
  border: 2px solid var(--ink);
  flex-shrink: 0;
}
.mosaic__divider-label {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-transform: uppercase;
}
.mosaic__divider-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
}
.mosaic__divider-rule {
  flex: 1;
  height: 3px;
  background: var(--ink);
  opacity: 0.55;
}
.mosaic__empty {
  grid-column: span 12;
  padding: 80px 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink-3);
}

/* ----- Tile ----- */
.art-tile {
  position: relative;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--paper);
  font: inherit;
  text-align: left;
  padding: 0;
  transition: box-shadow 240ms var(--ease-out);
  transform: scale(1) rotate(0deg);
  will-change: transform;
}
.art-tile:focus-visible {
  outline: 3px solid var(--accent-orange);
  outline-offset: 3px;
}
.art-tile.is-hover {
  z-index: 3;
  box-shadow: 6px 6px 0 var(--ink);
  animation: art-jiggle 520ms var(--ease-bounce) forwards;
}
@keyframes art-jiggle {
  0%   { transform: scale(1)     rotate(0deg); }
  22%  { transform: scale(1.03)  rotate(-0.5deg); }
  45%  { transform: scale(1.018) rotate(0.3deg); }
  68%  { transform: scale(1.024) rotate(-0.15deg); }
  85%  { transform: scale(1.02)  rotate(0.08deg); }
  100% { transform: scale(1.02)  rotate(0deg); }
}

/* Cover (placeholder recipe — used when no src is set) */
.art-cover {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
/* Cover (real image) */
.art-cover--image { background: var(--ink); }
.art-cover__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* In the lightbox the cover holds the full image — fit it inside the
   container so nothing critical gets cropped. */
.lightbox__cover .art-cover__img {
  object-fit: contain;
  background: var(--ink);
}
.art-cover__stripes {
  position: absolute;
  inset: 0;
  opacity: 0.16;
}
.art-cover__glyph {
  position: absolute;
  right: -8px;
  top: -22px;
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 85cqmin;
  line-height: 0.8;
  opacity: 0.2;
  pointer-events: none;
  user-select: none;
}
.art-cover__disc-row {
  position: absolute;
  left: 12px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.art-cover__disc {
  width: min(72px, 25%);
  aspect-ratio: 1;
  border-radius: 999px;
  border: 2.5px solid;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.art-cover__disc img {
  width: 62%;
  height: 62%;
  transform: rotate(-8deg);
}
.art-cover__title {
  font-family: var(--font-display);
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 70%;
}

/* Category badge */
.art-tile__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  border: 1.5px solid;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
  z-index: 2;
}

/* Hover caption */
.art-tile__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 44px 16px 14px;
  background: linear-gradient(to top, rgba(20,16,12,0.92) 30%, rgba(20,16,12,0.5) 70%, transparent 100%);
  color: var(--paper);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease-out, transform 240ms ease-out;
  pointer-events: none;
  z-index: 2;
}
.art-tile.is-hover .art-tile__caption {
  opacity: 1;
  transform: translateY(0);
}
.art-tile__caption-title {
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.art-tile__caption-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 8px;
}
.art-tile__caption-client {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-tangerine);
}
.art-tile__caption-zoom {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--paper);
  letter-spacing: 0.08em;
  border: 1.5px solid var(--paper);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(242,107,31,0.85);
}

@media (prefers-reduced-motion: reduce) {
  .art-tile.is-hover {
    animation: none;
    transform: scale(1.03);
    transition: transform 200ms ease-out, box-shadow 200ms ease-out;
  }
}

/* =====================================================================
   FOOTER (portfolio variant)
   ===================================================================== */
.port-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 60px 40px 36px;
  border-top: 2px solid var(--ink);
  position: relative;
  overflow: hidden;
}
.port-footer__watermark {
  position: absolute;
  right: -30px;
  bottom: -80px;
  pointer-events: none;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 320px;
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: var(--ink-2);
  opacity: 0.6;
  user-select: none;
}
.port-footer__inner {
  max-width: 1200px;
  position: relative;
}
.port-footer__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-tangerine);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.port-footer__heading {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 8px 0 18px;
  color: var(--paper);
  text-wrap: balance;
  max-width: 880px;
}
.port-footer__body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--paper-muted);
  max-width: 580px;
  margin: 0;
}
.port-footer__ctas {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.port-footer__btn {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 12px 22px;
  text-decoration: none;
  border: 2.5px solid;
  transition: transform 150ms var(--ease-bounce), box-shadow 150ms var(--ease-out);
}
.port-footer__btn--orange {
  background: var(--accent-orange);
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--paper);
}
.port-footer__btn--orange:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--paper);
}
.port-footer__btn--outline {
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
}
.port-footer__btn--outline:hover {
  background: rgba(251, 245, 234, 0.08);
}
.port-footer__legal {
  position: relative;
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-5);
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* =====================================================================
   LIGHTBOX
   ===================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 16, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  /* Tight margin so the card can swell almost to the viewport edge. */
  padding: 16px;
  animation: lb-in 220ms ease-out;
}
.lightbox[hidden] { display: none; }

@keyframes lb-in {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox__hud {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.lightbox__counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--paper);
  letter-spacing: 0.14em;
}
.lightbox__close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--paper);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--accent-orange);
}

.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  border: 2.5px solid var(--paper);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--accent-orange);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 1;
}
.lightbox__arrow--prev { left: 24px; }
.lightbox__arrow--next { right: 24px; }

.lightbox__card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 var(--ink);
  display: grid;
  overflow: hidden;
  /* width / height / grid-template-columns are set inline by JS per
     artwork so the card matches the image's natural aspect, never
     larger than the source and never taller than the viewport. */
  max-width: 100%;
  max-height: 96vh;
}

.lightbox__cover {
  position: relative;
  min-height: 0;
  border-right: 3px solid var(--ink);
  overflow: hidden;
  container-type: size;
}
/* Big-mode cover styles (rendered inside .lightbox__cover) */
.lightbox__cover .art-cover__glyph {
  font-size: 70vmin;
  right: -2%;
  top: -8%;
}
.lightbox__cover .art-cover__disc-row {
  left: 5%;
  bottom: 8%;
  gap: 28px;
}
.lightbox__cover .art-cover__disc {
  width: 140px;
  border-width: 4px;
  box-shadow: 6px 6px 0 currentColor;
}
.lightbox__cover .art-cover__title {
  font-size: 56px;
  max-width: 60vw;
}

.lightbox__meta {
  padding: 28px 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--ink);
  overflow: auto;
}
.lightbox__meta-eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lightbox__cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
}
.lightbox__year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.12em;
}
.lightbox__title {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
.lightbox__client {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}
.lightbox__client #lb-client-prefix { color: var(--ink-2); }
.lightbox__client #lb-client        { color: var(--accent-orange); }
/* When no prefix is set (Personal / Studio piece), let the client text
   sit in normal ink instead of being highlighted in orange. */
.lightbox__client.is-plain #lb-client { color: var(--ink-2); }
.lightbox__desc {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}
.lightbox__specs { margin-top: 4px; }
.lightbox__spec {
  display: grid;
  grid-template-columns: 92px 1fr;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--rule);
}
.lightbox__spec-label {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 2px;
}
.lightbox__spec-value { color: var(--ink); }

.lightbox__footer {
  margin-top: auto;
  display: flex;
  gap: 10px;
  padding-top: 14px;
  border-top: 1.5px dashed var(--ink);
}
.lightbox__chip {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 150ms var(--ease-bounce), box-shadow 150ms var(--ease-out);
}
.lightbox__chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}
.lightbox__chip--dark {
  background: var(--ink);
  color: var(--paper);
}
.lightbox__spacer { flex: 1; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 960px) {
  .masthead__bar,
  .masthead__title-block,
  .masthead__stats,
  .filter-row,
  .port-footer { padding-left: 24px; padding-right: 24px; }
  .masthead__crumb { display: none; }
  .mosaic { padding: 18px 18px 56px; }
  .masthead__stat { padding: 0 16px; }
  .lightbox { padding: 12px; }
  /* Mobile stack — override the per-artwork inline sizing JS applies. */
  .lightbox__card {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr auto;
    width: 100% !important;
    height: auto !important;
    max-height: 96vh;
  }
  .lightbox__cover { aspect-ratio: 16 / 10; border-right: none; border-bottom: 3px solid var(--ink); }
  .lightbox__arrow { width: 48px; height: 48px; font-size: 18px; }
  .lightbox__arrow--prev { left: 12px; }
  .lightbox__arrow--next { right: 12px; }
}
@media (max-width: 720px) {
  .mosaic { grid-template-columns: repeat(6, 1fr); }
  .filter-row__hint { display: none; }
}
@media (max-width: 540px) {
  .masthead__stats { gap: 12px; }
  .masthead__stat { padding: 0 10px; }
  .masthead__stat-value { font-size: 22px; }
}
