/* TTC LAB — Terminal homepage, adapted from ttc-lab-terminal-v2.html */

body.template-index {
  background: #e7eae8;
}

body.template-index .section-header,
body.template-index .shopify-section-group-header-group,
body.template-index .shopify-section-group-footer-group {
  display: none !important;
}

body.template-index #MainContent {
  min-height: 100svh;
  margin: 0;
  padding: 0;
}

.ttc-terminal,
.ttc-terminal * {
  box-sizing: border-box;
}

.ttc-terminal {
  --lab-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --lab-primary: 0.9;
  --lab-secondary: 0.55;
  --lab-tertiary: 0.45;
  --lab-ghost: 0.28;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--lab-ink);
  background: var(--lab-bg);
  font-family: var(--lab-mono) !important;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 300ms ease, color 300ms ease;
}

.ttc-terminal[data-mode="paper"] {
  --lab-bg: #f1f1f1;
  --lab-ink: #0a0a0a;
  --lab-red: #4b0f12;
  --lab-blue: #1e5cff;
  --lab-dash: rgba(0, 0, 0, 0.35);
}

.ttc-terminal[data-mode="unit"] {
  --lab-bg: #e7eae8;
  --lab-ink: #101312;
  --lab-red: #4b0f12;
  --lab-blue: #1e5cff;
  --lab-dash: rgba(10, 20, 15, 0.35);
}

.ttc-terminal[data-mode="night"] {
  --lab-bg: #0c0c0c;
  --lab-ink: #e8e8e6;
  --lab-red: #d0525a;
  --lab-blue: #7d97ff;
  --lab-dash: rgba(255, 255, 255, 0.28);
  --lab-primary: 0.96;
  --lab-secondary: 0.72;
  --lab-tertiary: 0.62;
  --lab-ghost: 0.48;
}

.ttc-terminal a {
  color: inherit;
}

.ttc-terminal button,
.ttc-terminal input {
  font: inherit;
}

.ttc-terminal :focus-visible {
  outline: 1px dashed var(--lab-dash);
  outline-offset: 4px;
}

.ttc-terminal__header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  border: 0;
}

.ttc-terminal__header-left,
.ttc-terminal__header-right {
  display: flex;
  align-items: center;
}

.ttc-terminal__header-left {
  min-width: 0;
  gap: 20px;
}

.ttc-terminal__header-right {
  flex: 0 0 auto;
  gap: 24px;
}

.ttc-terminal__local {
  min-width: 0;
  overflow: hidden;
  opacity: var(--lab-tertiary);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ttc-terminal__header a {
  color: inherit;
  opacity: var(--lab-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.ttc-terminal__header a:hover {
  opacity: var(--lab-primary);
}

.ttc-terminal__modes {
  display: flex;
  gap: 14px;
}

.ttc-terminal__modes button {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font-size: 11px;
  line-height: inherit;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
  cursor: pointer;
}

.ttc-terminal__modes button.is-on {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ttc-terminal__main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.ttc-terminal__inner {
  width: 100%;
  max-width: 760px;
}

.ttc-sector {
  border-bottom: 1px dashed var(--lab-dash);
}

.ttc-sector:first-child {
  border-top: 1px dashed var(--lab-dash);
}

.ttc-sector__title {
  margin: 0;
  font: inherit;
  color: var(--lab-ink);
}

.ttc-sector__head {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 16px 0;
  border: 0;
  color: inherit;
  background: none;
  font-size: 11px;
  font-weight: 400;
  line-height: inherit;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.ttc-sector__name {
  opacity: var(--lab-secondary);
}

.ttc-sector__head:hover .ttc-sector__name,
.ttc-sector.is-open .ttc-sector__name {
  opacity: var(--lab-primary);
}

.ttc-sector__count {
  flex: 0 0 auto;
  opacity: var(--lab-tertiary);
}

.ttc-sector__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 350ms ease;
}

.ttc-sector.is-open .ttc-sector__panel {
  grid-template-rows: 1fr;
}

.ttc-sector__panel-inner {
  min-height: 0;
  overflow: hidden;
}

.ttc-sector__list {
  padding: 0 0 18px;
}

.ttc-row {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 9px 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.ttc-row__line {
  flex: 0 0 28px;
  opacity: var(--lab-ghost);
}

.ttc-row__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  opacity: var(--lab-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ttc-row:hover .ttc-row__name {
  opacity: var(--lab-primary);
}

.ttc-row__meta {
  flex: 0 0 auto;
  max-width: 48%;
  opacity: var(--lab-tertiary);
  text-align: right;
}

.ttc-row__was {
  margin-right: 10px;
  text-decoration: line-through;
  opacity: 0.6;
}

.ttc-row.is-locked {
  cursor: default;
}

.ttc-row.is-locked .ttc-row__name {
  opacity: var(--lab-ghost);
}

.ttc-row.is-locked:hover .ttc-row__name {
  opacity: var(--lab-ghost);
}

.ttc-row__meta.is-active,
.ttc-sector__count.is-active {
  color: var(--lab-red);
  animation: ttcTerminalPulse 3s ease-in-out infinite;
}

.ttc-gate__form {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 18px;
  padding: 4px 0 4px 46px;
}

.ttc-gate__form input {
  width: min(240px, 100%);
  margin: 0;
  padding: 6px 4px;
  border: 0;
  border-bottom: 1px dashed var(--lab-dash);
  border-radius: 0;
  outline: none;
  color: var(--lab-ink);
  background: transparent;
  font-size: 11px;
  line-height: inherit;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: none;
}

.ttc-gate__form input::placeholder {
  color: currentColor;
  opacity: var(--lab-tertiary);
}

.ttc-gate__form input:focus-visible {
  border-bottom-color: var(--lab-ink);
  outline: none;
}

.ttc-action {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--lab-blue);
  background: none;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-transform: uppercase;
  cursor: pointer;
}

.ttc-action:hover {
  opacity: 0.7;
}

.ttc-gate__error {
  color: var(--lab-red);
  opacity: 0;
  transition: opacity 200ms ease;
}

.ttc-gate.has-error .ttc-gate__error {
  opacity: var(--lab-secondary);
}

.ttc-gate__unlocked {
  display: none;
}

.ttc-gate.is-unlocked .ttc-gate__unlocked {
  display: block;
}

.ttc-gate.is-unlocked .ttc-gate__form {
  display: none;
}

.ttc-terminal__signature {
  padding: 0 24px 14px;
}

.ttc-terminal__signature h1,
.ttc-terminal__signature p {
  margin: 0;
  font: inherit;
}

.ttc-terminal__signature h1 {
  opacity: var(--lab-primary);
}

.ttc-terminal__signature p {
  opacity: var(--lab-secondary);
}

.ttc-terminal__signature .ttc-terminal__year {
  opacity: var(--lab-tertiary);
}

.ttc-terminal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 24px;
  color: var(--lab-ink);
  background: var(--lab-bg) !important;
}

.ttc-terminal__footer a,
.ttc-terminal__footer span {
  color: inherit;
  opacity: var(--lab-ghost);
  text-decoration: none;
}

.ttc-terminal__footer a:hover {
  opacity: var(--lab-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes ttcTerminalPulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.85;
  }
}

@media (max-width: 749px) {
  .ttc-terminal {
    letter-spacing: 0.11em;
  }

  .ttc-terminal__header {
    min-height: 64px;
    gap: 14px;
    padding: 10px 16px;
  }

  .ttc-terminal__header-left {
    flex: 1 1 auto;
    gap: 12px;
  }

  .ttc-terminal__header-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  .ttc-terminal__local {
    font-size: 9px;
    letter-spacing: 0.09em;
  }

  .ttc-terminal__modes {
    gap: 8px;
  }

  .ttc-terminal__modes button {
    font-size: 9px;
    letter-spacing: 0.09em;
  }

  .ttc-terminal__main {
    align-items: flex-start;
    padding: 40px 16px;
  }

  .ttc-sector__head {
    padding: 15px 0;
  }

  .ttc-row {
    gap: 10px;
    padding: 9px 0;
  }

  .ttc-row__line {
    flex-basis: 24px;
  }

  .ttc-row__meta {
    max-width: 42%;
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .ttc-row__was {
    display: none;
  }

  .ttc-gate__form {
    gap: 14px;
    padding-left: 34px;
  }

  .ttc-gate__form input {
    width: min(200px, calc(100% - 62px));
  }

  .ttc-gate__error {
    flex-basis: 100%;
    padding-left: 0;
  }

  .ttc-terminal__signature {
    padding: 0 16px 12px;
  }

  .ttc-terminal__footer {
    gap: 10px 18px;
    padding: 20px 16px;
  }
}

@media (max-width: 390px) {
  .ttc-terminal__header {
    gap: 10px;
  }

  .ttc-terminal__modes {
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ttc-terminal,
  .ttc-sector__panel,
  .ttc-gate__error {
    transition: none;
  }

  .ttc-row__meta.is-active,
  .ttc-sector__count.is-active {
    animation: none;
    opacity: var(--lab-secondary);
  }
}

html,body{margin:0;min-height:100%;}button,input{font:inherit;}

body.template-index{background:#f1f1f1}.ttc-terminal[data-mode="unit"]{--lab-bg:#f1f1f1}.ttc-terminal__modes button{min-width:48px;text-align:right}
