:root {
  color-scheme: light;
  --ink: #151617;
  --muted: #686d6f;
  --paper: #fbfbfa;
  --card: #ffffff;
  --band: #f0f2f3;
  --line: #d7dbdc;
  --green: #315f53;
  --green-dark: #244a41;
  --mint: #dceae5;
  --yellow: #f3ead0;
  --coral: #f2dfda;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "Century Gothic", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: #fff;
  background: var(--green);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.hidden,
.page-glow {
  display: none !important;
}

.site-header,
main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  min-height: 84px;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
}

.brand-mark svg {
  width: 27px;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.brand-mark circle {
  fill: var(--ink);
  stroke: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .65rem;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.header-actions,
.service-state,
.button-row,
.profile-chip,
.field-heading,
.form-actions,
.panel-heading,
.input-button-row,
.usage-details {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 22px;
}

.service-state {
  gap: 8px;
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c49a3a;
}

.service-state.online .state-dot {
  background: #438863;
}

.service-state.offline .state-dot {
  background: #b85f50;
}

.text-button {
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.text-button:hover {
  color: var(--green);
}

.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 112px 0 126px;
  text-align: center;
}

.eyebrow,
.mini-label {
  color: var(--ink);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
}

.eyebrow span {
  width: 30px;
  height: 1px;
  background: var(--ink);
}

.hero h1 {
  max-width: 830px;
  margin: 28px auto 26px;
  font-size: clamp(3rem, 7.1vw, 5.8rem);
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: .96;
}

.hero p {
  max-width: 610px;
  margin: 0 auto;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.75;
}

.hero::after {
  width: 46px;
  height: 2px;
  margin: 34px auto 0;
  display: block;
  background: var(--ink);
  content: "";
}

.loading-card,
.access-card {
  position: relative;
  z-index: 0;
  isolation: isolate;
  margin-bottom: 100px;
}

.loading-card::before,
.access-card::before {
  position: absolute;
  z-index: -1;
  inset: -54px calc(50% - 50vw);
  background: var(--band);
  clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
  content: "";
}

.loading-card {
  min-height: 210px;
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.loading-card strong,
.loading-card p {
  display: block;
  margin: 0;
}

.loading-card p {
  margin-top: 6px;
  color: var(--muted);
}

.loading-orbit {
  position: relative;
  width: 44px;
  height: 44px;
  border: 2px solid var(--line);
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

.loading-orbit span {
  position: absolute;
  top: -3px;
  left: 17px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.access-card {
  min-height: 390px;
  padding: clamp(38px, 7vw, 72px);
  display: grid;
  grid-template-columns: minmax(150px, 260px) minmax(280px, 480px);
  align-items: center;
  justify-content: center;
  gap: clamp(35px, 8vw, 100px);
}

.access-visual {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
}

.access-visual svg {
  width: 60%;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.access-copy h2,
.admin-panel h2 {
  margin: 13px 0 17px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1;
}

.access-copy p {
  margin: 0 0 24px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
}

.access-copy > small {
  display: block;
  margin-top: 15px;
  color: var(--muted);
  font-size: .73rem;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 1px;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.primary-button {
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
}

.primary-button:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
}

.secondary-button:hover {
  color: #fff;
  background: var(--ink);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: .5;
  transform: none;
  cursor: wait;
}

.github-button svg {
  width: 21px;
  fill: currentColor;
}

.pending-card,
.denied-card {
  min-height: 320px;
  grid-template-columns: 110px minmax(280px, 580px);
}

.pending-icon {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
}

.pending-icon svg {
  width: 58px;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3;
}

.button-row {
  flex-wrap: wrap;
  gap: 17px;
}

.workspace {
  position: relative;
  z-index: 0;
  padding: 112px 0 124px;
}

.workspace::before {
  position: absolute;
  z-index: -1;
  inset: 0 calc(50% - 50vw);
  background: var(--band);
  clip-path: polygon(0 3%, 100% 0, 100% 97%, 0 100%);
  content: "";
}

.workspace-heading {
  position: relative;
  min-height: 112px;
  margin-bottom: 52px;
  display: flex;
  align-items: start;
  justify-content: center;
  gap: 28px;
  text-align: center;
}

.workspace-heading h2 {
  margin: 13px 0 0;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 750;
  letter-spacing: .23em;
  line-height: 1.35;
  text-transform: uppercase;
}

.workspace-heading > div:first-child::after {
  width: 44px;
  height: 2px;
  margin: 25px auto 0;
  display: block;
  background: var(--ink);
  content: "";
}

.profile-chip {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 176px;
  padding: 7px 10px 7px 7px;
  gap: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
}

.profile-chip img,
.profile-placeholder {
  width: 34px;
  height: 34px;
}

.profile-chip img {
  object-fit: cover;
}

.profile-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
}

.profile-chip small,
.profile-chip strong {
  max-width: 145px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-chip small {
  color: var(--muted);
  font-size: .67rem;
}

.profile-chip strong {
  margin-top: 2px;
  font-size: .84rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(300px, .72fr);
  align-items: start;
  gap: 28px;
}

.predictor-column,
.account-column {
  display: grid;
  gap: 20px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--card);
}

.composer-panel,
.result-panel {
  padding: clamp(28px, 5vw, 44px);
}

.field-heading,
.form-actions,
.panel-heading,
.usage-details {
  justify-content: space-between;
  gap: 20px;
}

.field-heading label,
.key-form label {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.field-heading span {
  color: var(--muted);
  font-size: .72rem;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: #fff;
  transition: border .18s ease, box-shadow .18s ease;
}

textarea:focus,
input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(49, 95, 83, .11);
}

textarea {
  min-height: 190px;
  margin-top: 10px;
  padding: 20px;
  resize: vertical;
  font-size: 1.02rem;
  line-height: 1.65;
}

textarea::placeholder,
input::placeholder {
  color: #9a9fa1;
}

.example-row {
  margin: 17px 0 30px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.example-row > span {
  margin-right: 2px;
  color: var(--muted);
  font-size: .72rem;
}

.example-chip {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #cfd8d5;
  border-radius: 999px;
  color: var(--green-dark);
  background: transparent;
  font-size: .7rem;
  font-weight: 750;
  cursor: pointer;
}

.example-chip:hover {
  background: var(--mint);
}

.form-actions {
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.form-actions p {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.5;
}

.form-actions svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.result-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.result-heading h3,
.panel-heading h3,
.endpoint-panel h3 {
  margin: 6px 0 0;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -.02em;
}

.result-time {
  color: var(--muted);
  font-size: .7rem;
}

.emotion-list {
  margin-top: 28px;
  display: grid;
  gap: 17px;
}

.emotion-row {
  display: grid;
  grid-template-columns: minmax(85px, 125px) 1fr 52px;
  align-items: center;
  gap: 14px;
}

.emotion-name {
  overflow: hidden;
  font-size: .82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emotion-track,
.usage-track {
  height: 8px;
  overflow: hidden;
  background: #e6e9e9;
}

.emotion-fill {
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width .7s cubic-bezier(.22, .8, .28, 1);
}

.emotion-row:nth-child(2) .emotion-fill { background: #52796f; }
.emotion-row:nth-child(3) .emotion-fill { background: #76978e; }
.emotion-row:nth-child(4) .emotion-fill { background: #9cb2ac; }
.emotion-row:nth-child(5) .emotion-fill { background: #91a7a1; }

.emotion-score {
  text-align: right;
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.result-note {
  margin: 25px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.55;
}

.account-panel,
.usage-panel,
.endpoint-panel {
  padding: 27px;
}

.api-badge {
  padding: 6px 8px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.panel-intro,
.endpoint-panel p {
  margin: 13px 0 20px;
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.55;
}

.key-form label {
  display: block;
  margin-bottom: 7px;
}

.input-button-row {
  align-items: stretch;
  gap: 8px;
}

.input-button-row input {
  min-width: 0;
  padding: 0 13px;
  font-size: .8rem;
}

.input-button-row .secondary-button {
  min-height: 43px;
}

.secret-box {
  margin-top: 17px;
  padding: 15px;
  border: 1px solid #d9c998;
  background: #faf6e9;
}

.secret-box strong,
.secret-box span {
  display: block;
}

.secret-box strong {
  font-size: .78rem;
}

.secret-box span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .67rem;
}

.secret-box code {
  margin: 12px 0;
  padding: 10px;
  display: block;
  overflow-wrap: anywhere;
  color: var(--green-dark);
  background: rgba(255, 255, 255, .85);
  font-size: .7rem;
  line-height: 1.5;
}

.compact-row {
  gap: 13px;
}

.compact-row .secondary-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: .66rem;
}

.compact-row .text-button {
  font-size: .66rem;
}

.key-list {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.key-row,
.request-row {
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}

.key-row:last-child,
.request-row:last-child {
  border-bottom: 0;
}

.key-row strong,
.key-row small,
.request-identity strong,
.request-identity small {
  display: block;
}

.key-row strong,
.request-identity strong {
  font-size: .78rem;
}

.key-row small,
.request-identity small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .65rem;
}

.revoke-button,
.request-action {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: .65rem;
  font-weight: 800;
  cursor: pointer;
}

.usage-panel .panel-heading > strong {
  color: var(--green);
  font-size: 1.2rem;
}

.usage-track {
  margin: 21px 0 12px;
}

.usage-track span {
  width: 0;
  height: 100%;
  display: block;
  background: var(--green);
  transition: width .5s ease;
}

.usage-details {
  color: var(--muted);
  font-size: .66rem;
}

.usage-details strong {
  color: var(--ink);
}

.usage-input {
  margin: .85rem 0 0;
  color: var(--muted);
  font-size: .78rem;
}

.endpoint-panel code {
  padding: 11px;
  display: block;
  overflow-x: auto;
  color: var(--ink);
  background: var(--band);
  font-size: .68rem;
  white-space: nowrap;
}

.endpoint-panel p {
  margin-bottom: 0;
}

.admin-section {
  margin-top: 0;
  padding: 110px 0;
}

.section-divider {
  margin-bottom: 50px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  color: var(--ink);
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.section-divider span {
  height: 1px;
  background: var(--ink);
}

.admin-panel {
  padding: clamp(28px, 5vw, 44px);
}

.admin-panel h2 {
  margin-bottom: 0;
  font-size: 2.4rem;
}

.request-list {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.admin-subheading {
  margin-top: 34px;
}

.admin-subheading h3 {
  margin: 5px 0 0;
  font-size: 1.2rem;
}

.request-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.request-identity img,
.request-avatar {
  width: 38px;
  height: 38px;
}

.request-identity img {
  object-fit: cover;
}

.request-avatar {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  font-size: .8rem;
  font-weight: 800;
}

.request-actions {
  display: flex;
  gap: 7px;
}

.request-action.approve {
  border-color: #adc6bd;
  color: var(--green-dark);
  background: var(--mint);
}

.request-action.deny {
  border-color: #dfbbb2;
  color: #8d493f;
  background: var(--coral);
}

.empty-row {
  padding: 20px 0;
  color: var(--muted);
  font-size: .76rem;
  text-align: center;
}

footer {
  width: 100%;
  margin: 0;
  padding: 72px max(24px, calc((100vw - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  color: var(--muted);
  background: var(--band);
  font-size: .68rem;
  letter-spacing: .11em;
  text-align: center;
  text-transform: uppercase;
}

footer::before {
  width: 44px;
  height: 2px;
  margin-bottom: 15px;
  background: var(--ink);
  content: "";
}

.toast-region {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 9px;
}

.toast {
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 16px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .16);
  font-size: .78rem;
  line-height: 1.45;
  animation: toast-in .25s ease both;
}

.toast.error {
  background: #79392f;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 880px) {
  .workspace-heading {
    justify-content: flex-start;
    text-align: left;
  }

  .workspace-heading > div:first-child::after {
    margin-left: 0;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .account-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-panel {
    grid-row: span 2;
  }
}

@media (max-width: 700px) {
  .site-header,
  main {
    width: min(100% - 28px, 1120px);
  }

  .site-header {
    min-height: 72px;
    padding: 14px 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    font-size: .69rem;
  }

  .brand small {
    font-size: .65rem;
  }

  .header-actions {
    gap: 12px;
  }

  .service-state {
    display: none;
  }

  .hero {
    padding: 78px 0 86px;
  }

  .hero h1 {
    font-size: clamp(2.65rem, 14vw, 4.5rem);
  }

  .hero p {
    font-size: .95rem;
  }

  .loading-card,
  .access-card {
    margin-bottom: 76px;
  }

  .access-card {
    padding: 38px 20px;
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .access-visual {
    width: 150px;
    margin: auto;
  }

  .pending-card,
  .denied-card {
    text-align: center;
  }

  .pending-icon {
    margin: auto;
  }

  .pending-card .button-row {
    justify-content: center;
  }

  .workspace {
    padding: 82px 0 90px;
  }

  .workspace::before {
    clip-path: polygon(0 1.2%, 100% 0, 100% 98.8%, 0 100%);
  }

  .workspace-heading {
    min-height: auto;
    margin-bottom: 46px;
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-heading h2 {
    font-size: 1.25rem;
    letter-spacing: .16em;
  }

  .profile-chip {
    position: static;
    margin-top: 20px;
  }

  .account-column {
    grid-template-columns: 1fr;
  }

  .account-panel {
    grid-row: auto;
  }

  .composer-panel,
  .result-panel,
  .account-panel,
  .usage-panel,
  .endpoint-panel,
  .admin-panel {
    padding: 23px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions p {
    max-width: none;
  }

  .form-actions .primary-button {
    width: 100%;
  }

  .example-chip,
  .text-button {
    min-height: 44px;
  }

  .emotion-row {
    grid-template-columns: 84px minmax(0, 1fr) 43px;
    gap: 8px;
  }

  .request-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-section {
    padding: 78px 0;
  }

  footer {
    padding: 58px 20px;
  }
}

@media (max-width: 420px) {
  .site-header {
    align-items: flex-start;
  }

  .brand small {
    display: none;
  }

  .header-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0 14px;
  }

  .header-actions .text-button {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
