/* Grid case studies (work/<project>/): full-bleed images, hairline grid, sections alternating washi / #EDEBEA.
   Mirrors the "grid edition" frames in Figma. Motion lives in case-grid.js; everything is visible without it. */
.cg { --cg-line: #b1b5b8; --cg-alt: #edebea; --cg-ink: #0d283a; --cg-tetsu: #334a5a; --cg-muted: #65757f; --cg-accent: var(--fuji);
  position: relative; z-index: 1; background: var(--washi); color: var(--cg-ink); font-family: "Poppins", system-ui, sans-serif; }
.cg * { box-sizing: border-box; }
.cg p, .cg h1, .cg h2, .cg h3 { margin: 0; }
.cg img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cg-sec { position: relative; background: var(--washi); }
.cg-sec.alt { background: var(--cg-alt); }
.cg-row { display: grid; position: relative; }
.cg-4 { grid-template-columns: repeat(4, 1fr); }
.cg-2 { grid-template-columns: 1fr 1fr; }
.cg-cell { position: relative; padding: 24px; }
/* hairlines: drawn as pseudo-elements so they can animate in */
.cg-line-b::after, .cg-line-t::before { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--cg-line); transform-origin: left; }
.cg-line-b::after { bottom: 0; }
.cg-line-t::before { top: 0; }
.cg-line-r { border-right: 1px solid var(--cg-line); }
.cg-row > .cg-cell:not(:last-child) { border-right: 1px solid var(--cg-line); }

.cg-small { font-size: 12px; line-height: 1.45; }
.cg-num { font-size: 12px; color: var(--cg-accent); }
.cg-muted { color: var(--cg-muted); }
.cg-tetsu { color: var(--cg-tetsu); }
.cg-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; font-size: 13px; font-weight: 500; }
.cg-head .cg-num { font-weight: 400; }

/* 00 top bar */
.cg-top .cg-cell { padding: 20px 24px; font-size: 12px; }
.cg-top a { color: inherit; text-decoration: none; font-weight: 600; }

/* 00b opening statement band */
.cg-open { background: var(--cg-deep, #14312b); color: #dbd9cf; display: grid; grid-template-columns: 300px 1fr 1fr; gap: 0 60px; padding: 96px 24px 96px 0; }
.cg-open .cg-label { font-size: 12px; color: var(--cg-accent-on-dark, #44b5b0); margin-bottom: 8px; }
.cg-open .cg-client { grid-column: 2; font-size: clamp(28px, 2.6vw, 38px); line-height: 1.15; letter-spacing: -0.02em; }
.cg-open .cg-meta { display: grid; gap: 20px; font-size: 14px; }

/* 01 hero */
.cg-hero { position: relative; height: min(860px, 92vh); overflow: hidden; background: #14312b; }
.cg-hero-media { position: absolute; inset: 0; }
.cg-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgb(13 25 30 / 0.45)); }
.cg-cross-v, .cg-cross-h { position: absolute; background: rgb(255 255 255 / 0.45); z-index: 2; }
.cg-cross-v { left: 50%; top: 0; bottom: 0; width: 1px; }
.cg-cross-h { top: 50%; left: 0; right: 0; height: 1px; }
.cg-hero-note { position: absolute; z-index: 3; left: 40px; bottom: 40px; color: #fff; font-size: 13px; line-height: 1.4; }
.cg-hero-logo { position: absolute; z-index: 3; right: 40px; bottom: 40px; width: clamp(180px, 22vw, 330px); color: #dbd9cf; display: grid; justify-items: center; gap: 6px; }
.cg-hero-logo img { height: auto; }

/* client lockup (mark + wordmark) */
.cg-lockup { display: grid; justify-items: center; gap: 4px; }
.cg-lockup .w1 { font-family: "EB Garamond", serif; font-weight: 600; font-size: 3em; line-height: 1; }
.cg-lockup .w2 { font-family: "Source Sans 3", sans-serif; font-size: 1.5em; letter-spacing: 0.32em; padding-left: 0.32em; }
.cg-lockup img { width: 72%; }

/* 02 intro statement */
.cg-intro { padding: 24px 24px 72px; }
.cg-intro .cg-statement { font-size: clamp(26px, 2.6vw, 38px); font-weight: 500; line-height: 1.18; letter-spacing: -0.02em; max-width: 900px; margin-top: 96px; }
.cg-intro .cg-body { font-size: 14px; line-height: 1.6; color: var(--cg-tetsu); max-width: 880px; margin-top: 56px; }

/* 03 the ask */
.cg-ask .cg-cell { padding: 32px 24px 48px; min-height: 300px; }
.cg-ask .cg-big { font-size: clamp(48px, 5.4vw, 72px); font-weight: 500; letter-spacing: -0.03em; line-height: 1; margin-top: 120px; }
.cg-ask .cg-big b { color: var(--cg-accent); font-weight: 500; }
.cg-ask .cg-right { display: flex; flex-direction: column; justify-content: flex-end; padding-left: 40px; }
.cg-ask .cg-lead { font-size: clamp(18px, 1.6vw, 22px); font-weight: 500; line-height: 1.3; max-width: 520px; }
.cg-ask .cg-lead span { color: var(--cg-muted); }
.cg-ask .cg-sub { font-size: 13px; line-height: 1.6; color: var(--cg-tetsu); max-width: 420px; margin-top: 20px; }

/* 04 keywords + palette (one 4-column block) */
.cg-kw .cg-cell { padding: 24px 24px 32px; }
.cg-kw h3 { font-size: clamp(20px, 1.8vw, 26px); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
.cg-kw .cg-desc { font-size: 12.5px; line-height: 1.55; color: var(--cg-tetsu); padding: 20px 24px 28px; }
.cg-kw-img { height: clamp(260px, 29vw, 420px); overflow: hidden; }
.cg-kw-img img { height: 100%; }
.cg-swatch { position: relative; height: clamp(240px, 25vw, 360px); overflow: hidden; }
.cg-swatch .fill { position: absolute; inset: 0; }
.cg-swatch .lab { position: absolute; left: 24px; bottom: 28px; font-size: 18px; font-weight: 600; letter-spacing: 0.02em; }
.cg-swatch .lab small { display: block; font-size: 11px; font-weight: 400; letter-spacing: 0.08em; margin-top: 2px; opacity: 0.85; }
.cg-neutrals { display: flex; gap: 40px; flex-wrap: wrap; padding: 16px 24px; font-size: 12px; color: var(--cg-tetsu); }
.cg-neutrals i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 10px; vertical-align: -3px; box-shadow: inset 0 0 0 1px var(--cg-line); }

/* 06 identity */
.cg-split { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.cg-split > div { height: clamp(380px, 43vw, 620px); display: grid; place-items: center; }
.cg-split .cg-lockup { font-size: clamp(14px, 1.5vw, 22px); }
.cg-concept { font-size: clamp(22px, 2.2vw, 32px); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; padding: 32px 24px 40px; }
.cg-concept span { color: var(--cg-muted); }
.cg-rationale { font-size: 14px; line-height: 1.6; color: var(--cg-tetsu); padding: 32px 80px 40px 40px; }

/* 07 typography */
.cg-type .cg-cell { padding: 24px 24px 48px; }
.cg-aa { font-size: clamp(140px, 16vw, 220px); line-height: 1; margin: 24px 0 16px; letter-spacing: -0.02em; }
.cg-type .name { font-size: clamp(22px, 2vw, 30px); }
.cg-type .set { font-size: 13px; line-height: 1.5; color: var(--cg-tetsu); margin-top: 14px; }
.cg-type .d { font-size: 13px; line-height: 1.55; color: var(--cg-tetsu); margin-top: 16px; max-width: 520px; }

/* 08 pattern band */
.cg-pattern { position: relative; overflow: hidden; height: clamp(380px, 44vw, 640px); background-color: var(--cg-deep, #14312b); }
.cg-pattern img { object-fit: cover; object-position: left top; } /* exact 1440×640 artwork exported from Figma */
.cg-pattern-cap { background: #14312b; color: #dbd9cf; }
.cg-pattern-cap .cg-cell { padding: 24px; }
.cg-pattern-cap h3 { font-size: clamp(20px, 1.8vw, 26px); font-weight: 500; letter-spacing: -0.01em; }
.cg-pattern-cap p { font-size: 12.5px; line-height: 1.55; opacity: 0.8; max-width: 560px; }
.cg-pattern-cap .cg-cell:not(:last-child) { border-color: rgb(219 217 207 / 0.25); }

/* 09 assets */
.cg-assets { overflow: hidden; }
.cg-assets .cg-2 > div { height: clamp(300px, 29vw, 420px); overflow: hidden; }

/* 10 website */
.cg-web .cg-title { font-size: clamp(36px, 3.4vw, 48px); font-weight: 500; line-height: 1.08; letter-spacing: -0.03em; padding: 32px 24px 40px; }
.cg-web .cg-copy { padding: 32px 80px 40px 40px; font-size: 14px; line-height: 1.6; color: var(--cg-tetsu); }
.cg-web .cg-copy a { display: inline-block; margin-top: 18px; color: var(--cg-accent); font-weight: 500; font-size: 13px; text-decoration: none; }
.cg-web-media { overflow: hidden; }
.cg-web-media img { height: auto; }

/* 12 next */
.cg-next .cg-2 > .cg-cell { min-height: 300px; }
.cg-next .contact { display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; font-size: 13px; line-height: 1.4; padding: 32px 24px 40px; }
.cg-next .contact a:first-child { font-weight: 500; }
.cg-next .contact a { color: inherit; text-decoration: none; }
.cg-next .next { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; gap: 68px; padding: 120px 24px 54px 40px; }
.cg-next .big { font-size: clamp(64px, 8.4vw, 120px); font-weight: 500; letter-spacing: -0.04em; line-height: 1; color: var(--cg-ink); white-space: nowrap; }
.cg-next .big b, .cg-next .big .cg-dot { color: #44b5b0; font-weight: 500; }
.cg-pill { display: inline-block; padding: 10px 22px; border-radius: 999px; background: var(--cg-ink); color: #dbd9d8; font-size: 12px; text-decoration: none; transition: background 0.2s; }
.cg-pill:hover { background: var(--cg-accent); }
.cg-bottom .cg-cell { padding: 16px 24px 20px; font-size: 12px; }

/* ---------- motion states: large text and headings only (case-grid.js adds .cg-anim; reduced motion skips it) ---------- */
.cg-anim [data-rise] { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.cg-anim [data-rise].in { opacity: 1; transform: none; }
.cg-anim [data-words] .w { display: inline-block; opacity: 0.12; filter: blur(4px); transition: opacity 0.6s, filter 0.6s; }
.cg-anim [data-words] .w.on { opacity: 1; filter: none; }
.cg-anim [data-mask] { overflow: hidden; }
.cg-anim [data-mask] > * { display: block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.cg-anim [data-mask].in > * { transform: none; }
.cg-anim .cg-aa { opacity: 0; transform: scale(0.92); filter: blur(8px); transition: opacity 1s, transform 1.2s var(--ease), filter 1s; }
.cg-anim .in .cg-aa { opacity: 1; transform: none; filter: none; }
.cg-anim .cg-next .big .l { display: inline-block; transform: translateY(40%); opacity: 0; transition: transform 0.9s var(--ease), opacity 0.6s; transition-delay: calc(var(--i) * 40ms); }
.cg-anim .cg-next.in .big .l { transform: none; opacity: 1; }


@media (max-width: 860px) {
  .cg-4 { grid-template-columns: 1fr 1fr; }
  .cg-2, .cg-split { grid-template-columns: 1fr; }
  .cg-row > .cg-cell { border-right: 0 !important; }
  .cg-4 > .cg-cell:nth-child(odd) { border-right: 1px solid var(--cg-line) !important; }
  .cg-row > .cg-cell + .cg-cell { border-top: 1px solid var(--cg-line); }
  .cg-4 > .cg-cell:nth-child(2) { border-top: 0; }
  .cg-open { grid-template-columns: 1fr; padding: 64px 16px; gap: 28px; }
  .cg-open .cg-client { grid-column: 1; }
  .cg-cell, .cg-head, .cg-intro { padding-left: 16px; padding-right: 16px; }
  .cg-hero { height: 70vh; }
  .cg-hero-note { left: 16px; bottom: 16px; }
  .cg-hero-logo { right: 16px; bottom: 16px; width: 160px; }
  .cg-ask .cg-big { margin-top: 48px; }
  .cg-ask .cg-right, .cg-rationale, .cg-web .cg-copy { padding-left: 16px; padding-right: 16px; }
  .cg-intro .cg-statement { margin-top: 48px; }
}
@media (max-width: 560px) {
  /* text rows stack; the keyword/palette block and top bar stay two-up so each word stays beside its image and swatch */
  .cg-4:not(.cg-top):not(.cg-kw .cg-4) { grid-template-columns: 1fr; }
  .cg-4:not(.cg-top):not(.cg-kw .cg-4) > .cg-cell { border-right: 0 !important; }
  .cg-4:not(.cg-top):not(.cg-kw .cg-4) > .cg-cell:nth-child(2) { border-top: 1px solid var(--cg-line); }
  .cg-kw h3 { font-size: 19px; }
  .cg-kw .cg-desc { font-size: 12px; padding: 14px 16px 18px; }
  .cg-swatch .lab { left: 16px; bottom: 18px; font-size: 15px; }
}

/* full-bleed artwork exported from Figma at its own ratio (hero photos, composites, product shots) */
.cg-media img { height: auto; }
.cg-media.cg-2 > * { overflow: hidden; }

/* results: an ink band, title + link on the left, a ruled list of numbers on the right */
.cg-results { background: var(--cg-ink); color: #dbd9d8; }
.cg-results .cg-cell { padding: 32px 24px 64px; }
.cg-results .cg-row > .cg-cell:not(:last-child) { border-right-color: rgb(219 217 216 / 0.18); }
.cg-results .cg-big { font-size: clamp(48px, 5.4vw, 64px); font-weight: 500; letter-spacing: -0.03em; line-height: 1; margin-top: 24px; }
.cg-results .cg-big b { color: var(--cg-accent); font-weight: 500; }
.cg-results a { display: inline-block; margin-top: 40px; color: var(--cg-accent); font-size: 13px; font-weight: 500; text-decoration: none; }
.cg-stats { list-style: none; margin: 0; padding: 0 40px 0 40px; display: grid; }
.cg-stats li { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 24px; padding: 16px 0; border-bottom: 1px solid rgb(219 217 216 / 0.25); }
.cg-stats b { font-size: 28px; font-weight: 400; letter-spacing: -0.01em; }
.cg-stats span { font-size: 12px; opacity: 0.85; }

.cg-pill.lg { padding: 13px 29px; font-size: clamp(18px, 1.7vw, 24px); line-height: 1.55; }
.cg-type-img { padding: 0 !important; background: #dbd9d8; }
.cg-type-img img { display: block; width: 100%; height: auto; }
.cg-gill { font-family: "Gill Sans", "Gill Sans MT", "Gill Sans Nova", Calibri, sans-serif; }
@media (max-width: 860px) {
  .cg-stats { padding: 0 16px; }
  .cg-stats li { grid-template-columns: 120px 1fr; }
}

/* softened, like a deck page: the hairlines between cells are very faint instead of grey */
.cg { --cg-line: rgb(13 40 58 / 0.08); }

/* studio lockup (miio creative solutions) in the top bar and bottom bar */
.cg-logo { display: block; width: 153px; max-width: 100%; height: auto; color: #0d283a; --dot-top: #03938d; --dot-bottom: #c54d7f; }
.cg-top a:has(.cg-logo), .cg-bottom a:has(.cg-logo) { display: inline-block; }

/* merch: continued growth row with fuji stats */
.cg-growth .cg-concept { margin: 0; }
.cg-growth > .cg-cell:last-child { padding: 32px 24px 40px; display: grid; gap: 28px; align-content: start; }
.cg-growth-copy { font-size: 14px; line-height: 1.55; max-width: 560px; }
.cg-stats.cg-stats-light { padding: 0; }
.cg-stats-light li { grid-template-columns: 200px 1fr; border-bottom: 1px solid #03938d; padding: 14px 0; }
.cg-stats-light b { color: #03938d; }
.cg-stats-light span { color: var(--cg-ink); opacity: 1; }
.cg-link { font-size: 13px; color: inherit; text-decoration: none; font-weight: 500; }
.cg-link:hover { color: var(--cg-accent); }
.cg-stats b { font-variant-numeric: tabular-nums; }
.cg-stats-light b { white-space: nowrap; }
@media (max-width: 760px) { .cg-stats-light li { grid-template-columns: auto 1fr; } .cg-stats-light b { font-size: 24px; } }
@media (max-width: 860px) {
  .cg-next .cg-2 { grid-template-columns: 1fr !important; }
  .cg-next .cg-2 > .cg-cell { min-height: 0; }
  .cg-next .next { order: -1; padding: 64px 16px 40px; gap: 32px; }
  .cg-next .big { font-size: 12vw; }
  .cg-next .contact { padding: 24px 16px 32px; }
}
/* section heads carry their own hairline, so give the line something to sit on */
.cg-head.cg-line-b, .cg-head.cg-line-t { position: relative; }
/* footer: a way back to the work list instead of the contact line */
.cg-next .contact { justify-content: flex-end; align-items: flex-start; }
.cg-next .contact .cg-back { color: #dbd9d8; font-size: 14px; font-weight: 400; padding: 12px 24px; }
.cg-back span { display: inline-block; margin-right: 4px; transition: transform 0.3s var(--ease); }
.cg-back:hover span { transform: translateX(-4px); }
