

@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
  animation-timing-function: ease;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

.palette-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.palette-btn:hover,
.palette-btn:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
}
.palette-btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.palette-btn kbd {
  font-family: inherit;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}
@media (max-width: 1100px) {
  .palette-btn kbd {
    display: none;
  }
  .palette-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
}
@media (hover: none) {
  .palette-btn kbd {
    display: none;
  }
}

.palette[hidden] {
  display: none;
}
.palette {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: min(14vh, 120px) 16px 16px;
}
.palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 7, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.palette-box {
  position: relative;
  width: min(620px, 100%);
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: paletteIn 0.18s var(--ease);
}
@keyframes paletteIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}
.palette-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.palette-field svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.palette-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.palette-input::placeholder {
  color: var(--text-faint);
}
.palette kbd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text-faint);
}
.palette-list {
  overflow-y: auto;
  padding: 6px;
  overscroll-behavior: contain;
}
.palette-group {
  padding: 10px 12px 4px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.palette-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
}
.palette-item.is-sel {
  background: var(--gold-dim);
  box-shadow: inset 0 0 0 1px var(--gold-line);
}
.pi-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pi-hint {
  flex: none;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  color: var(--text-faint);
}
.palette-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.palette-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-faint);
}
.pf-keys {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 560px) {
  .palette-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .pi-title {
    white-space: normal;
  }
  .pi-hint {
    max-width: 100%;
  }
  .pf-tip {
    display: none;
  }
  .palette {
    padding-top: 72px;
  }
}
html.palette-open {
  overflow: hidden;
}

.msr-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1001;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 18px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: var(--bg-elevated-2);
  color: var(--text);
  font-size: 0.82rem;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.msr-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hero-terminal .term-body {
  max-height: 440px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-line) transparent;
}
.term-live {
  margin-top: 14px;
  opacity: 0;
  animation: termLineIn 0.5s var(--ease) 3.2s forwards;
}
.term-hint,
.term-live-out {
  unicode-bidi: plaintext;
  text-align: start;
}
.term-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.72rem;
  color: var(--text-faint);
}
.term-chip {
  padding: 3px 10px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-bright);
  transition:
    background 0.2s,
    border-color 0.2s;
}
.term-chip:hover,
.term-chip:focus-visible {
  background: var(--gold-dim);
  border-color: var(--gold);
}
.term-input-line {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  cursor: text;
}
.term-typed {
  white-space: pre;
  color: var(--text);
}
.term-input-line .term-cursor {
  margin: 0;
  vertical-align: baseline;
  flex: none;
  opacity: 0.55;
  animation: none;
}
.term-input-line.is-focus .term-cursor {
  opacity: 1;
  animation: termBlink 1s steps(1) infinite;
}
.term-ph {
  margin-left: 8px;
  color: var(--text-faint);
  pointer-events: none;
}
.term-input-line .term-prompt {
  margin-right: 8px;
}
.term-input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  background: none;
  border: 0;
  outline: 0;
  padding: 0;
  color: transparent;
  font: inherit;
  caret-color: transparent;
}
.term-input::placeholder {
  color: var(--text-faint);
}
.term-live-out,
.term-live-line {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}
.term-live-out {
  margin-bottom: 8px;
  white-space: pre-wrap;
}
.term-live-out.term-out-strong {
  margin-bottom: 8px;
}
.term-link {
  color: var(--gold-bright);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-underline-offset: 3px;
}
.term-link:hover {
  text-decoration-color: var(--gold);
}

.resume-chip {
  position: relative;
  z-index: 1;
  display: inline-block;
  align-self: flex-start;
  margin-top: 14px;
  padding: 5px 12px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--gold-dim);
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.resume-bar {
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  z-index: 2;
  background: linear-gradient(
    to right,
    var(--gold) var(--p, 0%),
    rgba(255, 255, 255, 0.06) var(--p, 0%)
  );
}
html.lang-fa .resume-bar {
  background: linear-gradient(
    to left,
    var(--gold) var(--p, 0%),
    rgba(255, 255, 255, 0.06) var(--p, 0%)
  );
}
.resume-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  background: var(--gold-dim);
  font-size: 0.9rem;
}
.resume-banner[hidden] {
  display: none;
}
.resume-actions {
  display: flex;
  gap: 8px;
}
.resume-banner button {
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text);
}
.resume-banner button:first-child {
  border-color: var(--gold);
  color: var(--gold-bright);
}
.resume-banner button:hover {
  border-color: var(--gold);
}

.filter-wrap {
  margin-bottom: var(--space-4);
}
.filter-label {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-chip {
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  transition:
    border-color 0.2s,
    color 0.2s,
    background 0.2s;
}
.filter-chip:hover {
  border-color: var(--gold);
  color: var(--text);
}
.filter-chip.is-on {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold-bright);
}
.filter-status {
  min-height: 1.2em;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
#work .work-card[hidden] {
  display: none !important;
}

.prose p {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
  line-height: 1.9;
  font-size: 1.02rem;
}
.learn-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
@media (max-width: 760px) {
  .learn-grid {
    grid-template-columns: 1fr;
  }
}

.notfound {
  min-height: 78svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-3);
  padding-block: var(--space-5);
}
.notfound-code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.5rem, 14vw, 8rem);
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.notfound-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
}
.notfound-text {
  color: var(--text-muted);
}
.nf-term {
  width: min(560px, 100%);
  margin-top: var(--space-3);
  direction: ltr;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: rgba(10, 12, 15, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  box-shadow: 0 30px 60px -32px rgba(0, 0, 0, 0.7);
}
.nf-path {
  color: var(--text);
  word-break: break-all;
}
.nf-status {
  color: #ff8a3d;
  font-weight: 600;
}
.nf-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.notfound .page-actions {
  justify-content: center;
  margin-top: var(--space-3);
}

body:has(.notfound) .yazd-marker {
  display: none;
}
.brand {
  white-space: nowrap;
}
@media (max-width: 560px) {
  .nav-cta > .btn {
    display: none;
  }
}
