/* =====================================================================
   HOME 4 (prototype, index4.html) — loaded after home.css and home2.css.

   index2 with each card drawn as a drawing sheet:

     frame        a thin line inset from the card edge, with centring
                  marks crossing it at the middle of each side (the way
                  ISO 5457 sheets mark their axes of symmetry)
     title block  ruled cells along the bottom of the frame: sheet number
                  "IV / XII", category, then the title; the open card
                  gets a VIEW PROJECT cell on the right of the title row
     ruler        the scrollbar is a line with one tick per sheet and a
                  bracket for the part of the strip that's on screen;
                  ticks jump to their sheet (ticks added by home4.js)

   The strip can also be dragged with the mouse like a touchscreen, with
   momentum and a rubber-band at the ends (home4.js).

   Portrait phones/tablets keep the split view from home.css: there .tb
   is display: contents, so its children lay out exactly as on index.
   ===================================================================== */

body.home4 .tb { display: contents; }
/* the category has no brackets in this file's markup; the split view adds them back */
body.home4 .index-label.cat:not(:empty)::before { content: "["; }
body.home4 .index-label.cat:not(:empty)::after { content: "]"; }
body.home4 .scrollbar .tick { display: none; }

@media not all and (orientation: portrait) and (max-width: 1100px) {

  body.home4 .track {
    --m: clamp(7px, calc(var(--card-h) * 0.016), 12px);     /* card edge to frame */
    --line: rgba(236, 239, 244, 0.17);
    --tb-small: clamp(8px, calc(var(--card-h) * 0.0165), 12px);
    --card-w-active: 34vw;
    cursor: grab;
  }
  body.home4 .track.is-settling { transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1); }

  body.home4 .box,
  body.home4 .card { border-radius: 5px; }

  /* ---- frame and centring marks ---- */
  body.home4 .box::before {
    content: "";
    position: absolute;
    inset: var(--m);
    z-index: 5;
    border: 1px solid var(--line);
    pointer-events: none;
    transition: border-color 0.5s var(--ease-out);
  }
  body.home4 .box::after {
    content: "";
    position: absolute;
    inset: calc(var(--m) - 5px);
    z-index: 5;
    pointer-events: none;
    opacity: 0.4;
    background:
      linear-gradient(var(--light-primary), var(--light-primary)) 50% 0 / 1px 11px no-repeat,
      linear-gradient(var(--light-primary), var(--light-primary)) 50% 100% / 1px 11px no-repeat,
      linear-gradient(var(--light-primary), var(--light-primary)) 0 50% / 11px 1px no-repeat,
      linear-gradient(var(--light-primary), var(--light-primary)) 100% 50% / 11px 1px no-repeat;
    transition: opacity 0.5s var(--ease-out);
  }
  body.home4 .box:hover::before { border-color: rgba(236, 239, 244, 0.3); }
  body.home4 .box.active::before { border-color: rgba(236, 239, 244, 0.42); }
  body.home4 .box.active::after { opacity: 0.85; }

  /* ---- title block ---- */
  body.home4 .tb {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    position: absolute;
    left: var(--m);
    right: var(--m);
    bottom: var(--m);
    z-index: 4;
    text-align: left;
    border-top: 1px solid var(--line);
    pointer-events: none;            /* clicks fall through to the card / the preview */
    background-color: rgba(5, 18, 32, 0);
    transition: border-color 0.5s var(--ease-out), background-color 0.9s var(--ease-out);
  }
  /* the open card's preview runs on down behind the block to the card's bottom
     edge. Only a light tint sits between them; the text is kept readable by a
     tight dark halo of its own (below) */
  body.home4 .box.active .tb { --line: rgba(236, 239, 244, 0.42); background-color: rgba(5, 18, 32, 0.3); }
  body.home4 .box.active .tb .index-label,
  body.home4 .box.active .tb .s-title,
  body.home4 .box.active .tb .see-more {
    text-shadow: 0 0 2px #051220, 0 0 5px #051220, 0 0 9px #051220, 0 0 14px rgba(5, 18, 32, 0.9);
  }
  body.home4 .box.active .tb .index-label { color: #eceff4; }
  body.home4 .box.active .tb .index-label.cat { color: rgba(236, 239, 244, 0.85); }

  body.home4 .tb .index-label {
    position: static;
    grid-row: 1;
    margin: 0;
    padding: 0.75em 0.95em 0.7em;
    width: auto;
    transform: none;
    font-size: var(--tb-small);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.14em;
    white-space: nowrap;
    opacity: 1;
    color: rgba(236, 239, 244, 0.86);
    border-bottom: 1px solid var(--line);
    text-shadow: 0 0 4px #000;
  }
  body.home4 .tb .index-label:not(.cat) {
    grid-column: 1;
    border-right: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
  }
  /* "IV / XII": which sheet, of how many (home4.js fills data-of) */
  body.home4 .tb .index-label:not(.cat)[data-of]::after {
    content: " / " attr(data-of);
    color: rgba(236, 239, 244, 0.5);
  }
  body.home4 .tb .index-label.cat {
    grid-column: 2 / -1;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(236, 239, 244, 0.6);
  }
  /* no category: the sheet number takes the whole row */
  body.home4 .tb .index-label.cat:empty { display: none; }
  body.home4 .tb .index-label:not(.cat):has(+ .cat:empty) { grid-column: 1 / -1; border-right: 0; }
  body.home4 .tb .index-label.cat::before,
  body.home4 .tb .index-label.cat::after { content: none; }

  body.home4 .tb .s-title {
    position: static;
    grid-column: 1 / 3;
    grid-row: 2;
    align-self: center;
    width: auto;
    padding: 0.62em 0.7em 0.56em;
    transform: none;
    text-align: left;
    white-space: normal;
    line-height: 1.08;
    font-size: clamp(11px, calc(var(--card-h) * 0.03), 22px);
    transition: font-size var(--dur) var(--ease-out-2);
  }
  body.home4 .box.active .tb .s-title {
    font-size: clamp(14px, calc(var(--card-h) * 0.047), 36px);
  }

  body.home4 .tb .see-more {
    position: static;
    display: none;
    grid-column: 3;
    grid-row: 2;
    align-self: stretch;
    margin: 0;
    padding: 0 1.3em;
    transform: none;
    font-family: inherit;
    font-size: var(--tb-small);
    font-weight: 500;
    letter-spacing: 0.14em;
    color: var(--light-primary);
    background: rgba(5, 18, 32, 0.45);
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    pointer-events: auto;
    transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
  }
  body.home4 .box.active .tb .see-more {
    display: block;
    opacity: 1;
    visibility: visible;
    animation: tb-cell 0.9s var(--ease-out) 0.25s both;
  }
  body.home4 .box.active .tb .see-more[aria-disabled="true"] { color: rgba(236, 239, 244, 0.5); }
  body.home4 .box.active .tb .see-more:not([aria-disabled="true"]):hover,
  body.home4 .box.active .tb .see-more:not([aria-disabled="true"]):focus-visible {
    color: var(--dark-primary);
    background: var(--light-primary);
    outline: none;
  }
  @keyframes tb-cell { from { opacity: 0; } to { opacity: 1; } }

  /* ---- dragging ---- */
  body.home4.is-dragging,
  body.home4.is-dragging * { cursor: grabbing !important; }
  body.home4.is-dragging .box { pointer-events: none; }

  /* ---- ruler ---- */
  body.home4 .scrollbar {
    left: 50%;
    bottom: 2.4vh;
    width: min(58vw, 660px);
    height: 30px;
    transform: translateX(-50%);
    background: none;
    border: 0;
    border-top: 1px solid rgba(236, 239, 244, 0.26);
    border-radius: 0;
  }
  body.home4 .handle {
    top: -1px;
    height: 8px;
    background: rgba(236, 239, 244, 0.1);
    border: 0;
    border-top: 2px solid var(--light-primary);
    border-left: 1px solid rgba(236, 239, 244, 0.7);
    border-right: 1px solid rgba(236, 239, 244, 0.7);
    border-radius: 0;
  }
  body.home4 .scrollbar .tick {
    display: block;
    position: absolute;
    top: 0;
    z-index: 1002;
    width: 24px;
    height: 30px;
    margin: 0 0 0 -12px;
    padding: 0;
    font-family: inherit;
    color: var(--light-primary);
    background: none;
    border: 0;
    cursor: pointer;
  }
  body.home4 .scrollbar .tick i {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 6px;
    background: currentColor;
    opacity: 0.45;
    transition: height 0.35s var(--ease-out), opacity 0.35s var(--ease-out);
  }
  body.home4 .scrollbar .tick span {
    position: absolute;
    left: 50%;
    top: 15px;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 1;
    opacity: 0.38;
    transition: opacity 0.35s var(--ease-out);
  }
  body.home4 .scrollbar .tick:hover i,
  body.home4 .scrollbar .tick:focus-visible i { height: 10px; opacity: 0.9; }
  body.home4 .scrollbar .tick:hover span,
  body.home4 .scrollbar .tick:focus-visible span { opacity: 0.9; }
  body.home4 .scrollbar .tick:focus-visible { outline: 1px solid rgba(236, 239, 244, 0.6); outline-offset: 1px; }
  body.home4 .scrollbar .tick.on i { height: 12px; opacity: 1; }
  body.home4 .scrollbar .tick.on span { opacity: 1; }
}

/* compact: the ruler is part of the column there, so make room for it */
@media (max-width: 1380px), (max-height: 640px) {
  @media not all and (orientation: portrait) and (max-width: 1100px) {
    body.home4 .track { --card-w-active: min(calc(var(--card-h) * 0.86), 62vw); }
    @supports (height: 1cqh) {
      body.home4 .track { --card-h: calc(84cqh - 44px); }
    }
    body.home4 .scrollbar {
      left: auto;
      bottom: auto;
      width: min(64%, 520px);
      height: 26px;
      margin: 10px auto 8px;
      transform: none;
    }
    body.home4 .scrollbar .tick { height: 26px; }
    body.home4 .scrollbar .tick span { top: 14px; font-size: 8px; }
  }
}
@media (max-width: 760px) {
  /* not enough room for twelve numerals: only the open sheet keeps its number */
  body.home4 .scrollbar .tick:not(.on) span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.home4 .track.is-settling { transition: none; }
  body.home4 .box.active .tb .see-more { animation: none; }
}

/* ---------------------------------------------------------------------
   Ring cursor (home4.js adds .ring-cursor and puts has-ring on <body>
   once a mouse has moved; without that class the system cursor stays)
   --------------------------------------------------------------------- */
html body.home4.has-ring,
html body.home4.has-ring * { cursor: none !important; }

.ring-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2147483647;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s linear;
  will-change: transform;
}
.ring-cursor.is-on { opacity: 1; }
.ring-cursor i {
  position: absolute;
  left: -11px;
  top: -11px;
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  border: 1.5px solid #eceff4;
  border-radius: 50%;
  background: rgba(236, 239, 244, 0.14);
  box-shadow: 0 0 0 1px rgba(5, 18, 32, 0.45);      /* keeps it visible on light pictures */
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.16s linear;
}
/* pressing fills the ring in from the middle, in the ring's own colour */
.ring-cursor i::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  background: #eceff4;
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.6, 1);     /* empties a little slower than it fills */
}
.ring-cursor.is-down i::after { transform: scale(1); transition: transform 0.13s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring-cursor.is-act i { transform: scale(1.55); background: rgba(236, 239, 244, 0.05); }
.ring-cursor.is-down i { transform: scale(0.82); }
html:has(body.is-dragging) .ring-cursor i { transform: scale(1.35, 0.62); }
@media (prefers-reduced-motion: reduce) { .ring-cursor i, .ring-cursor i::after { transition: none !important; } }

/* ---------------------------------------------------------------------
   Header: the home page uses the shared header from page-header.css (loaded
   after this file), the same one as Gallery and About. So in every layout
   the page is a column: header, then the carousel in what's left (home.css
   only did that for its compact layout; its desktop header was fixed over
   a full-height track).
   --------------------------------------------------------------------- */
body.home4 .site-header { flex: 0 0 auto; }
@media (min-width: 1381px) and (min-height: 641px) {
  /* desktop only: home.css already lays the compact and split views out this way */
  body.home4 { display: flex; flex-direction: column; }
  body.home4 #blocker { display: none; }
  body.home4 .home-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  body.home4 .carousel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
  /* the cards stay clear of the ruler at the bottom */
  body.home4 .track { flex: 1 1 auto; min-height: 0; width: 100%; height: auto; margin: 0; --card-h: min(80vh, calc(100vh - 205px)); padding-bottom: 6vh; }
}
}
