/* Typebar Cascade — typewriter typebar nav (Appily-OneHundred exclusive)
   Not hop / flues / quoins / prism / capstan / boom tags / tambour / clips /
   wirecell / spindle bridge / twine kites / bottom dock / glass island / left rail */

:root {
  /* Matches .ty-inner min-height + platen border for sticky page chrome */
  --a100-nav-h: 112px;
}
@media (max-width: 900px) {
  :root { --a100-nav-h: 96px; }
}

.ty-platen {
  position: sticky;
  top: 0;
  z-index: 80;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(232, 51, 12, 0.12), transparent 40%),
    radial-gradient(ellipse at 88% 0%, rgba(0, 143, 130, 0.12), transparent 42%),
    linear-gradient(180deg, #1C2434 0%, var(--a100-ink) 70%);
  color: var(--a100-on-ink);
  border-bottom: 4px solid var(--a100-bloom);
  box-shadow: 0 12px 28px rgba(15, 20, 31, 0.35);
  overflow: hidden;
}
.ty-platen-shelf {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  background: linear-gradient(180deg, #4A5568 0%, #2A3348 55%, #182030 100%);
  border-top: 2px solid rgba(255, 201, 51, 0.35);
  pointer-events: none;
}
.ty-platen-roll {
  position: absolute;
  left: 8%;
  right: 8%;
  top: -10px;
  height: 14px;
  border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(
    90deg,
    #F7F2EA 0 18px,
    #E8DFD0 18px 20px
  );
  border: 2px solid var(--a100-ink);
  border-bottom: 0;
  opacity: 0.9;
}
.ty-platen-groove {
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 2px;
  background: rgba(0, 0, 0, 0.35);
}

.ty-inner {
  position: relative;
  z-index: 1;
  width: min(100% - 24px, var(--a100-max));
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 12px;
  min-height: 108px;
  padding: 14px 0 22px;
}

/* Carriage-return brand lever */
.ty-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
  color: var(--a100-ink);
  padding: 8px 12px 8px 8px;
  background: var(--a100-field);
  border: 2px solid var(--a100-bloom);
  border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25);
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.ty-brand:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.28);
  color: var(--a100-ink);
}
.ty-brand-lever {
  position: relative;
  width: 36px;
  height: 44px;
  flex-shrink: 0;
}
.ty-lever-knob {
  position: absolute;
  left: 50%;
  top: 0;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  border: 2px solid var(--a100-ink);
  background: var(--a100-accent);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}
.ty-lever-arm {
  position: absolute;
  left: 50%;
  top: 14px;
  width: 6px;
  height: 28px;
  margin-left: -3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #C8CDD6, #6A7488);
  border: 2px solid var(--a100-ink);
}
.ty-brand-copy small {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--a100-secondary-deep);
}
.ty-brand-copy strong {
  display: block;
  font-family: var(--a100-font-display);
  font-size: 1.15rem;
  line-height: 1.05;
  color: var(--a100-accent-deep);
}

.ty-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  min-height: 92px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 4px 0;
  perspective: 600px;
}
.ty-bars::-webkit-scrollbar { display: none; }

.ty-bar {
  --ty-tone: var(--a100-bloom);
  position: relative;
  flex: 0 0 auto;
  width: 72px;
  height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-decoration: none !important;
  color: var(--a100-ink);
  transform-origin: 50% 8px;
  transform: rotate(var(--ty-rest, 0deg));
  transition: transform 320ms cubic-bezier(.2, .9, .2, 1);
  animation: ty-rest-in 520ms cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--ty-i, 0) * 45ms);
}
.ty-bar--coral { --ty-tone: var(--a100-accent); }
.ty-bar--teal { --ty-tone: var(--a100-secondary); }
.ty-bar--bloom { --ty-tone: var(--a100-bloom); }

.ty-bar-pivot {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  border: 2px solid var(--a100-bloom);
  background: #2A3348;
  z-index: 3;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}
.ty-bar-arm {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 5px;
  height: 42px;
  margin-left: -2.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, #D5DAE2, #7A8494);
  border: 1px solid rgba(255, 246, 238, 0.2);
  z-index: 1;
  transform-origin: 50% 0;
  transition: height 320ms ease, background 220ms ease;
}
.ty-bar-slug {
  position: relative;
  z-index: 2;
  width: 68px;
  min-height: 44px;
  padding: 6px 6px 8px;
  border: 2px solid var(--a100-ink);
  border-radius: 6px;
  background: var(--a100-surface);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.28);
  text-align: center;
  transition: background 220ms ease, color 220ms ease, box-shadow 220ms ease, transform 320ms ease;
}
.ty-bar-glyph {
  display: block;
  font-family: var(--a100-font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ty-tone);
  line-height: 1;
  margin-bottom: 2px;
}
.ty-bar-label {
  display: block;
  font-family: var(--a100-font-display);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--a100-ink);
}
.ty-bar-count {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  border: 2px solid var(--a100-ink);
  background: var(--a100-accent);
  color: #fff;
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.ty-bar:hover,
.ty-bar:focus-visible {
  transform: rotate(0deg) translateY(-14px);
  outline: none;
  z-index: 5;
}
.ty-bar:hover .ty-bar-arm,
.ty-bar:focus-visible .ty-bar-arm,
.ty-bar.is-active .ty-bar-arm {
  height: 50px;
  background: linear-gradient(180deg, #F0F2F6, var(--ty-tone));
}
.ty-bar:hover .ty-bar-slug,
.ty-bar:focus-visible .ty-bar-slug {
  box-shadow: 5px 5px 0 var(--a100-bloom);
  transform: translateY(-2px);
}
.ty-bar.is-active {
  transform: rotate(0deg) translateY(-18px);
  z-index: 6;
}
.ty-bar.is-active .ty-bar-slug {
  background: var(--ty-tone);
  box-shadow: 5px 5px 0 var(--a100-bloom);
}
.ty-bar.is-active .ty-bar-label,
.ty-bar.is-active .ty-bar-glyph {
  color: #fff;
}
.ty-bar.is-active.ty-bar--bloom .ty-bar-label,
.ty-bar.is-active.ty-bar--bloom .ty-bar-glyph {
  color: var(--a100-bloom-ink);
}

.ty-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 8px;
}
.ty-spool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border: 2px solid var(--a100-bloom);
  border-radius: 999px;
  background: transparent;
  color: var(--a100-bloom);
  font-family: var(--a100-font-display);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}
.ty-spool-core {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: radial-gradient(circle at 40% 40%, #fff6, transparent 50%), var(--a100-accent);
  box-shadow: inset 0 0 0 3px var(--a100-ink);
}
.ty-spool:hover,
.ty-spool[aria-expanded="true"] {
  background: var(--a100-bloom);
  color: var(--a100-bloom-ink);
  transform: translateY(-2px);
}
.ty-strike {
  display: none;
  min-height: 42px;
  padding: 8px 14px;
  border: 2px solid var(--a100-bloom);
  border-radius: 8px;
  background: var(--a100-accent);
  color: #fff;
  font-family: var(--a100-font-display);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ty-search,
.ty-more {
  width: min(100% - 24px, var(--a100-max));
  margin: 0 auto;
  padding: 0 0 14px;
  display: none;
  position: relative;
  z-index: 2;
}
.ty-search.is-open,
.ty-more.is-open { display: block; }
.ty-search-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--a100-field);
  border: 2px solid var(--a100-bloom);
  border-radius: 10px;
}
.ty-search input {
  flex: 1;
  min-height: 44px;
  padding: 10px 14px;
  border: 2px solid var(--a100-ink);
  border-radius: 8px;
  background: #fff;
  color: var(--a100-ink);
}
.ty-search button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--a100-accent);
  color: #fff;
  font-family: var(--a100-font-display);
  font-weight: 700;
  cursor: pointer;
}
.ty-more {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
}
.ty-more.is-open { display: flex; }
.ty-more a {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 246, 238, 0.1);
  color: var(--a100-on-ink);
  text-decoration: none !important;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid rgba(255, 201, 51, 0.4);
}
.ty-more a:hover,
.ty-more a[aria-current="page"] {
  background: var(--a100-secondary-deep);
  color: #fff;
  border-color: var(--a100-secondary-deep);
}

/* Mobile strike sheet */
.ty-strike-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 20, 31, 0.58);
}
.ty-strike-sheet.is-open { display: block; }
.ty-strike-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: var(--a100-field);
  color: var(--a100-ink);
  border: 3px solid var(--a100-ink);
  border-radius: 16px;
  box-shadow: var(--a100-shadow-hard);
  padding: 18px;
  animation: ty-strike-in 360ms cubic-bezier(.2, .8, .2, 1);
}
.ty-strike-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.ty-strike-head strong {
  font-family: var(--a100-font-display);
  font-size: 1.15rem;
  color: var(--a100-accent-deep);
}
.ty-strike-close {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid var(--a100-ink);
  background: var(--a100-bloom);
  font-size: 1.2rem;
  cursor: pointer;
}
.ty-strike-keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ty-key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px;
  border-radius: 10px;
  background: var(--a100-surface);
  border: 2px solid var(--a100-ink);
  border-bottom-width: 5px;
  text-decoration: none !important;
  font-family: var(--a100-font-display);
  font-weight: 700;
  color: var(--a100-ink);
  animation: ty-rest-in 400ms ease both;
  animation-delay: calc(var(--ty-i, 0) * 30ms);
}
.ty-key--coral { border-left: 5px solid var(--a100-accent); }
.ty-key--teal { border-left: 5px solid var(--a100-secondary); }
.ty-key--bloom { border-left: 5px solid var(--a100-bloom); }
.ty-key.is-active {
  background: var(--a100-ink);
  color: var(--a100-on-ink);
}
.ty-key em {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--a100-accent);
  color: #fff;
  font-style: normal;
  font-size: 0.75rem;
  display: grid;
  place-items: center;
}

@keyframes ty-rest-in {
  from { opacity: 0; transform: rotate(var(--ty-rest, 0deg)) translateY(16px); }
  to { opacity: 1; transform: rotate(var(--ty-rest, 0deg)) translateY(0); }
}
@keyframes ty-strike-in {
  from { transform: translateY(-18px) scale(0.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 900px) {
  .ty-inner { grid-template-columns: 1fr auto; }
  .ty-bars,
  .ty-tools .ty-spool--more { display: none; }
  .ty-strike { display: inline-flex; align-items: center; }
  .ty-inner { min-height: 72px; padding-block: 12px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .ty-bar,
  .ty-key,
  .ty-strike-panel { animation: none; }
  .ty-bar,
  .ty-bar-arm,
  .ty-bar-slug { transition: none; }
}
