/* ============================================================
   Work detail page (works/*.html)
   Shared by all five SELECTED WORKS sub-pages.
   ============================================================ */

.work {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 170px var(--gutter) 80px;
}

/* ── Eyebrow: category tag + counter ───────────────────────── */

.work__eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.work__tag {
  padding: 4px 10px;
  border: 1px solid var(--amber-line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--amber);
}

.work__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ── Title ─────────────────────────────────────────────────── */

.work__title {
  margin: 0;
  font-weight: 400;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* ── Meta table: CLIENT / CATEGORY / ROLE ──────────────────── */

.work__meta {
  margin: 36px 0 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.work__meta > div {
  margin: 0;
}

.work__meta dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.work__meta dd {
  margin: 6px 0 0;
  font-weight: 300;
  font-size: 14px;
  color: var(--text);
}

/* ── Image frames ──────────────────────────────────────────── */

.work__hero {
  margin: 48px 0 0;
}

.work__gallery {
  margin: 56px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.frame {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.frame--4x3 {
  aspect-ratio: 4 / 3;
}

.frame--16x9 {
  aspect-ratio: 16 / 9;
}

.frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Empty-state caption — stands in until the client artwork lands.
   Delete the <p> (and drop in an <img>) to fill the frame. */
.frame__placeholder {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-weight: 300;
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

/* Horizontal scroller variant: many deliverables in one swipeable row */
.work__scroller {
  margin-top: 56px;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 163, 61, 0.5) rgba(245, 241, 234, 0.08);
}

.work__scroller:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 4px;
}

.work__scroller::-webkit-scrollbar {
  height: 6px;
}

.work__scroller::-webkit-scrollbar-track {
  background: rgba(245, 241, 234, 0.08);
}

.work__scroller::-webkit-scrollbar-thumb {
  background: rgba(232, 163, 61, 0.5);
}

/* Sized so the next card peeks past the edge — the cue that the row scrolls. */
.work__scroller .work__shot {
  flex: 0 0 min(420px, 80%);
  scroll-snap-align: start;
}

/* Deliverable art comes in mixed ratios (16:9, Brain's 1.91:1, …) — contain,
   never crop: edge-to-edge text on a thumbnail must stay readable. */
.work__scroller .frame img {
  object-fit: contain;
}

/* Gallery item with a caption below the frame */
.work__shot {
  margin: 0;
}

.work__shot figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ── Two-column blocks (label + body) ──────────────────────── */

.work__section {
  margin-top: 64px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
}

.work__section-label {
  font-family: var(--font-mincho);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--amber);
}

.work__lead {
  margin: 0;
  max-width: 640px;
  font-weight: 300;
  font-size: 16px;
  line-height: 2;
  letter-spacing: 0.06em;
  color: var(--text);
}

.work__lead--pending {
  color: var(--text-dim);
}

/* ── Result stats (before → after) ─────────────────────────── */

.work__stats {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.stat {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.stat__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.stat__value {
  margin-top: 10px;
  font-family: var(--font-en);
  font-weight: 300;
  font-size: clamp(20px, 1.8vw, 26px);
  letter-spacing: 0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat__arrow {
  color: var(--amber);
}

.stat__note {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
}

.work__stats-period {
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

/* ── Link row ──────────────────────────────────────────────── */

.work__links {
  margin-top: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.btn-outline {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 14px 28px;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text);
  transition: color 0.2s, border-color 0.2s;
}

@media (hover: hover) {
  .btn-outline:hover {
    color: var(--amber);
    border-color: var(--amber);
  }
}

.link-quiet {
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ── Next work ─────────────────────────────────────────────── */

.work__next {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.work__next-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.work__next-link {
  font-weight: 400;
  font-size: clamp(14px, 1.5vw, 16px);
  letter-spacing: 0.04em;
  color: var(--text);
}

/* ── CONTACT (sub-page edition of the TOP section; CSS-only roll) ── */

.work-contact {
  margin-top: 96px;
}

.work-contact__eyebrow {
  font-family: var(--font-mincho);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--amber);
  margin-bottom: 14px;
}

.work-contact__title {
  margin: 0 0 22px;
  font-family: var(--font-en);
  font-weight: 300;
  font-size: clamp(34px, 3.5vw, 48px);
  letter-spacing: 0.02em;
  color: var(--text);
}

.work-contact__note {
  margin: 0 0 44px;
  font-weight: 300;
  font-size: 14px;
  line-height: 2;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.contact-row {
  display: block;
  border-top: 1px solid var(--line);
  padding: 34px 0;
}

.contact-row:last-of-type {
  border-bottom: 1px solid var(--line);
}

.contact-row__grid {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 24px;
}

.contact-row__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.contact-row__value {
  display: block;
  overflow: hidden;
  height: 1.14em;
  font-family: var(--font-en);
  font-weight: 300;
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.14;
  letter-spacing: 0.02em;
}

.contact-row__roll {
  display: block;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}

.contact-row__roll span {
  display: block;
  color: var(--text);
}

.contact-row__roll span + span {
  color: var(--amber);
}

@media (hover: hover) {
  .contact-row:hover .contact-row__roll {
    transform: translateY(-50%);
  }
}

.contact-row__arrow {
  font-size: 15px;
  color: var(--amber);
}

/* ── Mobile ────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .work {
    padding: 130px 20px 60px;
  }

  .work__section,
  .work__gallery,
  .work__stats {
    grid-template-columns: 1fr;
  }

  .contact-row__grid {
    grid-template-columns: 56px 1fr auto;
    gap: 12px;
  }
}

/* ── AI workflow page: process flow diagram ─────────────────── */

.flow {
  margin: 8px 0 16px;
}

.flow__track {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
}

.flow__step {
  border: 1px solid var(--line);
  background: rgba(20, 20, 20, 0.55);
  padding: 22px 20px 20px;
}

.flow__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--amber);
}

.flow__en {
  font-family: var(--font-en);
  font-weight: 400;
  font-size: 19px;
  margin: 10px 0 3px;
  color: var(--text);
}

.flow__ja {
  font-family: var(--font-mincho);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--text-muted);
}

.flow__desc {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-muted);
}

.flow__arrow {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--amber);
}

.flow__loop {
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px dashed var(--amber-line);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.flow__loop .amber {
  color: var(--amber);
}

/* MD two-layer diagram (brand.md / plan.md) */
.md-layers {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  margin: 18px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.md-layers__key {
  color: var(--amber);
  white-space: nowrap;
}

.md-layers__val {
  color: var(--text-muted);
  line-height: 1.7;
}

/* tool figure caption naming */
.work__shot--tool figcaption b {
  color: var(--text);
  font-weight: 500;
}

@media (max-width: 767px) {
  .flow__track {
    grid-template-columns: 1fr;
  }

  .flow__arrow {
    justify-content: center;
    transform: rotate(90deg);
    height: 22px;
  }
}

/* Second paragraph in a section reads as supporting copy */
.work__lead + .work__lead {
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-muted);
}

/* Full-width tool figure below a section */
.work__toolfig {
  margin: 40px 0 0;
}

/* ── Horizontal gallery affordance (hint + edge fade + drag) ── */

.work__scrollwrap {
  position: relative;
}

/* Right-edge fade says "more to the right"; fades out at the end. */
.work__scrollwrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 14px;
  width: 90px;
  background: linear-gradient(to right, rgba(10, 10, 10, 0), rgba(10, 10, 10, 0.92));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s;
}

.work__scrollwrap.is-end::after {
  opacity: 0;
}

.work__scrollhint {
  margin-top: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  transition: opacity 0.5s;
}

.work__scrollhint.is-hidden {
  opacity: 0;
}

.work__scrollhint-arrow {
  color: var(--amber);
  animation: hint-slide 1.6s ease-in-out infinite;
}

@keyframes hint-slide {
  0%, 100% { transform: translateX(0); opacity: 0.5; }
  50% { transform: translateX(10px); opacity: 1; }
}

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

/* Inside the wrap the hint owns the top margin */
.work__scrollwrap .work__scroller {
  margin-top: 16px;
}

@media (hover: hover) {
  .work__scrollwrap .work__scroller {
    cursor: grab;
  }
}

.work__scroller.is-grabbing {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}
