/* =========================================================
   SIIRF home page
   ========================================================= */
@font-face { font-family: "Playfair Display"; src: url("../fonts/playfair-italic.woff2") format("woff2"); font-style: italic; font-weight: 700; font-display: swap; }
@font-face { font-family: "Bebas Neue"; src: url("../fonts/bebas.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("../fonts/cinzel.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("../fonts/baskerville.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Abril Fatface"; src: url("../fonts/abril.woff2") format("woff2"); font-display: swap; }

body.home .site-footer { margin-top: 0; }

/* ===== Hero: the library shelf at night ===== */
.hero-band { background: radial-gradient(ellipse 45% 65% at 76% 48%, rgba(224, 180, 90, .16), rgba(224, 180, 90, 0) 70%), var(--primary); color: #F6F3EC; }
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 44px 22px 70px; }
.hero .kicker { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #E0B45A; margin: 0 0 14px; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02; color: #F6F3EC; margin-bottom: 18px; }
.hero .lead { font-size: 1.15rem; color: #C9CED4; max-width: 46ch; margin-bottom: 26px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }

.shelfbox { position: relative; height: 420px; }
.row { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 6px; }
.shelf { position: absolute; left: 0; right: 0; bottom: 46px; height: 24px; border-radius: 4px; background: linear-gradient(#8A6040, #5A3C24); box-shadow: 0 16px 26px -8px rgba(0, 0, 0, .55); }
.hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: .86rem; color: #C9CED4; margin: 0; }

.spine {
  position: relative; display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl; transform: rotate(180deg);
  width: var(--w); height: var(--h); padding: 22px 0; border-radius: 4px 4px 2px 2px;
  color: var(--i); background-color: var(--c); text-decoration: none; white-space: nowrap;
  background-image: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .14) 28%, rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, .3));
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  transition: transform .25s ease;
}
.spine::before, .spine::after { content: ""; position: absolute; left: 8px; right: 8px; height: 8px; border-top: 2px solid var(--g); border-bottom: 2px solid var(--g); opacity: .8; }
.spine::before { bottom: 16px; } .spine::after { top: 16px; }
.spine:hover, .spine:focus-visible { transform: rotate(180deg) translateY(18px); color: var(--i); }
.spine:focus-visible { outline: 3px solid #E0B45A; outline-offset: 3px; }
.s-about { --c: #5E6E58; --i: #F1E6C8; --g: #D9BC7E; --w: 66px; --h: 250px; font-family: "Cinzel", Georgia, serif; font-weight: 700; font-size: .95rem; letter-spacing: .06em; }
.s-assess { --c: #7A3E31; --i: #F3E6CC; --g: #D9BB7B; --w: 72px; --h: 282px; font-family: "Playfair Display", Georgia, serif; font-style: italic; font-weight: 700; font-size: 1.06rem; }
.s-game { --c: #4A5D70; --i: #EEE7D6; --g: #D4B57A; --w: 76px; --h: 300px; font-family: "Bebas Neue", Impact, sans-serif; font-size: 1.5rem; letter-spacing: .1em; }
.s-log { --c: #B7862B; --i: #2A2116; --g: #3B2E1E; --w: 64px; --h: 242px; font-family: "Libre Baskerville", Georgia, serif; font-weight: 700; font-size: .92rem; }
.s-guides { --c: #56475E; --i: #F0E5CF; --g: #D4B57A; --w: 72px; --h: 276px; font-family: "Abril Fatface", Georgia, serif; font-size: 1.06rem; letter-spacing: .03em; }
.s-plan { --c: #3E5442; --i: #EED9A0; --g: #D9BC7E; --w: 78px; --h: 298px; font-family: var(--serif); font-weight: 700; font-size: .96rem; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 30px; }
  .shelfbox { height: 360px; transform: scale(.8); transform-origin: top center; margin-bottom: -60px; }
}

/* ===== About ===== */
.about { padding-top: 56px; scroll-margin-top: 80px; }
.about p { max-width: 72ch; }
.about .label { font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.about p { font-size: 1.08rem; color: var(--muted); }
.about .by { font-size: .98rem; }

/* ===== The six stages ===== */
.cycle { display: grid; grid-template-columns: 440px 1fr; gap: 50px; align-items: center; padding-top: 64px; }
.cycle .ring svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 30px rgba(31, 41, 51, .15)); }
.label { font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.lead2 { color: var(--muted); font-size: 1.05rem; }
.stages { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.stages li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.stages strong { display: block; }
.stages span:not(.sn) { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.sn { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 800; font-size: .85rem; }
.s1 { background: #2F3E4E; } .s2 { background: #4A5D70; } .s3 { background: #B7862B; } .s4 { background: #8A6A2E; } .s5 { background: #3E5442; } .s6 { background: #7A3E31; }
@media (max-width: 960px) { .cycle { grid-template-columns: 1fr; gap: 20px; } .cycle .ring { max-width: 380px; margin: 0 auto; } }
@media (max-width: 560px) { .stages { grid-template-columns: 1fr; } }

/* ===== The team ===== */
.team-title { font-family: var(--font); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px; }
.team { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 18px 22px; }
.team li { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 88px; text-align: center; }
.avatar { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; border: 3px solid var(--paper); box-shadow: 0 6px 14px -8px rgba(31, 41, 51, .5); }
.avatar.c1 { background: #2F3E4E; } .avatar.c2 { background: #B7862B; } .avatar.c3 { background: #4A5D70; } .avatar.c4 { background: #7A3E31; }
.avatar.c5 { background: #3E5442; } .avatar.c6 { background: #8A6A2E; } .avatar.c7 { background: #56475E; }
.pname { font-weight: 700; font-size: .9rem; }

/* ===== Partner band ===== */
.band { margin: 56px 0 64px; background: var(--primary); color: #F6F3EC; border-radius: 8px; padding: 28px 32px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.band h2 { color: #F6F3EC; margin: 0 0 4px; }
.band p { margin: 0; color: #C9CED4; }
.band .actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ===== Incident helper (bot) ===== */
#irh {
  --ink: #1F2933;
  --muted: #56606B;
  --paper: #FFFFFF;
  --sage: #F3EFE5;
  --green: #2F3E4E;
  --green-dark: #1F2A36;
  --alert: #9B3B2E;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}
#irh *, #irh *::before, #irh *::after { box-sizing: border-box; }
#irh button { font: inherit; cursor: pointer; }
#irh :focus-visible { outline: 3px solid #B7862B; outline-offset: 2px; }

#irh-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 9998;
  background: var(--green); color: #fff; border: 0;
  padding: 14px 20px; border-radius: 999px; font-weight: 700;
  box-shadow: 0 6px 20px rgba(23, 89, 74, .35);
}
#irh-launch:hover { background: var(--green-dark); }

#irh-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 9999;
  width: min(400px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 40px));
  display: flex; flex-direction: column;
  background: var(--paper); border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(29, 36, 51, .28);
}
#irh-panel[hidden] { display: none; }

#irh-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px; background: var(--ink); color: #fff;
}
#irh-head strong { display: block; font-size: 18px; }
#irh-head span { font-size: 13px; color: #C9CED4; }
#irh-close { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; padding: 0 4px; }

#irh-log { flex: 1; min-height: 120px; overflow-y: auto; padding: 18px; background: var(--sage); display: flex; flex-direction: column; gap: 12px; }

.irh-bot, .irh-you { max-width: 92%; padding: 12px 14px; border-radius: 12px; }
.irh-bot { background: var(--paper); align-self: flex-start; border-bottom-left-radius: 4px; }
.irh-bot.urgent { border-left: 5px solid var(--alert); }
.irh-you { background: var(--green); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.irh-bot p { margin: 0 0 8px; }
.irh-bot p:last-child { margin-bottom: 0; }
.irh-bot h3 { margin: 0 0 6px; font-size: 16px; }

.irh-steps { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: s; }
.irh-steps li { counter-increment: s; margin-bottom: 8px; }
.irh-steps label { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; cursor: pointer; }
.irh-steps input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green); }
.irh-steps input:checked + span { color: var(--muted); text-decoration: line-through; }
.irh-steps span::before { content: counter(s) ". "; font-weight: 700; }

.irh-help { margin-top: 10px; padding-top: 10px; border-top: 1px solid #E3DCCB; font-size: 15px; }
.irh-help a { color: var(--green-dark); font-weight: 700; }

#irh-options { padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); border-top: 1px solid #E3DCCB; max-height: 45%; overflow-y: auto; flex-shrink: 0; }
.irh-opt {
  text-align: left; padding: 11px 14px; border-radius: 10px;
  background: var(--paper); color: var(--green-dark); border: 2px solid var(--green);
}
.irh-opt:hover { background: var(--sage); }

#irh-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px 12px; font-size: 13px; color: var(--muted); background: var(--paper); }
#irh-restart { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 0; }

@media (max-width: 480px) {
  #irh-panel { right: 0; bottom: 0; width: 100vw; height: 92vh; border-radius: 14px 14px 0 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .irh-bot, .irh-you { animation: irh-in .18s ease-out; }
  @keyframes irh-in { from { opacity: 0; transform: translateY(4px); } }
}
.hero-band { overflow: hidden; }
@media (max-width: 420px) {
  .shelfbox { transform: scale(.7); margin-bottom: -100px; }
}
@media (max-width: 900px) {
  .shelf { left: 50%; right: auto; width: 480px; transform: translateX(-50%); }
}
@media (max-width: 360px) {
  .shelfbox { transform: scale(.64); margin-bottom: -115px; }
}
