/* ─── Case study pages: the top bar, the hero and the way back ───
   Each page is a dedicated piece, so it opens like a cover: the title sits in a Figma-style
   selection, the same motif as the homepage, and the only way out is back to the work. */
@font-face {
    font-family: "Postmans Serif";
    src: url("fonts/postmans-serif-light.woff2") format("woff2");
    font-weight: 300;
    font-display: swap;
}

.cs3 { --accent: #2b3aff; --accent-ink: #fff; }

/* top bar: in the page, not floating over it */
.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1296px;
    margin: 0 auto;
    padding: 28px var(--gutter) 0;
}
.bar__back, .bar__hello {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 18px 0 14px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text);
    transition: background .2s ease, transform .2s ease;
}
.bar__back { background: rgba(0, 0, 0, .06); }
.bar__back:hover { background: rgba(0, 0, 0, .1); }
.bar__back span { display: inline-block; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.bar__back:hover span { transform: translateX(-3px); }
.bar__hello { padding: 0 4px; color: var(--muted); }
.bar__hello:hover { color: var(--text); }
.bar a:focus-visible, .back-out:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* hero */
.cs3 .hero2 {
    max-width: 1296px;
    margin: 0 auto;
    padding: 120px 0 0;
    text-align: center;
}
.hero2__frame {
    position: relative;
    display: inline-block;
    padding: 16px 22px 20px;
    margin: 0 auto;
}
.hero2__frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--accent);
    animation: frameIn .9s .15s cubic-bezier(.2, .8, .2, 1) both;
}
.hero2__frame i {
    position: absolute;
    width: 11px;
    height: 11px;
    background: var(--bg);
    border: 1.5px solid var(--accent);
    animation: handleIn .35s cubic-bezier(.2, .8, .2, 1) both;
}
.hero2__frame i:nth-of-type(1) { left: -6px; top: -6px; animation-delay: .55s; }
.hero2__frame i:nth-of-type(2) { right: -6px; top: -6px; animation-delay: .62s; }
.hero2__frame i:nth-of-type(3) { left: -6px; bottom: -6px; animation-delay: .69s; }
.hero2__frame i:nth-of-type(4) { right: -6px; bottom: -6px; animation-delay: .76s; }
.hero2__label {
    position: absolute;
    left: -1px;
    bottom: calc(100% + 10px);
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    white-space: nowrap;
    animation: fadeIn .4s .8s ease both;
}
.hero2__size {
    position: absolute;
    left: 50%;
    top: calc(100% + 12px);
    transform: translateX(-50%);
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    animation: fadeIn .4s .9s ease both;
}
.cs3 .hero2 h1 {
    font-family: "Postmans Serif", Georgia, serif;
    font-weight: 300;
    font-size: clamp(52px, 8.6vw, 136px);
    line-height: .98;
    letter-spacing: -0.035em;
    color: var(--text);
    text-wrap: balance;
}
.hero2__tag {
    margin: 64px auto 0;
    max-width: 30ch;
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.35;
    letter-spacing: -0.015em;
    color: var(--muted);
    text-wrap: balance;
}
.hero2__tag .script { color: var(--text); font-size: 1.25em; line-height: 0; }
.hero2__facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 960px;
    margin: 72px auto 0;
    border-top: 1px solid var(--line);
    text-align: left;
}
.hero2__facts div { padding: 18px 20px 0 0; }
.hero2__facts div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.hero2__facts dt { font-size: 13px; color: var(--faint); }
.hero2__facts dd { margin-top: 6px; font-size: 15px; line-height: 21px; color: var(--text); }
.hero2__facts dd.todo { opacity: .45; font-style: italic; }

@keyframes frameIn { from { clip-path: inset(0 100% 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes handleIn { from { opacity: 0; transform: scale(.4); } }
@keyframes fadeIn { from { opacity: 0; } }

/* the way out at the end: back to the work, nothing sideways */
.back-out {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1296px;
    width: calc(100% - 2 * 72px);   /* lines up with the footer below */
    margin: 160px auto 0;
    padding: 40px 0;
    border-top: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}
.back-out__t { font-family: "Postmans Serif", Georgia, serif; font-weight: 300; font-size: clamp(36px, 5vw, 72px); line-height: 1; letter-spacing: -0.03em; }
.back-out__s { display: block; margin-top: 12px; font-size: 15px; color: var(--muted); }
.back-out__arrow {
    flex: none;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    font-size: 26px;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.back-out:hover .back-out__arrow { transform: translateX(-6px); }

@media (max-width: 768px) {
    .bar { padding: 16px 16px 0; }
    .cs3 .hero2 { padding-top: 72px; }
    .hero2__frame { padding: 10px 12px 12px; }
    .hero2__tag { margin-top: 52px; }
    .hero2__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 48px; }
    .hero2__facts div:nth-child(3) { padding-left: 0; border-left: 0; }
    .hero2__facts div:nth-child(n+3) { margin-top: 18px; border-top: 1px solid var(--line); }
    .back-out { width: calc(100% - 32px); margin-top: 96px; }
    .back-out__arrow { width: 56px; height: 56px; }
    .cs3 .cs-foot { padding-bottom: 48px; }
}
@media (prefers-reduced-motion: reduce) {
    .hero2__frame::before, .hero2__frame i, .hero2__label, .hero2__size { animation: none; }
}

.cs3 .hero2 + .gallery, .cs3 .hero2 + .hero-fan { margin-top: 112px; }
.arrive .bar { animation: csArrive .6s .05s ease both; }
@keyframes csArrive { from { opacity: 0; transform: translateY(8px); } }

/* ─── Soft reveal for the opened depths (see case-reveal.js): words come into focus left to right ─── */
.rv rv-w { display: inline-block; opacity: 0; filter: blur(10px); }
.rv.in rv-w { animation: rw-in 1s cubic-bezier(.25, .7, .25, 1) var(--d, 0ms) both; }
.rv.rv-done rv-w { animation: none; opacity: 1; filter: none; }
/* underlines don't reach inside inline-blocks, so links draw their own per word */
.rv a rv-w { text-decoration: underline; text-decoration-color: inherit; text-underline-offset: inherit; }
@keyframes rw-in {
	from { opacity: 0; filter: blur(10px); }
	55% { opacity: .85; }
	to { opacity: 1; filter: blur(0); }
}
.rv-m { opacity: 0; filter: blur(16px); transition: opacity 1s ease, filter 1.2s cubic-bezier(.25, .7, .25, 1); }
.rv-m.in { opacity: 1; filter: none; }
@media (prefers-reduced-motion: reduce) {
	.rv rv-w, .rv-m { opacity: 1 !important; filter: none !important; animation: none !important; }
}
