/* TBR30 STYLES
   Direction (from the unslop pass):
   - Product: a small creative studio from Kochi for branding, design and motion
   - Character: warm, hands-on, a little playful
   - World: a designer's studio after dark, print proofs and ink under a desk lamp
   - Moments: the dot-matrix logo in the hero, and the work itself (colour lives in the projects)
   - Signature: the dot from the logo (section labels, dividers, footer pattern)
   Spacing sits on a 4px grid. One accent, used rarely. */

:root {
    /* PALETTE: only these colours are used across the site
       orange #ff8a00 · charcoal #373A3E · cream #fff2df · on black */
    --orange: #ff8a00;
    --charcoal: #373A3E;
    --cream: #fff2df;
    --bg-deep: #050505;
    --bg: #0a0a0a;
    --surface: #1d1e20; /* charcoal, a step down for quiet surfaces */
    --raised: #2a2c2f;  /* charcoal, a half step down */
    --text: var(--cream);
    --text-2: rgba(255, 242, 223, 0.72);
    --text-3: rgba(255, 242, 223, 0.5);
    --line: rgba(255, 242, 223, 0.1);
    --line-strong: rgba(255, 242, 223, 0.18);

    /* The one accent: the palette orange */
    --accent-color: var(--orange);
    --accent-rgb: 255 138 0;
    --on-accent: #0a0a0a;    /* black text on orange, as in the palette */

    /* Kept for older rules and the personal page: plain solid orange, no gradients */
    --brand-gradient: var(--accent-color);
    --gradient-accent: var(--accent-color);

    /* Older variable names some pages still use */
    --dark-bg: var(--bg);
    --dark-surface: var(--surface);
    --light-text: var(--text);
    --secondary-text: var(--text-2);

    --font-heading: 'General Sans', sans-serif;
    --font-body: 'General Sans', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --radius-control: 10px;
    --radius-card: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* The loading screen is gone: pages show straight away */
#preloader { display: none !important; }

/* --- HEADER --- */
.main-header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    background-color: rgba(10, 10, 10, 0.92);
    padding: 16px 0; border-bottom: 1px solid var(--line);
}
.header-container { max-width: 1400px; margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 36px; display: block; }
/* Top header = the other pages only, as one outlined pill group on the right; each link has a small ↗ */
.nav-links { list-style: none; display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 30em; background: rgba(255, 242, 223, 0.03); }
.nav-links a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 30em; text-decoration: none; color: var(--text-2); font-weight: 500; font-size: 0.95rem; transition: color 0.15s var(--ease), background-color 0.15s var(--ease); }
.nav-links a .nav-out { font-size: 0.7rem; transform: rotate(-45deg); opacity: 0.55; transition: transform 0.25s var(--ease), opacity 0.15s var(--ease), color 0.15s var(--ease); }
.nav-links a:hover { color: var(--text); background: rgba(255, 242, 223, 0.07); }
.nav-links a:hover .nav-out { transform: rotate(0); opacity: 1; color: var(--orange); }
.nav-links a[aria-current="page"] { color: #0a0a0a; background: var(--cream); }
.nav-links a[aria-current="page"] .nav-out { display: none; }
.hamburger-menu { display: none; background: none; border: none; font-size: 1.25rem; color: var(--text); cursor: pointer; width: 40px; height: 40px; border-radius: var(--radius-control); }

/* --- HERO --- */
#hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 96px 24px 64px; position: relative; }
#glitter-canvas { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
.hero-subtitle { font-size: clamp(1.125rem, 2.4vw, 1.25rem); line-height: 1.5; color: var(--text-2); font-weight: 400; max-width: 36rem; position: relative; z-index: 10; }
.hero-subtitle .accent-text { color: var(--text); }

/* Masked magnetic dot logo: the one bright moment */
.hero-logo-wrapper { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; height: 352px; margin: 32px 0; z-index: 10; }
#magnetic-overlay { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 20; }

/* --- SECTIONS & HEADINGS --- */
section { padding: 112px 24px; }
.section-container { max-width: 1360px; margin: 0 auto; }
/* Small outlined pill above each heading, led by the logo's orange dot */
.section-tag {
    display: flex; align-items: center; gap: 10px; width: fit-content; margin: 0 auto 24px;
    padding: 8px 18px; border: 1px solid var(--line-strong); border-radius: 30em;
    color: var(--text-2); font-size: 0.875rem; font-weight: 500; letter-spacing: 0.02em;
}
.section-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }
/* Section heading: big, bold, uppercase, centred, with the second line in orange */
.section-title {
    display: block; text-align: center; text-transform: uppercase;
    font-size: clamp(2.25rem, 6vw, 4.5rem); font-weight: 700; line-height: 0.98;
    letter-spacing: -0.025em; color: var(--text); margin-bottom: 56px; text-wrap: balance;
}
/* The highlighted words in a heading: solid orange (no gradients) */
.accent-text { color: var(--accent-color); font-weight: inherit; }

/* --- SYNDICATE (home): centred statement, numbers and the team, no boxes --- */
.syndicate { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 40px; }
#about-copy { max-width: 64rem; }
.syndicate-lead { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 500; line-height: 1.25; letter-spacing: -0.015em; margin-bottom: 16px; color: var(--text); }
.syndicate-lead.is-long { font-size: clamp(1.125rem, 2vw, 1.375rem); line-height: 1.5; letter-spacing: 0; }
.syndicate-body { font-size: 1.0625rem; line-height: 1.65; color: var(--text-2); margin: 0 auto 12px; max-width: 58rem; }
.syndicate-body:last-child { margin-bottom: 0; }
.syndicate-team { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.team-faces { display: flex; align-items: center; text-decoration: none; }
.team-faces .face { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 3px solid var(--bg); margin-left: -14px; background: var(--charcoal); display: flex; align-items: center; justify-content: center; color: var(--cream); font-weight: 600; }
.team-faces .face:first-child { margin-left: 0; }
.team-faces .face img { width: 100%; height: 100%; object-fit: cover; }
.faces-label { margin-left: 16px; color: var(--text-2); font-size: 1rem; font-weight: 500; transition: color 0.15s var(--ease); }
.team-faces:hover .faces-label { color: var(--text); }
/* Numbers as small dark cards with a thin orange-tinted edge */
.syndicate-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; width: 100%; max-width: 760px; }
.syndicate-stats[hidden] { display: none; }
.stat { padding: 24px 16px; border-radius: 24px; background: var(--surface); border: 1px solid rgb(var(--accent-rgb) / 0.18); }
.stat strong { display: block; font-size: 2.25rem; font-weight: 700; line-height: 1.1; color: var(--orange); font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-2); font-size: 0.875rem; }

/* --- SERVICES ("What we do"): a sideways row of black cards with glossy 3D icons.
   The card in the middle lights up in the orange gradient; swipe, scroll or use the arrows. --- */
#services-list {
    list-style: none; display: flex; gap: 20px;
    /* The row runs the full width of the screen, so cards slide in from the edges */
    width: 100vw; margin-left: calc(50% - 50vw);
    padding: 24px calc(50vw - 160px) 32px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
#services-list::-webkit-scrollbar { display: none; }
#services-list > li {
    position: relative; flex: 0 0 320px; min-height: 440px; scroll-snap-align: center; cursor: pointer;
    display: flex; flex-direction: column; padding: 28px 26px 30px; border-radius: 28px; overflow: hidden; isolation: isolate;
    background: linear-gradient(180deg, #141416 0%, #0b0b0c 100%); border: 1px solid rgba(255, 242, 223, 0.08);
    transform: scale(0.94); opacity: 0.6;
    transition: transform 0.55s var(--ease), opacity 0.55s var(--ease), border-color 0.4s var(--ease), box-shadow 0.55s var(--ease);
}
#services-list > li:hover { opacity: 0.85; }
/* Orange gradient layer, faded in on the middle card */
#services-list > li::before {
    content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.55s var(--ease);
    background: radial-gradient(120% 80% at 80% 0%, #ffb054 0%, transparent 55%), linear-gradient(160deg, #ff9a1f 0%, var(--orange) 35%, #d86800 70%, #7a3500 100%);
}
#services-list > li.is-active { transform: scale(1); opacity: 1; border-color: rgba(255, 180, 90, 0.6); box-shadow: 0 30px 80px -24px rgba(255, 138, 0, 0.6), 0 0 0 1px rgba(255, 138, 0, 0.25); }
#services-list > li.is-active::before { opacity: 1; }

.svc-num { position: absolute; top: 26px; right: 26px; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-3); font-variant-numeric: tabular-nums; transition: color 0.4s var(--ease); }
.svc-text { margin-top: auto; padding-right: 52px; }
.services h3 { font-size: 1.375rem; font-weight: 600; color: var(--text); line-height: 1.2; margin: 0 0 8px; transition: color 0.4s var(--ease); }
.services p { color: var(--text-2); font-size: 0.925rem; line-height: 1.55; transition: color 0.4s var(--ease); }
#services-list > li.is-active h3, #services-list > li.is-active .svc-num { color: #0a0a0a; }
#services-list > li.is-active p { color: rgba(10, 10, 10, 0.72); }

/* The 3D object: stacked copies of the icon make the depth, the top copy is a glossy black face
   with an orange rim of light. It floats gently and turns a little on the middle card. */
.svc-3d { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 220px; perspective: 700px; }
.svc-3d-inner { position: relative; display: grid; place-items: center; font-size: 7.5rem; line-height: 1; transform-style: preserve-3d; transform: rotateX(14deg) rotateY(-22deg); transition: transform 0.8s var(--ease); animation: svcFloat 6s ease-in-out infinite; }
.svc-3d-inner > i { grid-area: 1 / 1; }
.svc-3d-depth { color: #050505; transform: translate(calc(var(--k) * 1.4px), calc(var(--k) * 1.6px)); text-shadow: 0 0 1px rgba(255, 138, 0, 0.25); }
.svc-3d-depth:first-child { filter: drop-shadow(0 26px 22px rgba(0, 0, 0, 0.85)); }
.svc-3d-face {
    background: linear-gradient(150deg, #5a5a5e 0%, #1c1c1f 28%, #070707 55%, #1a1a1c 72%, #ff8a00 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
    filter: drop-shadow(-1px -1px 0 rgba(255, 210, 160, 0.35)) drop-shadow(0 0 14px rgba(255, 138, 0, 0.35));
}
@keyframes svcFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
#services-list > li.is-active .svc-3d-inner { transform: rotateX(8deg) rotateY(14deg) scale(1.06); }
#services-list > li.is-active .svc-3d-depth { color: #1a0c00; text-shadow: none; }
#services-list > li.is-active .svc-3d-face { background: linear-gradient(150deg, #6d6d72 0%, #232326 25%, #050505 55%, #2a2a2d 80%, #fff2df 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(-1px -1px 0 rgba(255, 255, 255, 0.5)) drop-shadow(0 0 18px rgba(255, 242, 223, 0.35)); }

/* Round "go" arrow: opens the Work page for this service */
.svc-go { position: absolute; right: 22px; bottom: 26px; z-index: 1; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); color: var(--text); text-decoration: none; transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease); }
.svc-go i { transform: rotate(-45deg); transition: transform 0.3s var(--ease); }
.svc-go:hover i { transform: rotate(0); }
#services-list > li.is-active .svc-go { background: #0a0a0a; border-color: #0a0a0a; color: var(--orange); }
#services-list > li:not(.is-active) .svc-go:hover { background: var(--orange); border-color: var(--orange); color: #0a0a0a; }

/* Arrow buttons under the row */
.svc-controls { display: flex; justify-content: center; gap: 12px; margin-top: 8px; }
.svc-controls[hidden] { display: none; }
.svc-arrow { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(255, 242, 223, 0.04); color: var(--text); font-size: 1.05rem; cursor: pointer; transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease); }
.svc-arrow:hover:not(:disabled) { background: var(--orange); border-color: var(--orange); color: #0a0a0a; }
.svc-arrow:disabled { opacity: 0.3; cursor: default; }

/* Extra services ("Smaller box" in admin): a compact row under the main cards */
.services--minor { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.services[hidden] { display: none; }
.services--minor li { position: relative; flex: 1 1 260px; display: flex; align-items: center; gap: 16px; padding: 16px 70px 16px 16px; border-radius: 22px; background: #111113; border: 1px solid var(--line); cursor: pointer; transition: border-color 0.25s var(--ease), flex-grow 0.45s var(--ease); }
.services--minor li:hover { flex-grow: 1.25; border-color: rgb(var(--accent-rgb) / 0.5); }
.services--minor .svc-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgb(var(--accent-rgb) / 0.12); color: var(--orange); font-size: 1rem; }
.services--minor .svc-num { display: none; }
.services--minor .svc-text { margin: 0; padding: 0; }
.services--minor h3 { font-size: 1.0625rem; margin: 0 0 2px; }
.services--minor p { font-size: 0.875rem; }
.services--minor .svc-go { top: 50%; bottom: auto; right: 16px; width: 38px; height: 38px; margin-top: -19px; }
.services--minor li:hover .svc-go { background: var(--orange); border-color: var(--orange); color: #0a0a0a; }

@media (max-width: 600px) {
    #services-list { padding-left: calc(50vw - 39vw); padding-right: calc(50vw - 39vw); gap: 14px; }
    #services-list > li { flex-basis: 78vw; min-height: 400px; }
    .svc-3d-inner { font-size: 6rem; }
}
@media (prefers-reduced-motion: reduce) { .svc-3d-inner { animation: none; } }

.section-cta { margin-top: 48px; text-align: center; }

/* --- WORK PREVIEW (home) --- */
.portfolio-grid { width: 100%; }
.portfolio-item { width: 31%; margin-bottom: 32px; border-radius: 12px; overflow: hidden; cursor: pointer; position: relative; background: var(--surface); }
.portfolio-item img { width: 100%; display: block; }
/* Project title fades in over the image on hover (always shown on touch screens) */
.portfolio-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 20px; background: linear-gradient(to top, rgba(10,10,10,0.88) 0%, rgba(10,10,10,0.2) 50%, transparent 72%); opacity: 0; transition: opacity 0.18s var(--ease); pointer-events: none; }
.portfolio-overlay h3 { color: var(--text); font-size: 1.125rem; font-weight: 500; line-height: 1.3; }
.portfolio-overlay span { color: var(--text-2); font-size: 0.875rem; display: flex; align-items: center; gap: 8px; }
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
@media (hover: none) { .portfolio-overlay { opacity: 1; } }

/* --- HERO ACTIONS & CONTACT --- */
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; position: relative; z-index: 10; }
.hero-subtitle[hidden] { display: none; }
/* Contact: an orange gradient band with dark text and a cream pill button */
#contact .section-container { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cta-band { padding: 88px 32px; border-radius: 40px; background: linear-gradient(135deg, var(--orange) 0%, #e86f00 50%, #9c4700 100%); color: #0a0a0a; box-shadow: 0 30px 80px -30px rgb(var(--accent-rgb) / 0.55); }
.cta-band .section-tag { color: #0a0a0a; border-color: rgba(10, 10, 10, 0.3); }
.cta-band .section-tag::before { background: #0a0a0a; }
.cta-band .section-title { color: #0a0a0a; margin-bottom: 24px; }
.contact-text { font-size: 1.25rem; color: var(--text-2); margin-bottom: 32px; max-width: 48rem; }
.cta-band .contact-text { color: rgba(10, 10, 10, 0.75); }
.contact-btn { margin-bottom: 16px; }
.cta-band .slide-btn { --near: 1; background: var(--cream); border-color: transparent; color: #0a0a0a; }
.cta-band .slide-btn::before { background-image: linear-gradient(to right, var(--charcoal) 0%, #0a0a0a 100%); }
.cta-band .slide-btn:hover { color: var(--cream); }
.cta-band .slide-btn .slide-btn-icon { background: #0a0a0a; color: var(--cream); }
.cta-band .slide-btn:hover .slide-btn-icon { background: var(--orange); color: #0a0a0a; }
.contact-email { color: var(--text-3); font-size: 0.95rem; margin-bottom: 40px; }
.contact-email a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; transition: text-decoration-color 0.15s var(--ease); }
.contact-email a:hover { text-decoration-color: var(--accent-color); }
.cta-band .contact-email { color: rgba(10, 10, 10, 0.65); margin-bottom: 32px; }
.cta-band .contact-email a { color: #0a0a0a; text-decoration-color: rgba(10, 10, 10, 0.35); }
.cta-band .contact-email a:hover { text-decoration-color: #0a0a0a; }
.cta-band .social-icon { background: rgba(10, 10, 10, 0.12); border-color: rgba(10, 10, 10, 0.18); color: #0a0a0a; }
.cta-band .social-icon:hover { background: #0a0a0a; color: var(--orange); border-color: #0a0a0a; }
@media (max-width: 600px) { .cta-band { padding: 64px 20px; border-radius: 28px; } }

/* --- BUTTONS ---
   From Uiverse.io by xueyuantan - https://uiverse.io/xueyuantan/rotten-pig-19
   MIT License, Copyright (c) xueyuantan
   Adapted for TBR30: the pill fill sweeps in from the left on hover (the Uiverse effect), in the palette
   (charcoal to orange). At rest only the label shows; as the mouse comes near (button-glow.js sets --near
   from 0 to 1) the pill fades in. The label rolls up and the icon swaps on hover. */
.slide-btn {
    --near: 0;
    position: relative; isolation: isolate; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 14px;
    height: 54px; padding: 0 8px 0 26px; border-radius: 30em;
    background: rgba(255, 242, 223, calc(var(--near) * 0.06));
    border: 1px solid rgba(255, 242, 223, calc(var(--near) * 0.3));
    color: var(--text);
    font-family: inherit; font-size: 1rem; font-weight: 500; letter-spacing: 0; text-transform: none; text-decoration: none;
    cursor: pointer; white-space: nowrap;
    transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), transform 0.12s var(--ease);
}
/* The fill that sweeps across on hover */
.slide-btn::before {
    content: ''; position: absolute; top: 0; left: 0; z-index: -1;
    width: 0; height: 100%; border-radius: 30em;
    background-image: linear-gradient(to right, #0a0a0a 0%, #2a1406 35%, var(--orange) 100%); /* black into orange */
    transition: width 0.5s ease;
}
.slide-btn:hover::before { width: 100%; }
.slide-btn:hover { border-color: transparent; }
.slide-btn:active { transform: scale(0.98); }
/* Main call-to-action: same behaviour, with an orange icon so it reads as the first choice */
.slide-btn--accent .slide-btn-icon { background: var(--orange); color: var(--on-accent); }
/* Rolling label */
.slide-btn-text { position: relative; display: inline-flex; flex-direction: column; height: 1.3em; line-height: 1.3em; overflow: hidden; }
.slide-btn-text span { transition: transform 0.35s var(--ease); }
.slide-btn-text .text-down { display: block; position: absolute; top: 100%; left: 0; }
.slide-btn:hover .slide-btn-text span { transform: translateY(-100%); }
/* Round icon at the end (like the arrow circle in the reference) */
.slide-btn-icon { position: relative; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 242, 223, 0.1); color: var(--text); display: flex; align-items: center; justify-content: center; font-size: 0.875rem; overflow: hidden; transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
.slide-btn:hover .slide-btn-icon { background: #0a0a0a; color: var(--cream); }
.slide-btn-icon span { position: absolute; display: flex; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.slide-btn-icon .icon-rest { opacity: 1; transform: none; }
.slide-btn-icon .icon-hover { display: flex; opacity: 0; transform: translate(-12px, 12px); }
.slide-btn:hover .icon-rest { opacity: 0; transform: translate(12px, -12px); }
.slide-btn:hover .icon-hover { opacity: 1; transform: none; }
/* Touch screens have no mouse to come near, so the pill always shows */
@media (hover: none) { .slide-btn { --near: 1; } }

/* --- JOURNAL LIST --- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 32px; width: 100%; padding-bottom: 48px; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; text-decoration: none; transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease); display: flex; flex-direction: column; height: 100%; }
.post-card:hover { border-color: var(--line-strong); background: #232527; }
.post-card-image { height: 240px; overflow: hidden; width: 100%; background: var(--raised); }
/* No cover: the logo's dot pattern on a warm surface */
.post-card-image.no-image { background: radial-gradient(circle, rgba(255,242,223,0.12) 1.5px, transparent 1.6px) 0 0 / 16px 16px, var(--raised); display: flex; align-items: flex-end; padding: 20px; }
.post-card-image.no-image::after { content: "TBR30 Journal"; color: var(--text-2); font-size: 0.875rem; font-weight: 500; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }
.post-card-content { padding: 24px; flex-grow: 1; display: flex; flex-direction: column; }
.post-card h3 { color: var(--text); font-size: 1.25rem; margin-bottom: 12px; line-height: 1.35; font-weight: 500; }
.post-card p { color: var(--text-2); font-size: 0.95rem; line-height: 1.6; margin-bottom: 24px; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { border-top: 1px solid var(--line); padding-top: 16px; display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; color: var(--text-3); }
.read-more { color: var(--text); font-weight: 500; display: flex; align-items: center; gap: 8px; font-size: 0.875rem; text-transform: none; letter-spacing: 0; }
.read-more i { color: var(--accent-color); }

#blog-header { text-align: left; padding-bottom: 32px; }
#blog-header .section-title { justify-content: flex-start; text-align: left; } /* the Journal keeps its clean left-aligned look */
#blog-header .section-title { margin-bottom: 12px !important; }
#blog-header .section-subtitle { display: block; margin: 0 0 16px; max-width: 36rem; color: var(--text-2); font-size: 1.125rem; }

/* --- SHARED FOOTER (built by layout.js): a still dot pattern from the logo --- */
.tetris-footer { position: relative; width: 100%; background: var(--bg-deep); display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.tetris-footer::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle, rgba(255,242,223,0.07) 1.5px, transparent 1.6px) 0 0 / 20px 20px; -webkit-mask-image: linear-gradient(to bottom, black, transparent 80%); mask-image: linear-gradient(to bottom, black, transparent 80%); }
#tetris-canvas { display: none; }
.footer-content { position: relative; display: flex; justify-content: space-between; padding: 64px 32px 48px; color: var(--text); flex-wrap: wrap; gap: 40px; max-width: 1400px; width: 100%; margin: 0 auto; }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col h3 { font-size: 0.95rem; margin-bottom: 4px; color: var(--text); font-weight: 500; }
.footer-col .footer-brand { display: inline-block; margin-bottom: 18px; }
.footer-col .footer-brand img { height: 40px; width: auto; display: block; }
.footer-col p { color: var(--text-2); font-size: 0.95rem; max-width: 260px; line-height: 1.6; }
.footer-col a { color: var(--text-2); text-decoration: none; font-size: 0.95rem; transition: color 0.15s var(--ease); }
.footer-col a:hover { color: var(--text); }
.footer-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; max-width: 280px; }
.footer-other-links { display: flex; flex-direction: column; gap: 12px; }
.footer-other-links[hidden] { display: none; }
.footer-socials a { width: 40px; height: 40px; border-radius: var(--radius-control); background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--text-2); transition: color 0.15s var(--ease), border-color 0.15s var(--ease); }
.footer-socials a:hover { color: var(--text); border-color: var(--line-strong); }
.footer-admin { margin-top: 8px; font-size: 0.875rem !important; color: var(--text-3) !important; }
.footer-bottom { position: relative; padding: 20px 32px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 0.875rem; max-width: 1400px; width: 100%; margin: auto auto 0; }
@media (max-width: 768px) { .footer-content { padding: 48px 20px 32px; flex-direction: column; } .footer-bottom { padding: 20px; } }

/* --- CLIENTS: a slow scrolling strip of logos, fading out softly at both edges --- */
#clients { padding: 120px 0; }
#clients .section-container { padding: 0 24px; }
#clients .section-title { margin-bottom: 64px; }
.client-scroller { width: 100%; overflow: hidden; padding: 12px 0; -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent); mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent); }
.client-list { display: flex; align-items: center; width: max-content; gap: 104px; animation: clientScroll 45s linear infinite; }
.client-scroller:hover .client-list { animation-play-state: paused; }
.client-logo { height: 88px; max-width: 220px; object-fit: contain; filter: grayscale(1) brightness(1.8) opacity(0.65); transition: filter 0.18s var(--ease); }
.client-logo:hover { filter: none; }
@media (max-width: 600px) { .client-logo { height: 64px; max-width: 160px; } .client-list { gap: 64px; } #clients { padding: 80px 0; } }
/* The logos are written twice in a row, so moving by half loops seamlessly */
@keyframes clientScroll { to { transform: translateX(-50%); } }

/* --- CONTACT ICONS --- */
.social-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.social-icon { width: 44px; height: 44px; border-radius: var(--radius-control); background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 1.125rem; text-decoration: none; transition: color 0.15s var(--ease), border-color 0.15s var(--ease); }
.social-icon:hover { color: var(--text); border-color: var(--line-strong); }

/* --- RESPONSIVE --- */
@media (max-width: 1200px) { .portfolio-item { width: 47%; } }
@media (max-width: 768px) { .post-grid { grid-template-columns: 1fr; } .post-card-image { height: 200px; } section { padding: 64px 20px; } }
@media (max-width: 600px) { .portfolio-item { width: 100%; } .nav-links { display: none; } .hamburger-menu { display: block; } .header-container { padding: 0 20px; } }
/* Mobile menu, opened by the hamburger button (layout.js) */
@media (max-width: 600px) { .nav-links.active { display: flex; flex-direction: column; gap: 4px; position: absolute; top: 100%; left: 0; width: 100%; padding: 12px 20px 20px; background-color: var(--bg); border-bottom: 1px solid var(--line); } .nav-links.active a { display: block; padding: 8px 0; font-size: 1rem; } }

/* One gentle entrance as sections scroll into view */
.hidden { opacity: 0; transform: translateY(8px); }
.visible { opacity: 1; transform: none; transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); }

/* --- PAGE TRANSITIONS: a quick cross-fade between pages (Chrome, Edge, Safari) --- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; animation-timing-function: var(--ease); }

/* --- ACCESSIBILITY --- */
:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 3px; border-radius: 6px; }
.slide-btn:focus-visible { outline-offset: 3px; border-radius: 30em; --near: 1; }
/* Visitors who turn on "reduce motion" on their device get calm, still pages */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    @view-transition { navigation: none; }
    .hidden { opacity: 1; transform: none; }
    #glitter-canvas { display: none; }
    .client-list { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
}

/* --- JOURNAL POST PAGE (post.html) --- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; pointer-events: none; }
.reading-progress span { display: block; height: 100%; background: var(--accent-color); transform-origin: left; transform: scaleX(0); }

.post-container { max-width: 720px; margin: 0 auto; padding: 136px 20px 80px; }
.post-loading { color: var(--text-3); text-align: center; padding: 80px 0; }
.post-header { text-align: left; margin-bottom: 40px; }
.post-back { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); text-decoration: none; font-size: 0.95rem; margin-bottom: 32px; transition: color 0.15s var(--ease); }
.post-back:hover { color: var(--text); }
.post-kicker { color: var(--text-2); font-size: 0.95rem; font-weight: 500; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.post-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-color); }
.post-header h1 { font-size: clamp(2.25rem, 5.5vw, 3.25rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; color: var(--text); margin-bottom: 24px; }
.post-byline { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.post-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.post-avatar img { width: 20px; height: 20px; }
.post-byline-text { display: flex; flex-direction: column; line-height: 1.4; }
.post-byline-text strong { color: var(--text); font-size: 0.95rem; font-weight: 500; }
.post-byline-text span { color: var(--text-3); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.post-meta-line { color: var(--text-3); font-size: 0.95rem; }

/* Cover: a little wider than the text column */
.post-cover { position: relative; margin: 0 0 48px; width: min(1000px, calc(100vw - 40px)); margin-left: 50%; transform: translateX(-50%); border-radius: var(--radius-card); overflow: hidden; background: var(--surface); }
.post-cover img { width: 100%; display: block; max-height: 560px; object-fit: cover; }
.post-cover-fallback { display: none; }
/* No cover: the logo's dot pattern on a warm surface */
.post-cover.no-image { aspect-ratio: 21 / 8; background: radial-gradient(circle, rgba(255,242,223,0.1) 1.5px, transparent 1.6px) 0 0 / 20px 20px, var(--surface); border: 1px solid var(--line); }
.post-cover.no-image .post-cover-fallback { display: flex; position: absolute; inset: 0; align-items: flex-end; padding: 24px 28px; }
.post-cover-fallback span { color: var(--text-2); font-weight: 500; font-size: 0.95rem; }

/* Reading text */
.post-content { font-size: 1.125rem; line-height: 1.8; color: rgba(255, 242, 223, 0.85); font-weight: 400; }
.post-content > p:first-child { font-size: 1.25rem; line-height: 1.7; color: var(--text); }
.post-content p { margin-bottom: 24px; }
.post-content strong { color: var(--text); font-weight: 600; }
.post-content em { font-style: normal; color: var(--text); }
.post-content a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-color); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.post-content a:hover { color: var(--accent-color); }
.post-content h1, .post-content h2 { font-size: clamp(1.5rem, 3.2vw, 1.75rem); color: var(--text); font-weight: 500; line-height: 1.3; margin: 56px 0 16px; }
.post-content h3 { font-size: 1.25rem; color: var(--text); font-weight: 500; margin: 40px 0 12px; }
.post-content ul, .post-content ol { padding-left: 1.4em; margin-bottom: 28px; }
.post-content li { margin-bottom: 8px; padding-left: 4px; }
.post-content li::marker { color: var(--text-3); }
.post-content blockquote { border-left: 2px solid var(--accent-color); margin: 40px 0; padding: 4px 0 4px 24px; font-size: 1.25rem; line-height: 1.6; color: var(--text); font-style: normal; }
.post-content img { max-width: 100%; height: auto; display: block; border-radius: 12px; margin: 40px auto; }
.post-content pre, .post-content code { font-family: var(--font-mono); font-size: 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.post-content code { padding: 2px 6px; }
.post-content pre { padding: 16px 20px; overflow-x: auto; margin: 32px 0; }
.post-content pre code { border: none; padding: 0; background: none; }
.post-content hr { border: none; text-align: center; margin: 48px 0; }
.post-content hr::after { content: "\2022  \2022  \2022"; color: var(--text-3); letter-spacing: 8px; }
.post-content .ql-align-center { text-align: center; }
.post-content .ql-align-right { text-align: right; }
.post-content .ql-align-justify { text-align: justify; }

/* Share bar */
.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.post-header .share-bar { padding-top: 16px; border-top: 1px solid var(--line); }
.share-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; height: 40px; padding: 0 12px; border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; font-size: 0.9rem; font-weight: 500; text-decoration: none; cursor: pointer; transition: color 0.15s var(--ease), border-color 0.15s var(--ease); }
.share-btn[hidden] { display: none; }
.share-btn i { font-size: 1rem; }
.share-btn:hover { color: var(--text); border-color: var(--line-strong); }
.share-btn.copied { color: #4cc38a; border-color: rgba(76, 195, 138, 0.4); }
.post-end { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.post-end p { color: var(--text); font-weight: 500; font-size: 1.05rem; }
.post-next { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 20px; margin-top: 40px; padding: 24px; border-radius: var(--radius-card); border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color 0.15s var(--ease); }
.post-next span { grid-column: 1; color: var(--text-3); font-size: 0.875rem; }
.post-next strong { grid-column: 1; color: var(--text); font-size: 1.25rem; font-weight: 500; line-height: 1.35; }
.post-next i { grid-column: 2; grid-row: 1 / span 2; color: var(--accent-color); font-size: 1.125rem; }
.post-next:hover { border-color: var(--line-strong); }

/* Small pop-up message ("Link copied") */
.toast { position: fixed; left: 50%; bottom: 32px; z-index: 300; transform: translate(-50%, 8px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); font-weight: 500; font-size: 0.9rem; padding: 10px 16px; border-radius: var(--radius-control); transition: opacity 0.18s var(--ease), transform 0.18s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
    .post-container { padding-top: 112px; }
    .post-cover { border-radius: 12px; margin-bottom: 36px; }
    .post-content { font-size: 1.0625rem; }
    .post-content > p:first-child { font-size: 1.1875rem; }
    .post-end { flex-direction: column; align-items: flex-start; }
}

/* --- PROJECT VIEWER (project-viewer.js): a sheet that scrolls from the top --- */
html.pv-open, html.pv-open body { overflow: hidden; }
.pv { position: fixed; inset: 0; z-index: 10000; background: rgba(5, 5, 5, 0.92); opacity: 0; transition: opacity 0.2s var(--ease); }
.pv.show { opacity: 1; }
.pv[hidden] { display: none; }
.pv-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding: 64px 20px 40px; }
.pv-sheet { max-width: 1200px; margin: 0 auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; transform: translateY(8px); transition: transform 0.3s var(--ease); }
.pv.show .pv-sheet { transform: none; }
.pv-head { padding: 40px clamp(20px, 5vw, 56px) 32px; }
.pv-kicker { color: var(--text-2); font-size: 0.95rem; font-weight: 500; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.pv-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-color); }
.pv-title { color: var(--text); font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; }
.pv-desc { color: var(--text-2); font-size: 1.0625rem; line-height: 1.7; max-width: 760px; margin-top: 16px; white-space: pre-line; }
.pv-desc:empty { display: none; }
/* Images stacked edge to edge, like a Behance project; tall ones show in full */
.pv-media { display: flex; flex-direction: column; gap: 4px; background: var(--bg-deep); }
.pv-media img { display: block; width: 100%; height: auto; min-height: 240px; background: var(--surface); }
.pv-media img.loaded { min-height: 0; background: none; }
.pv-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 24px; border-top: 1px solid var(--line); }
.pv-foot[hidden] { display: none; }
.pv-nav { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; transition: border-color 0.15s var(--ease); }
.pv-nav span { display: flex; flex-direction: column; min-width: 0; }
.pv-nav small { color: var(--text-3); font-size: 0.875rem; }
.pv-nav strong { font-size: 1rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-nav i { color: var(--text-2); }
.pv-next { justify-content: flex-end; text-align: right; }
.pv-nav:hover { border-color: var(--line-strong); }
.pv-close { position: fixed; top: 12px; right: 16px; z-index: 2; width: 44px; height: 44px; border-radius: var(--radius-control); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 1.125rem; cursor: pointer; transition: background-color 0.15s var(--ease); }
.pv-close:hover { background: var(--raised); }
@media (max-width: 600px) {
    .pv-scroll { padding: 56px 0 0; }
    .pv-sheet { border-radius: 16px 16px 0 0; border-left: none; border-right: none; }
    .pv-head { padding: 28px 20px 24px; }
    .pv-foot { grid-template-columns: 1fr; padding: 16px; }
}

/* Mobile menu (hamburger): a plain list instead of the pill group */
@media (max-width: 600px) {
    .nav-links.active { border: none; border-radius: 0; border-bottom: 1px solid var(--line); }
    .nav-links.active a { height: 44px; padding: 0 4px; justify-content: space-between; }
    .nav-links.active a[aria-current="page"] { background: none; color: var(--orange); }
}

/* --- BOTTOM RIBBON (home page, built by layout.js): the page's sections; the highlight slides along --- */
.section-ribbon {
    position: fixed; left: 50%; bottom: 20px; z-index: 90; transform: translateX(-50%);
    display: flex; align-items: center; gap: 2px; max-width: calc(100% - 24px); padding: 5px;
    border-radius: 30em; background: rgba(20, 20, 22, 0.78); border: 1px solid var(--line-strong);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.4);
    overflow-x: auto; scrollbar-width: none; animation: ribbonIn 0.6s var(--ease) both 0.4s;
}
.section-ribbon::-webkit-scrollbar { display: none; }
@keyframes ribbonIn { from { opacity: 0; transform: translate(-50%, 24px); } }
.section-ribbon a {
    position: relative; z-index: 1; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    height: 38px; padding: 0 16px; border-radius: 30em; color: var(--text-2); text-decoration: none;
    font-size: 0.875rem; font-weight: 500; white-space: nowrap; transition: color 0.3s var(--ease);
}
.section-ribbon a[hidden] { display: none; }
.section-ribbon a:hover, .section-ribbon a.is-active { color: var(--text); }
/* Contact is always the bright pill at the end (like a "Select plan" button) */
.section-ribbon a.ribbon-cta { background: var(--cream); color: #0a0a0a; margin-left: 4px; font-weight: 600; }
.section-ribbon a.ribbon-cta:hover { background: #fff; }
/* The sliding highlight behind the current section */
.ribbon-glow {
    position: absolute; left: 0; top: 5px; height: 38px; width: 0; border-radius: 30em; z-index: 0;
    background: linear-gradient(135deg, rgba(255, 138, 0, 0.28), rgba(255, 138, 0, 0.12)); border: 1px solid rgba(255, 138, 0, 0.45);
    transition: transform 0.45s var(--ease), width 0.45s var(--ease), opacity 0.3s var(--ease);
}
.ribbon-glow.on-cta { opacity: 0; }
/* Keep the footer's last line clear of the ribbon */
body.has-ribbon .footer-bottom { padding-bottom: 96px; }
@media (max-width: 600px) {
    .section-ribbon { bottom: 12px; }
    .section-ribbon a { padding: 0 12px; font-size: 0.8125rem; height: 36px; }
    .ribbon-glow { height: 36px; }
}

/* --- CONTACT BUBBLE (every page, built by layout.js) --- */
.contact-bubble { position: fixed; right: 20px; bottom: 20px; z-index: 95; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
.contact-bubble.is-away { opacity: 0; transform: translateY(16px); pointer-events: none; }
.bubble-toggle {
    display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 6px; border-radius: 30em; cursor: pointer;
    border: 1px solid rgba(255, 138, 0, 0.5); background: rgba(20, 20, 22, 0.85); color: var(--text); font: inherit; font-weight: 600; font-size: 0.95rem;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 14px 40px -14px rgba(255, 138, 0, 0.55);
    animation: bubbleIn 0.6s var(--ease) both 1.2s; transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}
.bubble-toggle:hover { transform: translateY(-2px); background: rgba(30, 30, 32, 0.95); }
.bubble-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--orange), #c95f00); color: #0a0a0a; font-size: 1.05rem; position: relative; }
/* A soft ping around the icon, now and then */
.bubble-icon::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--orange); opacity: 0; animation: bubblePing 4s ease-out infinite 2s; }
@keyframes bubblePing { 0% { opacity: 0.7; transform: scale(1); } 35%, 100% { opacity: 0; transform: scale(1.5); } }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(20px) scale(0.9); } }
.contact-bubble.is-open .bubble-icon::after { animation: none; }
.bubble-card {
    position: relative; width: 300px; padding: 24px; border-radius: 24px; background: #141416; border: 1px solid var(--line-strong);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 138, 0, 0.08); animation: cardIn 0.35s var(--ease);
}
.bubble-card[hidden] { display: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.bubble-card h3 { font-size: 1.25rem; font-weight: 600; color: var(--text); margin: 10px 0 6px; }
.bubble-card > p:not(.bubble-hello) { color: var(--text-2); font-size: 0.9rem; line-height: 1.5; margin-bottom: 18px; }
.bubble-hello { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 0.8125rem; }
.bubble-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.18); }
.bubble-main { display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border-radius: 30em; background: var(--orange); color: #0a0a0a; font-weight: 600; text-decoration: none; transition: background-color 0.2s var(--ease); }
.bubble-main:hover { background: #ffa033; }
.bubble-alt { display: block; text-align: center; margin-top: 12px; color: var(--text-2); font-size: 0.875rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
.bubble-alt:hover { color: var(--text); }
.bubble-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255, 242, 223, 0.06); color: var(--text-2); cursor: pointer; }
.bubble-close:hover { color: var(--text); background: rgba(255, 242, 223, 0.12); }
/* Where the ribbon is wide compared to the screen, the bubble sits above it; on smaller screens it is an icon only */
@media (max-width: 1100px) { body.has-ribbon .contact-bubble { bottom: 76px; } }
@media (max-width: 900px) {
    .bubble-label { display: none; }
    .bubble-toggle { padding: 0 5px; height: 50px; }
    .contact-bubble { right: 14px; }
    .bubble-card { width: min(300px, calc(100vw - 28px)); }
}
@media (prefers-reduced-motion: reduce) { .bubble-icon::after { animation: none; } }

/* Services loop: no fade while the row quietly swaps to the twin card */
#services-list.no-anim > li, #services-list.no-anim > li::before, #services-list.no-anim .svc-3d-inner { transition: none !important; }

/* Headings: one line on wide screens (wrapping only if they really don't fit); two lines on phones */
@media (min-width: 761px) { .section-title .m-br { display: none; } }
.syndicate-stats { max-width: 960px; }

/* --- SMALL POP-UP for single pieces and videos (piece-viewer.js), like opening an Instagram post --- */
.piece-pop { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(5, 5, 5, 0.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.2s var(--ease); }
.piece-pop[hidden] { display: none; }
.piece-pop.is-open { opacity: 1; }
.piece-card { position: relative; display: flex; max-width: min(980px, 100%); max-height: min(84vh, 760px); border-radius: 20px; overflow: hidden; background: #121214; border: 1px solid var(--line-strong); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9); transform: scale(0.96) translateY(8px); transition: transform 0.25s var(--ease); }
.piece-pop.is-open .piece-card { transform: none; }
.piece-media { flex: 0 1 auto; display: flex; align-items: center; justify-content: center; background: #000; min-width: 0; }
.piece-media img { display: block; max-width: min(620px, 62vw); max-height: min(84vh, 760px); width: auto; height: auto; object-fit: contain; }
.piece-media:has(iframe), .piece-media:has(video) { width: min(640px, 62vw); max-height: min(84vh, 760px); }
.piece-media.is-tall { width: min(400px, 62vw, calc(min(84vh, 760px) * 0.5625)); }
.piece-media iframe, .piece-media video { width: 100%; height: 100%; border: 0; display: block; }
.piece-info { width: 300px; flex-shrink: 0; padding: 56px 24px 24px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; border-left: 1px solid var(--line); }
.piece-card.no-info .piece-info { display: none; }
.piece-brand { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 0.875rem; font-weight: 600; }
.piece-brand span { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #ffb054, var(--orange) 60%, #a84a00); }
.piece-title { font-size: 1.25rem; font-weight: 600; color: var(--text); line-height: 1.25; margin-top: 8px; }
.piece-title:empty, .piece-caption:empty { display: none; }
.piece-caption { color: var(--text-2); font-size: 0.95rem; line-height: 1.6; white-space: pre-line; }
.piece-link { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 0.9rem; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
.piece-link:hover { text-decoration-color: var(--orange); }
.piece-link[hidden] { display: none; }
/* NFTs (Work page pop-up and cards): chain tag, collection name, traits grid like on OpenSea */
.nft-chain { display: inline-flex; align-items: center; gap: 6px; width: fit-content; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--chain, #8247e5) 16%, transparent); color: var(--chain, #a77bff); font-size: 0.75rem; font-weight: 600; font-family: var(--font-mono); }
.nft-chain svg { width: 13px; height: 13px; flex: none; }
.nft-col { color: var(--text-3); font-size: 0.75rem; }
.nft-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 8px; }
.nft-top + .piece-title { margin-top: 0; }
.nft-traits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.nft-traits div { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.nft-traits small { color: var(--text-3); font-size: 0.68rem; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nft-traits strong { color: var(--text); font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(10, 10, 10, 0.7); color: var(--text); cursor: pointer; font-size: 1rem; }
.piece-close:hover { background: var(--orange); color: #0a0a0a; }
@media (max-width: 760px) {
    .piece-pop { padding: 12px; }
    .piece-card { flex-direction: column; max-height: 90vh; width: 100%; }
    .piece-media img { max-width: 100%; max-height: 62vh; margin: 0 auto; }
    .piece-media:has(iframe), .piece-media:has(video) { width: 100%; }
    .piece-media.is-tall { width: min(100%, calc(62vh * 0.5625)); margin: 0 auto; }
    .piece-info { width: 100%; padding: 16px 18px 20px; border-left: none; border-top: 1px solid var(--line); }
}

/* --- WHO MADE IT (credits.js) --- */
.cr-face { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--charcoal); color: var(--cream); font-size: 0.75rem; font-weight: 600; border: 2px solid #0a0a0a; }
.cr-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-team { background: linear-gradient(135deg, var(--orange), #c95f00); color: #0a0a0a; font-size: 0.7rem; }
.cr-more { background: #1d1e20; color: var(--text-2); font-size: 0.65rem; }
/* On a tile: faces overlapping, bottom right */
.cr-badge { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: flex; padding: 3px; border-radius: 30em; background: rgba(10, 10, 10, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cr-badge .cr-face + .cr-face { margin-left: -9px; }
/* In the pop-up / viewer: "Made by" with names */
.cr-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cr-label { color: var(--text-3); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 10px; }
.cr-people { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.cr-person { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; border-radius: 30em; padding-right: 8px; }
.cr-person .cr-face { width: 38px; height: 38px; font-size: 0.95rem; border-color: var(--line-strong); }
.cr-person .cr-team { font-size: 0.9rem; }
.cr-person strong { display: block; font-size: 0.9rem; font-weight: 600; line-height: 1.2; }
.cr-person small { display: block; color: var(--text-3); font-size: 0.78rem; }
.cr-person small:empty { display: none; }
a.cr-person:hover strong { color: var(--orange); }
.piece-info .cr-block { margin-top: auto; }
.piece-info .cr-block + .piece-link { margin-top: 12px; }
