/* Granomar website: built to look like the app itself. Colours, fonts, the sidebar and
   the overview hero are taken from .streamlit/config.toml and app.py. */
:root {
  --bg: #ffffff;
  --side: #f6f7f6;
  --ink: #1d2320;
  --line: rgba(128, 128, 128, .24);
  --soft: rgba(128, 128, 128, .07);
  --accent: #2f7a55;
  --accent-hover: #276848;
  --on-accent: #ffffff;
  --magenta: #b8336a;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131615;
    --side: #181c1a;
    --ink: #e3e7e5;
    --accent: #4fa57a;
    --accent-hover: #5fb58a;
    --on-accent: #0f1311;
    --magenta: #e05a96;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: grid; grid-template-columns: 300px 1fr;
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---- sidebar (as in the app) ---- */
.side {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 44px 24px 32px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brandrow { display: flex; align-items: center; gap: .6rem; }
.brandrow img { width: 38px; height: 38px; flex: none; }
.brand { font: 600 1.6rem/1.1 var(--serif); letter-spacing: -.01em; }
.tagline { font-size: .82rem; opacity: .68; margin-top: .15rem; line-height: 1.3; }
.sidecredit { font-size: .86rem; margin-top: .75rem; line-height: 1.3; }
.sidecredit b { font-weight: 600; }
.labrow { display: flex; align-items: center; gap: .5rem; margin-top: .55rem;
          padding-top: .55rem; border-top: 1px solid var(--line); }
.labrow img { width: 26px; height: 26px; flex: none; }
.labname { font-size: .78rem; font-weight: 600; opacity: .85; line-height: 1.2; }
.labpi { font-size: .72rem; opacity: .65; line-height: 1.25; }

.signbox { margin: 1.6rem 0 1.8rem; }
.signin {
  display: block; text-align: center;
  padding: .62rem 1rem;
  background: var(--accent); color: var(--on-accent);
  border: 1px solid var(--accent); border-radius: 4px;
  font: 600 .98rem/1.2 var(--sans); text-decoration: none;
  position: relative; overflow: hidden;
  transition: background .15s ease, transform .1s ease;
}
.signin:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.signin:active { transform: translateY(1px); }
.signin:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.signin::after {                      /* a soft light sweeps across on hover */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-18deg); transition: left .6s ease;
}
.signin:hover::after { left: 120%; }
.access { font-size: .78rem; opacity: .65; margin: .5rem 0 0; text-align: center; }

.label { font-size: .72rem; font-weight: 600; text-transform: uppercase;
         letter-spacing: .07em; opacity: .6; margin: 0 0 .45rem; }
.sections { list-style: none; margin: 0; padding: 0; }
.sections li { display: flex; align-items: center; gap: .55rem; font-size: .94rem;
               padding: .18rem 0; opacity: .5; }
.radio { width: 15px; height: 15px; border-radius: 50%; border: 1px solid currentColor;
         opacity: .7; flex: none; }
.locked { font-size: .78rem; opacity: .55; margin: .55rem 0 0; }

/* ---- main: the overview hero (as in the app) ---- */
.main { padding: 2.6rem 3rem 3rem; max-width: 1380px; width: 100%;
        display: flex; align-items: center; }
.hero { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(420px, 1.4fr);
        gap: 2.8rem; align-items: center; width: 100%; }
.title-row { display: flex; align-items: center; gap: .85rem; }
svg.mark { width: 60px; height: 60px; flex: none; overflow: visible; }
.hero-name { font: 600 3.1rem/1 var(--serif); letter-spacing: -.02em; margin: 0; }
.byline { font-size: 1rem; margin: .75rem 0 0 .1rem; opacity: .9; }
.byline b { font-weight: 600; }
.hero-line { font: 400 1.24rem/1.45 var(--serif); margin: 1.05rem 0 .9rem; max-width: 34rem; }
.hero-how { font-size: .88rem; line-height: 1.6; opacity: .78; margin: 0; max-width: 34rem; }
.signin.wide { display: none; }       /* shown on phones, where the sidebar moves down */
.home { display: flex; align-items: center; gap: .6rem; margin-top: 1.4rem;
        padding-top: .9rem; border-top: 1px solid var(--line); max-width: 34rem; }
.home img { width: 36px; height: 36px; flex: none; }
.home-name { font-size: .82rem; font-weight: 500; line-height: 1.35; opacity: .85; }
.home-sub { font-size: .78rem; opacity: .65; margin-top: .08rem; }
.dot { padding: 0 .4rem; opacity: .55; }

/* the time course: the pictures light up one after another, like the experiment */
.hero-right { margin: 0; }
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tile { position: relative; border-radius: 2px; overflow: hidden; background: #000; }
.tile img { width: 100%; aspect-ratio: 1; display: block;
            transition: filter .8s ease, transform 6s ease; }
.strip.playing .tile img { filter: brightness(.45) saturate(.6); }
.strip.playing .tile.on img { filter: none; transform: scale(1.04); }
.tile::after { content: ""; position: absolute; inset: 0; border: 2px solid transparent;
               border-radius: 2px; transition: border-color .6s ease; pointer-events: none; }
.strip.playing .tile.on::after { border-color: var(--accent); }
.strip.playing .tile.on.heat::after { border-color: var(--magenta); }

.axis { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
        margin-top: .7rem; border-top: 1px solid var(--line); }
.progress { position: absolute; top: -1px; left: 0; height: 2px; width: 0;
            background: var(--accent); transition: width .9s ease; }
.tick { position: relative; padding-top: .55rem; font-size: .82rem; line-height: 1.3;
        transition: opacity .5s ease; }
.tick::before { content: ""; position: absolute; top: -4px; left: 0; width: 7px; height: 7px;
                border-radius: 50%; background: var(--accent); transition: transform .4s ease; }
.tick.heat::before { background: var(--magenta); }
.tick.on::before { transform: scale(1.6); }
.tick b { display: block; font-weight: 600; }
.tick span { opacity: .7; }
.axis.playing .tick { opacity: .45; }
.axis.playing .tick.on { opacity: 1; }
figcaption { font-size: .78rem; line-height: 1.5; opacity: .72; margin-top: .9rem; }
figcaption b { font-weight: 600; opacity: 1; }

/* ---- the logo: the drops drift in and merge, then the RNA strand draws itself ---- */
.mark circle { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
.mark .m1 { animation: drop 1.1s .2s cubic-bezier(.3, 1.4, .5, 1) both; }
.mark .m2 { opacity: .8; animation: drop2 1.1s .35s cubic-bezier(.3, 1.4, .5, 1) both; }
.mark .m3 { opacity: .55; animation: drop3 1.1s .5s cubic-bezier(.3, 1.4, .5, 1) both,
            breathe 4s 2s ease-in-out infinite; }
.mark .rna { fill: none; stroke: var(--magenta); stroke-width: 2.6; stroke-linecap: round;
             stroke-dasharray: 70; stroke-dashoffset: 70; animation: draw 1.2s 1s ease-out forwards; }
@keyframes drop  { from { transform: translate(-14px, 10px) scale(.3); opacity: 0; } }
@keyframes drop2 { from { transform: translate(16px, -12px) scale(.3); opacity: 0; } }
@keyframes drop3 { from { transform: translate(18px, -16px) scale(.2); opacity: 0; } }
@keyframes draw  { to { stroke-dashoffset: 0; } }
@keyframes breathe { 50% { transform: scale(1.18); } }

.hero-left > *, .hero-right { animation: rise .8s cubic-bezier(.2, .7, .2, 1) backwards; }
.byline { animation-delay: .15s; }
.hero-line { animation-delay: .3s; }
.hero-how { animation-delay: .45s; }
.home { animation-delay: .6s; }
.hero-right { animation-delay: .35s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---- narrower screens: the app's own break point, then phones ---- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: 1.6rem; }
  .hero-name { font-size: 2.4rem; }
}
@media (max-width: 760px) {
  body { display: block; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line);
          padding: 20px 16px; }
  .signbox, .label, .sections, .locked { display: none; }
  .main { padding: 1.6rem 16px 2.4rem; }
  .signin.wide { display: block; margin: 1.3rem 0 0; }
  .tick { font-size: .72rem; }
  .tick span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .mark .rna { stroke-dashoffset: 0; }
}

/* shown when Sign in is pressed before the private address is set */
.access-note { font-size: .82rem; line-height: 1.45; margin: .7rem 0 0; padding: .6rem .75rem;
               border-left: 3px solid var(--accent); background: var(--soft); border-radius: 2px; }
.access-note.wide { display: none; }
@media (max-width: 760px) { .access-note.wide:not([hidden]) { display: block; } }

/* ======== creative layer ======== */
#field { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0;
         pointer-events: none; }
.side, .main { position: relative; z-index: 1; }
.main { flex-direction: column; justify-content: center; gap: 3rem; }

/* the title: a slow green light passes through the name */
.hero-name {
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) 40%, var(--accent) 50%,
              var(--ink) 60%, var(--ink) 100%);
  background-size: 300% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 7s 2.2s ease-in-out infinite;
}
@keyframes shine { 0% { background-position: 100% 0; } 40%, 100% { background-position: 0 0; } }

/* sidebar: sections come in one by one; a dot slides in on hover */
.sections li { animation: slidein .5s ease backwards; transition: opacity .2s ease, transform .2s ease; }
.sections li:nth-child(1) { animation-delay: .5s; } .sections li:nth-child(2) { animation-delay: .58s; }
.sections li:nth-child(3) { animation-delay: .66s; } .sections li:nth-child(4) { animation-delay: .74s; }
.sections li:nth-child(5) { animation-delay: .82s; } .sections li:nth-child(6) { animation-delay: .9s; }
.sections li:nth-child(7) { animation-delay: .98s; }
.sections li:hover { opacity: .85; transform: translateX(3px); }
.sections li:hover .radio { background: radial-gradient(circle, var(--accent) 0 3px, transparent 4px);
                            border-color: var(--accent); opacity: 1; }
@keyframes slidein { from { opacity: 0; transform: translateX(-10px); } }

/* pictures lift a little under the mouse */
.tile { transition: transform .3s ease, box-shadow .3s ease; cursor: zoom-in; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .55); }

/* ---- the journey: plate to paper ---- */
.journey { width: 100%; }
.journey-head { display: flex; align-items: baseline; gap: .9rem; margin-bottom: 1.1rem;
                border-top: 1px solid var(--line); padding-top: 1.6rem; flex-wrap: wrap; }
.journey-head h2 { font: 600 1.35rem/1.2 var(--serif); margin: 0; }
.journey-head span { font-size: .82rem; opacity: .62; }
.path { list-style: none; margin: 0; padding: 0; position: relative;
        display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.path::before {                       /* the line that joins the five stops */
  content: ""; position: absolute; left: 10%; right: 10%; top: 44px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 14px);
}
.path::after {                        /* a pulse travelling along it */
  content: ""; position: absolute; top: 41px; left: 10%; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
  animation: travel 12.5s linear infinite;
}
@keyframes travel { from { left: 10%; } to { left: calc(90% - 8px); } }
.stop {
  position: relative; text-align: center; padding: 0 .4rem 1rem;
  border-radius: 6px; transition: transform .3s ease, background .3s ease;
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) backwards;
}
.stop:nth-child(1) { animation-delay: .8s; } .stop:nth-child(2) { animation-delay: .9s; }
.stop:nth-child(3) { animation-delay: 1s; } .stop:nth-child(4) { animation-delay: 1.1s; }
.stop:nth-child(5) { animation-delay: 1.2s; }
.stop svg {
  width: 88px; height: 88px; display: block; margin: 0 auto .7rem; padding: 14px;
  border-radius: 50%; background: var(--bg); border: 1px solid var(--line);
  fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: border-color .4s ease, box-shadow .4s ease, transform .4s ease;
}
.stop svg .f { fill: var(--accent); stroke: none; transition: transform .6s ease; transform-box: fill-box; transform-origin: center; }
.stop svg .m, .stop svg .mag { fill: var(--magenta); }
.stop svg .mag { fill: none; stroke: var(--magenta); }
.stop svg .thin { stroke-width: 1.1; opacity: .7; }
.stop svg .dash { stroke-dasharray: 3 3; opacity: .6; }
.stop b { display: block; font: 600 1rem/1.25 var(--serif); }
.stop span { display: block; font-size: .8rem; line-height: 1.4; opacity: .68; margin-top: .25rem; }
.stop:hover, .stop.on { transform: translateY(-4px); }
.stop:hover svg, .stop.on svg {
  border-color: var(--accent); transform: scale(1.06);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent),
              0 12px 28px -14px color-mix(in srgb, var(--accent) 70%, transparent);
}
.stop:hover svg .f, .stop.on svg .f { transform: scale(1.35); }

/* fade in when scrolled into view (phones) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.seen { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .path { grid-template-columns: repeat(3, 1fr); row-gap: 1.4rem; }
  .path::before, .path::after { display: none; }
}
@media (max-width: 760px) {
  .main { gap: 2.2rem; }
  .path { grid-template-columns: 1fr 1fr; }
  .stop svg { width: 72px; height: 72px; padding: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-name { background: none; color: var(--ink); }
  .reveal { opacity: 1; transform: none; }
}
.side { position: sticky; top: 0; align-self: start; }   /* stays in place while the page scrolls */
@media (max-width: 760px) { .side { position: relative; } }
