/* inkworld.inkykat.dev. Tokens live in chat.css (:root). */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--ink);
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--chalk);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
#content {
  flex: 1;
}
a {
  color: var(--blue);
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}
img {
  max-width: 100%;
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 50;
  padding: 8px 14px;
  background: var(--chalk);
  color: var(--ink);
}
.muted {
  color: var(--fog);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: rgb(16 14 28 / 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--chalk);
  text-decoration: none;
  font: 700 1.5rem/1 var(--hand);
}
.wordmark img {
  border-radius: 50%;
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-right: auto;
}
.nav-links a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--fog);
  text-decoration: none;
  font-weight: 700;
}
.nav-links a:hover {
  color: var(--chalk);
}
.nav-links a[aria-current='page'] {
  color: var(--ink);
  background: var(--chalk);
}
.account {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.account img {
  border-radius: 50%;
}
.account form {
  margin: 0;
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--fog);
  font: inherit;
  font-weight: 400;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 10px;
  font: 700 1rem/1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
}
.btn-main {
  background: var(--pink);
  color: var(--ink);
}
.btn-main:hover {
  background: #f5d6e0;
}
.btn-quiet {
  background: transparent;
  color: var(--chalk);
  border-color: var(--line);
}
.btn-quiet:hover {
  border-color: var(--fog);
}
.btn-danger {
  background: var(--red);
  color: var(--ink);
}

/* ---------- landing: the banner is the one loud thing ---------- */
.hero {
  position: relative;
  height: clamp(300px, 42vw, 500px);
  overflow: hidden;
  isolation: isolate;
  background: #000;
}
.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* TV static: a small noise canvas scaled up, plus scanlines */
.hero-static {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  mix-blend-mode: screen;
  opacity: 0.2;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(to bottom, rgb(0 0 0 / 0.22) 0 1px, transparent 1px 3px),
    linear-gradient(to bottom, rgb(16 14 28 / 0.25), rgb(16 14 28 / 0.55) 55%, var(--ink));
}
.hero-id {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(20px, 4vw, 44px);
  display: flex;
  align-items: flex-end;
  gap: clamp(14px, 2.5vw, 26px);
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}
.hero-icon {
  flex: none;
  width: clamp(76px, 11vw, 120px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid var(--chalk);
  background: var(--board);
  transform: rotate(-4deg);
}
.hero-name {
  margin: 0;
  font: 700 clamp(2.6rem, 7vw, 5rem)/0.95 var(--hand);
  letter-spacing: -0.01em;
  text-shadow: 0 2px 18px rgb(0 0 0 / 0.6);
  overflow-wrap: anywhere;
}
.hero-count {
  margin: 6px 0 0;
  color: var(--fog);
  font-weight: 700;
}

.landing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: clamp(32px, 6vw, 80px);
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px) clamp(16px, 4vw, 40px) 72px;
  align-items: start;
}
.about-desc {
  margin: 0 0 28px;
  max-width: 34ch;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.45;
}
.about-actions .btn {
  min-height: 52px;
  padding: 12px 30px;
  font-size: 1.1rem;
}
.about-more {
  display: grid;
  gap: 2px;
  margin-top: 40px;
  max-width: 460px;
  border-top: 1px solid var(--line);
}
.side-link {
  display: grid;
  gap: 2px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--chalk);
  text-decoration: none;
}
.side-link strong {
  font-size: 1.1rem;
}
.side-link span {
  color: var(--fog);
}
.side-link:hover strong {
  color: var(--pink);
}

/* chalkboard rules */
.rules {
  position: sticky;
  top: 76px;
  padding: 24px 26px 18px;
  background: var(--board);
  border-radius: 18px 18px 18px 4px;
  border: 1px solid var(--line);
}
.rules h2 {
  margin: 0 0 10px;
  font: 700 2.1rem/1 var(--hand);
}
.rules ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}
.rules li {
  counter-increment: rule;
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
  line-height: 1.45;
}
.rules li:last-child {
  border-bottom: 0;
}
.rules li::before {
  content: counter(rule);
  font: 700 1.45rem/1 var(--hand);
  color: var(--blue);
}
.rules li:nth-child(7n + 2)::before { color: var(--green); }
.rules li:nth-child(7n + 3)::before { color: var(--orange); }
.rules li:nth-child(7n + 4)::before { color: var(--pink); }
.rules li:nth-child(7n + 5)::before { color: var(--purple); }
.rules li:nth-child(7n + 6)::before { color: var(--red); }
.rules li:nth-child(7n + 7)::before { color: var(--yellow); }
.rules .rule-key {
  font-weight: 700;
}

/* ---------- inner pages ---------- */
.narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px clamp(16px, 4vw, 40px) 72px;
}
.wide-ish {
  max-width: 920px;
}
.page-title {
  margin: 0 0 8px;
  font: 700 clamp(2.2rem, 5vw, 3rem)/1.05 var(--hand);
}
.section-title {
  margin: 40px 0 12px;
  font: 700 1.8rem/1.1 var(--hand);
}
.lede {
  margin: 0 0 24px;
  max-width: 60ch;
  color: var(--fog);
  font-size: 1.08rem;
}
.notice {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgb(184 241 208 / 0.12);
  border: 1px solid rgb(184 241 208 / 0.4);
}
.signin-note {
  margin: 0 0 24px;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.choice-main {
  background: var(--board);
}
.choice h2 {
  margin: 0;
  font: 700 1.9rem/1.1 var(--hand);
}
.choice p {
  margin: 0 0 16px;
  color: var(--fog);
  flex: 1;
}
.choice form {
  margin: 0;
}

/* application form */
.app-form {
  display: grid;
  gap: 26px;
}
.field {
  display: grid;
  gap: 8px;
}
.q {
  display: grid;
  grid-template-columns: 2rem 1fr;
  font-weight: 700;
}
.q-n {
  font: 700 1.35rem/1.1 var(--hand);
  color: var(--pink);
}
.optional {
  font-weight: 400;
  color: var(--fog);
}
textarea,
input:not([type='radio']) {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--board);
  color: var(--chalk);
  font: inherit;
  resize: vertical;
}
.field textarea {
  margin-left: 2rem;
  width: calc(100% - 2rem);
}
textarea:focus,
input:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgb(179 212 233 / 0.3);
}
.radio-row {
  display: flex;
  gap: 10px;
  margin-left: 2rem;
}
.radio {
  position: relative;
}
.radio input {
  position: absolute;
  opacity: 0;
}
.radio span {
  display: inline-block;
  min-width: 84px;
  padding: 8px 18px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--board);
  cursor: pointer;
  font-weight: 700;
}
.radio input:checked + span {
  background: var(--chalk);
  color: var(--ink);
  border-color: var(--chalk);
}
.radio input:focus-visible + span {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.has-error textarea,
.has-error .radio span {
  border-color: var(--red);
}
.field-error {
  margin: 0 0 0 2rem;
  color: var(--red);
  font-weight: 700;
}
.form-end {
  padding-top: 6px;
}

/* status */
.status-card {
  padding: 22px 24px;
  background: var(--board);
  border-radius: 16px;
  border: 1px solid var(--line);
}
.status-card p {
  margin: 0 0 6px;
}
.status {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--ink);
}
.st-pending { background: var(--orange); }
.st-accepted { background: var(--green); }
.st-denied { background: var(--red); }
.reason {
  margin: 8px 0 12px;
  padding: 8px 14px;
  border-left: 4px solid var(--line);
}
.app-id {
  margin-top: 14px !important;
  color: var(--fog);
}
.app-id code {
  color: var(--chalk);
  font-size: 0.92rem;
}
.answers {
  margin: 0;
}
.qa {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.qa dt {
  display: grid;
  grid-template-columns: 2rem 1fr;
  font-weight: 700;
}
.qa dd {
  margin: 4px 0 0 2rem;
  white-space: pre-wrap;
}

/* tickets */
.new-ticket {
  display: grid;
  gap: 10px;
  padding: 22px 24px;
  background: var(--board);
  border-radius: 16px;
  border: 1px solid var(--line);
  justify-items: start;
}
.new-ticket label {
  font-weight: 700;
}
.ticket-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.ticket-list a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--chalk);
  text-decoration: none;
}
.ticket-list a:hover strong {
  color: var(--pink);
}
.ticket-list span {
  color: var(--fog);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ticket-list time {
  color: var(--fog);
  font-size: 0.88rem;
}

.chat-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px clamp(0px, 3vw, 28px) 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 0 clamp(16px, 3vw, 28px) 16px;
  border-bottom: 1px solid var(--line);
}
.chat-head p {
  margin: 0;
}
.chat-page .chat {
  flex: 1;
}
.close-box {
  position: relative;
}
.close-box summary {
  list-style: none;
}
.close-box summary::-webkit-details-marker {
  display: none;
}
.close-box form {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 5;
  display: grid;
  gap: 8px;
  width: 300px;
  padding: 16px;
  background: var(--board);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.composer {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px clamp(16px, 3vw, 28px) 18px;
  background: var(--ink);
  border-top: 1px solid var(--line);
}
.composer textarea {
  resize: none;
}
.composer-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--red);
  font-weight: 700;
}
.composer-error:empty {
  display: none;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(16px, 4vw, 40px);
  border-top: 1px solid var(--line);
  color: var(--fog);
  font-size: 0.9rem;
}

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .landing {
    grid-template-columns: 1fr;
  }
  .rules {
    position: static;
  }
  .choices {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  .account span {
    display: none;
  }
  .ticket-list a {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
@media (max-width: 520px) {
  .wordmark span {
    display: none;
  }
  .msg {
    padding-left: 14px;
    padding-right: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
