/* ==========================================================================
   Living Field — design system for denissolis.com
   (BAFTA-inspired procedural particle identity, ported from docs/Living Field v8)

   The field runs sitewide (canvas lives in base.html). Content sits on
   frosted surfaces above it. This block is additive: it overrides the
   tokens the field needs and styles the new blocks; it does not remove
   existing SnapFolio rules it doesn't override.
   ========================================================================== */

/* --- Typography + palette tokens (append to :root) ---------------------- */
:root {
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --field-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --lf-text: var(--heading-color);
  --lf-text-2: rgba(244, 245, 247, .62);
  --lf-text-3: rgba(244, 245, 247, .38);
  --lf-hair: rgba(244, 245, 247, .12);
  --lf-hair-strong: rgba(244, 245, 247, .32);
  --lf-panel-bg: rgba(7, 9, 13, .72);
  --lf-panel-brd: rgba(244, 245, 247, .07);
  --lf-ui-bg: rgba(10, 12, 16, .88);
  --lf-ui-brd: rgba(244, 245, 247, .12);
}

/* Light theme: inverts the whole SnapFolio scheme (the template already
   reads every color from these variables, so one block re-skins the site). */
html[data-theme="light"] {
  --background-color: #f4f3ef;
  --default-color: #14161a;
  --heading-color: #14161a;
  --accent-color: #23262d;
  --surface-color: #ffffff;
  --contrast-color: #ffffff;

  --nav-color: rgba(20, 22, 26, .58);
  --nav-hover-color: #14161a;
  --nav-mobile-background-color: #ffffff;
  --nav-dropdown-background-color: #ffffff;
  --nav-dropdown-color: #14161a;
  --nav-dropdown-hover-color: #23262d;

  --lf-text-2: rgba(20, 22, 26, .66);
  --lf-text-3: rgba(20, 22, 26, .44);
  --lf-hair: rgba(20, 22, 26, .16);
  --lf-hair-strong: rgba(20, 22, 26, .4);
  --lf-panel-bg: rgba(244, 243, 239, .78);
  --lf-panel-brd: rgba(20, 22, 26, .09);
  --lf-ui-bg: rgba(255, 255, 255, .86);
  --lf-ui-brd: rgba(20, 22, 26, .14);
}

html[data-theme="light"] .light-background {
  --background-color: #edece7;
  --surface-color: #ffffff;
}
html[data-theme="light"] .dark-background {
  --background-color: #f4f3ef;
  --default-color: #14161a;
  --heading-color: #14161a;
  --surface-color: #ffffff;
  --contrast-color: #ffffff;
}

/* --- Top bar (v8 nav) ---------------------------------------------------- */
/* The theme button lives in the bar; base styles only. */
.theme-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lf-text-3);
  background: transparent;
  border: 1px solid var(--lf-ui-brd);
  border-radius: 100px;
  padding: 6px 13px;
  cursor: pointer;
  transition: color .25s, border-color .25s;
}
.theme-btn:hover { color: var(--lf-text); border-color: var(--lf-hair-strong); }

/* --- Field canvas (sitewide) + hero scrim (home only) -------------------- */
#living-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
#lf-scrim { display: none; }
body.has-field #lf-scrim {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(58% 62% at 30% 52%,
              rgba(7, 9, 13, .74) 0%, rgba(7, 9, 13, .4) 46%, rgba(7, 9, 13, 0) 78%);
}
html[data-theme="light"] body.has-field #lf-scrim {
  background: radial-gradient(58% 62% at 30% 52%,
              rgba(244, 243, 239, .8) 0%, rgba(244, 243, 239, .45) 46%, rgba(244, 243, 239, 0) 78%);
}

/* --- Sitewide layering: content above the field --------------------------- */
main.main { position: relative; z-index: 2; }
#footer {
  position: relative;
  z-index: 2;
  background: transparent;
  border-top: 1px solid var(--lf-hair);
}
#footer .copyright,
#footer p { color: var(--lf-text-3); }
#footer .sitename { color: var(--lf-text-2); }
#preloader { display: none !important; } /* the field IS the opening moment */
#scroll-top { display: none !important; }

/* The field replaces section backgrounds: the inner .container becomes a
   frosted surface so content stays readable on every page type. */
.section,
.section-light,
.section-dark,
.light-background,
.dark-background {
  background-color: transparent !important;
}
.section .container,
.section-light .container,
.section-dark .container {
  position: relative;
  background: var(--lf-panel-bg);
  border: 1px solid var(--lf-panel-brd);
  border-radius: 16px;
  padding: 48px 40px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
@media (max-width: 640px) {
  .section .container,
  .section-light .container,
  .section-dark .container {
    padding: 34px 22px;
    border-radius: 12px;
    margin: 0 10px;
  }
}

/* --- Top bar (v8 nav): fixed, gradient, right-aligned mono links --------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 997;
  background: linear-gradient(rgba(7, 9, 13, .55), transparent);
}
html[data-theme="light"] .topbar {
  background: linear-gradient(rgba(244, 243, 239, .6), transparent);
}
.topbar-menu {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 20px 5vw;
}
.topbar-menu > ul {
  display: flex;
  align-items: center;
  gap: 34px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.topbar-menu > ul a {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lf-text-3);
  text-decoration: none;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  transition: color .25s;
}
.topbar-menu > ul a:hover,
.topbar-menu > ul a.active { color: var(--lf-text); }
.topbar-menu > ul a .navicon { margin-right: 8px; font-size: 13px; }

.topbar-socials {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
.topbar-socials a {
  font-size: 13px;
  color: var(--lf-text-3);
  transition: color .25s;
}
.topbar-socials a:hover { color: var(--lf-text); }

.topbar-lang .lang-switcher {
  position: static !important;
  margin: 0 !important;
  z-index: auto;
}
.topbar-lang .lang-switcher > ul { gap: 18px; align-items: center; line-height: 1; height: auto; padding: 0; margin: 0; }
.topbar-lang .lang-switcher li { display: inline-flex; align-items: center; height: auto; }
.topbar-lang .lang-switcher i {
  display: none;
}
.topbar-lang a {
  width: auto;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: .18em;
  line-height: 1;
  color: var(--lf-text-3) !important;
  text-transform: uppercase;
  transition: color .25s;
}
.topbar-lang a:hover { color: var(--lf-text) !important; }
.topbar-lang a.fw-bold { color: var(--lf-text) !important; font-weight: 500; }
.topbar-theme { margin-left: 18px; }

/* Content pages: clear the floating bar (home hero is full-bleed under it) */
main.main { padding-top: 62px; }
body.has-field main.main { padding-top: 0; }

/* --- Mobile: hamburger + top panel --------------------------------------- */
.topbar .header-toggle {
  display: none;
}
@media (max-width: 1199px) {
  .topbar {
    display: flex;
    align-items: center;
    background: var(--lf-ui-bg);
    border-bottom: 1px solid var(--lf-hair);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .topbar .header-toggle {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 10px 14px 10px 4vw;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--lf-ui-brd);
    color: var(--lf-text-2);
    font-size: 18px;
    cursor: pointer;
    transition: color .25s;
  }
  .topbar .header-toggle:hover { color: var(--lf-text); }
  .topbar-menu {
    flex: 1;
    justify-content: flex-end;
    padding: 12px 4vw;
    gap: 12px;
  }
  .topbar-menu > ul {
    display: none;
  }
  .topbar-socials { display: none; }
  .topbar-lang .lang-switcher > ul { gap: 12px; }
  .topbar-lang a { font-size: 9px; }
  .topbar-theme { margin-left: 0; }
  main.main { padding-top: 58px; }
  body.has-field main.main { padding-top: 0; }

  .topbar.header-show .topbar-menu > ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: fixed;
    top: 61px;
    left: 0; right: 0;
    z-index: 998;
    background: var(--lf-ui-bg);
    border-bottom: 1px solid var(--lf-hair);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 5vw 22px;
  }
  .topbar.header-show .topbar-menu > ul a {
    font-size: 13px;
    padding: 13px 0;
  }
}
@media (min-width: 1200px) {
  .topbar .header-toggle { display: none !important; }
}

/* Typography across the site */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -.01em;
}
.section-title { text-align: left; }
.section-title h2:before,
.section-title h2:after { display: none; }
.section-title h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 8px;
}
.section-title p {
  color: var(--lf-text-2);
  font-size: 15px;
  max-width: 60ch;
}

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--lf-text-3);
  margin-bottom: 20px;
}

/* Cards over the field get a hairline border to separate from the panel */
.card-box,
.blog-box,
.service-box {
  background: transparent !important;
  border: 1px solid var(--lf-hair);
  transition: border-color .25s;
}
.card-box:hover,
.blog-box:hover,
.service-box:hover {
  border-color: var(--lf-hair-strong);
}

/* --- Home page layout ------------------------------------------------------ */
/* Home sections stay open (no container surface): the field IS the page,
   readability comes from .text-panel on the method/work/contact blocks. */
body.has-field .section,
body.has-field .section-light,
body.has-field .section-dark {
  padding: 72px 5vw;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}
body.has-field .section .container,
body.has-field .section-light .container,
body.has-field .section-dark .container {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
@media (max-width: 640px) {
  body.has-field .section { padding: 48px 5vw; }
}

/* Shared readability surface for the method / work / contact blocks */
.text-panel {
  background: var(--lf-panel-bg);
  border: 1px solid var(--lf-panel-brd);
  border-radius: 16px;
  padding: 56px 48px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
@media (max-width: 640px) {
  .text-panel { padding: 34px 24px; border-radius: 12px; }
}

/* --- Hero (open, no panel — the field is the composition) ----------------- */
.lf-hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  max-width: none;
}
.lf-hero h1 {
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: .92;
  letter-spacing: -.02em;
  max-width: 12ch;
  text-wrap: balance;
  color: var(--lf-text);
}
.lf-hero .lf-caption {
  margin-top: 34px;
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--lf-text-2);
}
.lf-hero .lf-caption .lf-sep { color: var(--lf-text-3); }
.lf-hero .lf-lede {
  margin-top: 16px;
  font-family: var(--field-body);
  font-size: 18px;
  color: var(--lf-text-2);
  max-width: 50ch;
}
.lf-more {
  margin-top: 44px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: .12em;
  color: var(--lf-text);
  text-decoration: none;
  border-bottom: 1px solid var(--lf-hair-strong);
  padding-bottom: 5px;
  display: inline-block;
  width: max-content;
  transition: border-color .25s;
}
.lf-more:hover { border-color: var(--lf-text); }
.lf-more em { font-style: normal; display: inline-block; transition: transform .25s; }
.lf-more:hover em { transform: translate(3px, 3px); }
.lf-scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--lf-text-3);
  animation: lf-hint 2.6s ease-in-out infinite;
}
@keyframes lf-hint { 50% { transform: translateY(6px); opacity: .45; } }
@media (max-width: 480px) {
  .lf-hero h1 { font-size: clamp(3rem, 22vw, 4.5rem); }
  .lf-hero .lf-caption { font-size: 10px; letter-spacing: .16em; }
}
@media (prefers-reduced-motion: reduce) {
  .lf-scroll-hint { animation: none; }
}

/* --- Work -------------------------------------------------------------------- */
.lf-work { max-width: 1000px; }
.lf-work .lf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.lf-work h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  margin: 0;
  color: var(--lf-text);
}
.lf-work .lf-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--lf-text-3);
}
.lf-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 28px 4px;
  border-top: 1px solid var(--lf-hair);
  text-decoration: none;
  color: inherit;
  transition: border-color .25s;
}
.lf-row:last-of-type { border-bottom: 1px solid var(--lf-hair); }
.lf-row .lf-n { font-family: var(--mono); font-size: 12px; color: var(--lf-text-3); }
.lf-row .lf-t {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  line-height: 1.1;
  transition: color .25s;
}
.lf-row .lf-t small {
  display: block;
  font-family: var(--field-body);
  font-size: .85rem;
  color: var(--lf-text-3);
  margin-top: 7px;
  font-weight: 400;
  letter-spacing: 0;
}
.lf-row .lf-m {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--lf-text-3);
  letter-spacing: .08em;
  white-space: nowrap;
}
.lf-row:hover .lf-t { color: var(--lf-text); }
.lf-row:hover { border-color: var(--lf-hair-strong); }
@media (max-width: 640px) {
  .lf-row { grid-template-columns: 1fr; gap: 6px; }
  .lf-row .lf-m { white-space: normal; }
  .lf-row .lf-n { display: none; }
}

/* --- Contact ------------------------------------------------------------------ */
.lf-contact { text-align: center; }
.lf-contact .text-panel { max-width: 600px; margin: 0 auto; }
.lf-contact h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
  max-width: 16ch;
  margin: 0 auto 22px;
  color: var(--lf-text);
}
.lf-contact .lf-lede-2 {
  font-family: var(--field-body);
  color: var(--lf-text-2);
  max-width: 46ch;
  margin: 0 auto 36px;
  font-size: 15.5px;
}
.lf-mail {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--lf-text);
  text-decoration: none;
  border-bottom: 1px solid var(--lf-hair-strong);
  padding-bottom: 4px;
  transition: border-color .25s;
  display: inline-block;
}
.lf-mail:hover { border-color: var(--lf-text); }
.lf-socials {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  gap: 28px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  flex-wrap: wrap;
}
.lf-socials a { color: var(--lf-text-3); text-decoration: none; transition: color .25s; }
.lf-socials a:hover { color: var(--lf-text); }

/* ============================================================================
   About (old SnapFolio layout) — restyled onto the particle field
   Overrides main.css .about block to match the Living Field identity.
   ============================================================================ */
.about {
  padding: 12vh 5vw;
  min-height: 100vh;
  display: flex;
  align-items: center;
}
.about .container { max-width: 1100px; width: 100%; }

/* profile tile — frosted panel, v8 borders instead of heavy shadows */
.about .profile-card {
  background: var(--lf-panel-bg);
  border: 1px solid var(--lf-panel-brd);
  border-radius: 18px;
  padding: 2.75rem 2rem;
  text-align: center;
  box-shadow: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.about .profile-card::before {
  height: 2px;
  background: linear-gradient(90deg,
    hsl(210,80%,60%), hsl(310,80%,60%), hsl(50,90%,60%));
  opacity: .7;
}
.about .profile-header .profile-image {
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 1px solid var(--lf-hair-strong);
  box-shadow: none;
  position: relative;
}
.about .profile-header .profile-image::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--lf-panel-brd);
  pointer-events: none;
}
.about .profile-header .profile-badge {
  background: #23262d;
  border-color: var(--lf-panel-bg);
  box-shadow: none;
}
.about .profile-header .profile-badge i { color: var(--lf-text); }
.about .profile-content h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--lf-text);
}
.about .profile-content .profession {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lf-text-2);
}
.about .contact-links .contact-item {
  background: var(--lf-ui-bg);
  border: 1px solid var(--lf-ui-brd);
  color: var(--lf-text-2);
  border-radius: 10px;
  box-shadow: none;
}
.about .contact-links .contact-item:hover {
  background: var(--lf-ui-bg);
  color: var(--lf-text);
  border-color: var(--lf-hair-strong);
  transform: none;
  box-shadow: none;
}
.about .contact-links .contact-item i { color: var(--lf-text-3); }

/* right column */
.about .about-content { padding-left: 3rem; }
.about .about-content .section-header { margin-bottom: 2rem; }
.about .about-content .badge-text {
  background: transparent;
  color: var(--lf-text-2);
  padding: 0 0 12px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 400;
  font-family: var(--mono);
  letter-spacing: .26em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--lf-hair);
  margin-bottom: 1.5rem;
}
.about .about-content .section-header h2 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.01em;
  color: var(--lf-text);
}
.about .about-content .description p {
  font-family: var(--field-body);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--lf-text-2);
  max-width: 60ch;
}

/* stats grid — frosted panel */
.about .stats-grid {
  background: var(--lf-panel-bg);
  border: 1px solid var(--lf-panel-brd);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  box-shadow: none;
}
.about .stats-grid .stat-item {}
.about .stats-grid .stat-number {
  font-family: var(--display);
  font-weight: 300;
  font-size: 2rem;
  color: var(--lf-text);
}
.about .stats-grid .stat-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lf-text-3);
  margin-top: 4px;
}

/* details */
.about .details-grid {}
.about .details-grid .detail-item .detail-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lf-text-3);
}
.about .details-grid .detail-item .detail-value {
  font-family: var(--field-body);
  color: var(--lf-text);
  font-size: 14px;
}

/* CTA buttons — v8 mono outline */
.about .cta-section .btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  border-radius: 100px;
  padding: 12px 26px;
  border: 1px solid var(--lf-hair-strong);
  background: transparent;
  color: var(--lf-text);
  box-shadow: none;
}
.about .cta-section .btn i { margin-right: 8px; }
.about .cta-section .btn.btn-primary {
  background: var(--lf-text);
  border-color: var(--lf-text);
  color: var(--bg);
}
.about .cta-section .btn.btn-primary:hover {
  opacity: .8;
  background: var(--lf-text);
  color: var(--bg);
}
.about .cta-section .btn.btn-outline:hover {
  color: var(--lf-text);
  border-color: var(--lf-text);
  background: transparent;
}

/* mobile */
@media (max-width: 991px) {
  .about { padding: 10vh 4vw; }
  .about .about-content { padding-left: 0; margin-top: 2.5rem; }
}
@media (max-width: 480px) {
  .about .profile-card { padding: 2rem 1.25rem; }
  .about .profile-header .profile-image { width: 130px; height: 130px; }
  .about .stats-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

/* --- Project / rich-text code blocks ----------------------------------- */
/* Compact, dark code box used by the CodeBlock and Markdown (codehilite).
   Dark box on purpose: it reads clearly on both the light field and the
   dark spectrum field. */
.portfolio-description pre,
.portfolio-description pre.codehilite {
  background: #2d2d2d;
  color: #e0e0e0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  padding: 18px 20px;
  border-radius: 8px;
  border: 1px solid var(--lf-hair-strong);
  overflow-x: auto;
  margin: 0 0 24px;
}
.portfolio-description pre code {
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}
/* Inline code inside markdown / rich text */
.portfolio-description :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--lf-hair);
  color: var(--lf-text);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* ============================================================================
   Projects index + project detail — restyled onto the Living Field identity
   (overrides the legacy SnapFolio .portfolio-* layout in main.css).
   ============================================================================ */

/* --- Index: list-cards (A3) ------------------------------------------------ */
.p-index-head {
  padding: 8px 0 40px;
}
.p-index-head h1 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -.01em;
  color: var(--lf-text);
  margin: 0;
}
.p-index-head h1 + .kicker { margin-top: 0; }
.p-index-head .kicker { margin-bottom: 14px; }

/* Filter bar — mono pill tags */
.p-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 44px;
}
.p-filter {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lf-text-3);
  background: transparent;
  border: 1px solid var(--lf-hair);
  border-radius: 100px;
  padding: 8px 16px;
  cursor: pointer;
  transition: color .25s, border-color .25s;
}
.p-filter:hover { color: var(--lf-text); border-color: var(--lf-hair-strong); }
.p-filter.is-active {
  color: var(--lf-text);
  border-color: var(--lf-hair-strong);
}

/* The list itself reuses .text-panel (frosted, hairline border) */
.p-index-list {
  padding: 8px 44px;
}
.p-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 32px;
  align-items: center;
  padding: 30px 4px;
  border-bottom: 1px solid var(--lf-hair);
  text-decoration: none;
  color: inherit;
  transition: border-color .25s;
}
.p-row:last-child { border-bottom: none; }
.p-row:hover { border-color: var(--lf-hair-strong); }

.p-row-thumb {
  width: 160px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--lf-ui-bg);
  border: 1px solid var(--lf-ui-brd);
}
.p-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p-row-body h2 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.15;
  color: var(--lf-text);
  margin: 0 0 8px;
  transition: color .25s;
}
.p-row:hover .p-row-body h2 { color: var(--lf-text); }
.p-row-body p {
  font-family: var(--field-body);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--lf-text-2);
  margin: 0;
  max-width: 60ch;
}

.p-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lf-text-3);
  white-space: nowrap;
}
.p-row-date { color: var(--lf-text-2); }

@media (max-width: 900px) {
  .p-index-list { padding: 8px 28px; }
  .p-row { grid-template-columns: 120px 1fr; gap: 20px; }
  .p-row-thumb { width: 120px; height: 90px; }
  .p-row-meta { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; white-space: normal; }
}
@media (max-width: 560px) {
  .p-row { grid-template-columns: 1fr; gap: 14px; }
  .p-row-thumb { width: 100%; height: 200px; }
  .p-row-meta { grid-column: 1; flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
}

/* --- Detail: editorial article (B1) ---------------------------------------- */
.p-detail-head {
  padding: 48px 0 8px;
  max-width: 840px;
}
.p-detail-head h1 {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -.015em;
  color: var(--lf-text);
  margin: 0 0 22px;
  text-wrap: balance;
}
.p-detail-head .kicker { margin-bottom: 14px; }

.p-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lf-text-3);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  align-items: baseline;
}
.p-meta a { color: var(--lf-text-2); text-decoration: none; border-bottom: 1px solid var(--lf-hair-strong); transition: color .25s, border-color .25s; }
.p-meta a:hover { color: var(--lf-text); border-color: var(--lf-text); }
.p-meta-sep { color: var(--lf-hair-strong); }

/* Cover image — full-width within container, natural ratio, no crop
   (NOTE: the featured image is NOT rendered on the detail page; it only
   feeds the projects-index thumbnails. The gallery is the .p-slideblock
   StreamField block below. Kept rule out in case a future template needs it.) */

/* Reading column — centered, comfortable line length */
.p-reading {
  max-width: 720px;
  margin: 44px auto 0;
  font-family: var(--field-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--lf-text-2);
}
.p-reading h1,
.p-reading h2,
.p-reading h3 {
  color: var(--lf-text);
}
.p-reading h1 { font-size: 2rem; }
.p-reading h2 { font-size: 1.7rem; margin-top: 2.2em; }
.p-reading h3 { font-size: 1.3rem; margin-top: 1.8em; }
.p-reading p { margin: 0 0 1.4em; }
.p-reading a { color: var(--lf-text); text-decoration: none; border-bottom: 1px solid var(--lf-hair-strong); }
.p-reading a:hover { border-color: var(--lf-text); }
.p-reading blockquote {
  border-left: 2px solid var(--lf-hair-strong);
  margin: 1.8em 0;
  padding: 4px 0 4px 22px;
  color: var(--lf-text-2);
  font-style: italic;
}
.p-reading table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 14.5px;
  font-family: var(--field-body);
}
.p-reading th,
.p-reading td {
  border-bottom: 1px solid var(--lf-hair);
  padding: 10px 12px;
  text-align: left;
}
.p-reading th { color: var(--lf-text); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

/* Prev / next strip */
.p-prevnext {
  margin-top: 72px;
  padding: 28px 0 12px;
  border-top: 1px solid var(--lf-hair);
}
.p-prevnext a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lf-text-3);
  text-decoration: none;
  transition: color .25s;
}
.p-prevnext a:hover { color: var(--lf-text); }

/* ============================================================================
   Gallery slider — StreamField block (4:3 manual carousel)
   Images are shown COMPLETELY (object-fit: contain): no crop, no zoom.
   Manual navigation only (side arrows + dots), no autoplay.
   Click a slide to open the full image in glightbox.
   ============================================================================ */
.p-slideblock { margin: 44px 0; }
.p-slideblock-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--lf-text-3);
  margin: 0 0 16px;
  font-weight: 400;
}

.p-slider {
  border: 1px solid var(--lf-panel-brd);
  border-radius: 14px;
  overflow: hidden;
  background: var(--lf-ui-bg);
}
.p-slider-viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.p-slider-track {
  display: flex;
  height: 100%;
  transition: transform .45s cubic-bezier(.22, .61, .36, 1);
}
.p-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* contain = the WHOLE image is always visible, never cropped or zoomed */
.p-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transition: opacity .25s;
}
.p-slide a:hover img { opacity: .9; }
.p-slider-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 20px 14px;
  font-family: var(--field-body);
  font-size: 13px;
  line-height: 1.4;
  color: rgba(244, 245, 247, .92);
  background: linear-gradient(transparent, rgba(7, 9, 13, .72));
  pointer-events: none;
}

/* arrows */
.p-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--lf-hair-strong);
  background: rgba(7, 9, 13, .4);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s, background .25s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.p-slider:hover .p-slider-arrow { opacity: 1; }
.p-slider-arrow:hover { background: rgba(7, 9, 13, .7); }
.p-slider-prev { left: 14px; }
.p-slider-next { right: 14px; }

/* dots */
.p-slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--lf-hair);
}
.p-slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--lf-hair-strong);
  cursor: pointer;
  transition: background .25s, width .25s;
}
.p-slider-dot.is-active {
  background: var(--lf-text);
  width: 20px;
  border-radius: 100px;
}
@media (max-width: 560px) {
  .p-slideblock { margin: 34px 0; }
  .p-slider-arrow {
    width: 34px; height: 34px; font-size: 18px;
    opacity: 1; /* always visible on touch */
  }
}

