
:root {
  --accent-color: #24b7a4;
  --heading-color: #ffffff;
  --default-color: #ffffff;
  --term-bg: #211d17;
  --term-bar: #2a251d;
  --term-ink: #ece3cf;
  --term-ink-dim: #8f8672;
  --term-accent: #7fa895;
  --term-clay: #d99b5f;
  --term-err: #c97b6b;
  --term-border: #3a3327;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  color: var(--default-color);
  font-family: "JetBrains Mono", "Vazirmatn", monospace;
  background-color: #243746;
  background-image:
    linear-gradient(160deg, rgba(26, 46, 58, 0.55) 0%, rgba(49, 71, 89, 0.35) 50%, rgba(20, 40, 52, 0.7) 100%),
    url(../img/bg.jpg);
  background-position: top center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(36, 183, 164, 0.18), transparent 55%),
    rgba(49, 71, 89, 0.55);
  z-index: 0;
  pointer-events: none;
}

@media (min-width: 1366px) {
  body {
    background-attachment: fixed;
  }
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: color-mix(in srgb, var(--accent-color), white 25%);
}

h1,
h2,
h3,
h4 {
  color: var(--heading-color);
  margin: 0;
}

.main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px 8px;
}

.header .logo .sitename {
  font-family: "Syne", "Vazirmatn", sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--heading-color);
}


.header-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.header-links a {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.82rem;
  border-bottom: 1px solid transparent;
}

.header-links a:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

/* Hero: intro + terminal */
.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  padding: 28px 20px 40px;
}

.intro {
  width: min(920px, 92vw);
  text-align: center;
  animation: rise-in 0.85s ease both;
}

.intro-kicker {
  margin: 0 0 14px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.intro-name {
  font-family: "Syne", "Vazirmatn", sans-serif;
  font-size: clamp(2.8rem, 9vw, 5.4rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
@media (max-width: 768px) {
  .intro-name {
    font-size: clamp(1.8rem, 10vw, 2.0rem);
    white-space: nowrap;
  }
}
.intro-role {
  margin: 18px 0 0;
  font-family: "Syne", "Vazirmatn", sans-serif;
  font-size: clamp(1.15rem, 2.8vw, 1.55rem);
  font-weight: 600;
  color: var(--accent-color);
  letter-spacing: 0.02em;
}

.intro-place {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.72);
}

.intro-lead {
  margin: 18px auto 0;
  max-width: 34rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.terminal {
  width: min(920px, 92vw);
  height: min(68vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--term-bg);
  color: var(--term-ink);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(36, 183, 164, 0.12);
  animation: rise-in 0.9s ease 0.18s both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Contact */
.contact {
  position: relative;
  z-index: 1;
  width: min(920px, 92vw);
  margin: 0 auto;
  padding: 20px 0 48px;
  animation: rise-in 0.9s ease 0.28s both;
}

.contact h2 {
  font-family: "Syne", "Vazirmatn", sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.contact-lead {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.contact-list li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.92rem;
}

.contact-list li > span:first-child {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-list a {
  color: #fff;
  border-bottom: 1px dashed rgba(36, 183, 164, 0.55);
  width: fit-content;
}

.contact-list a:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.contact-plain {
  color: rgba(255, 255, 255, 0.9);
}

#titlebar {
  background: var(--term-bar);
  border-bottom: 1px solid var(--term-border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dots {
  display: flex;
  gap: 7px;
}

.dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.85;
}

.d1 { background: #c97b6b; }
.d2 { background: #d9b45f; }
.d3 { background: #7fa895; }

#titlebar .name {
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
  color: var(--term-ink-dim);
}

#lang-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  color: var(--term-ink-dim);
  background: transparent;
  border: 1px solid var(--term-border);
  border-radius: 5px;
  padding: 3px 8px;
  flex-shrink: 0;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

#lang-badge:hover {
  color: var(--term-accent);
  border-color: var(--term-accent);
  background: rgba(127, 168, 149, 0.08);
}

#screen {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 8px;
  font-size: 0.9rem;
  line-height: 1.85;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

#screen::-webkit-scrollbar {
  width: 9px;
}

#screen::-webkit-scrollbar-thumb {
  background: var(--term-border);
  border-radius: 5px;
}

.line {
  margin-bottom: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

.line.rtl {
  direction: rtl;
  text-align: right;
  font-family: "Vazirmatn", "JetBrains Mono", monospace;
}

.line.cmd .prompt {
  color: var(--term-accent);
  font-weight: 600;
}

.line.dim { color: var(--term-ink-dim); }
.line.accent { color: var(--term-accent); }
.line.clay { color: var(--term-clay); }
.line.err { color: var(--term-err); }
.line.gap { height: 10px; }

.ascii {
  color: var(--term-accent);
  font-size: 0.72rem;
  line-height: 1.35;
  margin-bottom: 6px;
  white-space: pre;
}

.terminal a {
  color: var(--term-clay);
  text-decoration: none;
  border-bottom: 1px dashed var(--term-clay);
}

.terminal a:hover {
  color: var(--term-accent);
  border-bottom-color: var(--term-accent);
}

.input-wrap {
  padding: 0 20px;
  flex-shrink: 0;
}

#input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 6px;
}

#input-row .prompt {
  color: var(--term-accent);
  font-weight: 600;
  flex-shrink: 0;
  font-size: 0.9rem;
}

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--term-ink);
  font-family: "JetBrains Mono", "Vazirmatn", monospace;
  font-size: 0.9rem;
  caret-color: var(--term-accent);
  direction: ltr;
}

#hint {
  flex-shrink: 0;
  padding: 9px 20px 14px;
  font-size: 0.72rem;
  color: var(--term-ink-dim);
  border-top: 1px solid var(--term-border);
}

#hint.rtl {
  direction: rtl;
  text-align: right;
}

#hint b {
  color: var(--term-clay);
  font-family: "JetBrains Mono", monospace;
}

/* Footer */
.footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 10px 20px 18px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
}

.footer p {
  margin: 0;
}

.footer .credits {
  margin-top: 4px;
  font-size: 0.7rem;
  opacity: 0.8;
}

.footer .credits a {
  color: var(--accent-color);
}

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  overflow: hidden;
  background: #314759;
}

#preloader:before {
  content: "";
  position: fixed;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  border: 6px solid #ffffff;
  border-color: #ffffff transparent #ffffff transparent;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: animate-preloader 1.5s linear infinite;
}

@keyframes animate-preloader {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .header {
    padding: 14px 16px 4px;
  }

  .header-links {
    gap: 12px;
  }

  .header-links a {
    font-size: 0.75rem;
  }

  .hero {
    padding: 18px 12px 28px;
    gap: 22px;
  }

  .intro-lead {
    font-size: 0.88rem;
  }

  .terminal {
    width: 100%;
    height: min(70vh, 560px);
    border-radius: 10px;
  }

  #screen {
    font-size: 0.82rem;
    padding: 14px 12px 6px;
  }

  .input-wrap {
    padding: 0 12px;
  }

  #hint {
    font-size: 0.66rem;
    padding: 8px 12px 12px;
  }

  .contact {
    width: 100%;
    padding: 8px 16px 36px;
  }

  .contact-list li {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

body.lang-fa .intro,
body.lang-fa .contact,
body.lang-fa .header-links,
body.lang-fa .footer {
  font-family: "Vazirmatn", "Syne", sans-serif;
}

body.lang-fa .intro-name,
body.lang-fa .intro-role,
body.lang-fa .contact h2 {
  font-family: "Vazirmatn", "Syne", sans-serif;
}

body.lang-fa .intro {
  text-align: center;
}

body.lang-fa .contact-list li {
  direction: rtl;
}

body.lang-fa .contact-list li > span:first-child {
  text-align: right;
}

body.lang-fa .header {
  flex-direction: row-reverse;
}

::selection {
  background: var(--term-accent);
  color: #211d17;
}
