:root {
  --bg: #07060e;
  --panel: rgba(20, 18, 34, .66);
  --elev: rgba(255, 255, 255, .05);
  --elev-2: rgba(255, 255, 255, .085);
  --line: rgba(255, 255, 255, .09);
  --text: #f3f2fb;
  --dim: rgba(243, 242, 251, .64);
  --faint: rgba(243, 242, 251, .38);
  --c1: #22d3ee;
  --c2: #f472b6;
  --c3: #a78bfa;

  --grad-a: linear-gradient(135deg, #61a266, #273b29);

  --grad-text: linear-gradient(135deg, #c98bff, #ff5ea8);
  --grad-b: linear-gradient(135deg, #1f8a63, #0f4a3a);
  --grad-c: linear-gradient(135deg, #1f8f7a, #155e3c);
  --glow: 52, 211, 153;

  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 11px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

h1,
h2,
p,
ul,
form {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--c3);
  outline-offset: 2px;
  border-radius: 8px;
}

.lang-en {
  display: none;
}

[data-lang="en"] .lang-fa {
  display: none;
}

[data-lang="en"] .lang-en {
  display: inline;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- ambient background ---------- */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .32;
  animation: drift 20s ease-in-out infinite alternate;
}

.blob-a {
  width: 55vmax;
  height: 55vmax;
  background: var(--c1);
  top: -24vmax;
  inset-inline-start: -20vmax;
}

.blob-b {
  width: 44vmax;
  height: 44vmax;
  background: var(--c2);
  bottom: -24vmax;
  inset-inline-end: -18vmax;
  animation-delay: -7s;
}

.blob-c {
  width: 34vmax;
  height: 34vmax;
  background: var(--c3);
  top: 38vh;
  inset-inline-end: -16vmax;
  opacity: .2;
  animation-delay: -13s;
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(3%, 6%) scale(1.14);
  }
}

/* ---------- layout ----------
   Fixed height (not min-height) so the shell shrinks and .shell-body scrolls
   internally — the page itself never scrolls and the dock stays put. */
#app {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  gap: 12px;
}

/* ---------- the box ---------- */
.shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .07);
  overflow: hidden;
}

.shell-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
}

.shell-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c1);
  flex: none;
  box-shadow: 0 0 10px rgba(var(--glow), .9);
}

.shell-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--dim);
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  min-height: 32px;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.lang-btn:hover {
  background: var(--elev-2);
  color: var(--text);
  border-color: rgba(255, 255, 255, .18);
}

/* scrollbar fully hidden — scrolling still works */
.shell-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 18px 26px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.shell-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: viewIn .4s var(--ease);
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- home ---------- */
/* the résumé is short by design — centre it so the box never looks half-empty */
#view-home.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.avatar {
  position: relative;
  width: 118px;
  height: 118px;
  margin-bottom: 4px;
}

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--c1), var(--c2), var(--c3), var(--c1));
  animation: spin 7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.avatar-img,
.avatar-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid #0d0b18;
  object-fit: cover;
  background: #15122a;
}

.avatar-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--grad-a);
  color: #fff;
  font-size: 42px;
  font-weight: 800;
}

.avatar.no-img .avatar-img {
  display: none;
}

.avatar.no-img .avatar-fallback {
  display: flex;
}

.hero-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.2;
}

.hero-role {
  font-size: 14.5px;
  font-weight: 600;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-loves {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--dim);
}

.hero-loves .i {
  color: var(--c3);
  flex: none;
}

/* ---------- sections ---------- */
.sec {
  margin-top: 24px;
}

.sec:first-child {
  margin-top: 0;
}

.sec-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 11px;
}

[data-lang="fa"] .sec-title {
  letter-spacing: 0;
  text-transform: none;
  font-size: 13.5px;
}

.prose {
  font-size: 14.5px;
  color: var(--dim);
  line-height: 1.85;
}

/* ---------- specialties : tools ---------- */
.tools {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.tool {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
  transition: transform .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease);
}

.tool::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 22%, transparent), transparent 62%);
  opacity: 0;
  transition: opacity .22s var(--ease);
}

.tool:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tc) 45%, transparent);
}

.tool:hover::before {
  opacity: 1;
}

/* a lone last card fills the row instead of leaving a ragged hole */
.tools> :last-child:nth-child(odd) {
  grid-column: span 2;
}

.tool-ic {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tc);
  background: var(--elev-2);
  border: 1px solid var(--line);
  /* fallback */
  background: color-mix(in srgb, var(--tc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc) 30%, transparent);
}

.tool b {
  position: relative;
  font-size: 13.5px;
  font-weight: 700;
}

.projects {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proj {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 14px;
}

.proj strong {
  font-size: 14.5px;
  font-weight: 700;
}

.proj p {
  font-size: 12.8px;
  color: var(--dim);
  line-height: 1.6;
  margin: 4px 0 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags i {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(34, 211, 238, .13);
  color: #7fe3f5;
}

.shots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.shot {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--elev);
  border: 1px solid var(--line);
  padding: 0;
  transition: transform .22s var(--ease), border-color .22s var(--ease);
}

.shot:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, .2);
}

.shot:active {
  transform: scale(.98);
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot-ph {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}

.shot.no-img img {
  display: none;
}

.shot.no-img {
  cursor: default;
}

.shot.no-img .shot-ph {
  display: flex;
}

/* ---------- favorites : music ---------- */
.tracks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.track.playing {
  background: rgba(var(--glow), .12);
  border-color: rgba(var(--glow), .34);
}

.track.error {
  opacity: .5;
}

.track-btn {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--grad-c);
  transition: transform .18s var(--ease), filter .18s var(--ease);
}

.track-btn:hover {
  filter: brightness(1.12);
}

.track-btn:active {
  transform: scale(.92);
}

.track-btn .ic-pause {
  display: none;
}

.track.playing .track-btn .ic-play {
  display: none;
}

.track.playing .track-btn .ic-pause {
  display: block;
}

.track-main {
  flex: 1;
  min-width: 0;
}

.track-meta strong {
  display: block;
  font-size: 13.8px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-meta small {
  font-size: 11.8px;
  color: var(--dim);
}

.track-bar {
  display: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  margin-top: 7px;
  cursor: pointer;
}

.track.playing .track-bar,
.track.loaded .track-bar {
  display: block;
}

.track-bar>span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--grad-c);
}

.track-time {
  flex: none;
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.note {
  font-size: 12px;
  color: var(--faint);
  text-align: center;
  margin-top: 10px;
  line-height: 1.7;
}

.hobbies {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

/* each hobby carries its own colour via the inline --tc */
.hobby {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 8px;
  font-size: 13.5px;
  font-weight: 700;
  transition: transform .22s var(--ease), border-color .22s var(--ease);
}

.hobby::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .22s var(--ease);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 20%, transparent), transparent 65%);
}

.hobby:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--tc) 45%, transparent);
}

.hobby:hover::before {
  opacity: 1;
}

.hobby>* {
  position: relative;
}

.hobby-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tc);
  background: var(--elev-2);
  border: 1px solid var(--line);
  /* fallback */
  background: color-mix(in srgb, var(--tc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc) 32%, transparent);
}

/* ---------- contact ---------- */
.cards {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.card {
  display: flex;
  align-items: stretch;
  gap: 0;
  position: relative;
  overflow: hidden;
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .22s var(--ease), transform .22s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .22s var(--ease);
  background: linear-gradient(135deg, color-mix(in srgb, var(--bc) 20%, transparent), transparent 60%);
}

.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--bc) 50%, transparent);
}

.card:hover::before {
  opacity: 1;
}

.card[data-brand="tg"] {
  --bc: #3ea6f0;
}

.card[data-brand="ig"] {
  --bc: #e1306c;
}

.card[data-brand="mail"] {
  --bc: #f5a524;
}

.card-go {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-width: 0;
  min-height: 60px;
}

.card-ic {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bc);
  background: var(--elev-2);
  border: 1px solid var(--line);
  /* fallback */
  background: color-mix(in srgb, var(--bc) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--bc) 30%, transparent);
}

.card-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-txt small {
  font-size: 11px;
  color: var(--faint);
  font-weight: 600;
}

.card-txt b {
  font-size: 14px;
  font-weight: 700;
  direction: ltr;
  unicode-bidi: plaintext;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[dir="rtl"] .card-txt b {
  text-align: right;
}

.card-copy {
  position: relative;
  flex: none;
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  border-inline-start: 1px solid var(--line);
  transition: color .2s var(--ease), background .2s var(--ease);
}

.card-copy:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .04);
}

.card-copy .ic-done {
  display: none;
  color: #5fe3a0;
}

.card.copied .card-copy .ic-copy {
  display: none;
}

.card.copied .card-copy .ic-done {
  display: block;
}

/* NOTE: keep this class name distinct from the .copied state on .card —
   a shared name made every copied card inherit this text styling. */
.copy-toast {
  font-size: 12px;
  font-weight: 600;
  color: #5fe3a0;
  text-align: center;
  margin-top: 10px;
  animation: viewIn .25s var(--ease);
}

.copy-toast[hidden] {
  display: none;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field>span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dim);
}

.field input,
.field textarea {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 13px;
  min-height: 46px;
  resize: vertical;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--c1);
  background: var(--elev-2);
  outline: none;
}

.field textarea {
  min-height: 88px;
}

.send {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--grad-a);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border-radius: 14px;
  padding: 14px 20px;
  min-height: 50px;
  transition: transform .18s var(--ease), filter .18s var(--ease), opacity .18s var(--ease);
}

.send:hover {
  filter: brightness(1.12);
}

.send:active {
  transform: scale(.98);
}

.send[disabled] {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.send .ic-sent {
  display: none;
}

.send[data-state="sent"] {
  opacity: 1;
  background: none;
  background-color: rgba(var(--glow), .16);
  color: #5fe3a0;
  border: 1px solid rgba(var(--glow), .35);
}

.send[data-state="sent"] .ic-send {
  display: none;
}

.send[data-state="sent"] .ic-sent {
  display: block;
}

.form-status {
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.7;
}

.form-status[hidden] {
  display: none;
}

.form-status[data-kind="ok"] {
  color: #5fe3a0;
}

.form-status[data-kind="err"] {
  color: #ff8a9b;
}

.form-status[data-kind="sending"] {
  color: var(--dim);
}

/* ---------- dock ---------- */
.dock {
  position: relative;
  flex: none;
  display: flex;
  align-items: stretch;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  padding: 6px;
  box-shadow: 0 20px 50px -22px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* positioned with physical left/translateX so it works in both RTL and LTR */
.dock-pill {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 0;
  border-radius: 15px;
  background: var(--grad-a);
  transition: transform .42s var(--ease), width .42s var(--ease);
  pointer-events: none;
}

.dock-item {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 6px 2px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  transition: color .25s var(--ease);
}

.dock-item .i {
  transition: transform .3s var(--ease);
}

.dock-item:hover {
  color: var(--dim);
}

.dock-item.active {
  color: #fff;
}

.dock-item.active .i {
  transform: translateY(-1px) scale(1.06);
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 4, 12, .9);
  backdrop-filter: blur(8px);
  padding: 22px;
  animation: fadeIn .25s var(--ease);
}

.lightbox[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  border-radius: var(--r-md);
  box-shadow: 0 30px 80px -20px #000;
}

.lb-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--elev-2);
  border: 1px solid var(--line);
  color: #fff;
}

/* ---------- larger screens ---------- */
@media (min-width:560px) {
  #app {
    max-width: 540px;
    padding: 22px 18px 22px;
    gap: 14px;
  }

  .shell-body {
    padding: 24px 22px 30px;
  }

  .hobbies {
    grid-template-columns: repeat(4, 1fr);
  }

  .shots {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-name {
    font-size: 32px;
  }
}

@media (min-width:900px) {
  #app {
    justify-content: center;
    padding-block: 26px;
  }

  .shell {
    flex: 0 1 auto;
    max-height: 76dvh;
  }
}