/* =========================================================================
   GianOS — app views
   App chrome (compact bar + oversized collapsing hero title) and the
   content blocks the apps are built from: profile panel, badges, work tile,
   forces, kit rows, timeline, outcome notes, contact CTAs, agent diagram.
   Reading surfaces stay calm paper; clay is the single content accent.
   ========================================================================= */

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
}

/* ----------------------------------------------------------------- chrome */

.app__bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: max(0.65rem, env(safe-area-inset-top)) 0.9rem 0.65rem;
  background: color-mix(in oklch, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
          backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color calc(0.3s * var(--ms)) var(--ease);
}
html[data-display="framed"] .app__bar { padding-top: 2.5rem; } /* clears the simulated status bar */
.app.is-scrolled .app__bar { border-bottom-color: var(--line-soft); }

.app__back {
  flex: 0 0 auto;
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  transition: transform calc(0.3s * var(--ms)) var(--spring), background calc(0.25s * var(--ms)) var(--ease);
}
.app__back:hover { background: var(--surface-2); }
.app__back:active { transform: scale(0.88); }
.app__back:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.app__back svg { width: 1.1rem; height: 1.1rem; }

.app__glyph {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.72rem;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
}
.app__glyph svg { width: 1.1rem; height: 1.1rem; }

.app__name {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  opacity: 0;
  transform: translateY(0.3rem);
  transition: opacity calc(0.3s * var(--ms)) var(--ease), transform calc(0.3s * var(--ms)) var(--ease);
}
.app.is-scrolled .app__name { opacity: 1; transform: none; }

.app__scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding: 0.4rem 1.25rem max(2.4rem, env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
html[data-display="framed"] .app__scroll { padding-bottom: 3rem; } /* clears the handle */

/* oversized display title that collapses as you scroll */
.app__hero { padding: 0.7rem 0 1.1rem; }
.app__kicker {
  display: block;
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.app__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.7rem, 13vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--text);
}
/* scroll-driven collapse where the engine supports it; the bar-title fade
   (JS class) is the everywhere fallback */
@supports (animation-timeline: scroll()) {
  .app__hero {
    animation: hero-collapse linear both;
    animation-timeline: scroll(nearest);
    animation-range: 0 140px;
    transform-origin: left top;
  }
  @keyframes hero-collapse {
    to { transform: scale(0.86); opacity: 0.4; }
  }
}

/* ------------------------------------------------------- reveal on scroll */

.reveal { opacity: 0; transform: translateY(1.2rem); }
.reveal.in {
  opacity: 1;
  transform: none;
  transition:
    opacity calc(0.6s * var(--ms)) var(--ease) calc(var(--stagger, 0) * 0.07s * var(--ms)),
    transform calc(0.7s * var(--ms)) var(--ease) calc(var(--stagger, 0) * 0.07s * var(--ms));
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------- text blocks */

.block { max-width: 60ch; }
.block + .block,
.block + .forces, .block + .notes, .block + .contact { margin-top: 1.4rem; }
.block p + p { margin-top: 0.7rem; }
.lead { font-size: 1.12rem; line-height: 1.55; }
.hl { color: var(--text); font-weight: 600; box-shadow: inset 0 -0.42em 0 var(--accent-soft); padding: 0 0.04em; }
.hook-tail { margin-top: 0.7rem; color: var(--text-muted); }
.hook-tail strong { color: var(--accent); font-weight: 600; }
.stakes { margin-top: 0.85rem; font-size: 1.02rem; color: var(--text); }
.stakes strong { color: var(--accent); font-weight: 700; }

.punchline {
  margin-top: 1.3rem;
  max-width: 22ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}
.punchline strong { color: var(--accent); }

/* the quiet, honest block (off-code) */
.quiet {
  margin-top: 1rem;
  max-width: 56ch;
  padding: 0.95rem 1rem;
  background: var(--stage);
  border: 1px solid var(--line-soft);
  border-radius: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.quiet p + p { margin-top: 0.6rem; }
.quiet strong { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------- badges */

.badges { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.42rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.36rem 0.72rem;
  border-radius: 0.7rem;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  white-space: nowrap;
}
.badge--lead { background: var(--accent-soft); border-color: var(--accent-line); font-weight: 600; }
.badge--ghost { background: transparent; color: var(--text-muted); border-style: dashed; }
.badge--flag { background: var(--surface); }
.badge__dot {
  width: 0.46rem; height: 0.46rem; border-radius: 50%;
  background: var(--accent);
}

/* ------------------------------------------------------------ work tile */

.tile {
  margin-top: 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 1.05rem;
  padding: 0.9rem 0.95rem;
  max-width: 56ch;
}
.tile__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem;
  margin-bottom: 0.45rem;
}
.tile__org { font-family: var(--font-label); font-size: 0.7rem; color: var(--accent); }
.tile__when { font-family: var(--font-label); font-size: 0.68rem; color: var(--text-faint); white-space: nowrap; }
.tile__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.tile__title strong { color: var(--accent); }
.tile__sub { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.35rem; }
.tile__sub strong { color: var(--text); font-weight: 600; }

/* ----------------------------------------------------- forces (system) */

.forces { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 1rem; max-width: 56ch; }
.force {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 1rem;
  padding: 0.8rem 0.9rem;
}
.force__k {
  font-family: var(--font-label);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.force p { margin-top: 0.2rem; font-size: 0.95rem; color: var(--text-muted); }
.force strong { color: var(--text); }

/* --------------------------------------- outcome notes (notification-like) */

.notes { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 1rem; max-width: 56ch; }
.note {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  padding: 0.75rem 0.9rem;
  border-radius: 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.note__app { font-family: var(--font-label); font-size: 0.64rem; color: var(--accent); }
.note__title { font-weight: 600; font-size: 0.92rem; color: var(--text); line-height: 1.25; }
.note__body { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ------------------------------------------- agentviz: AI mini-diagram */

.agentviz {
  margin-top: 1rem;
  max-width: 56ch;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 1.05rem;
  padding: 1rem 0.9rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.agentviz__agent {
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.24rem 0.72rem;
  border-radius: 1rem;
  box-shadow: 0 0.4rem 1.3rem -0.3rem var(--accent-strong);
}
.agentviz__beam {
  width: 2px; height: 0.9rem;
  background: linear-gradient(var(--accent), transparent);
}
.agentviz__mods { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.mod {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 0.5rem;
  padding: 0.3rem 0.55rem;
}
.mod--hot {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.agentviz__cap { font-size: 0.8rem; color: var(--text-faint); margin-top: 0.15rem; text-align: center; }
.agentviz__cap strong { color: var(--text-muted); }

/* ------------------------------------------------ punch: tag + bold line */

.punch {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  margin-top: 1rem;
  max-width: 56ch;
}
.punch__k {
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 0.24rem 0.5rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  margin-top: 0.12rem;
}
.punch p { font-size: 0.96rem; color: var(--text-muted); }
.punch strong { color: var(--text); font-weight: 600; }

/* ----------------------------------------------------------- toolkit */

.kit { display: flex; flex-direction: column; gap: 0.95rem; max-width: 56ch; }
.kit__row { display: flex; flex-direction: column; gap: 0.45rem; }
.kit__k {
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.kit__row--lead .kit__k { color: var(--accent); }

/* -------------------------------------------------------------- timeline */

.timeline { list-style: none; display: flex; flex-direction: column; max-width: 56ch; }
.timeline__item {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  gap: 0.9rem;
  padding: 0.6rem 0 0.6rem 0.9rem;
  position: relative;
  align-items: baseline;
}
.timeline__item::before {
  content: ""; position: absolute; left: 0; top: 0.95em;
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--accent); outline: 3px solid var(--surface);
}
.timeline__item::after {
  content: ""; position: absolute; left: 0.245rem; top: 1.4em; bottom: -0.6em;
  width: 1.5px; background: var(--line);
}
.timeline__item:last-child::after { display: none; }
.timeline__item--edu::before { background: var(--text-faint); }
.timeline__when { font-family: var(--font-label); font-size: 0.74rem; color: var(--text-faint); }
.timeline__what { font-size: 0.96rem; color: var(--text-muted); }

/* --------------------------------------------------------------- contact */

.contact { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; max-width: 56ch; }
.cta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  text-decoration: none;
  transition: border-color calc(0.3s * var(--ms)) var(--ease), background calc(0.3s * var(--ms)) var(--ease), transform calc(0.3s * var(--ms)) var(--ease);
}
.cta:hover { border-color: var(--accent-line); background: var(--surface-3); transform: translateY(-0.12rem); }
.cta:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.cta:active { transform: translateY(0); }
.cta__icon { flex: 0 0 auto; color: var(--accent); }
.cta__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cta__k { font-family: var(--font-label); font-size: 0.68rem; color: var(--text-faint); text-transform: lowercase; }
.cta__v { font-weight: 600; color: var(--text); }
.cta__go { color: var(--accent); font-weight: 700; font-size: 1.15rem; transition: transform calc(0.3s * var(--ms)) var(--ease); }
.cta:hover .cta__go { transform: translateX(0.28rem); }

/* -------------------------------------------------- profile panel (about) */

.block--panel {
  margin-top: 1.4rem;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 1.25rem;
  padding: 1rem 1.1rem;
  max-width: 56ch;
}
.profile {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.12rem 0 1rem;
  margin: 0.02rem 0 0.55rem;
  border-bottom: 1px solid var(--line-soft);
}
.profile__ava { position: relative; flex: 0 0 auto; width: 3.9rem; height: 3.9rem; }
.profile__avaframe {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 0.4rem 1.2rem -0.4rem oklch(0 0 0 / 0.6);
}
.profile__avaframe img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 26%;       /* show the face, no head-crop */
  transform: scaleX(-1);          /* mirror only: face turns toward the card */
}
.profile__ava .dot--live {
  position: absolute;
  right: 0.04rem;
  bottom: 0.04rem;
  width: 0.84rem;
  height: 0.84rem;
  outline: 2.5px solid var(--surface-2);
  z-index: 2;
}
.profile__id { display: flex; flex-direction: column; gap: 0.16rem; min-width: 0; }
.profile__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.14rem;
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.profile__role { font-size: 0.82rem; line-height: 1.25; color: var(--text-muted); }
.profile__link {
  align-self: flex-start;
  margin-top: 0.38rem;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  font-family: var(--font-label);
  font-size: 0.73rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--accent-line);
  border-radius: 1.5rem;
  transition: background calc(0.25s * var(--ms)) var(--ease), transform calc(0.25s * var(--ms)) var(--ease);
}
.profile__link:hover { background: var(--accent-soft); transform: translateY(-0.08rem); }
.profile__link:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }

.panel { display: flex; flex-direction: column; }
.panel__row {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.8rem;
  padding: 0.5rem 0;
  align-items: baseline;
}
.panel__row + .panel__row { border-top: 1px solid var(--line-soft); }
.panel__row dt {
  font-family: var(--font-label);
  font-size: 0.74rem;
  color: var(--text-faint);
  text-transform: lowercase;
}
.panel__row dd { color: var(--text-muted); font-size: 0.95rem; }
.panel__row dd strong { color: var(--text); font-weight: 600; }
.flags { font-size: 1.1rem; letter-spacing: 0.12em; }

/* very small phones */
@media (max-width: 360px) {
  .app__scroll { padding-inline: 1rem; }
  .lead { font-size: 1.04rem; }
}
