/* IKTEN landing · section «ΚΑΙ ΣΤΑ ΙΔΙΩΤΙΚΑ ΕΡΓΑ.» (#idiotika) · owner: builder id · class prefix: idi-
   Place: after «ΤΙΜΙΕΣ ΑΠΑΝΤΗΣΕΙΣ.» (#erotiseis), right before the black closing #telos, into which it leads.
   Greek copy: the brief of the builder (v2, 29/11), word for word, nothing more. Hand-over: work/handoff/idiotika.md
   The one moment: THE PROJECT SIGN. Every public work has a sign at the entrance of the site; the page plants its own,
   in its own materials: a board of white enamel (the plate of the machine) on two steel posts, a black band, four screws,
   a printed frame line, and under it, bolted to the same posts, a box with the seven roles of the private works as keys
   of the machine that are not lit yet (the sunk, veiled state of a key outside a filter, one lamp blinking slowly). It stands in front of a photograph
   of a site; its long evening shadow runs down into the ground, and the ground darkens into the black closing.
   Motion (transform and opacity only): the sign is set down once when it comes into view (640 ms, a short fall and a
   settle; dust at the feet); while it is on screen a gust passes every 8 s (a tremor of a few tenths of a degree from
   the feet, and a glint across the enamel); the lamp of the keys blinks at half the page's rate (3.2 s: waiting, not
   running). Reduced motion: the sign stands, the lamp is lit, nothing moves. Without the script: everything is visible.
   WebKit: no container units, no :has(); the masks of the page are not used here; filters only on still layers. */

.sec-idiotika {
  /* the width of the board: everything on the sign is measured from it */
  --idi-w: clamp(560px, 43vw, 720px);
  --idi-px: 15%;                                        /* the posts, from each edge of the board (their centres) */
  --idi-post: clamp(13px, calc(var(--idi-w) * .031), 22px);
  --idi-gap: calc(var(--idi-w) * .042);                 /* between the board and the box of keys */
  --idi-legs: calc(var(--idi-w) * .2);                  /* the posts under the box, down to the ground */
  --idi-ground: calc(var(--idi-w) * .16 + 26px);        /* the ground in front of the feet */
  --idi-pad: calc(var(--idi-w) * .021);                 /* the white rim of the board, where the screws are */
  --idi-ft: calc(var(--idi-w) * .074);                  /* the title of the work, on the black band */
  --idi-fv: calc(var(--idi-w) * .068);                  /* the values of the rows */
  --idi-fl: max(13px, calc(var(--idi-w) * .0235));      /* the engraved labels */
  --idi-lc: 31%;                                        /* the column of the labels */
  --idi-fz: calc(var(--idi-ground) + 130px);           /* how far up the ground starts to darken */
  --idi-dusk: 50, 42, 35;                               /* the colour of the top of #telos (its photograph under its veil), measured */
  --idi-enamel: url(../img/tooth.png), linear-gradient(162deg, #ffffff 0%, #fdfcf9 42%, #efede6 100%);
}

.idi-in { max-width: var(--page-max, 1840px); margin-inline: auto; }
.idi-line { display: block; margin-top: .5em; color: var(--ink); font-weight: 520; }
.idi-line b { font-weight: 720; }

/* ── the site: a full-bleed photograph, the content column inside it ── */
.idi-site {
  position: relative; isolation: isolate; overflow: hidden;
  margin-inline: calc(0px - max(var(--pad, 16px), calc((100vw - var(--page-max, 1840px)) / 2)));
  margin-bottom: calc(0px - clamp(40px, 7vh, 80px));     /* down to the edge of the section: the closing follows at once */
  padding: clamp(40px, 7vh, 72px) max(var(--pad, 16px), calc((100vw - var(--page-max, 1840px)) / 2)) var(--idi-ground);
  border-top: 1px solid var(--ink);
  background: rgb(var(--idi-dusk));
}
.idi-photo { position: absolute; inset: 0; z-index: 0; }
.idi-photo picture, .idi-photo img { display: block; width: 100%; height: 100%; }
.idi-photo img { object-fit: cover; object-position: 34% 72%; backface-visibility: hidden; }
/* depth of field: the sign is in focus, the site behind it a little soft and a little darker. One still filter,
   never animated. (When the real photograph is shot with its own depth of field, set --idi-dof: none.) */
.idi-photo { --idi-dof: blur(1.6px) brightness(.9) saturate(.9); }
.idi-photo picture { filter: var(--idi-dof); transform: scale(1.02); }   /* the scale hides the soft edge of the blur */
/* the ground falls into the evening, and at the last pixel it is the colour the closing starts with */
.idi-fade {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(var(--idi-dusk), 0) calc(100% - var(--idi-fz)),
                            rgba(var(--idi-dusk), .12) calc(100% - var(--idi-fz) * .78),
                            rgba(var(--idi-dusk), .36) calc(100% - var(--idi-fz) * .55),
                            rgba(var(--idi-dusk), .64) calc(100% - var(--idi-fz) * .34),
                            rgba(var(--idi-dusk), .86) calc(100% - var(--idi-fz) * .16),
                            rgba(var(--idi-dusk), .97) calc(100% - var(--idi-fz) * .05),
                            rgb(var(--idi-dusk)) 100%),
    linear-gradient(180deg, rgba(var(--sh), .16), rgba(var(--sh), 0) 30%);
}
.idi-place { position: relative; z-index: 1; max-width: var(--page-max, 1840px); margin-inline: auto; }
.idi-stand { position: relative; width: var(--idi-w); max-width: 100%; }

/* ── the rig: what stands on the posts. .idi-rig is set down once, .idi-sway trembles in the wind ── */
.idi-rig { position: relative; }
.idi-sway { position: relative; display: flex; flex-direction: column; transform-origin: 50% 100%; }

.idi-post {
  position: absolute; z-index: 0; top: 6%; bottom: 0; left: var(--idi-px); width: var(--idi-post);
  transform: translateX(-50%);
  background: linear-gradient(90deg, #6d6b64 0%, #b9b6ac 16%, #eceae4 34%, #d3d0c6 50%, #8f8d85 72%, #5b5953 100%);
  box-shadow: 0 0 0 1px rgba(19, 19, 17, .62);
}
.idi-post--r { left: auto; right: var(--idi-px); transform: translateX(50%); }
.idi-post::after {                                     /* earth on the feet */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22%;
  background: linear-gradient(180deg, rgba(52, 38, 26, 0), rgba(52, 38, 26, .55));
}
.idi-legs { display: block; height: var(--idi-legs); }

/* ── the board: white enamel, a printed frame line, a black band, rows ── */
.idi-board {
  position: relative; z-index: 1; overflow: hidden; padding: var(--idi-pad); border-radius: 4px;
  background: var(--idi-enamel);
  box-shadow: 0 0 0 1px var(--ink), inset 0 1px 0 #fff,
              2px 3px 0 0 #8c897f, 2px 3px 0 1px rgba(19, 19, 17, .5),
              0 30px 44px -26px rgba(var(--sh), .8);
}
.idi-face { position: relative; border-radius: 2px; box-shadow: 0 0 0 1.5px var(--ink); }
.idi-band {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: calc(var(--idi-w) * .03);
  padding: calc(var(--idi-w) * .027) calc(var(--idi-w) * .036) calc(var(--idi-w) * .031);
  background: linear-gradient(180deg, #232321, #111110); color: #fff; border-radius: 2px 2px 0 0;
}
.idi-lbl { font: 700 var(--idi-fl)/1.15 var(--f-display); letter-spacing: .14em; color: var(--ink-3); }
.idi-band .idi-lbl { grid-column: 1; color: rgba(255, 255, 255, .74); }
.idi-val { min-width: 0; font: 900 var(--idi-fv)/.9 var(--f-display); letter-spacing: -.004em; color: var(--ink); }
.idi-val--title { grid-column: 1; margin-top: .16em; font-size: var(--idi-ft); color: #fff; text-wrap: balance; }
.idi-mark { grid-column: 2; grid-row: 1 / 3; align-self: center; width: calc(var(--idi-w) * .072); height: auto; color: var(--mark); }
.idi-row {
  display: grid; grid-template-columns: var(--idi-lc) minmax(0, 1fr); align-items: baseline; column-gap: calc(var(--idi-w) * .03);
  padding: calc(var(--idi-w) * .024) calc(var(--idi-w) * .036) calc(var(--idi-w) * .021);
}
.idi-row + .idi-row { border-top: 1px solid var(--ink); }

.idi-screw, .idi-bolt {
  position: absolute; z-index: 2; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffffff 0%, #d9d6cc 38%, #8e8b82 100%);
  box-shadow: 0 0 0 1px rgba(19, 19, 17, .6), 0 1px 1px rgba(var(--sh), .5);
}
.idi-screw::before {                                   /* the slot, each one turned its own way */
  content: ""; position: absolute; left: 1px; right: 1px; top: 50%; height: 1.5px; margin-top: -.75px;
  background: rgba(19, 19, 17, .7); transform: rotate(var(--idi-r, 20deg));
}
.idi-screw--tl, .idi-screw--bl { left: calc(var(--idi-pad) / 2 - 4.5px); }
.idi-screw--tr, .idi-screw--br { right: calc(var(--idi-pad) / 2 - 4.5px); }
.idi-screw--tl, .idi-screw--tr { top: calc(var(--idi-pad) / 2 - 4.5px); }
.idi-screw--bl, .idi-screw--br { bottom: calc(var(--idi-pad) / 2 - 4.5px); }
.idi-screw--tr { --idi-r: -38deg; }
.idi-screw--bl { --idi-r: 74deg; }
.idi-screw--br { --idi-r: 6deg; }

/* a light that crosses the enamel when the wind turns the board (it shows on the band and on the shaded side) */
.idi-glint {
  position: absolute; z-index: 3; top: -10%; bottom: -10%; left: 0; width: 32%; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .14) 40%,
                              rgba(255, 255, 255, .34) 50%, rgba(255, 255, 255, .14) 60%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-120%) skewX(-16deg);
}

/* ── the box of keys, bolted to the posts: seven keys of the machine (1/12: the roles), sunk and veiled: not lit yet ── */
.idi-box {
  position: relative; z-index: 1; margin-top: var(--idi-gap); pointer-events: none;
  padding: calc(var(--idi-pad) * 1.05) calc(var(--idi-pad) * 1.05) calc(var(--idi-pad) * 1.05) calc(var(--idi-w) * .052);
  border-radius: 4px; background: var(--idi-enamel);
  box-shadow: 0 0 0 1px var(--ink), inset 0 1px 0 #fff,
              2px 3px 0 0 #8c897f, 2px 3px 0 1px rgba(19, 19, 17, .5),
              0 24px 34px -24px rgba(var(--sh), .75);
}
.idi-bolt { width: 8px; height: 8px; }
.idi-bolt--tl, .idi-bolt--bl { left: var(--idi-px); margin-left: -4px; }
.idi-bolt--tr, .idi-bolt--br { right: var(--idi-px); margin-right: -4px; }
.idi-bolt--tl, .idi-bolt--tr { top: calc(var(--idi-pad) * .52 - 4px); }
.idi-bolt--bl, .idi-bolt--br { bottom: calc(var(--idi-pad) * .52 - 4px); }
.idi-lamp { position: absolute; left: calc(var(--idi-w) * .026); top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; }
/* 1/12: the roles of the private works, in two groups with an engraved label each: six keys for building and
   renovation (three by two), and one tall key for permits, beside them (on phones: under them, full width) */
.idi-keys { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "la lb" "ta tb"; column-gap: 12px; row-gap: 7px; }
.idi-glbl { align-self: end; min-width: 0; padding-left: 2px; font: 700 var(--idi-fl)/1.15 var(--f-display); letter-spacing: .12em;
  color: var(--ink-3); overflow-wrap: normal; }
.idi-glbl--a { grid-area: la; }
.idi-glbl--b { grid-area: lb; }
.idi-tray { display: grid; gap: 10px; }
.idi-tray--a { grid-area: ta; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.idi-tray--b { grid-area: tb; grid-template-columns: minmax(0, 1fr); }
.idi-tray--b .idi-k { display: flex; flex-direction: column; }
.idi-tray--b .idi-k .k__cap { flex: 1 1 auto; height: auto; }
.idi-k.k { cursor: default; }
.idi-k.k.is-off .k__cap::after { opacity: .56; }       /* readable as words, plainly off (the wall uses .8) */
.idi-k .k__t { overflow-wrap: normal; hyphens: manual; }

/* ── on the ground: the holes of the posts, the long shadow, the dust of the setting down ── */
.idi-feet i, .idi-dust i { position: absolute; top: 100%; left: var(--idi-px); transform: translate(-50%, -50%); }
.idi-feet i + i, .idi-dust i + i { left: auto; right: var(--idi-px); transform: translate(50%, -50%); }
.idi-feet i { width: calc(var(--idi-post) * 4.6); height: 14px;
  background: radial-gradient(closest-side, rgba(22, 15, 8, .78), rgba(22, 15, 8, .3) 60%, rgba(22, 15, 8, 0)); }
.idi-dust i { width: calc(var(--idi-post) * 9); height: 38px; opacity: 0;
  background: radial-gradient(closest-side, rgba(240, 231, 214, .95), rgba(240, 231, 214, .4) 55%, rgba(240, 231, 214, 0)); }

.idi-cast {                                            /* the sign laid on the ground, toward the viewer and the right */
  position: absolute; top: 100%; left: 0; right: 0; height: calc(var(--idi-ground) * .8);
  transform: skewX(50deg); transform-origin: 0 0; filter: blur(2.5px); pointer-events: none;
}
.idi-cast i { position: absolute; }
/* the farther from the feet, the softer: every piece fades out toward its far end, so nothing reaches the seam */
.idi-cast__post { top: 0; height: 100%; left: var(--idi-px); width: var(--idi-post); margin-left: calc(var(--idi-post) / -2);
  background: linear-gradient(180deg, rgba(22, 15, 8, .62), rgba(22, 15, 8, .3) 60%, rgba(22, 15, 8, 0)); }
.idi-cast__post--r { left: auto; right: var(--idi-px); margin: 0 calc(var(--idi-post) / -2) 0 0; }
.idi-cast__box { left: 0; right: 0; top: 24%; height: 18%; background: linear-gradient(180deg, rgba(22, 15, 8, .52), rgba(22, 15, 8, .4)); }
.idi-cast__board { left: 0; right: 0; top: 48%; bottom: 0; background: linear-gradient(180deg, rgba(22, 15, 8, .46), rgba(22, 15, 8, .2) 60%, rgba(22, 15, 8, 0)); }

/* ── motion, armed by the script (nothing is hidden without it) ── */
/* the photograph comes in as the photographs of the page do (css/live.css .ph: 900 ms, 1700 ms --out). It is the
   filtered element itself that moves, so the blur is drawn once and only a finished layer is scaled. */
.idi-armed .idi-photo picture { opacity: 0; transform: scale(1.08); }
.idi-armed.idi-seen .idi-photo picture { opacity: 1; transform: scale(1.02); transition: opacity 900ms linear, transform 1700ms var(--out); }
.idi-armed:not(.idi-planted) .idi-rig { opacity: 0; }
.idi-armed:not(.idi-planted) .idi-cast, .idi-armed:not(.idi-planted) .idi-feet { opacity: 0; }
.idi-armed.idi-planted .idi-cast, .idi-armed.idi-planted .idi-feet { opacity: 1; transition: opacity 360ms linear 300ms; }
.idi-drop .idi-rig { animation: idi-plant 640ms both; }
.idi-drop .idi-dust i { animation: idi-dust 900ms cubic-bezier(.23, 1, .32, 1) 380ms both; }
.idi-drop .idi-dust i + i { animation-name: idi-dust-r; }
.idi-live .idi-sway { animation: idi-gust 8s cubic-bezier(.65, 0, .35, 1) 1.4s infinite; }
.idi-live .idi-glint { animation: idi-glint 8s linear 1.4s infinite; }
.idi-live .idi-lamp { animation: idi-blink 3.2s steps(1, end) infinite; }

@keyframes idi-plant {
  0% { opacity: 0; transform: translateY(-30px); animation-timing-function: cubic-bezier(.55, 0, .85, .4); }
  10% { opacity: 1; }
  60% { transform: translateY(0); animation-timing-function: cubic-bezier(.23, 1, .32, 1); }
  76% { transform: translateY(-3px); animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes idi-dust {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(.3); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}
@keyframes idi-dust-r {
  0% { opacity: .9; transform: translate(50%, -50%) scale(.3); }
  100% { opacity: 0; transform: translate(50%, -50%) scale(1.5); }
}
@keyframes idi-gust {
  0% { transform: rotate(0deg); }
  4% { transform: rotate(.38deg); }
  9% { transform: rotate(-.28deg); }
  14% { transform: rotate(.18deg); }
  19% { transform: rotate(-.1deg); }
  24% { transform: rotate(.04deg); }
  29%, 100% { transform: rotate(0deg); }
}
@keyframes idi-glint {
  0% { opacity: 0; transform: translateX(-120%) skewX(-16deg); }
  2% { opacity: 1; }
  19% { opacity: 1; transform: translateX(330%) skewX(-16deg); }
  21%, 100% { opacity: 0; transform: translateX(330%) skewX(-16deg); }
}
@keyframes idi-blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

@media (prefers-reduced-motion: reduce) {
  .idi-armed .idi-photo picture { opacity: 1; transform: scale(1.02); }
  .idi-armed .idi-rig, .idi-armed .idi-cast, .idi-armed .idi-feet { opacity: 1; transform: none; }
  .idi-sway, .idi-glint, .idi-lamp, .idi-dust i { animation: none !important; }
  .idi-glint, .idi-dust i { opacity: 0; }
}

/* ── wide screens: the sign grows no more; the site keeps the photograph full-bleed ── */
@media (min-width: 1700px) {
  .sec-idiotika { --idi-w: 740px; }
}

/* ── tablets: the heads stack (prims), the sign stands in the middle ── */
@media (max-width: 1100px) {
  .sec-idiotika { --idi-w: min(620px, calc(100vw - 2 * var(--pad, 16px))); }
  .idi-stand { margin-inline: auto; }
  .idi-photo img { object-position: 46% 72%; }
}

/* ── phones: the sign is the width of the column; labels above their values; the keys two by two ── */
@media (max-width: 640px) {
  .sec-idiotika {
    --idi-w: min(400px, calc(100vw - 2 * var(--pad, 16px) - 36px));
    --idi-ft: calc(var(--idi-w) * .088);
    --idi-fv: calc(var(--idi-w) * .104);
    --idi-fl: max(12.5px, calc(var(--idi-w) * .037));
    --idi-pad: 10px;
    --idi-gap: 14px;
    --idi-legs: 78px;
    --idi-ground: 96px;
    --idi-fz: 250px;
    --idi-post: 12px;
    --idi-px: 17%;
  }
  .idi-site { padding-top: clamp(96px, 16vh, 140px); }
  .idi-photo img { object-position: 60% 78%; }
  .idi-band { padding: 13px 13px 14px; }
  .idi-mark { grid-row: 1; align-self: start; width: 28px; margin-top: -2px; }
  .idi-row { grid-template-columns: minmax(0, 1fr); padding: 10px 13px 9px; }
  .idi-row .idi-lbl { margin-bottom: 5px; }
  /* the keys: the six three by two, the permits key under them at full width; their words stay, small */
  .idi-box { padding: 10px 9px 10px 24px; }
  .idi-lamp { left: 12px; }
  .idi-keys { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "la" "ta" "lb" "tb"; row-gap: 6px; }
  .idi-glbl--b { margin-top: 6px; }
  .idi-tray.m-tray { padding: 7px; gap: 6px; }
  .idi-k .k__cap { height: 62px; padding: 7px 7px 7px; }
  .idi-tray--b .idi-k .k__cap { height: 50px; }
  .idi-k .k__t { font-size: 11.5px; letter-spacing: .01em; line-height: 1.02; }
  .idi-k .k__t.is-tight { font-size: 10.5px; letter-spacing: -.01em; }
  .idi-k .k__top .ik-ico { font-size: 17px; }
  .idi-cast { transform: skewX(44deg); }
}

/* ── the narrowest phones: the six role keys two by two, so their words keep their width ── */
@media (max-width: 374px) {
  .idi-tray--a { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
